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

Some questions about the critic loss #13

Open
HYB777 opened this issue Jan 8, 2025 · 2 comments
Open

Some questions about the critic loss #13

HYB777 opened this issue Jan 8, 2025 · 2 comments

Comments

@HYB777
Copy link

HYB777 commented Jan 8, 2025

Hello, thanks for your nice work.

I would like to ask some questions about the critic loss.

If I understand correctly, the soft action return $$Z(s_t, a_t)\sim\mathcal{N}(\mu_\theta(s_t,a_t), \sigma_\theta^2(s_t,a_t))$$, and $$Z(s_t, a_t)=r_t+\gamma(Z_\bar{\theta}(s_{t+1}, a_{t+1})-\alpha\log\pi(a_{t+1}|s_{t+1}))\sim\mathcal{N}(r_t+\gamma(\mu_\bar{\theta}(s_t,a_t)-\alpha\log\pi(a_{t+1}|s_{t+1})), \gamma^2\sigma_\bar{\theta}^2(s_{t+1},a_{t+1}))$$.

Then, can we use the following critic loss?

$$L_{critic}(\theta)=(\mu_\theta(s_t,a_t)-( r_t+ \gamma( \mu_\bar{\theta}(s_t,a_t)-\alpha\log\pi(a_{t+1}|s_{t+1}) ) ) )^2+( \sigma_\theta(s_t,a_t)-\gamma\sigma_\bar{\theta}(s_{t+1},a_{t+1}))^2$$

@Kirikirito
Copy link
Contributor

Thank you for your insightful question!

Actually, you cannot use the critic loss as proposed in your question. The original formula for $Z(s_t,a_t)$
in the paper is somewhat oversimplified, which may lead to some misunderstanding. The complete and correct value distribution consistency condition should take into account the marginal distributions by integrating over $s'$ and $a'$:
soft action return
It is essential to account for the randomness of $s'$ and $a'$. A closed-form solution for the target value distribution cannot be obtained because the environment dynamics $p(s'|s,a)$ is unknown. In such cases, only sample-based update rules can be applied.

@HYB777
Copy link
Author

HYB777 commented Jan 9, 2025

Thank you for your insightful question!

Actually, you cannot use the critic loss as proposed in your question. The original formula for Z ( s t , a t ) in the paper is somewhat oversimplified, which may lead to some misunderstanding. The complete and correct value distribution consistency condition should take into account the marginal distributions by integrating over s ′ and a ′ : soft action return It is essential to account for the randomness of s ′ and a ′ . A closed-form solution for the target value distribution cannot be obtained because the environment dynamics p ( s ′ | s , a ) is unknown. In such cases, only sample-based update rules can be applied.

Thank you for your answer! It perfectly clears up my confusion!

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