AxMiPRO
Abstract base class for optimizers that provides common functionality and standardized handling of AxOptimizerArgs
Extends
Constructors
Constructor
new AxMiPRO(args: Readonly<AxOptimizerArgs>): AxMiPRO;
Parameters
Parameter | Type |
---|---|
args | Readonly <AxOptimizerArgs > |
Returns
AxMiPRO
Overrides
Methods
compile()
compile<IN, OUT>(
program: Readonly<AxGen<IN, OUT>>,
examples: readonly AxTypedExample<IN>[],
metricFn: AxMetricFn,
options?: AxCompileOptions): Promise<AxMiPROResult<IN, OUT>>;
The main compile method to run MIPROv2 optimization
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
<AxMiPROResult
<IN
, 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
configureAuto()
configureAuto(level: "medium" | "light" | "heavy"): void;
Configures the optimizer for light, medium, or heavy optimization
Parameters
Parameter | Type | Description |
---|---|---|
level | "medium" | "light" | "heavy" | The optimization level: “light”, “medium”, or “heavy” |
Returns
void
getConfiguration()
getConfiguration(): Record<string, unknown>;
Get optimizer-specific configuration
Returns
Record
<string
, unknown
>
Current optimizer configuration
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;
Reset optimizer state for reuse with different programs
Returns
void
Overrides
updateConfiguration()
updateConfiguration(config: Readonly<Record<string, unknown>>): void;
Update optimizer configuration
Parameters
Parameter | Type | Description |
---|---|---|
config | Readonly <Record <string , unknown >> | New configuration to merge with existing |
Returns
void
validateProgram()
validateProgram<IN, OUT>(_program: Readonly<AxGen<IN, OUT>>): object;
Validate that the optimizer can handle the given program
Type Parameters
Type Parameter |
---|
IN |
OUT extends AxGenOut |
Parameters
Parameter | Type |
---|---|
_program | Readonly <AxGen <IN , OUT >> |
Returns
object
Validation result with any issues found
Name | Type |
---|---|
issues | string [] |
isValid | boolean |
suggestions | string [] |