Interface Dataset
public interface Dataset
An in-memory labelled dataset of fixed-shape samples (CHW images or flat vectors).
-
Method Summary
Modifier and TypeMethodDescriptionvoidbatch(int b, int size, float[] x, int[] y) Copies batchbofsizesamples, in dataset order, intoxandy.intcount()The number of samples.static Datasetof(float[] x, int[] y, int... sampleShape) A dataset over arrays:xholds the samples back to back,yone label each.default voidsample(int i, float[] x, int xAt, int[] y, int yAt) Copies sampleiintoxatxAtand its label intoyatyAt(DataLoaderassembles shuffled batches with it).int[]The shape of one sample, e.g. {1, 28, 28} or {3, 32, 32}.default intThe number of values in one sample: the product ofsampleShape().
-
Method Details
-
count
int count()The number of samples. -
sampleShape
int[] sampleShape()The shape of one sample, e.g. {1, 28, 28} or {3, 32, 32}. -
batch
void batch(int b, int size, float[] x, int[] y) Copies batchbofsizesamples, in dataset order, intoxandy. -
sample
default void sample(int i, float[] x, int xAt, int[] y, int yAt) Copies sampleiintoxatxAtand its label intoyatyAt(DataLoaderassembles shuffled batches with it). The default copies throughbatch(int, int, float[], int[])of size 1. -
sampleSize
default int sampleSize()The number of values in one sample: the product ofsampleShape(). -
of
A dataset over arrays:xholds the samples back to back,yone label each.
-