AxBaseOptimizer
Defined in: https://github.com/ax-llm/ax/blob/9a5a7060a48f9eef46efc680b0cdf6b42bff5df2/src/ax/dsp/optimizer.ts#L1195
Abstract base class for optimizers that provides common functionality and standardized handling of AxOptimizerArgs
Extended by
Type Parameters
Type Parameter | Default type |
---|---|
IN | any |
OUT extends AxGenOut | any |
Implements
AxOptimizer
<IN
,OUT
>
Constructors
Constructor
new AxBaseOptimizer<IN, OUT>(args: Readonly<AxOptimizerArgs>): AxBaseOptimizer<IN, OUT>;
Defined in: https://github.com/ax-llm/ax/blob/9a5a7060a48f9eef46efc680b0cdf6b42bff5df2/src/ax/dsp/optimizer.ts#L1240
Parameters
Parameter | Type |
---|---|
args | Readonly <AxOptimizerArgs > |
Returns
AxBaseOptimizer
<IN
, OUT
>
Methods
compile()
abstract compile(
program: Readonly<AxGen<IN, OUT>>,
metricFn: AxMetricFn,
options?: AxCompileOptions): Promise<AxOptimizerResult<OUT>>;
Defined in: https://github.com/ax-llm/ax/blob/9a5a7060a48f9eef46efc680b0cdf6b42bff5df2/src/ax/dsp/optimizer.ts#L1455
Abstract method that must be implemented by concrete optimizers
Parameters
Parameter | Type |
---|---|
program | Readonly <AxGen <IN , OUT >> |
metricFn | AxMetricFn |
options? | AxCompileOptions |
Returns
Promise
<AxOptimizerResult
<OUT
>>
Implementation of
compilePareto()
compilePareto(
program: Readonly<AxGen<IN, OUT>>,
metricFn: AxMultiMetricFn,
options?: AxCompileOptions): Promise<AxParetoResult<OUT>>;
Defined in: https://github.com/ax-llm/ax/blob/9a5a7060a48f9eef46efc680b0cdf6b42bff5df2/src/ax/dsp/optimizer.ts#L1579
Multi-objective optimization using Pareto frontier Default implementation that leverages the single-objective compile method
Parameters
Parameter | Type | Description |
---|---|---|
program | Readonly <AxGen <IN , OUT >> | The program to optimize |
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(
program: Readonly<AxGen<IN, OUT>>,
metricFn: AxMetricFn,
options?: AxCompileOptions): AsyncIterableIterator<AxOptimizationProgress>;
Defined in: https://github.com/ax-llm/ax/blob/9a5a7060a48f9eef46efc680b0cdf6b42bff5df2/src/ax/dsp/optimizer.ts#L1468
Optimize a program with real-time streaming updates
Parameters
Parameter | Type | Description |
---|---|---|
program | Readonly <AxGen <IN , OUT >> | The program to optimize |
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/9a5a7060a48f9eef46efc680b0cdf6b42bff5df2/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/9a5a7060a48f9eef46efc680b0cdf6b42bff5df2/src/ax/dsp/optimizer.ts#L2496
Reset optimizer state for reuse with different programs
Returns
void