AxBaseOptimizer
Defined in: https://github.com/ax-llm/ax/blob/8dfd0ce02b8cb386fb2c93fa280a2ec0da2d6011/src/ax/dsp/optimizer.ts#L1116
Abstract base class for optimizers that provides common functionality and standardized handling of AxOptimizerArgs
Extended by
Implements
Constructors
Constructor
new AxBaseOptimizer(args: Readonly<AxOptimizerArgs>): AxBaseOptimizer;
Defined in: https://github.com/ax-llm/ax/blob/8dfd0ce02b8cb386fb2c93fa280a2ec0da2d6011/src/ax/dsp/optimizer.ts#L1161
Parameters
Parameter | Type |
---|---|
args | Readonly <AxOptimizerArgs > |
Returns
AxBaseOptimizer
Methods
compile()
abstract compile<IN, OUT>(
program: Readonly<AxGen<IN, OUT>>,
examples: readonly AxTypedExample<IN>[],
metricFn: AxMetricFn,
options?: AxCompileOptions): Promise<AxOptimizerResult<OUT>>;
Defined in: https://github.com/ax-llm/ax/blob/8dfd0ce02b8cb386fb2c93fa280a2ec0da2d6011/src/ax/dsp/optimizer.ts#L1431
Abstract method that must be implemented by concrete optimizers
Type Parameters
Type Parameter |
---|
IN |
OUT extends AxGenOut |
Parameters
Parameter | Type |
---|---|
program | Readonly <AxGen <IN , OUT >> |
examples | readonly AxTypedExample <IN >[] |
metricFn | AxMetricFn |
options? | AxCompileOptions |
Returns
Promise
<AxOptimizerResult
<OUT
>>
Implementation of
compilePareto()
compilePareto<IN, OUT>(
program: Readonly<AxGen<IN, OUT>>,
examples: readonly AxTypedExample<IN>[],
metricFn: AxMultiMetricFn,
options?: AxCompileOptions): Promise<AxParetoResult<OUT>>;
Defined in: https://github.com/ax-llm/ax/blob/8dfd0ce02b8cb386fb2c93fa280a2ec0da2d6011/src/ax/dsp/optimizer.ts#L1559
Multi-objective optimization using Pareto frontier Default implementation that leverages the single-objective compile method
Type Parameters
Type Parameter |
---|
IN |
OUT extends AxGenOut |
Parameters
Parameter | Type | Description |
---|---|---|
program | Readonly <AxGen <IN , OUT >> | The program to optimize |
examples | readonly AxTypedExample <IN >[] | Training examples |
metricFn | AxMultiMetricFn | Multi-objective metric function that returns multiple scores |
options? | AxCompileOptions | Optional configuration options |
Returns
Promise
<AxParetoResult
<OUT
>>
Pareto optimization result with frontier of non-dominated solutions
Implementation of
compileStream()
compileStream<IN, OUT>(
program: Readonly<AxGen<IN, OUT>>,
examples: readonly AxTypedExample<IN>[],
metricFn: AxMetricFn,
options?: AxCompileOptions): AsyncIterableIterator<AxOptimizationProgress>;
Defined in: https://github.com/ax-llm/ax/blob/8dfd0ce02b8cb386fb2c93fa280a2ec0da2d6011/src/ax/dsp/optimizer.ts#L1446
Optimize a program with real-time streaming updates
Type Parameters
Type Parameter |
---|
IN |
OUT extends AxGenOut |
Parameters
Parameter | Type | Description |
---|---|---|
program | Readonly <AxGen <IN , OUT >> | The program to optimize |
examples | readonly AxTypedExample <IN >[] | Training examples |
metricFn | AxMetricFn | Evaluation metric function |
options? | AxCompileOptions | Optional configuration options |
Returns
AsyncIterableIterator
<AxOptimizationProgress
>
Async iterator yielding optimization progress
Implementation of
getStats()
getStats(): AxOptimizationStats;
Defined in: https://github.com/ax-llm/ax/blob/8dfd0ce02b8cb386fb2c93fa280a2ec0da2d6011/src/ax/dsp/optimizer.ts#L2492
Get current optimization statistics
Returns
Current optimization statistics
Implementation of
reset()
reset(): void;
Defined in: https://github.com/ax-llm/ax/blob/8dfd0ce02b8cb386fb2c93fa280a2ec0da2d6011/src/ax/dsp/optimizer.ts#L2605
Reset optimizer state for reuse with different programs
Returns
void