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

SCQLアルゴリズムの追加 #2

Closed
sql-hkr opened this issue Jan 15, 2023 · 1 comment
Closed

SCQLアルゴリズムの追加 #2

sql-hkr opened this issue Jan 15, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@sql-hkr
Copy link
Owner

sql-hkr commented Jan 15, 2023

SACアルゴリズムの損失関数に以下のペナルティー項を追加する.

$$
\mathcal{L}Q(\theta_i)
\triangleq
\mathbb{E}
{(s,a,s')\sim \mathcal{D},a'\sim \pi_\phi(\cdot \mid s')}
\left[
\frac{1}{2}
\left(
y-Q_{\theta_i}(s,a)
\right)^2\right]
+
\mathbb{E}{s\sim \mathcal{D},a\sim \pi\phi(\cdot \mid s)}
\left[
Q_{\theta_i}(s,a)
\right]
$$

ただし, $y$

$$ y \triangleq r(s,a)+\gamma \min_{j=1,2}Q_{\theta_j'}(s',a')-\alpha \log \pi_\phi(a'\mid s') $$

である.

@sql-hkr sql-hkr added the enhancement New feature or request label Jan 15, 2023
sql-hkr added a commit that referenced this issue Jan 15, 2023
@sql-hkr
Copy link
Owner Author

sql-hkr commented Jan 15, 2023

wandb.log()に関しても一部修正

wandb.log(
    {
        "q1_pred": q1_pred.mean(),
        "q2_pred": q2_pred.mean(),
        "q_target": q_target.mean(),
        "actor_q": q_new_actions.mean(),
        "alpha": alpha,
        "loss/q1": qf1_loss,
        "loss/q2": qf2_loss,
        "loss/alpha": alpha_loss,
        "loss/policy": policy_loss,
    },
    step=self._current_epoch,
)

@sql-hkr sql-hkr closed this as completed Jan 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant