arcade.stages
Pipeline stage entry points (data, classify, hardware, visualization).
Functions
|
Run the default data stage (load, demodulate, split, transitions). |
- class arcade.stages.BaseClassifyStage[source]
Bases:
ABCTrain and evaluate classifiers (classify stage).
- class arcade.stages.BaseDataStage[source]
Bases:
ABCLoad, demodulate, preprocess, split, and detect transitions.
- class arcade.stages.BaseFeatureStage[source]
Bases:
ABCCompute filter banks / feature sets from transition results.
- class arcade.stages.DefaultClassifyStage[source]
Bases:
BaseClassifyStageTrain and evaluate classifiers from config.
Runs the feature stage for matched filters, then trains each classifier listed in
cfg.classifiers.run(plus an optional custom classifier).- run(cfg, data_out)[source]
Train/evaluate all configured classifiers.
- Parameters:
- Return type:
- Returns:
Dict with
filter_setandclassifiers(per-name results containingmodel,metrics,history,sweep, …). Ifsplitsis missing, returns empty classifier results.
- run_single_classifier(clf_name, *, cfg, filter_set, splits, transition_result, feature_registry, post_measured=None)[source]
Train and evaluate one classifier, optionally with length sweep.
- Parameters:
clf_name (
str) – Registered classifier name (e.g.threshold,ngrc).cfg (
Any) – Pipeline config (training, sweep, tuning, data knobs).filter_set (
Any) – Matched-filter bank from the feature stage (may beNonefor trace-only classifiers).splits (
Any) – Train/val/test split object from the data stage.transition_result (
Any) – Transition detection result used for length sweeps (may beNonewhen sweep is disabled).feature_registry (
Any) – Module exposingget_feature_fn(usuallyarcade.features.kinds).post_measured (
dict[str,ndarray] |None) – Optional post-measurement labels keyed by split name (train/val/test), used by REMF.
- Return type:
- Returns:
Dict with
model,metrics,history,sweep,best_params,benchmark_features, andbenchmark_traces.
- arcade.stages.DefaultDataStage
alias of
Readout2019DataStage
- class arcade.stages.DefaultFeatureStage[source]
Bases:
BaseFeatureStageCompute MF / RMF / EMF matched filters from transition results.
- class arcade.stages.DefaultHardwareStage[source]
Bases:
BaseHardwareStageFPGA resource estimation, export, and design-space exploration.
- class arcade.stages.DefaultOptimizationStage[source]
Bases:
BaseOptimizationStageApply pruning, distillation, NAS, and quantization.
- class arcade.stages.DefaultVisualizationStage[source]
Bases:
BaseVisualizationStageGenerate plots and summary reports.
- class arcade.stages.Readout2019DataStage[source]
Bases:
BaseDataStageLoad, split (indices first), demodulate, preprocess, detect transitions.
- run(cfg, *, cache_dir=None, demod_cache_path=None, classifiers_run=None)[source]
Load and prepare IQ traces for downstream classify / hardware stages.
- Parameters:
cfg (
Any) – Pipeline config (datablock drives loaders, demod, preprocessing, transitions, and split).cache_dir (
str|Path|None) – Optional root for demod / spectral / transition caches.demod_cache_path (
str|Path|None) – Optional explicit demod-cache file path.classifiers_run (
list[str] |None) – Classifier names used whentransitions.autoplans leakage vs filter-only detection.
- Return type:
- Returns:
Data-stage dict with
bundle,traces,labels,label_set,relaxation_result,transition_result,spectral_labels,splits, and flat train/val/test keys when splits are available. May includepost_measured.
- arcade.stages.hydrate_data_out(data_out)[source]
Ensure flat train/val/test keys exist (e.g. after loading old pickles).
- arcade.stages.data_out_data_fraction(data_out, frac)[source]
Subsample train/val/test splits; keep
transition_resultunchanged.
- arcade.stages.data_out_labels_placeholder(features)[source]
Zero labels placeholder for DSE resource-only sweeps.
- arcade.stages.resolve_cache_paths(dcfg, *, cache_dir, demod_cache_path)[source]
Resolve demod / transition / spectral cache locations.
- Parameters:
dcfg (
Any) – Data config block (demodulation,transitions).cache_dir (
str|Path|None) – If set, all caches live under this directory (demod_traces.pkl,spectral_cache,transitions).demod_cache_path (
str|Path|None) – Explicit demod-cache file; overridesdcfg.demodulation.cache_pathwhencache_diris unset.
- Return type:
- Returns:
Dict with keys
demod,spectral, andtransition(each aPathorNone).
- arcade.stages.transition_plan(tcfg, classifiers_run)[source]
Decide which transition detectors to run for this pipeline.
- Parameters:
- Return type:
- Returns:
Tuple
(run_relaxations, run_leakage, leakage_method).
- arcade.stages.run_data_stage(cfg, *, cache_dir=None, demod_cache_path=None, classifiers_run=None)[source]
Run the default data stage (load, demodulate, split, transitions).
Thin wrapper around
DefaultDataStage.- Parameters:
cfg (
Any) – Pipeline config (typicallyArcadeConfig).cache_dir (
str|Path|None) – Optional root for demod / spectral / transition caches.demod_cache_path (
str|Path|None) – Optional explicit demod-cache file path.classifiers_run (
list[str] |None) – Classifier names used to auto-plan transition detection whentransitions.autois enabled.
- Return type:
- Returns:
Data-stage dict with traces, labels, splits, and transition results.
- arcade.stages.run_classify_stage(cfg, data_out)[source]
Run the default classify stage.
Thin wrapper around
DefaultClassifyStage.
- arcade.stages.run_single_classifier(*args, **kwargs)[source]
Train and evaluate one classifier (module-level entry point).
Backward-compatible wrapper around
DefaultClassifyStage.run_single_classifier().- Parameters:
*args (
Any) – Positional args forwarded toDefaultClassifyStage.run_single_classifier().**kwargs (
Any) – Keyword args forwarded toDefaultClassifyStage.run_single_classifier().
- Return type:
- Returns:
Per-classifier result dict (
model,metrics, …).
- arcade.stages.run_hardware_stage(cfg, classify_out)[source]
Run the default hardware stage.
Thin wrapper around
DefaultHardwareStage.
- arcade.stages.run_visualization_stage(cfg, data_out, classify_out, hardware_out)[source]
Run the default visualization stage.
Thin wrapper around
DefaultVisualizationStage.