45 size_t numSamples,
size_t xStride,
size_t yStride,
46 int numClasses,
int perClass,
unsigned seed = 42);
62 void GetBatch(
float *X_out,
float *Y_out,
int *labels_out)
noexcept;
65 int GetBatchSize() const noexcept {
return numClasses * perClass; }
86 std::vector<std::vector<size_t>> classIndices;
87 std::vector<size_t> pointers;
89 void ReshuffleClass(
int c)
noexcept;
93 std::vector<size_t> NextClassSlice(
int c,
int n)
noexcept;
size_t GetYStride() const noexcept
Floats per Y row, as given at construction.
Definition StreamAlignedBatcher.h:73
StreamAlignedBatcher(const float *X, const float *Y, const int *labels, size_t numSamples, size_t xStride, size_t yStride, int numClasses, int perClass, unsigned seed=42)
Definition StreamAlignedBatcher.cpp:6
size_t NumBatchesPerEpoch() const noexcept
Number of complete batches obtainable per epoch, limited by the rarest class's sample count (matches ...
Definition StreamAlignedBatcher.cpp:53
int GetNumClasses() const noexcept
Number of distinct classes, as given at construction.
Definition StreamAlignedBatcher.h:69
void GetBatch(float *X_out, float *Y_out, int *labels_out) noexcept
Fills the next batch into caller-provided, pre-allocated output buffers. Rows are GROUPED by class: r...
Definition StreamAlignedBatcher.cpp:61
size_t GetXStride() const noexcept
Floats per X row, as given at construction.
Definition StreamAlignedBatcher.h:71
int GetBatchSize() const noexcept
Rows per batch: numClasses * perClass.
Definition StreamAlignedBatcher.h:65
int GetPerClass() const noexcept
Examples per class in each batch, as given at construction.
Definition StreamAlignedBatcher.h:67
This file exists to provide both Tensor.h and IComputeBackend.h with device types without introducing...
Definition Backend.cpp:10