saealib.OptimizationStrategy#

class saealib.OptimizationStrategy[source]#

Bases: object

Base class for optimization strategies.

Strategies expose one canonical ComponentGraph topology. A strategy may describe it directly through build_pipeline; the default implementation recovers a facade for stage-based graphs.

Methods

__init__

build_graph

Build the strategy's canonical graph.

build_pipeline

Return the strategy's high-level Pipeline description.

contract

Return the strategy contract.

step

Perform one generation step: generate, score, evaluate, and update.

Method Details

OptimizationStrategy.__init__()#
OptimizationStrategy.build_graph(provider)[source]#

Build the strategy’s canonical graph.

Built-in strategies provide node/adapter specs to the canonical graph builder; graph-only extensions override this method and need not implement a Pipeline builder.

Parameters:

provider (ComponentProvider)

Return type:

ComponentGraph

OptimizationStrategy.build_pipeline(provider)[source]#

Return the strategy’s high-level Pipeline description.

Parameters:

provider (ComponentProvider)

Return type:

Pipeline

OptimizationStrategy.contract()[source]#

Return the strategy contract.

Return type:

ComponentContract

OptimizationStrategy.step(ctx, provider)[source]#

Perform one generation step: generate, score, evaluate, and update.

Parameters:
  • ctx (OptimizationState) – Current optimization context.

  • provider (ComponentProvider) – Component provider.

Returns:

Updated state returned by the pipeline.

Return type:

OptimizationState