Skip to main content

sample_continuous

Function sample_continuous 

Source
pub fn sample_continuous<R: Rng>(
    buffer: &ContinuousReplayBuffer,
    batch_size: usize,
    rng: &mut R,
) -> ContinuousReplayBatch
Expand description

Sample batch_size transitions uniformly with replacement from the filled portion of buffer.

Uniform with-replacement matches the canonical off-policy recipe and is what makes the sampler O(1) per draw. For small batches relative to buffer size the difference vs without-replacement is negligible.

ยงPanics

Panics if buffer.is_empty() or batch_size == 0.