Experiments and results
Parameter search
- cimba.decision(low, high, *, step=None, log=False)
Give a scalar
Paraman allowed range for optimization, including both bounds. The field’s annotation determines whether values are real, integer or boolean. See Optimization API for domain rules, linking fields and deriving values withmap.
- class cimba.Optimization(model, *, minimize=None, maximize=None, replications=32, window=None, seed=0)
Search for parameter values that minimize or maximize a per-trial objective. After search, choose among finalists on fresh trials, then estimate that choice on independent trials. See Optimization API for the API and Find the best parameters for a working recipe.
Sweeps
- cimba.sweep(*values)
Create an independent design axis. Assign it to a
Paramfield, a distribution parameter, anInput/Seriesfield (as a sweep of sources), or a child model field (as a sweep of model objects: one model tree per option). Independent sweeps cross. A single list argument is accepted:sweep([a, b, c]).Results.levelsreturns the swept values, including the model objects of a model sweep.The returned object has
valuesand one method:- cimba.map(function)
A new sweep on the same axis with
functionapplied to each value.
- cimba.sweeps(*columns)
Create linked sweeps that share one axis, one per column. All columns must have the same, nonzero length. Returns a tuple of sweeps.
- cimba.options(value)
Return a sweep’s tuple of options, or
(value,)for an ordinary value. Host-only helper; lists are ordinary values and are not flattened.
Experiment
- class cimba.Experiment(model, *, replications=1, window=None, seed=0, seeding='common', seeds=None)
Snapshot and validate a configured model for running.
- Parameters:
model – The root
Modelinstance.replications – Trials per design point (≥ 1).
window – A
Window; defaultWindow.until_idle().seed – Base seed of the experiment.
seeding –
"common"(same seed per replication across design points) or"independent".seeds – Explicit seeds, shaped
(replications,)or(points, replications); overridesseed/seeding.
- Raises:
cimba.schema.ModelDefinitionError – for missing or invalid configuration (the message names the instance path).
- run(*, workers=None, on_failure='record', input_memory=1 << 30)
Compile (if needed) and run every trial; return
Results.- Parameters:
workers – Worker threads;
Noneuses all cores.on_failure –
"record", or"raise"to raiseTrialsFailedif any trial fails.input_memory – Byte budget for host-generated input rows; replications are chunked to fit.
- only(*, trials, workers=1, on_failure='record', input_memory=1 << 30)
Rerun selected trials with their original seeds.
trialsholds flattened indicespoint * replications + replication. Returns aResultswith one design point per selected trial.
- describe()
A list of
{"instance", "field", "kind", "source"}rows.
- replications
- window
- seed
- seeding
Results
- class cimba.Results
Immutable outcome of
Experiment.run().- __getitem__(model)
Results for a static model instance (including every option of a model sweep, with
nanoutputs where it wasn’t selected), with one attribute per field:Samplesfor outputs, anInputRecordfor inputs and series, aSignalfor captured entities.
- failed
(points, replications)bool array.
- failure_reasons
(points, replications)string array.
- seeds
(points, replications)uint64 array of trial seeds.
- meta
Read-only mapping:
wall_time,workers,compile(misses,wall_time),extensions,native_failed,chunkswhen replications were chunked, andvariants(model trees run) when a child model is swept.
- levels(sweep)
The sweep’s value at each design point, as a tuple.
- to_table()
One dict per trial:
point,replication,seed,failed,reasonand"Class.output"columns.
- class cimba.Samples
One output across the design.
- values
Read-only
float64array(points, replications); failed trials arenan.
- shape
Supports indexing (
samples[p, r]) andnumpy.asarray.
- class cimba.Signal
A captured entity history.
- trial(point, replication)
Read-only
(times, values)arrays for one trial.
- class cimba.results.InputRecord
An input’s record in the results.
- source
Tuple of provenance dicts, one per design point.
- consumed
(points, replications)values consumed per trial.
- extended
(points, replications)extensions per trial.
- rows(point, replication)
Regenerate the exact values the trial consumed (read-only array).
Errors
Exception |
Raised when |
|---|---|
|
the configured model is incomplete or inconsistent (at
|
|
run settings are invalid (replications, window, seeds, memory). |
|
a model method can’t be compiled; the message gives |
|
trials failed and |
|
a source has invalid parameters or data. |
|
a compiled-only call is made on the host. |
|
an assignment of the wrong kind (for example a sweep on a plain field). |