Skip to content

Commit ffde45c

Browse files
committed
fix bugs
1 parent fc154a9 commit ffde45c

File tree

3 files changed

+22
-510
lines changed

3 files changed

+22
-510
lines changed

DDPG/DDPG_spinningup/main.py

+7
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@
2626
else:
2727
a = env.action_space.sample()
2828
o2, r, d, _ = env.step(a)
29+
30+
# new_goal = np.array([1.0, 0.0, 0.0], dtype=np.float32)
31+
# goal_cos, goal_sin, goal_thdot = new_goal[0], new_goal[1], new_goal[2]
32+
# cos_th, sin_th, thdot = o[0], o[1], o[2]
33+
# costs = (goal_cos - cos_th) ** 2 + (goal_sin - sin_th) ** 2 + 0.1 * (goal_thdot - thdot) ** 2
34+
# reward = 0 if costs < 0.5 else -1
35+
2936
ddpg.replay_buffer.store(o, a, r, o2, d)
3037

3138
if episode >= 5 and j % update_every == 0:

0 commit comments

Comments
 (0)