Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update test_ppo.py #382

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions test/test_ppo.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,20 @@

import unittest
from functools import partial

import gym
import tensorflow as tf

from spinup import ppo_tf1 as ppo

tf.compat.v1.disable_eager_execution()

class TestPPO(unittest.TestCase):
class TestPPO(tf.test.TestCase):
def test_cartpole(self):
''' Test training a small agent in a simple environment '''
env_fn = partial(gym.make, 'CartPole-v1')
ac_kwargs = dict(hidden_sizes=(32,))
with tf.Graph().as_default():
with tf.compat.v1.Session(config=tf.compat.v1.ConfigProto(allow_soft_placement=True)):
ppo(env_fn, steps_per_epoch=100, epochs=10, ac_kwargs=ac_kwargs)
# TODO: ensure policy has got better at the task


if __name__ == '__main__':
unittest.main()