mirror of
https://github.com/saymrwulf/stable-baselines3.git
synced 2026-07-24 19:43:50 +00:00
Fix infs in SAC by bounding the mean
This commit is contained in:
parent
57708a628c
commit
e49d97bf98
1 changed files with 2 additions and 0 deletions
|
|
@ -48,6 +48,8 @@ class Actor(BaseNetwork):
|
|||
self.mu, self.log_std = self.action_dist.proba_distribution_net(latent_dim=net_arch[-1],
|
||||
latent_sde_dim=latent_sde_dim,
|
||||
log_std_init=log_std_init)
|
||||
# Avoid saturation by limiting the mean of the gaussian to be in [-1, 1]
|
||||
self.mu = nn.Sequential(self.mu, nn.Tanh())
|
||||
else:
|
||||
self.action_dist = SquashedDiagGaussianDistribution(action_dim)
|
||||
self.mu = nn.Linear(net_arch[-1], action_dim)
|
||||
|
|
|
|||
Loading…
Reference in a new issue