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

[BugFix] Fix SAC alpha optim #1192

Merged
merged 44 commits into from
May 26, 2023
Merged
Changes from 1 commit
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
30a8763
init
vmoens May 24, 2023
e7f1dac
amend
vmoens May 24, 2023
79b5912
amend
vmoens May 24, 2023
be142ad
amend
vmoens May 24, 2023
95be960
amend
vmoens May 24, 2023
1c81ec3
amend
vmoens May 24, 2023
5e769d0
Merge remote-tracking branch 'origin/main' into fix_sac
vmoens May 24, 2023
3d8db39
amend
vmoens May 24, 2023
5080b09
amend
vmoens May 24, 2023
5418c6e
amend
vmoens May 25, 2023
f38a64c
amend
vmoens May 25, 2023
4a2fff4
amend
vmoens May 25, 2023
8efd0c4
amend
vmoens May 25, 2023
17b2808
amend
vmoens May 25, 2023
1cddbcc
amend
vmoens May 25, 2023
018b513
lint
vmoens May 25, 2023
17f4056
lint
vmoens May 25, 2023
38965d2
lint
vmoens May 25, 2023
a3c8b9e
fix
vmoens May 25, 2023
cb68bfd
fix
vmoens May 25, 2023
7ff6648
fix
vmoens May 25, 2023
86d9065
amend
vmoens May 25, 2023
4e10dc3
fix
vmoens May 25, 2023
c0a0e09
Merge remote-tracking branch 'origin/main' into fix_sac
vmoens May 26, 2023
2508cf6
Merge remote-tracking branch 'origin/main' into fix_sac
vmoens May 26, 2023
cccfea8
Merge remote-tracking branch 'origin/fix_sac' into fix_sac
vmoens May 26, 2023
c5e61f5
amend
vmoens May 26, 2023
1b50ca8
amend
vmoens May 26, 2023
7a14703
lint
vmoens May 26, 2023
c529a01
init
vmoens May 26, 2023
65b9241
Merge branch 'fix_brax' into fix_sac
vmoens May 26, 2023
68ea2c0
fix setup
vmoens May 26, 2023
a74d5c4
lint
vmoens May 26, 2023
8ff8c33
amend
vmoens May 26, 2023
364aba4
amend
vmoens May 26, 2023
cb1e975
amend
vmoens May 26, 2023
1e4b01a
amend
vmoens May 26, 2023
373dacd
Merge remote-tracking branch 'origin/main' into fix_sac
vmoens May 26, 2023
3afad13
Merge branch 'main' into fix_sac
vmoens May 26, 2023
8cf1d8a
fix
vmoens May 26, 2023
484de95
fix
vmoens May 26, 2023
c37d5e3
Merge remote-tracking branch 'origin/main' into fix_sac
vmoens May 26, 2023
556cea5
fix
vmoens May 26, 2023
c9b312a
fix
vmoens May 26, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
amend
  • Loading branch information
vmoens committed May 26, 2023
commit cb1e9750e07fb3ed2c0b388224e20a50521c9e98
8 changes: 4 additions & 4 deletions torchrl/modules/distributions/continuous.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,17 +94,17 @@ class SafeTanhTransform(D.TanhTransform):

def _call(self, x: torch.Tensor) -> torch.Tensor:
if x.dtype.is_floating_point:
eps = torch.finfo(x.dtype).resolution
eps = torch.finfo(x.dtype).resolution * 10
else:
raise NotImplementedError(f"No tanh transform for {x.dtype} inputs.")
return (x * (1 - eps)).tanh()
return safetanh(x, eps)

def _inverse(self, y: torch.Tensor) -> torch.Tensor:
if y.dtype.is_floating_point:
eps = torch.finfo(y.dtype).resolution
eps = torch.finfo(y.dtype).resolution * 10
else:
raise NotImplementedError(f"No inverse tanh for {y.dtype} inputs.")
x = y.atanh() / (1 - eps)
x = safeatanh(y, eps)
return x


Expand Down