public class ImageDataSetIterator extends AbstractDataSetIterator
Constructor and Description |
---|
ImageDataSetIterator() |
Modifier and Type | Method and Description |
---|---|
int |
getHeight() |
java.io.File |
getImagesLocation() |
org.nd4j.linalg.dataset.api.iterator.DataSetIterator |
getIterator(Instances data,
int seed,
int batchSize)
This method returns the iterator.
|
int |
getNumAttributes(Instances data)
This just returns the number of channels.
|
int |
getNumChannels() |
int |
getTrainBatchSize()
Getting the training batch size
|
int |
getWidth() |
void |
setHeight(int height) |
void |
setImagesLocation(java.io.File imagesLocation) |
void |
setNumChannels(int numChannels) |
void |
setTrainBatchSize(int trainBatchSize)
Setting the training batch size
|
void |
setWidth(int width) |
void |
validate(Instances data)
Validates the input dataset
|
getIterator, getOptions, listOptions, setOptions
@OptionMetadata(displayName="size of mini batch", description="The mini batch size to use in the iterator (default = 1).", commandLineParamName="bs", commandLineParamSynopsis="-bs <int>", displayOrder=0) public void setTrainBatchSize(int trainBatchSize)
AbstractDataSetIterator
setTrainBatchSize
in class AbstractDataSetIterator
trainBatchSize
- the batch sizepublic int getTrainBatchSize()
AbstractDataSetIterator
getTrainBatchSize
in class AbstractDataSetIterator
@OptionMetadata(displayName="directory of images", description="The directory containing the images (default = user home).", commandLineParamName="imagesLocation", commandLineParamSynopsis="-imagesLocation <string>", displayOrder=1) public java.io.File getImagesLocation()
public void setImagesLocation(java.io.File imagesLocation)
@OptionMetadata(displayName="desired width", description="The desired width of the images (default = 28).", commandLineParamName="width", commandLineParamSynopsis="-width <int>", displayOrder=2) public int getWidth()
public void setWidth(int width)
@OptionMetadata(displayName="desired height", description="The desired height of the images (default = 28).", commandLineParamName="height", commandLineParamSynopsis="-height <int>", displayOrder=3) public int getHeight()
public void setHeight(int height)
@OptionMetadata(displayName="desired number of channels", description="The desired number of channels (default = 1).", commandLineParamName="numChannels", commandLineParamSynopsis="-numChannels <int>", displayOrder=4) public int getNumChannels()
public void setNumChannels(int numChannels)
public void validate(Instances data) throws java.lang.Exception
data
- the input datasetjava.lang.Exception
- if validation is unsuccessfulpublic int getNumAttributes(Instances data)
getNumAttributes
in class AbstractDataSetIterator
data
- the dataset to compute the number of attributes frompublic org.nd4j.linalg.dataset.api.iterator.DataSetIterator getIterator(Instances data, int seed, int batchSize) throws java.lang.Exception
getIterator
in class AbstractDataSetIterator
data
- the dataset to useseed
- the seed for the random number generatorbatchSize
- the batch size to usejava.lang.Exception