|
The Encog Project | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.encog.neural.networks.BasicNetwork
public class BasicNetwork
This class implements a neural network. This class works in conjunction the Layer classes. Layers are added to the BasicNetwork to specify the structure of the neural network. The first layer added is the input layer, the final layer added is the output layer. Any layers added between these two layers are the hidden layers. The network structure is stored in the structure member. It is important to call: network.getStructure().finalizeStructure(); Once the neural network has been completely constructed.
| Constructor Summary | |
|---|---|
BasicNetwork()
Construct an empty neural network. |
|
| Method Summary | |
|---|---|
void |
addLayer(Layer layer)
Add a layer to the neural network. |
void |
addLayer(Layer layer,
SynapseType type)
Add a layer to the neural network. |
double |
calculateError(NeuralDataSet data)
Calculate the error for this neural network. |
int |
calculateNeuronCount()
Calculate the total number of neurons in the network across all layers. |
void |
checkInputSize(NeuralData input)
Check that the input size is acceptable, if it does not match the input layer, then throw an error. |
java.lang.Object |
clone()
Return a clone of this neural network. |
boolean |
compareLayer(Layer layerThis,
Layer layerOther,
int precision)
Used to compare one neural network to another, compare two layers. |
NeuralData |
compute(NeuralData input)
Compute the output for a given input to the neural network. |
NeuralData |
compute(NeuralData input,
NeuralOutputHolder useHolder)
Compute the output for a given input to the neural network. |
Persistor |
createPersistor()
Create a persistor for this object. |
boolean |
equals(BasicNetwork other)
Compare the two neural networks. |
boolean |
equals(BasicNetwork other,
int precision)
Determine if this neural network is equal to another. |
java.lang.String |
getDescription()
|
int |
getHiddenLayerCount()
Get the count for how many hidden layers are present. |
java.util.Collection<Layer> |
getHiddenLayers()
Get a collection of the hidden layers in the network. |
Layer |
getInputLayer()
Get the input layer. |
java.lang.String |
getName()
|
Layer |
getOutputLayer()
Get the output layer. |
NeuralStructure |
getStructure()
|
int |
getWeightMatrixSize()
|
int |
hashCode()
Generate a hash code. |
void |
inferOutputLayer()
Called to cause the network to attempt to infer which layer should be the output layer. |
boolean |
isHidden(Layer layer)
Determine if this layer is hidden. |
boolean |
isInput(Layer layer)
Determine if this layer is the input layer. |
boolean |
isOutput(Layer layer)
Determine if this layer is the output layer. |
void |
reset()
Reset the weight matrix and the thresholds. |
void |
setDescription(java.lang.String theDescription)
Set the description for this object. |
void |
setInputLayer(Layer input)
Define the input layer for the network. |
void |
setName(java.lang.String name)
Set the name of this object. |
void |
setOutputLayer(Layer outputLayer)
|
java.lang.String |
toString()
|
int |
winner(NeuralData input)
Determine the winner for the specified input. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public BasicNetwork()
| Method Detail |
|---|
public void addLayer(Layer layer)
addLayer in interface Networklayer - The layer to be added.
public void addLayer(Layer layer,
SynapseType type)
addLayer in interface Networklayer - The layer to be added to the network.type - What sort of synapse should connect this layer to the last.public double calculateError(NeuralDataSet data)
calculateError in interface Networkdata - The training set.
public int calculateNeuronCount()
calculateNeuronCount in interface Networkpublic void checkInputSize(NeuralData input)
checkInputSize in interface Networkinput - The input data.public java.lang.Object clone()
clone in interface Networkclone in interface EncogPersistedObjectclone in class java.lang.Object
public boolean compareLayer(Layer layerThis,
Layer layerOther,
int precision)
compareLayer in interface NetworklayerThis - The layer being compared.layerOther - The other layer.precision - The precision to use, how many decimal places.
public NeuralData compute(NeuralData input)
compute in interface Networkinput - The input to the neural network.
public NeuralData compute(NeuralData input,
NeuralOutputHolder useHolder)
compute in interface Networkinput - The input provide to the neural network.useHolder - Allows a holder to be specified, this allows
propagation training to check the output of each layer.
public Persistor createPersistor()
createPersistor in interface NetworkcreatePersistor in interface EncogPersistedObjectpublic boolean equals(BasicNetwork other)
equals in interface Networkother - The other neural network.
public boolean equals(BasicNetwork other,
int precision)
equals in interface Networkother - The other neural network.precision - The number of decimal places to compare to.
public java.lang.String getDescription()
getDescription in interface NetworkgetDescription in interface EncogPersistedObjectpublic int getHiddenLayerCount()
getHiddenLayerCount in interface Networkpublic java.util.Collection<Layer> getHiddenLayers()
getHiddenLayers in interface Networkpublic Layer getInputLayer()
getInputLayer in interface Networkpublic java.lang.String getName()
getName in interface NetworkgetName in interface EncogPersistedObjectpublic Layer getOutputLayer()
getOutputLayer in interface Networkpublic NeuralStructure getStructure()
getStructure in interface Networkpublic int getWeightMatrixSize()
getWeightMatrixSize in interface Networkpublic int hashCode()
hashCode in interface NetworkhashCode in class java.lang.Objectpublic void inferOutputLayer()
inferOutputLayer in interface Networkpublic boolean isHidden(Layer layer)
isHidden in interface Networklayer - The layer to evaluate.
public boolean isInput(Layer layer)
isInput in interface Networklayer - The layer to evaluate.
public boolean isOutput(Layer layer)
isOutput in interface Networklayer - The layer to evaluate.
public void reset()
reset in interface Networkpublic void setDescription(java.lang.String theDescription)
setDescription in interface NetworksetDescription in interface EncogPersistedObjecttheDescription - The description.public void setInputLayer(Layer input)
setInputLayer in interface Networkinput - The new input layer.public void setName(java.lang.String name)
EncogPersistedObject
setName in interface NetworksetName in interface EncogPersistedObjectname - the name to setpublic void setOutputLayer(Layer outputLayer)
setOutputLayer in interface NetworkoutputLayer - the outputLayer to setpublic java.lang.String toString()
toString in interface NetworktoString in class java.lang.Objectpublic int winner(NeuralData input)
winner in interface Networkinput - The input patter to present to the neural network.
|
The Encog Project | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||