Skip to main content

Crate drawset

Crate drawset 

Source
Expand description

drawset: sampling and subset-selection primitives.

This crate is meant to be a low-level “sampling toolbox” that other crates can depend on without pulling in domain-specific machinery.

Exposed modules:

  • reservoir: reservoir sampling (Algorithm L/R) + weighted reservoir.
  • gumbel: Gumbel-max / Gumbel-top-k / relaxed k-hot.
  • neighbor: simple neighborhood sampling helpers (useful for graph ML).
  • qmc: quasi-Monte Carlo sequences (Sobol, Halton, Owen-scrambled Sobol).
  • thinning: kernel thinning and herding (greedy coreset selection via MMD).

Re-exports§

pub use gumbel::gumbel_max_sample;
pub use gumbel::gumbel_noise;
pub use gumbel::gumbel_softmax;
pub use gumbel::gumbel_topk_sample;
pub use gumbel::gumbel_topk_sample_with_rng;
pub use gumbel::relaxed_topk_gumbel;
pub use neighbor::NeighborSampler;
pub use reservoir::ReservoirSampler;
pub use reservoir::ReservoirSamplerR;
pub use reservoir::WeightedReservoirSampler;
pub use thinning::kernel_herd;
pub use thinning::kernel_thin;
pub use thinning::mmd_sq_from_gram;

Modules§

gumbel
Gumbel-max sampling.
neighbor
Graph neighbor sampling.
qmc
Quasi-Monte Carlo sequences.
reservoir
Reservoir sampling.
thinning
Kernel thinning: coreset selection minimizing kernel discrepancy.

Structs§

SobolGenerator
Incremental Sobol sequence generator using Gray-code enumeration.

Functions§

halton_point
Compute a single Halton point in [0, 1)^d.
halton_sequence
Generate n Halton points in [0, 1)^d, starting from index = 1.
sobol_scrambled
Generate n Owen-scrambled Sobol points in [0, 1)^d.
sobol_sequence
Generate n Sobol points in [0, 1)^d, starting from index 1 (the origin at index 0 is skipped).