ray.rllib.utils.exploration.stochastic_sampling.StochasticSampling#

class ray.rllib.utils.exploration.stochastic_sampling.StochasticSampling(action_space: gymnasium.spaces.Space, *, framework: str, model: ModelV2, random_timesteps: int = 0, **kwargs)[source]#

Bases: Exploration

An 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__

Initializes a StochasticSampling Exploration object.

before_compute_actions

Hook for preparations before policy.compute_actions() is called.

get_exploration_optimizer

May add optimizer(s) to the Policy's own optimizers.

get_state

Returns the current exploration state.

on_episode_end

Handles necessary exploration logic at the end of an episode.

on_episode_start

Handles necessary exploration logic at the beginning of an episode.

postprocess_trajectory

Handles post-processing of done episode trajectories.

set_state

Sets the Exploration object's state to the given values.