Module: DSPy::Teleprompt::MIPROv2::AutoMode

Extended by:
T::Sig
Defined in:
lib/dspy/teleprompt/mipro_v2.rb

Overview

Auto-configuration modes for different optimization needs

Class Method Summary collapse

Class Method Details

.heavy(metric: nil, **kwargs) ⇒ Object



63
64
65
66
67
68
69
70
71
72
73
# File 'lib/dspy/teleprompt/mipro_v2.rb', line 63

def self.heavy(metric: nil, **kwargs)
  config = MIPROv2Config.new
  config.num_trials = 18
  config.num_instruction_candidates = 8
  config.max_bootstrapped_examples = 6
  config.max_labeled_examples = 24
  config.bootstrap_sets = 8
  config.optimization_strategy = "bayesian"
  config.early_stopping_patience = 5
  MIPROv2.new(metric: metric, config: config, **kwargs)
end

.light(metric: nil, **kwargs) ⇒ Object



27
28
29
30
31
32
33
34
35
36
37
# File 'lib/dspy/teleprompt/mipro_v2.rb', line 27

def self.light(metric: nil, **kwargs)
  config = MIPROv2Config.new
  config.num_trials = 6
  config.num_instruction_candidates = 3
  config.max_bootstrapped_examples = 2
  config.max_labeled_examples = 8
  config.bootstrap_sets = 3
  config.optimization_strategy = "greedy"
  config.early_stopping_patience = 2
  MIPROv2.new(metric: metric, config: config, **kwargs)
end

.medium(metric: nil, **kwargs) ⇒ Object



45
46
47
48
49
50
51
52
53
54
55
# File 'lib/dspy/teleprompt/mipro_v2.rb', line 45

def self.medium(metric: nil, **kwargs)
  config = MIPROv2Config.new
  config.num_trials = 12
  config.num_instruction_candidates = 5
  config.max_bootstrapped_examples = 4
  config.max_labeled_examples = 16
  config.bootstrap_sets = 5
  config.optimization_strategy = "adaptive"
  config.early_stopping_patience = 3
  MIPROv2.new(metric: metric, config: config, **kwargs)
end