d3rlpy.online.explorers.LinearDecayEpsilonGreedy

class d3rlpy.online.explorers.LinearDecayEpsilonGreedy(start_epsilon=1.0, end_epsilon=0.1, duration=1000000)[source]

\(\epsilon\)-greedy explorer with linear decay schedule.

Parameters
  • start_epsilon (float) – the beginning \(\epsilon\).

  • end_epsilon (float) – the end \(\epsilon\).

  • duration (int) – the scheduling duration.

Methods

compute_epsilon(step)[source]

Returns decayed \(\epsilon\).

Returns

\(\epsilon\).

Parameters

step (int) –

Return type

float

sample(algo, x, step)[source]

Returns \(\epsilon\)-greedy action.

Parameters
  • algo (d3rlpy.online.explorers._ActionProtocol) – algorithm.

  • x (numpy.ndarray) – observation.

  • step (int) – current environment step.

Returns

\(\epsilon\)-greedy action.

Return type

numpy.ndarray