|
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
dlife.nn.FFNeuralNetwork
public class FFNeuralNetwork
Implementation of a fully connected multi-layer feed forward neural network. The input layer of the network consists of a layer of "identity neurons" where the outputs are identical to the inputs. Further, there are no weights between an input and its associated "identity neuron." There is a layer of weights between every pair of Neuron layers. Each neuron in a hidden or output layer contains a bias weight with input 1. The output of the network is the output of the neurons in the final layer (after possible filtering by an NNDataFilter).
| Field Summary | |
|---|---|
protected double[][][] |
ffweights
|
protected double[][] |
layerInputs
|
protected double[][] |
layerOutputs
|
protected Neuron |
nType
|
| Fields inherited from class dlife.nn.NeuralNetwork |
|---|
filteredInputs, filteredOutputs, rawInputs, rawOutputs |
| Constructor Summary | |
|---|---|
FFNeuralNetwork(double[][][] ffweights,
Neuron nType)
Construct a new FFNeuralNetwork by providing the weight matrix for the network. |
|
FFNeuralNetwork(int[] layers,
double[] weights,
Neuron nType)
Construct a new FFNeuralNetwork using the provided 1d array of weights. |
|
FFNeuralNetwork(int[] layers,
Neuron nType)
Construct a new FFNeuralNetwork with the specified number of neurons in the layers and using the specified type of Neuron. |
|
| Method Summary | |
|---|---|
boolean[][] |
getConnections()
This method throws an UnsupportedOperationException because the FFNeuralNetwork does not use the connections matrix in the underlying NeuralNetwork class. |
double[][][] |
getFFWeights()
Return the internal weights matrix. |
double[] |
getFFWeights1d()
Get a 1d representation of the weights in this FFNeuralNetwork. |
double[][] |
getLayerInputs()
Get the inputs to the input, each hidden and output layers of neurons for this FFNeuralNetwork. |
double[][] |
getLayerOutputs()
Get the outputs of the input, each hidden and output layers of neurons for this FFNeuralNetwork. |
double[][] |
getWeights()
This method throws an UnsupportedOperationException because the FFNeuralNetwork does not rely on the weights in the underlying NeuralNetwork class. |
protected void |
makeLayerInputs()
|
protected void |
makeLayerOutputs()
|
int |
numInputs()
Get the number of inputs that there are in this FFNeuralNetowrk. |
int |
numOutputs()
Get the number of outputs that there are in this FFNeuralNetwork. |
void |
propagate()
Propagate the current filtered input values through the network. |
void |
randomizeWeights()
Randomize the weights in this neural network. |
static Object |
read(String filename)
Read and return the FFNeuralNetwork contained in the specified filename using Java's object serialization mechanism. |
void |
setInputs(double[] inputs)
Set the inputs to this FFNeuralNetwork. |
| Methods inherited from class dlife.nn.NeuralNetwork |
|---|
evaluate, evaluate, getFilteredInputs, getFilteredOutputs, getInputFilter, getInputFilter, getOutputFilter, getOutputFilter, getRawInputs, getRawOutputs, setInputFilter, setInputFilter, setOutputFilter, setOutputFilter, setOutputs |
| Methods inherited from class dlife.sys.SerializationBase |
|---|
write |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Neuron nType
protected double[][][] ffweights
protected transient double[][] layerInputs
protected transient double[][] layerOutputs
| Constructor Detail |
|---|
public FFNeuralNetwork(int[] layers,
Neuron nType)
layers - an array of ints specifying the number of neurons in each
layer of the network.nType - the type of neuron in the network.
public FFNeuralNetwork(double[][][] ffweights,
Neuron nType)
throws IllegalArgumentException
ffweights - the weights matrix.nType - the type of Neuron to use for this network.
IllegalArgumentException - if the ffweights do not specify a fully connected network.
public FFNeuralNetwork(int[] layers,
double[] weights,
Neuron nType)
layers - an array of ints specifying the number of neurons in each
layer of the network.weights - the weights for this network.nType - the type of Neuron to use for this network.
illegalArgumentException - if weights does not contain the correct number of weights.| Method Detail |
|---|
protected void makeLayerInputs()
protected void makeLayerOutputs()
public void randomizeWeights()
public double[][][] getFFWeights()
public double[] getFFWeights1d()
public int numInputs()
public int numOutputs()
public boolean[][] getConnections()
UnsupportedOperationException.public double[][] getWeights()
UnsupportedOperationException.
public void setInputs(double[] inputs)
throws IllegalArgumentException
setInputs in class NeuralNetworkinputs - the inputs to the network.
IllegalArgumentException - if the number of inputs does not match the size of the input
layer.
public void propagate()
throws IllegalStateException
propagate in class NeuralNetworkIllegalStateException - if this method is called before the inputs have been set by a
call to setInputs.public double[][] getLayerInputs()
public double[][] getLayerOutputs()
public static Object read(String filename)
throws SerializationError
filename - the full path of the file from which to read the object.
SerializationError - if there is a problem reading the object.
|
dLife Home Page | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||