Visits indices [0, dataset_size) in a seeded pseudo-random permutation – reproducible across runs given the same seed (std::mt19937), re-shuffled fresh each reset() call (a new epoch is a new permutation, not the same one repeated).
More...
#include <sampler.hpp>
|
| | ShuffleSampler (unsigned seed) |
| |
| void | reset (int64_t dataset_size) override |
| | Begins a new epoch over a dataset of the given size.
|
| |
| std::optional< int64_t > | next () override |
| | Fetches the next index in this epoch's order.
|
| |
| virtual | ~Sampler ()=default |
| |
Visits indices [0, dataset_size) in a seeded pseudo-random permutation – reproducible across runs given the same seed (std::mt19937), re-shuffled fresh each reset() call (a new epoch is a new permutation, not the same one repeated).
◆ ShuffleSampler()
| pulsatrix::ShuffleSampler::ShuffleSampler |
( |
unsigned |
seed | ) |
|
|
explicit |
◆ next()
| std::optional< int64_t > pulsatrix::ShuffleSampler::next |
( |
| ) |
|
|
overridevirtual |
Fetches the next index in this epoch's order.
- Returns
- The next index, or std::nullopt once every index has been produced.
Implements pulsatrix::Sampler.
◆ reset()
| void pulsatrix::ShuffleSampler::reset |
( |
int64_t |
dataset_size | ) |
|
|
overridevirtual |
Begins a new epoch over a dataset of the given size.
- Parameters
-
| dataset_size | Number of samples to produce indices for. Must be >= 0 – internal invariant (PULSATRIX_ASSERT, not throw): DataLoader always calls this with Dataset::size()'s return value directly, never unvalidated external input. |
Implements pulsatrix::Sampler.
The documentation for this class was generated from the following file: