Skip to content

EpsilonGreedyStrategy ​

python
EpsilonGreedyStrategy(epsilon_schedule: Schedule) -> None

Epsilon-greedy exploration strategy.

With probability epsilon, takes a random action (exploration). With probability (1 - epsilon), takes the greedy action (exploitation).

Initialize the EpsilonGreedyStrategy.

Parameters:

  • epsilon_schedule (Schedule) – Schedule for the epsilon value.

Source

Methods ​

get_exploration_value ​

python
get_exploration_value(steps: int) -> float | None

Get the current epsilon value for logging.

Parameters:

  • steps (int) – The current step count.

Returns:

  • float | None – The current epsilon value.

Source

should_explore ​

python
should_explore(steps: int) -> bool

Determine whether to take an exploratory (random) action.

Parameters:

  • steps (int) – The current step count.

Returns:

  • bool – True if a random action should be taken based on epsilon probability.

Source

Values ​

epsilon_schedule ​

python
epsilon_schedule = epsilon_schedule

Source