phenotypic.tune.TuningEngine#

class phenotypic.tune.TuningEngine(spec: TuningSpec, store: StudyStore | None = None)[source]#

Bases: object

Runs a TuningSpec over a calibration image set, journaling to a store.

Methods

__init__

Initialize the engine.

best_pipeline

Build the winning ImagePipeline from the best trial (or None).

optimize

Run the loop; return the best trial.

Attributes

store

The trial store this engine appends to.

Parameters:
__init__(spec: TuningSpec, store: StudyStore | None = None) None[source]#

Initialize the engine.

Parameters:
  • spec (TuningSpec) – The tuning recipe (base pipeline + space + scorer + strategy + budget).

  • store (StudyStore | None) – An optional pre-populated store (resume); any backend satisfying the StudyStore Protocol. A fresh JournalStudyStore is created when omitted.

Return type:

None

property store: StudyStore#

The trial store this engine appends to.

best_pipeline() ImagePipeline | None[source]#

Build the winning ImagePipeline from the best trial (or None).

Return type:

ImagePipeline | None

optimize(images: list) Trial | None[source]#

Run the loop; return the best trial.

Parameters:

images (list) – The calibration images (non-empty).

Returns:

The best Trial, or None if none succeeded.

Return type:

Trial | None