mirror of
https://github.com/saymrwulf/stable-baselines3.git
synced 2026-06-20 02:08:01 +00:00
Return entropy=None when entropy hasn't anal form
This commit is contained in:
parent
6da012f9ab
commit
2065b7ae60
1 changed files with 4 additions and 1 deletions
|
|
@ -628,7 +628,10 @@ class ActorCriticPolicy(BasePolicy):
|
|||
distribution = self._get_action_dist_from_latent(latent_pi)
|
||||
log_prob = distribution.log_prob(actions)
|
||||
values = self.value_net(latent_vf)
|
||||
entropy = distribution.entropy()
|
||||
try:
|
||||
entropy = distribution.entropy()
|
||||
except NotImplementedError:
|
||||
entropy = None
|
||||
return values, log_prob, entropy
|
||||
|
||||
def get_distribution(self, obs: th.Tensor) -> Distribution:
|
||||
|
|
|
|||
Loading…
Reference in a new issue