GEPA.Strategies.CandidateSelector.EpsilonGreedy (GEPA v0.3.0)

Copy Markdown View Source

Epsilon-greedy candidate selector with optional decay.

Picks the current best candidate with probability 1 - epsilon and a random candidate with probability epsilon. The epsilon value can decay after each selection to gradually reduce exploration.

Summary

Functions

Return the current epsilon value.

Create a new epsilon-greedy selector.

Reset current_epsilon back to the initial value.

Select a candidate using epsilon-greedy strategy.

Types

t()

@type t() :: %GEPA.Strategies.CandidateSelector.EpsilonGreedy{
  current_epsilon: float(),
  epsilon: float(),
  epsilon_decay: float(),
  epsilon_min: float()
}

Functions

current_epsilon(epsilon_greedy)

@spec current_epsilon(t()) :: float()

Return the current epsilon value.

new(opts \\ [])

@spec new(keyword()) :: t()

Create a new epsilon-greedy selector.

Options

  • :epsilon - initial exploration probability (default: 0.1)
  • :epsilon_decay - multiplicative decay applied after each selection (default: 1.0)
  • :epsilon_min - lower bound for epsilon after decay (default: 0.01)

reset(selector)

@spec reset(t()) :: t()

Reset current_epsilon back to the initial value.

select(selector, state, rand_state)

@spec select(t(), GEPA.State.t(), :rand.state() | nil) ::
  {GEPA.Types.program_idx(), t(), :rand.state()}

Select a candidate using epsilon-greedy strategy.

Returns {candidate_idx, updated_selector, new_rand_state}.