org.encog.engine.data
Class BasicEngineData

java.lang.Object
  extended by org.encog.engine.data.BasicEngineData
All Implemented Interfaces:
Serializable, EngineData

public class BasicEngineData
extends Object
implements EngineData, Serializable

A basic implementation of the EngineData interface. This implementation simply holds and input and ideal NeuralData object. For supervised training both input and ideal should be specified. For unsupervised training the input property should be valid, however the ideal property should contain null.

Author:
jheaton
See Also:
Serialized Form

Constructor Summary
BasicEngineData(double[] input)
          Construct the object with only input.
BasicEngineData(double[] input, double[] ideal)
          Construct a BasicNeuralDataPair class with the specified input and ideal values.
 
Method Summary
static EngineData createPair(int inputSize, int idealSize)
          Create a new neural data pair object of the correct size for the neural network that is being trained.
 double[] getIdealArray()
          Get the expected results.
 double[] getInputArray()
          Get the input data.
 boolean isSupervised()
          Determine if this data pair is supervised.
 void setIdealArray(double[] data)
          Set the ideal array.
 void setInputArray(double[] data)
          Set the input array.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BasicEngineData

public BasicEngineData(double[] input)
Construct the object with only input. If this constructor is used, then unsupervised training is being used.

Parameters:
input - The input to the neural network.

BasicEngineData

public BasicEngineData(double[] input,
                       double[] ideal)
Construct a BasicNeuralDataPair class with the specified input and ideal values.

Parameters:
input - The input to the neural network.
ideal - The expected results from the neural network.
Method Detail

createPair

public static EngineData createPair(int inputSize,
                                    int idealSize)
Create a new neural data pair object of the correct size for the neural network that is being trained. This object will be passed to the getPair method to allow the neural data pair objects to be copied to it.

Parameters:
inputSize - The size of the input data.
idealSize - The size of the ideal data.
Returns:
A new neural data pair object.

getIdealArray

public double[] getIdealArray()
Get the expected results. Returns null if this is unsupervised training.

Specified by:
getIdealArray in interface EngineData
Returns:
Returns the expected results, or null if unsupervised training.

getInputArray

public double[] getInputArray()
Get the input data.

Specified by:
getInputArray in interface EngineData
Returns:
The input data.

isSupervised

public boolean isSupervised()
Determine if this data pair is supervised.

Specified by:
isSupervised in interface EngineData
Returns:
True if this data pair is supervised.

setIdealArray

public void setIdealArray(double[] data)
Set the ideal array.

Specified by:
setIdealArray in interface EngineData
Parameters:
data - The ideal array.

setInputArray

public void setInputArray(double[] data)
Set the input array.

Specified by:
setInputArray in interface EngineData
Parameters:
data - The input array.

toString

public String toString()

Overrides:
toString in class Object


Copyright © 2011. All Rights Reserved.