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

Query regarding 'advantages' in a2c #43

Closed
akileshbadrinaaraayanan opened this issue Jun 21, 2017 · 4 comments
Closed

Query regarding 'advantages' in a2c #43

akileshbadrinaaraayanan opened this issue Jun 21, 2017 · 4 comments

Comments

@akileshbadrinaaraayanan

The actor net takes state as input and outputs a policy containing the probability of each action. In train_model(), the ground truth for training actor net is 'advantages' which is not a probability distribution over possible actions. So, how does the categorical cross-entropy computation between the predicted output of actor net and 'advantages' work?

Thanks,
Akilesh

@dnddnjs
Copy link
Contributor

dnddnjs commented Jun 24, 2017

Advantage means r + gamma * V(s') - V(s)
and loss function of policy network will be log(action_prob) * advantages which is form of cross entropy.

action_prob will be [p1, p2] and advantages will be [0, advantages] if actual action of agent is 2.
then cross entropy calculation just becomes [log(action_prob) * advantages]

@akileshbadrinaaraayanan
Copy link
Author

Thanks a lot!

@akileshbadrinaaraayanan
Copy link
Author

Hi,

Categorical cross-entropy in Keras with TF backend expects a probability distribution. However, advantages is not a probability distribution in this case. I have observed that it works fairly good but could you please explain how exactly it works. Categorical cross-entropy is generally defined between two probability distributions p(x) and q(x)

Thanks,
Akilesh

@fredcallaway
Copy link
Contributor

#54

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants