Last active
May 24, 2020 22:45
-
-
Save elumixor/09d220483543cfe5f0b87a41b9659b61 to your computer and use it in GitHub Desktop.
TRPO critic update
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from torch.optim import Adam | |
critic_optimizer = Adam(critic.parameters(), lr=0.005) | |
def update_critic(advantages): | |
loss = .5 * (advantages ** 2).mean() | |
critic_optimizer.zero_grad() | |
loss.backward() | |
critic_optimizer.step() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment