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

line 2 lead to imp_sampling=1 #9

Open
xzhang2523 opened this issue Feb 21, 2023 · 1 comment
Open

line 2 lead to imp_sampling=1 #9

xzhang2523 opened this issue Feb 21, 2023 · 1 comment

Comments

@xzhang2523
Copy link

log_action_probs = action_dists.log_prob(actions)

    imp_sampling = torch.exp(log_action_probs - log_action_probs.detach())
    # Change to torch.matmul
    reward_loss = -torch.mean(imp_sampling * reward_advs)

Since, log_action_probs - log_action_probs.detach()=0,
imp_sampling is a all one vector

@ajlangley
Copy link
Owner

I answered this question in your other issue about 0 KL divergence. Let me know if this is not a satisfactory answer.

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

2 participants