public abstract class AbstractNeuralNet extends java.lang.Object implements INeuralNet
Implementation of a neural net
Modifier and Type | Field and Description |
---|---|
protected java.util.ArrayList<LinkedLayer> |
hiddenLayers
Hidden layer
|
protected InputLayer |
inputLayer
Input layer
|
protected LinkedLayer |
outputLayer
Ouput layer
|
protected static <any> |
XML
Marshal/Unmarshal input layer, hidden layers and output layer
|
Constructor and Description |
---|
AbstractNeuralNet()
Empty constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addHlayer(LinkedLayer layer)
Adds a new layer to the neural net
|
INeuralNet |
copy()
Returns a copy of this neural net
|
boolean |
equals(INeuralNet other)
Checks if this neural net is equal to another
|
LinkedLayer |
getHlayer(int index)
Returns a specific hidden layer of the neural net
|
InputLayer |
getInputLayer()
Returns the input layer of this neural net
|
int |
getNofhlayers()
Returns the number of hidden layers of the neural net
|
int |
getNofhneurons()
Returns the number of hidden neurons of this neural net
|
int |
getNoflinks()
Returns the number of effective links of this neural net
|
LinkedLayer |
getOutputLayer()
Returns the output layer of this neural net
|
int |
hashCode()
Returns an integer number that identifies the neural net
|
void |
keepRelevantLinks(double significativeWeight)
Keep relevant links, that is, those links whose weight is higher
than certain number
|
boolean |
linksEmpty()
Checks if this neural net is empty of links
|
boolean |
linksFull()
Checks if this neural net is full of links
|
boolean |
neuronsEmpty()
Checks if this neural net is empty of neurons
|
boolean |
neuronsFull()
Checks if this neural net is full of neurons
|
void |
setInputLayer(InputLayer inputLayer)
Sets the input layer of this neural net
|
void |
setOutputLayer(LinkedLayer outputLayer)
Sets the output layer of this neural net
|
java.lang.String |
toString()
Returns a string representation of the neural net
|
protected static final <any> XML
Marshal/Unmarshal input layer, hidden layers and output layer
protected InputLayer inputLayer
protected java.util.ArrayList<LinkedLayer> hiddenLayers
protected LinkedLayer outputLayer
public int getNofhlayers()
Returns the number of hidden layers of the neural net
getNofhlayers
in interface INeuralNet
public InputLayer getInputLayer()
Returns the input layer of this neural net
getInputLayer
in interface INeuralNet
public void setInputLayer(InputLayer inputLayer)
Sets the input layer of this neural net
setInputLayer
in interface INeuralNet
inputLayer
- New input layer of the netpublic void addHlayer(LinkedLayer layer)
Adds a new layer to the neural net
addHlayer
in interface INeuralNet
layer
- New layerpublic LinkedLayer getHlayer(int index)
Returns a specific hidden layer of the neural net
getHlayer
in interface INeuralNet
index
- Number of layer to returnpublic LinkedLayer getOutputLayer()
Returns the output layer of this neural net
getOutputLayer
in interface INeuralNet
public void setOutputLayer(LinkedLayer outputLayer)
Sets the output layer of this neural net
setOutputLayer
in interface INeuralNet
outputLayer
- New output layer of the netpublic boolean equals(INeuralNet other)
Checks if this neural net is equal to another
equals
in interface INeuralNet
other
- Other neural net to comparepublic int hashCode()
Returns an integer number that identifies the neural net
hashCode
in interface INeuralNet
hashCode
in class java.lang.Object
public boolean neuronsFull()
Checks if this neural net is full of neurons
neuronsFull
in interface INeuralNet
public boolean neuronsEmpty()
Checks if this neural net is empty of neurons
neuronsEmpty
in interface INeuralNet
public boolean linksFull()
Checks if this neural net is full of links
linksFull
in interface INeuralNet
public boolean linksEmpty()
Checks if this neural net is empty of links
linksEmpty
in interface INeuralNet
public int getNofhneurons()
Returns the number of hidden neurons of this neural net
getNofhneurons
in interface INeuralNet
public int getNoflinks()
Returns the number of effective links of this neural net
getNoflinks
in interface INeuralNet
public void keepRelevantLinks(double significativeWeight)
Keep relevant links, that is, those links whose weight is higher than certain number
keepRelevantLinks
in interface INeuralNet
significativeWeight
- Significative weightpublic java.lang.String toString()
Returns a string representation of the neural net
toString
in class java.lang.Object
public INeuralNet copy()
Returns a copy of this neural net
copy
in interface INeuralNet