Distributions¶
Distributions are customized via the distributions
argument of policy
, for instance:
Agent.create(
...
policy=dict(distributions=dict(
float=dict(type='gaussian', stddev_mode='global'),
bounded_action=dict(type='beta')
))
...
)
See the policies documentation for more information about how to specify a policy.
-
class
tensorforce.core.distributions.
Categorical
(*, temperature_mode=None, skip_linear=False, name=None, action_spec=None, input_spec=None)¶ Categorical distribution, for discrete integer actions (specification key:
categorical
).Parameters: - temperature_mode ("predicted" | "global") – Whether to predict the temperature via a linear transformation of the state embedding, or to parametrize the temperature by a separate set of trainable weights (default: default temperature of 1).
- skip_linear (bool) – Whether to not add the implicit linear logits layer, requires suitable network output shape according to action space, not compatible with temperature_mode (default: false).
- name (string) – internal use.
- action_spec (specification) – internal use.
- input_spec (specification) – internal use.
-
class
tensorforce.core.distributions.
Gaussian
(*, stddev_mode='predicted', bounded_transform='tanh', name=None, action_spec=None, input_spec=None)¶ Gaussian distribution, for continuous actions (specification key:
gaussian
).Parameters: - stddev_mode ("predicted" | "global") – Whether to predict the standard deviation via a linear transformation of the state embedding, or to parametrize the standard deviation by a separate set of trainable weights (default: “predicted”).
- bounded_transform ("clipping" | "tanh") – Transformation to adjust sampled actions in case of bounded action space, “tanh” transforms distribution (e.g. log probability computation) accordingly whereas “clipping” does not (default: tanh).
- name (string) – internal use.
- action_spec (specification) – internal use.
- input_spec (specification) – internal use.
-
class
tensorforce.core.distributions.
Bernoulli
(*, name=None, action_spec=None, input_spec=None)¶ Bernoulli distribution, for binary boolean actions (specification key:
bernoulli
).Parameters: - name (string) – internal use.
- action_spec (specification) – internal use.
- input_spec (specification) – internal use.
-
class
tensorforce.core.distributions.
Beta
(*, name=None, action_spec=None, input_spec=None)¶ Beta distribution, for bounded continuous actions (specification key:
beta
).Parameters: - name (string) – internal use.
- action_spec (specification) – internal use.
- input_spec (specification) – internal use.