Skip to content

Commit

Permalink
Merge pull request openai#106 from colllin/patch-1
Browse files Browse the repository at this point in the history
[Exercise 1.3] Flatten actions in policy rollout
  • Loading branch information
bchess authored Jun 28, 2019
2 parents 71495c1 + 617dd56 commit affcea4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions spinup/exercises/problem_set_1/exercise1_3.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ def td3(env_fn, actor_critic=core.mlp_actor_critic, ac_kwargs=dict(), seed=0,
logger.setup_tf_saver(sess, inputs={'x': x_ph, 'a': a_ph}, outputs={'pi': pi, 'q1': q1, 'q2': q2})

def get_action(o, noise_scale):
a = sess.run(pi, feed_dict={x_ph: o.reshape(1,-1)})
a = sess.run(pi, feed_dict={x_ph: o.reshape(1,-1)})[0]
a += noise_scale * np.random.randn(act_dim)
return np.clip(a, -act_limit, act_limit)

Expand Down Expand Up @@ -382,4 +382,4 @@ def test_agent(n=10):
if args.use_soln:
true_td3(**all_kwargs)
else:
td3(**all_kwargs)
td3(**all_kwargs)

0 comments on commit affcea4

Please sign in to comment.