Use normal sampling for SAC

This commit is contained in:
Antonin Raffin 2020-02-21 14:50:28 +01:00
parent 809a3d3d38
commit 26ccf499b3
4 changed files with 5 additions and 4 deletions

View file

@ -21,6 +21,7 @@ Deprecations:
Others: Others:
^^^^^^^ ^^^^^^^
- SAC with SDE now sample only one matrix
Documentation: Documentation:
^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^

View file

@ -47,7 +47,7 @@ setup(name='torchy_baselines',
license="MIT", license="MIT",
long_description="", long_description="",
long_description_content_type='text/markdown', long_description_content_type='text/markdown',
version="0.2.0", version="0.2.1",
) )
# python setup.py sdist # python setup.py sdist

View file

@ -4,4 +4,4 @@ from torchy_baselines.ppo import PPO
from torchy_baselines.sac import SAC from torchy_baselines.sac import SAC
from torchy_baselines.td3 import TD3 from torchy_baselines.td3 import TD3
__version__ = "0.2.0" __version__ = "0.2.1"

View file

@ -171,8 +171,8 @@ class SAC(OffPolicyRLModel):
# is lost and we cannot backpropagate through again # is lost and we cannot backpropagate through again
# anyway, we need to sample because `log_std` may have changed between two gradient steps # anyway, we need to sample because `log_std` may have changed between two gradient steps
if self.use_sde: if self.use_sde:
self.actor.reset_noise(batch_size=batch_size) # self.actor.reset_noise(batch_size=batch_size)
# self.actor.reset_noise() self.actor.reset_noise()
# Action by the current actor for the sampled state # Action by the current actor for the sampled state
action_pi, log_prob = self.actor.action_log_prob(obs) action_pi, log_prob = self.actor.action_log_prob(obs)