-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add DDPG #1
base: vector-env
Are you sure you want to change the base?
Add DDPG #1
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good but needs implementation changes that we discussed.
with tf.GradientTape() as tape: | ||
Q = self.predict_values(states, actions, network='main') | ||
# TODO: Should we use huber loss here? | ||
loss = tf.reduce_mean(huber_loss(targets - Q)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use tf.square
instead
Dense(1) | ||
]) | ||
# We make one shared encoder for the actor and critic. | ||
# TODO: Should we make separate main/target/exec encoders? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we should have target/exec models for the encoder, too.
self.num_actions = self._vec_env.action_space.shape[-1] | ||
self.action_limit = self._vec_env.action_space.high.max() | ||
|
||
actor_optimizer = Adam(lr=1e-4) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's have a single optimizer for actor + critic. Use Adam with lr=1e-4.
No description provided.