Class: DSPy::Teleprompt::MIPROv2::MIPROv2Config
- Inherits:
-
Config
- Object
- Config
- DSPy::Teleprompt::MIPROv2::MIPROv2Config
- Extended by:
- T::Sig
- Defined in:
- lib/dspy/teleprompt/mipro_v2.rb
Overview
Configuration for MIPROv2 optimization
Instance Attribute Summary collapse
-
#bootstrap_sets ⇒ Object
Returns the value of attribute bootstrap_sets.
-
#early_stopping_patience ⇒ Object
Returns the value of attribute early_stopping_patience.
-
#final_temperature ⇒ Object
Returns the value of attribute final_temperature.
-
#init_temperature ⇒ Object
Returns the value of attribute init_temperature.
-
#num_instruction_candidates ⇒ Object
Returns the value of attribute num_instruction_candidates.
-
#num_trials ⇒ Object
Returns the value of attribute num_trials.
-
#optimization_strategy ⇒ Object
Returns the value of attribute optimization_strategy.
-
#proposer_config ⇒ Object
Returns the value of attribute proposer_config.
-
#track_diversity ⇒ Object
Returns the value of attribute track_diversity.
-
#use_bayesian_optimization ⇒ Object
Returns the value of attribute use_bayesian_optimization.
Instance Method Summary collapse
-
#initialize ⇒ MIPROv2Config
constructor
A new instance of MIPROv2Config.
- #to_h ⇒ Object
Constructor Details
#initialize ⇒ MIPROv2Config
Returns a new instance of MIPROv2Config.
96 97 98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/dspy/teleprompt/mipro_v2.rb', line 96 def initialize super @num_trials = 12 @num_instruction_candidates = 5 @bootstrap_sets = 5 @optimization_strategy = "adaptive" # greedy, adaptive, bayesian @init_temperature = 1.0 @final_temperature = 0.1 @early_stopping_patience = 3 @use_bayesian_optimization = true @track_diversity = true @proposer_config = DSPy::Propose::GroundedProposer::Config.new end |
Instance Attribute Details
#bootstrap_sets ⇒ Object
Returns the value of attribute bootstrap_sets.
72 73 74 |
# File 'lib/dspy/teleprompt/mipro_v2.rb', line 72 def bootstrap_sets @bootstrap_sets end |
#early_stopping_patience ⇒ Object
Returns the value of attribute early_stopping_patience.
84 85 86 |
# File 'lib/dspy/teleprompt/mipro_v2.rb', line 84 def early_stopping_patience @early_stopping_patience end |
#final_temperature ⇒ Object
Returns the value of attribute final_temperature.
81 82 83 |
# File 'lib/dspy/teleprompt/mipro_v2.rb', line 81 def final_temperature @final_temperature end |
#init_temperature ⇒ Object
Returns the value of attribute init_temperature.
78 79 80 |
# File 'lib/dspy/teleprompt/mipro_v2.rb', line 78 def init_temperature @init_temperature end |
#num_instruction_candidates ⇒ Object
Returns the value of attribute num_instruction_candidates.
69 70 71 |
# File 'lib/dspy/teleprompt/mipro_v2.rb', line 69 def num_instruction_candidates @num_instruction_candidates end |
#num_trials ⇒ Object
Returns the value of attribute num_trials.
66 67 68 |
# File 'lib/dspy/teleprompt/mipro_v2.rb', line 66 def num_trials @num_trials end |
#optimization_strategy ⇒ Object
Returns the value of attribute optimization_strategy.
75 76 77 |
# File 'lib/dspy/teleprompt/mipro_v2.rb', line 75 def optimization_strategy @optimization_strategy end |
#proposer_config ⇒ Object
Returns the value of attribute proposer_config.
93 94 95 |
# File 'lib/dspy/teleprompt/mipro_v2.rb', line 93 def proposer_config @proposer_config end |
#track_diversity ⇒ Object
Returns the value of attribute track_diversity.
90 91 92 |
# File 'lib/dspy/teleprompt/mipro_v2.rb', line 90 def track_diversity @track_diversity end |
#use_bayesian_optimization ⇒ Object
Returns the value of attribute use_bayesian_optimization.
87 88 89 |
# File 'lib/dspy/teleprompt/mipro_v2.rb', line 87 def use_bayesian_optimization @use_bayesian_optimization end |
Instance Method Details
#to_h ⇒ Object
111 112 113 114 115 116 117 118 119 120 121 122 123 |
# File 'lib/dspy/teleprompt/mipro_v2.rb', line 111 def to_h super.merge({ num_trials: @num_trials, num_instruction_candidates: @num_instruction_candidates, bootstrap_sets: @bootstrap_sets, optimization_strategy: @optimization_strategy, init_temperature: @init_temperature, final_temperature: @final_temperature, early_stopping_patience: @early_stopping_patience, use_bayesian_optimization: @use_bayesian_optimization, track_diversity: @track_diversity }) end |