Skip to main content

engine.dse.DSE

engine.dse.DSE(space, objective, constraints=None)

Declarative Design Space Exploration (DSE) Engine.

A unified interface for navigating ML system trade-offs through an exhaustive grid search over a defined parameter space, filtering by constraints and ranking by objective.

Methods

Name Description
search Enumerate a finite design grid and rank accepted evaluations.

search

engine.dse.DSE.search(evaluator_fn)

Enumerate a finite design grid and rank accepted evaluations.

Parameters

Name Type Description Default
evaluator_fn callable Function receiving one parameter dictionary and returning a result object or dictionary. Objective and constraint paths must resolve to comparable numeric scalars; Pint values are compared by magnitude without unit normalization. required

Returns

Name Type Description
dict Best parameters, scalar objective, original best result, and up to five ranked candidate records. Ties retain enumeration order; an empty accepted set raises ValueError.

Notes

Candidates are the Cartesian product of the configured parameter lists. Retain passing constraints and feasibility status PASS when present; sort objective magnitudes ascending for minimize and descending for maximize.

The evaluator uses identical metric meaning and units for every candidate. Constraint expressions use a three-token metric/operator/numeric-threshold form.

The method does not provide continuous optimization, automatic unit conversion, uncertainty, and causal interpretation of rankings. Evaluator exceptions skip candidates. Malformed constraints, unsupported operators, and non-finite thresholds raise ValueError before any candidate is evaluated. Supported operators are <, >, <=, >=, and ==. An unknown objective or constraint metric path raises ValueError on the first feasible result that lacks it.

Examples

>>> search = DSE({"x": [1, 2, 3]}, "minimize: cost", ["cost >= 4"])
>>> result = search.search(lambda p: {"cost": p["x"] ** 2})
>>> result["best_params"]
{'x': 2}
Back to top