ray.rllib.utils.exploration.stochastic_sampling.StochasticSampling
ray.rllib.utils.exploration.stochastic_sampling.StochasticSampling#
- class ray.rllib.utils.exploration.stochastic_sampling.StochasticSampling(action_space: <MagicMock name='mock.spaces.Space' id='140494124151808'>, *, framework: str, model: ray.rllib.models.modelv2.ModelV2, random_timesteps: int = 0, **kwargs)[source]#
Bases:
ray.rllib.utils.exploration.exploration.ExplorationAn exploration that simply samples from a distribution.
The sampling can be made deterministic by passing explore=False into the call to
get_exploration_action. Also allows for scheduled parameters for the distributions, such as lowering stddev, temperature, etc.. over time.Methods
__init__(action_space, *, framework, model)Initializes a StochasticSampling Exploration object.
before_compute_actions(*[, timestep, ...])Hook for preparations before policy.compute_actions() is called.
get_exploration_optimizer(optimizers)May add optimizer(s) to the Policy's own
optimizers.get_state([sess])Returns the current exploration state.
on_episode_end(policy, *[, environment, ...])Handles necessary exploration logic at the end of an episode.
on_episode_start(policy, *[, environment, ...])Handles necessary exploration logic at the beginning of an episode.
postprocess_trajectory(policy, sample_batch)Handles post-processing of done episode trajectories.
set_state(state[, sess])Sets the Exploration object's state to the given values.