pub struct SplitSampler { /* private fields */ }Expand description
Like RandomSampler, but an epoch is a slice of a data pass.
splits says how finely to cut one pass. The pass permutation is
unchanged and still covers every sample exactly once; splitting only
decides how much of it one epoch consumes, so splits epochs make one
pass and no sample is seen twice along the way.
This is what makes single-pass training (the normal regime for LLM pretraining) workable: everything that keys off the epoch boundary — eval, checkpointing, reporting — gets a boundary to key off, where a naive one-epoch run has none until teardown.
ⓘ
use flodl::SplitSampler;
// One pass over 10k samples, delivered as 20 epochs of 500.
let sampler = SplitSampler::new(10_000, 42, 20);At splits = 1 it behaves exactly like RandomSampler.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SplitSampler
impl RefUnwindSafe for SplitSampler
impl Send for SplitSampler
impl Sync for SplitSampler
impl Unpin for SplitSampler
impl UnsafeUnpin for SplitSampler
impl UnwindSafe for SplitSampler
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more