DiscreteHistogram¶
-
class DiscreteHistogram : public madspace::FunctionGenerator¶
Per-category weight accumulator that adapts a DiscreteSampler.
During the warm-up run it sums the sample weights for each category of each discrete dimension. The accumulated
values_dandcounts_dare then used to refine the learned categorical distributions (Sec. 3.2.2 of [1]).batchis the leading batch dimension.dindexes the discrete dimensions.Arguments
index_d–int, shape(batch,)– the chosen category per dimension.weight–float, shape(batch,)– the per-sample weights.
Returns
values_d–float, shape(option_counts[d],)– summed weight per category.counts_d–int, shape(option_counts[d],)– sample count per category.
References
[1] T. Heimel, O. Mattelaer, R. Winterhalder, “MadSpace”, https://arxiv.org/abs/2602.06895 (Sec. 3.2.2)
Public Functions
-
DiscreteHistogram(const std::vector<std::size_t> &option_counts)¶
- Parameters:
option_counts – Number of categories for each discrete dimension.