org.encog.neural.data.image
Class ImageNeuralDataSet

java.lang.Object
  extended by org.encog.neural.data.basic.BasicNeuralDataSet
      extended by org.encog.neural.data.image.ImageNeuralDataSet
All Implemented Interfaces:
Serializable, Iterable<NeuralDataPair>, EngineDataSet, EngineIndexableSet, Indexable, NeuralDataSet, EncogPersistedObject

public class ImageNeuralDataSet
extends BasicNeuralDataSet

Store a collection of images for training with a neural network. This class collects and then downsamples images for use with a neural network. This is a memory based class, so large datasets can run out of memory.

Author:
jheaton
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.encog.neural.data.basic.BasicNeuralDataSet
BasicNeuralDataSet.BasicNeuralIterator
 
Field Summary
static String MUST_USE_IMAGE
          Error message to inform the caller that only ImageNeuralData objects can be used with this collection.
 
Constructor Summary
ImageNeuralDataSet(Downsample downsampler, boolean findBounds, double hi, double lo)
          Construct this class with the specified downsampler.
 
Method Summary
 void add(NeuralData data)
          Add the specified data, must be an ImageNeuralData class.
 void add(NeuralData inputData, NeuralData idealData)
          Add the specified input and ideal object to the collection.
 void add(NeuralDataPair inputData)
          Add input and expected output.
 void downsample(int height, int width)
          Downsample all images and generate training data.
 int getHeight()
           
 int getWidth()
           
 
Methods inherited from class org.encog.neural.data.basic.BasicNeuralDataSet
clone, close, createPersistor, getCollection, getData, getDescription, getIdealSize, getInputSize, getName, getRecord, getRecordCount, isSupervised, iterator, openAdditional, setCollection, setData, setDescription, setName
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MUST_USE_IMAGE

public static final String MUST_USE_IMAGE
Error message to inform the caller that only ImageNeuralData objects can be used with this collection.

See Also:
Constant Field Values
Constructor Detail

ImageNeuralDataSet

public ImageNeuralDataSet(Downsample downsampler,
                          boolean findBounds,
                          double hi,
                          double lo)
Construct this class with the specified downsampler.

Parameters:
downsampler - The downsampler to use.
findBounds - Should the bounds be found and clipped.
hi - The high value to normalize to.
lo - The low value to normalize to.
Method Detail

add

public void add(NeuralData data)
Add the specified data, must be an ImageNeuralData class.

Specified by:
add in interface NeuralDataSet
Overrides:
add in class BasicNeuralDataSet
Parameters:
data - The data The object to add.

add

public void add(NeuralData inputData,
                NeuralData idealData)
Add the specified input and ideal object to the collection.

Specified by:
add in interface NeuralDataSet
Overrides:
add in class BasicNeuralDataSet
Parameters:
inputData - The image to train with.
idealData - The expected otuput form this image.

add

public void add(NeuralDataPair inputData)
Add input and expected output. This is used for supervised training.

Specified by:
add in interface NeuralDataSet
Overrides:
add in class BasicNeuralDataSet
Parameters:
inputData - The input data to train on.

downsample

public void downsample(int height,
                       int width)
Downsample all images and generate training data.

Parameters:
height - The height to downsample to.
width - the width to downsample to.

getHeight

public int getHeight()
Returns:
the height

getWidth

public int getWidth()
Returns:
the width


Copyright © 2011. All Rights Reserved.