public class MnistManager extends Object
| Constructor and Description |
|---|
MnistManager(String imagesFile,
String labelsFile)
Constructs an instance managing the two given data files.
|
| Modifier and Type | Method and Description |
|---|---|
MnistImageFile |
getImages()
Get the underlying images file as
MnistImageFile. |
MnistLabelFile |
getLabels()
Get the underlying labels file as
MnistLabelFile. |
int[][] |
readImage()
Reads the current image.
|
int |
readLabel()
Reads the current label.
|
void |
setCurrent(int index)
Set the position to be read.
|
static void |
writeImageToPpm(int[][] image,
String ppmFileName)
Writes the given image in the given file using the PPM data format.
|
public MnistManager(String imagesFile, String labelsFile) throws IOException
NULL value for one of the arguments in case reading only one
of the files (images and labels) is required.imagesFile - Can be NULL. In that case all future operations
using that file will fail.labelsFile - Can be NULL. In that case all future operations
using that file will fail.IOExceptionpublic static void writeImageToPpm(int[][] image,
String ppmFileName)
throws IOException
image - ppmFileName - IOExceptionpublic int[][] readImage()
throws IOException
IOExceptionpublic void setCurrent(int index)
index - public int readLabel()
throws IOException
IOExceptionpublic MnistImageFile getImages()
MnistImageFile.MnistImageFile.public MnistLabelFile getLabels()
MnistLabelFile.MnistLabelFile.Copyright © 2021. All rights reserved.