Stateful minibatch selection for GEPA.
The built-in epoch-shuffled strategy matches the pinned source default. A custom strategy is a struct whose module implements this behaviour. Its identity and state are checkpointed so resume cannot silently substitute or reset the consumer's sampling policy.
Summary
Types
@type context() :: %{iteration: non_neg_integer(), call_index: non_neg_integer()}
@type rng_state() :: Imp.Optimizer.GEPA.Random.state()
@type t() :: %Imp.Optimizer.GEPA.BatchSampler{ calls_in_iteration: non_neg_integer(), current_iteration: non_neg_integer() | nil, custom_identity: term() | nil, custom_strategy: struct() | nil, epoch: integer(), id_freqs: %{optional(non_neg_integer()) => pos_integer()}, last_trainset_size: non_neg_integer(), minibatch_size: pos_integer() | nil, shuffled_ids: [non_neg_integer()], trainset_identity: String.t() | nil }
Callbacks
Functions
@spec new(pos_integer() | nil) :: t()
@spec next_batches( t(), [term()], pos_integer(), pos_integer(), non_neg_integer(), :rand.state() ) :: {[{[term()], [non_neg_integer()]}], t(), :rand.state()}