Nous.Eval.Optimizer.Parameter (nous v0.13.3)
View SourceDefines optimizable parameters for agent configuration.
Parameters define the search space for optimization. Each parameter specifies a name, type, and valid range of values.
Parameter Types
:float- Continuous floating point values:integer- Discrete integer values:choice- Categorical choices from a list:bool- Boolean true/false
Examples
# Temperature from 0.0 to 1.0 in steps of 0.1
Parameter.float(:temperature, 0.0, 1.0, step: 0.1)
# Max tokens from 100 to 2000 in steps of 100
Parameter.integer(:max_tokens, 100, 2000, step: 100)
# Model selection
Parameter.choice(:model, [
"lmstudio:ministral-3-14b",
"lmstudio:qwen-7b",
"openai:gpt-4"
])
# Enable/disable a feature
Parameter.bool(:use_cot)Conditional Parameters
Parameters can be conditional on other parameter values:
Parameter.float(:top_p, 0.0, 1.0,
condition: {:temperature, &(&1 > 0.5)}
)
Summary
Functions
Check if a parameter is active given current config.
Create a boolean parameter.
Create a categorical choice parameter.
Create a float parameter.
Create an integer parameter.
Sample a random value from the parameter space.
Get all possible values for a parameter (for grid search).
Types
@type param_type() :: :float | :integer | :choice | :bool
Functions
Check if a parameter is active given current config.
Create a boolean parameter.
Options
:default- Default value (default: false):condition- Conditional on another parameter
Examples
Parameter.bool(:use_cot)
Parameter.bool(:stream, default: true)
Create a categorical choice parameter.
Options
:default- Default value:condition- Conditional on another parameter
Examples
Parameter.choice(:model, ["gpt-4", "gpt-3.5-turbo", "claude-3"])
Parameter.choice(:strategy, [:greedy, :sampling, :beam_search])
Create a float parameter.
Options
:step- Step size for grid search (default: calculated):default- Default value:log_scale- Use log scale for sampling:condition- Conditional on another parameter
Examples
Parameter.float(:temperature, 0.0, 1.0)
Parameter.float(:temperature, 0.0, 1.0, step: 0.1)
Parameter.float(:learning_rate, 1.0e-5, 1.0e-2, log_scale: true)
Create an integer parameter.
Options
:step- Step size (default: 1):default- Default value:condition- Conditional on another parameter
Examples
Parameter.integer(:max_tokens, 100, 4000)
Parameter.integer(:max_tokens, 100, 4000, step: 100)
Sample a random value from the parameter space.
Get all possible values for a parameter (for grid search).