STROOPWAFELCheckpoint¶
- class cosmic.output.STROOPWAFELCheckpoint(config, mixture, samples, is_hit, generation, gaussian_idx, bpp, bcm, initC, kick_info, num_explored, num_hits, num_hits_exploratory, fraction_explored, prior_fraction_rejected)[source]¶
Bases:
objectSerialisable snapshot of AdaptiveSampler state after exploration.
Saving this to disk decouples the exploration + adaptation phases from the (typically more expensive) refinement phase, which is the key enabler for multi-job SLURM workflows:
# Job 1 - exploration (embarrassingly parallel within the job) python run_explore.py # writes checkpoint.h5 # Job 2 - refinement (can be a larger allocation) python run_refine.py # reads checkpoint.h5, writes result.h5
A checkpoint is self-contained: alongside the exploration data it stores everything needed to rebuild the sampler — the parameter space,
BSEDict, thederive_params/reject_systems/is_interestingcallables, the remaining scalar settings, and the live RNG state — soAdaptiveSampler.from_checkpoint()needs nothing but the file. The callables and parameter space are serialised withdill.- Parameters:
- configdict
Everything needed to reconstruct the
AdaptiveSamplerfor the refinement phase: the constructor keyword arguments (parameter_space,total_systems,batch_size,BSEDict,SSEDict,is_interesting,derive_params,reject_systems,nproc,kappa,n_generations,only_save_hit_tables,min_active_fraction,min_entropy_change) plus the liverng.- mixtureGaussianMixture or None
Gaussian mixture fitted to exploration hits.
Noneif no hits were found or adaptation has not been run yet.- samplesnumpy.ndarray
(N, D) array of explored samples in sampling space (the internal transformed space used by the mixture model). Convert to physical space with
param_space.to_physical(samples).- is_hit, generation, gaussian_idxnumpy.ndarray
Per-sample flags and bookkeeping arrays (shapes (N,)).
- bpp, bcm, initC, kick_infopandas.DataFrame
COSMIC output from exploration, indexed by globally unique
bin_numso thatsamples[bin_num]gives the corresponding physical parameters.- num_exploredint
Systems evolved during exploration.
- num_hitsint
Raw hit count from exploration.
- num_hits_exploratoryint
Same as
num_hits(stored separately for use in_refine).- fraction_exploredfloat
Adaptive fraction of total budget used for exploration.
- prior_fraction_rejectedfloat
Estimated fraction of prior samples that fail physical rejection.
Methods Summary
Methods Documentation