|
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.
| Field Summary | |
|---|---|
static java.lang.String |
TAG_INPUT
Tag used for the input layer. |
static java.lang.String |
TAG_OUTPUT
Tag used for the output layer. |
| Constructor Summary | |
|---|---|
BasicNetwork()
Construct an empty neural network. |
|
BasicNetwork(NeuralLogic logic)
Construct a basic network using the specified logic. |
|
| 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 |
clearContext()
Clear any data from any context layers. |
void |
clearLayerTags()
Remove all layer tags. |
java.lang.Object |
clone()
Return a clone of this neural network. |
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. |
static int |
determineWinner(NeuralData output)
Determine which member of the output is the winning neuron. |
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()
|
Layer |
getLayer(java.lang.String tag)
Get the layer specified by the tag. |
java.util.Map<java.lang.String,Layer> |
getLayerTags()
|
NeuralLogic |
getLogic()
|
java.lang.String |
getName()
|
java.util.Map<java.lang.String,java.lang.String> |
getProperties()
|
double |
getPropertyDouble(java.lang.String name)
Get the specified property as a double. |
long |
getPropertyLong(java.lang.String name)
Get the specified property as a long. |
java.lang.String |
getPropertyString(java.lang.String name)
Get the specified property as a string. |
NeuralStructure |
getStructure()
|
java.util.Collection<java.lang.String> |
getTags(Layer layer)
Get a list of all of the tags on a specific layer. |
int |
getWeightMatrixSize()
|
int |
hashCode()
Generate a hash code. |
void |
reset()
Reset the weight matrix and the thresholds. |
void |
setDescription(java.lang.String theDescription)
Set the description for this object. |
void |
setLogic(NeuralLogic logic)
Set the type of logic this network should use. |
void |
setName(java.lang.String name)
Set the name of this object. |
void |
setProperty(java.lang.String name,
double d)
Set a property as a double. |
void |
setProperty(java.lang.String name,
long l)
Set a property as a long. |
void |
setProperty(java.lang.String name,
java.lang.String value)
Set a property as a double. |
void |
tagLayer(java.lang.String tag,
Layer layer)
Tag a layer. |
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 |
| Field Detail |
|---|
public static final java.lang.String TAG_INPUT
public static final java.lang.String TAG_OUTPUT
| Constructor Detail |
|---|
public BasicNetwork()
public BasicNetwork(NeuralLogic logic)
logic - The logic to use with the neural network.| Method Detail |
|---|
public static int determineWinner(NeuralData output)
output - The output from the neural network.
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 clearContext()
clearContext in interface ContextClearablepublic void clearLayerTags()
public java.lang.Object clone()
clone in interface Networkclone in class java.lang.Objectpublic 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 Layer getLayer(java.lang.String tag)
tag - The tag.
public java.util.Map<java.lang.String,Layer> getLayerTags()
public NeuralLogic getLogic()
public java.lang.String getName()
getName in interface NetworkgetName in interface EncogPersistedObjectpublic java.util.Map<java.lang.String,java.lang.String> getProperties()
public double getPropertyDouble(java.lang.String name)
name - The name of the property.
public long getPropertyLong(java.lang.String name)
name - The name of the specified property.
public java.lang.String getPropertyString(java.lang.String name)
name - The name of the property.
public NeuralStructure getStructure()
getStructure in interface Networkpublic java.util.Collection<java.lang.String> getTags(Layer layer)
layer - The layer to check.
public int getWeightMatrixSize()
getWeightMatrixSize in interface Networkpublic int hashCode()
hashCode in interface NetworkhashCode in class java.lang.Objectpublic void reset()
reset in interface Networkpublic void setDescription(java.lang.String theDescription)
setDescription in interface NetworksetDescription in interface EncogPersistedObjecttheDescription - The description.public void setLogic(NeuralLogic logic)
logic - The logic used by the network.public void setName(java.lang.String name)
EncogPersistedObject
setName in interface NetworksetName in interface EncogPersistedObjectname - the name to set
public void setProperty(java.lang.String name,
double d)
name - The name of the property.d - The value of the property.
public void setProperty(java.lang.String name,
long l)
name - The name of the property.l - The value of the property.
public void setProperty(java.lang.String name,
java.lang.String value)
name - The name of the property.value - The value of the property.
public void tagLayer(java.lang.String tag,
Layer layer)
tag - The tag name.layer - THe layer to tag.public 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 | ||||||||