Skip to content

Commit 596e38c

Browse files
authored
Fixes gradient propogation through std-dev (#66)
1 parent cd277d4 commit 596e38c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

rsl_rl/modules/actor_critic.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@ def entropy(self):
101101

102102
def update_distribution(self, observations):
103103
mean = self.actor(observations)
104-
self.distribution = Normal(mean, mean * 0.0 + self.std)
104+
std = self.std.expand_as(mean)
105+
self.distribution = Normal(mean, std)
105106

106107
def act(self, observations, **kwargs):
107108
self.update_distribution(observations)

0 commit comments

Comments
 (0)