public class MnistUtils extends Object
Modifier and Type | Class and Description |
---|---|
static class |
MnistUtils.MnistImage
MNIST image.
|
static class |
MnistUtils.MnistLabeledImage
MNIST labeled image.
|
Constructor and Description |
---|
MnistUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
asLIBSVM(String imagesPath,
String labelsPath,
String outPath,
Random rnd,
int cnt)
Convert random
count samples from MNIST dataset from two files (images and labels) into libsvm format. |
static List<MnistUtils.MnistLabeledImage> |
mnistAsList(String imagesPath,
String labelsPath,
Random rnd,
int cnt)
Read random
count samples from MNIST dataset from two files (images and labels) into a stream of labeled
vectors. |
static List<MnistUtils.MnistLabeledImage> |
mnistAsListFromResource(String imagesPath,
String labelsPath,
Random rnd,
int cnt)
Read random
count samples from MNIST dataset from two resources (images and labels) into a stream of
labeled vectors. |
static Stream<DenseVector> |
mnistAsStream(String imagesPath,
String labelsPath,
Random rnd,
int cnt)
Read random
count samples from MNIST dataset from two files (images and labels) into a stream of labeled
vectors. |
public static Stream<DenseVector> mnistAsStream(String imagesPath, String labelsPath, Random rnd, int cnt) throws IOException
count
samples from MNIST dataset from two files (images and labels) into a stream of labeled
vectors.imagesPath
- Path to the file with images.labelsPath
- Path to the file with labels.rnd
- Random numbers generator.cnt
- Count of samples to read.IgniteException
- In case of exception.IOException
public static List<MnistUtils.MnistLabeledImage> mnistAsList(String imagesPath, String labelsPath, Random rnd, int cnt) throws IOException
count
samples from MNIST dataset from two files (images and labels) into a stream of labeled
vectors.imagesPath
- Path to the file with images.labelsPath
- Path to the file with labels.rnd
- Random numbers generator.cnt
- Count of samples to read.IOException
- In case of exception.public static List<MnistUtils.MnistLabeledImage> mnistAsListFromResource(String imagesPath, String labelsPath, Random rnd, int cnt) throws IOException
count
samples from MNIST dataset from two resources (images and labels) into a stream of
labeled vectors.imagesPath
- Path to the resource with images.labelsPath
- Path to the resource with labels.rnd
- Random numbers generator.cnt
- Count of samples to read.IOException
- In case of exception.public static void asLIBSVM(String imagesPath, String labelsPath, String outPath, Random rnd, int cnt) throws IOException
count
samples from MNIST dataset from two files (images and labels) into libsvm format.imagesPath
- Path to the file with images.labelsPath
- Path to the file with labels.outPath
- Path to output path.rnd
- Random numbers generator.cnt
- Count of samples to read.IgniteException
- In case of exception.IOException
GridGain In-Memory Computing Platform : ver. 8.9.15 Release Date : December 3 2024