Class: GEPA::Proposer::ReflectiveMutationProposer

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Includes:
ProposeNewCandidate
Defined in:
lib/gepa/proposer/reflective_mutation/reflective_mutation.rb

Instance Method Summary collapse

Constructor Details

#initialize(logger:, trainset:, adapter:, candidate_selector:, module_selector:, batch_sampler:, perfect_score:, skip_perfect_score:, experiment_tracker:, reflection_lm: nil, telemetry: nil) ⇒ ReflectiveMutationProposer

Returns a new instance of ReflectiveMutationProposer.



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/gepa/proposer/reflective_mutation/reflective_mutation.rb', line 29

def initialize(
  logger:,
  trainset:,
  adapter:,
  candidate_selector:,
  module_selector:,
  batch_sampler:,
  perfect_score:,
  skip_perfect_score:,
  experiment_tracker:,
  reflection_lm: nil,
  telemetry: nil
)
  @logger = logger
  @trainset = trainset
  @adapter = adapter
  @candidate_selector = candidate_selector
  @module_selector = module_selector
  @batch_sampler = batch_sampler
  @perfect_score = perfect_score
  @skip_perfect_score = skip_perfect_score
  @experiment_tracker = experiment_tracker
  @reflection_lm = reflection_lm
  @telemetry = telemetry || GEPA::Telemetry
end

Instance Method Details

#propose(state) ⇒ Object



56
57
58
59
60
61
62
# File 'lib/gepa/proposer/reflective_mutation/reflective_mutation.rb', line 56

def propose(state)
  iteration = state.i + 1

  with_span('gepa.proposer.reflective_mutation.propose', iteration: iteration) do
    proposal_for_iteration(state, iteration)
  end
end