public class MnistImageFile extends MnistDbFile
| Constructor and Description |
|---|
MnistImageFile(String name,
String mode)
Creates new MNIST database image file ready for reading.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getCols()
Number of columns per image.
|
int |
getEntryLength()
Number of bytes for each entry.
|
int |
getHeaderSize() |
protected int |
getMagicNumber()
MNIST DB files start with unique integer number.
|
int |
getRows()
Number of rows per image.
|
void |
nextImage()
Move the cursor to the next image.
|
void |
prevImage()
Move the cursor to the previous image.
|
int[][] |
readImage()
Reads the image at the current position.
|
getCount, getCurrentIndex, next, prev, setCurrentIndexclose, getChannel, getFD, getFilePointer, length, read, read, read, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, seek, setLength, skipBytes, write, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTFpublic MnistImageFile(String name, String mode) throws IOException
name - the system-dependent filenamemode - the access modeIOExceptionFileNotFoundExceptionpublic int[][] readImage()
throws IOException
IOExceptionpublic void nextImage()
throws IOException
IOExceptionpublic void prevImage()
throws IOException
IOExceptionprotected int getMagicNumber()
MnistDbFilegetMagicNumber in class MnistDbFilepublic int getRows()
public int getCols()
public int getEntryLength()
MnistDbFilegetEntryLength in class MnistDbFilepublic int getHeaderSize()
getHeaderSize in class MnistDbFileCopyright © 2019. All rights reserved.