Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
27 changes: 26 additions & 1 deletion docs/misc/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,31 @@ Changelog
==========


Release 1.2.1a0 (WIP)
---------------------------


Breaking Changes:
^^^^^^^^^^^^^^^^^

New Features:
^^^^^^^^^^^^^
- Added method `get_distribution` for `ActorCriticPolicy` (@cyprienc)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Added method `get_distribution` for `ActorCriticPolicy` (@cyprienc)
- Added method `get_distribution` for ``ActorCriticPolicy`` (@cyprienc)


Bug Fixes:
^^^^^^^^^^

Deprecations:
^^^^^^^^^^^^^

Others:
^^^^^^^

Documentation:
^^^^^^^^^^^^^^



Release 1.2.0 (2021-09-03)
---------------------------

Expand Down Expand Up @@ -746,4 +771,4 @@ And all the contributors:
@diditforlulz273 @liorcohen5 @ManifoldFR @mloo3 @SwamyDev @wmmc88 @megan-klaiber @thisray
@tfederico @hn2 @LucasAlegre @AptX395 @zampanteymedio @JadenTravnik @decodyng @ardabbour @lorenz-h @mschweizer @lorepieri8 @vwxyzjn
@ShangqunYu @PierreExeter @JacopoPan @ltbd78 @tom-doerr @Atlis @liusida @09tangriro @amy12xx @juancroldan @benblack769 @bstee615
@c-rizz @skandermoalla @MihaiAnca13 @davidblom603 @ayeright
@c-rizz @skandermoalla @MihaiAnca13 @davidblom603 @ayeright @cyprienc
10 changes: 10 additions & 0 deletions stable_baselines3/common/policies.py
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,16 @@ def evaluate_actions(self, obs: th.Tensor, actions: th.Tensor) -> Tuple[th.Tenso
values = self.value_net(latent_vf)
return values, log_prob, distribution.entropy()

def get_distribution(self, obs: th.Tensor) -> Distribution:
"""
Get the current policy distribution given the observations.

:param obs:
:return: the action distribution.
"""
latent_pi, _, latent_sde = self._get_latent(obs)
return self._get_action_dist_from_latent(latent_pi, latent_sde)


class ActorCriticCnnPolicy(ActorCriticPolicy):
"""
Expand Down
2 changes: 1 addition & 1 deletion stable_baselines3/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2.0
1.2.1a0