AxBootstrapFewShot
Abstract base class for optimizers that provides common functionality and standardized handling of AxOptimizerArgs
Extends
Constructors
Constructor
new AxBootstrapFewShot(args: Readonly<AxOptimizerArgs & object>): AxBootstrapFewShot;
Parameters
Parameter | Type |
---|---|
args | Readonly <AxOptimizerArgs & object > |
Returns
AxBootstrapFewShot
Overrides
Methods
compile()
compile<IN, OUT>(
program: Readonly<AxGen<IN, OUT>>,
examples: readonly AxTypedExample<IN>[],
metricFn: AxMetricFn,
options?: AxCompileOptions): Promise<AxOptimizerResult<OUT>>;
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
>>
Overrides
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
Inherited from
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
Inherited from
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
Inherited from
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