|
dLife Home Page | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectdlife.sys.SerializationBase
dlife.nn.NeuralNetwork
public abstract class NeuralNetwork
Abstract base class that provides common functionality for a variety of neural networks. This includes setting up filters on the inputs and outputs as well as evaluating the performance of the network. Concrete subclasses of NeuralNetwork are expected to implement their own means of defining the type(s) of neurons that are used and also for handling any weights and/or connections.
When a NeuralNetwork is serialized its input and output filters are serialized. However, the current inputs and outputs of the network are transient and are not serialized with the network.
| Field Summary | |
|---|---|
protected double[] |
filteredInputs
|
protected double[] |
filteredOutputs
|
protected double[] |
rawInputs
|
protected double[] |
rawOutputs
|
| Constructor Summary | |
|---|---|
NeuralNetwork()
Construct a new NeuralNetwork with no input or output filters. |
|
| Method Summary | |
|---|---|
NNResults |
evaluate(NNDataSet data,
double tolerance)
Evaluate the performance of this NeuralNetwork on the provided NNDataSet. |
NNResults |
evaluate(NNDataSet data,
double tolerance,
boolean trace)
Evaluate the performance of this NeuralNetwork on the provided NNDataSet. |
double[] |
getFilteredInputs()
Get the values of the inputs of this NeuralNetowrk after all input filters have been applied. |
double[] |
getFilteredOutputs()
Get the filtered output of this NeuralNetwork. |
NNDataFilter |
getInputFilter()
Get the NNDataFilter that is to be applied to all inputs. |
NNDataFilter |
getInputFilter(int input)
Get the NNDataFilter that is to be applied to the specified input. |
NNDataFilter |
getOutputFilter()
Get the NNDataFilter that is to be applied to all outputs. |
NNDataFilter |
getOutputFilter(int output)
Get the NNDataFilter that is to be applied to the specified output. |
double[] |
getRawInputs()
Get the current raw values of the inputs to this NeuralNetowrk. |
double[] |
getRawOutputs()
Get the raw outputs of this NeuralNetwork. |
abstract void |
propagate()
Propagate the current (filtered) input values through this NeuralNetwork. |
void |
setInputFilter(NNDataFilter filter)
Set the NNDataFilter that will be used for every input to this NeuralNetwork. |
void |
setInputFilter(NNDataFilter filter,
int input)
Set the NNDataFilter applied to a specific input of the NeuralNetwork. |
void |
setInputs(double[] inputs)
Set the inputs of this NeuralNetwork to the specified values. |
void |
setOutputFilter(NNDataFilter filter)
Set the NNDataFilter that will be used for every output of this NeuralNetwork. |
void |
setOutputFilter(NNDataFilter filter,
int output)
Set the NNDataFilter used by a specific output of the NeuralNetwork. |
protected void |
setOutputs(double[] outputs)
Set the outputs of this NeuralNetwork. |
| Methods inherited from class dlife.sys.SerializationBase |
|---|
read, write |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected transient double[] rawInputs
protected transient double[] filteredInputs
protected transient double[] rawOutputs
protected transient double[] filteredOutputs
| Constructor Detail |
|---|
public NeuralNetwork()
| Method Detail |
|---|
public void setInputFilter(NNDataFilter filter)
filter - the NNDataFilter to use or null to clear the filter.
public void setInputFilter(NNDataFilter filter,
int input)
filter - the NNDataFilter to use or null to clear the filter.input - the input to which to assign the filter.public NNDataFilter getInputFilter()
public NNDataFilter getInputFilter(int input)
input - the input for which to get the filter.
public void setOutputFilter(NNDataFilter filter)
filter - the NNDataFilter to use or null to clear the filter.
public void setOutputFilter(NNDataFilter filter,
int output)
filter - the NNDataFilter to use or null to clear the filter.output - the output to which to assign the filter.public NNDataFilter getOutputFilter()
public NNDataFilter getOutputFilter(int output)
output - the output for which to get the filter.
public void setInputs(double[] inputs)
inputs - the inputs to the network.
public double[] getRawInputs()
throws IllegalStateException
IllegalStateException - if the inputs have not been set.
public double[] getFilteredInputs()
throws IllegalStateException
IllegalStateException - if the inputs have not been set.
public abstract void propagate()
throws IllegalStateException
IllegalStateException - if the inputs have not been set.protected void setOutputs(double[] outputs)
outputs - the raw outputs for this network.
public double[] getRawOutputs()
throws IllegalStateException
IllegalStateException - if propagate has never been called.
public double[] getFilteredOutputs()
throws IllegalStateException
IllegalStateException - if propagate has never been called.
public NNResults evaluate(NNDataSet data,
double tolerance,
boolean trace)
throws IllegalArgumentException
data - the NNDataSet to be used to evaluate this NeuralNetwork.tolerance - a fraction of the desired output value within which an
actual result is to be considered to be equal to the desired
output. E.g. 0.1 means that any actual output within 10% of
the specified correct output will be counted as a correct
response.trace - if true then a complete trace of the network outputs will be
reported for each input in the NNDataSet.
IllegalArgumentException - if the provided NNDataSet is empty.
public NNResults evaluate(NNDataSet data,
double tolerance)
data - the NNDataSet to be used to evaluate this NeuralNetwork.tolerance - a fraction of the desired output value within which an
actual result is to be considered to be equal to the desired
output. E.g. 0.1 means that any actual output within 10% of
the specified correct output will be counted as a correct
response.
IllegalArgumentException - if the provided NNDataSet is empty.
|
dLife Home Page | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||