MadnisTraining¶
- class madspace.MadnisTraining(self: madspace._madspace_py.MadnisTraining, generator_context: madspace._madspace_py.Context, optimizer_context: madspace._madspace_py.Context, config: madspace._madspace_py.MadnisConfig, integrands: collections.abc.Sequence[madspace._madspace_py.Integrand], cwnet: madspace._madspace_py.ChannelWeightNetwork | None, seed: SupportsInt | None = None)¶
Bases:
pybind11_objectMadNIS training loop for one subprocess’s channels [1, 2, 3].
Alternates sampling batches from the channels’ Integrand / ChannelWeightNetwork (online) or a replay buffer of past samples (buffered) with AdamOptimizer steps on the stratified variance loss, periodically drops underperforming channels, and tracks progress in a status history for reporting. MultiMadnisTraining coordinates one
MadnisTrainingper subprocess.References
[1] T. Heimel et al., “MadNIS - Neural multi-channel importance sampling”, https://arxiv.org/abs/2212.06172
[2] T. Heimel et al., “The MadNIS Reloaded”, https://arxiv.org/abs/2311.01548
[3] T. Heimel et al., “Differentiable MadNIS-Lite”, https://arxiv.org/abs/2408.01486
- Parameters:
generator_context – Context the sampling runtimes run on.
optimizer_context – Context the trained globals and optimizer live on.
config – Training configuration.
integrands – One integrand per channel to train.
cwnet – Optional shared channel-weight network.
seed – Top-level run seed.
channel_index_offset – Offset added to this subprocess’s local channel indices when deriving seeds, so MultiMadnisTraining’s subprocesses (which all share the same top-level seed) get non-overlapping
DerivedSeedchannel-index ranges.
- active_channel_count(self: madspace._madspace_py.MadnisTraining) int¶
Number of channels not yet dropped.
- active_channels(self: madspace._madspace_py.MadnisTraining) list[int]¶
Indices of the channels not yet dropped.
- train_step(self: madspace._madspace_py.MadnisTraining, batch_index: SupportsInt) None¶
Run training batch
batch_index: sample, optimize, and update the status history.