public class MnistLabelFile extends MnistDbFile
Constructor and Description |
---|
MnistLabelFile(java.lang.String name,
java.lang.String mode)
Creates new MNIST database label file ready for reading.
|
Modifier and Type | Method and Description |
---|---|
protected int |
getMagicNumber()
MNIST DB files start with unique integer number.
|
int |
readLabel()
Reads the integer at the current position.
|
int[] |
readLabels(int num)
Read the specified number of labels from the current position
|
getCount, getCurrentIndex, getEntryLength, getHeaderSize, next, prev, setCurrentIndex
close, 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, writeUTF
public MnistLabelFile(java.lang.String name, java.lang.String mode) throws java.io.IOException
name
- the system-dependent filenamemode
- the access modejava.io.IOException
java.io.FileNotFoundException
public int readLabel() throws java.io.IOException
java.io.IOException
public int[] readLabels(int num) throws java.io.IOException
java.io.IOException
protected int getMagicNumber()
MnistDbFile
getMagicNumber
in class MnistDbFile