Skip to content

Commit

Permalink
[Exercise 1.3] Flatten actions in policy rollout
Browse files Browse the repository at this point in the history
Updates exercise 1.3 to match the change made in commit 07bb739.
  • Loading branch information
colllin authored Jan 31, 2019
1 parent 391970e commit db4fb3f
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 db4fb3f

Please sign in to comment.