mirror of
https://github.com/saymrwulf/stable-baselines3.git
synced 2026-06-05 00:00:04 +00:00
Add a note for squashed gaussian
This commit is contained in:
parent
b157b4465a
commit
1bd2e42995
1 changed files with 2 additions and 0 deletions
|
|
@ -103,6 +103,8 @@ class SquashedDiagGaussianDistribution(DiagGaussianDistribution):
|
|||
# Inverse tanh
|
||||
# Naive implementation (not stable): 0.5 * torch.log((1 + x ) / (1 - x))
|
||||
# We use numpy to avoid numerical instability
|
||||
# TODO: store the gaussian action because of the action added
|
||||
# this would avoid also inverting the tanh
|
||||
if gaussian_action is None:
|
||||
gaussian_action = th.from_numpy(np.arctanh(action.cpu().numpy())).to(action.device)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue