org.joone.structure
Class Nakayama
- java.lang.Object
-
- org.joone.structure.Nakayama
-
- All Implemented Interfaces:
- java.io.Serializable, java.util.EventListener, ConvergenceListener, NeuralNetListener, NeuralValidationListener
public class Nakayama extends java.lang.Object implements NeuralNetListener, NeuralValidationListener, ConvergenceListener, java.io.Serializable
This class performs the method of optimizing activation functions as described in:K.Nakayama and Y.Kimura, "Optimization of activation functions in multilayer neural network applied to pattern classification", Proc. IEEE ICNN'94 Florida, pp.431-436, June 1994.
This techniques probably fails whenever the
NeuralNet.join()method is called because this optimization technique stops the network to perform the optimization, use aNeuralNetListenerinstead.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description Nakayama(NeuralNet aNet)Creates a new instance of Nakayama.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddLayer(Layer aLayer)Adds layers to this optimizer.voidaddLayers(NeuralNet aNeuralNet)Adds all the hidden layers to this optimizer.voidcicleTerminated(NeuralNetEvent e)voiderrorChanged(NeuralNetEvent e)doublegetEpsilon()Gets epsilon, the threshold to decide if a neuron should be deleted or not.voidnetConverged(ConvergenceEvent anEvent, ConvergenceObserver anObserver)This method is called whenever the network has converged according to someConvergenceObservervoidnetStarted(NeuralNetEvent e)voidnetStopped(NeuralNetEvent e)voidnetStoppedError(NeuralNetEvent e, java.lang.String error)voidnetValidated(NeuralValidationEvent event)booleanoptimize()Optimizes the activation functions of the neural network.voidsetEpsilon(double anEpsilon)Sets epsilon, the threshold to decide if a neuron should be deleted or not.
-
-
-
Constructor Detail
-
Nakayama
public Nakayama(NeuralNet aNet)
Creates a new instance of Nakayama.- Parameters:
aNet- the network to be optimized.
-
-
Method Detail
-
addLayer
public void addLayer(Layer aLayer)
Adds layers to this optimizer. The layers will be optimized. Layers should be on the same (layer) level, otherwise the optimization does not make sense.- Parameters:
aLayer- the layer to be added.
-
addLayers
public void addLayers(NeuralNet aNeuralNet)
Adds all the hidden layers to this optimizer. The layers will be optimized. The neuron network should consist of only one hidden layer, i.e. the hidden layers should be on the same level else this method doesn't make any sense. If the hidden layers are not all on the same level then the layers should be added individually my using , adding only the layers that are on the same hidden level.- Parameters:
aNeuralNet- the network holding the hidden layers.
-
optimize
public boolean optimize()
Optimizes the activation functions of the neural network.- Returns:
- whether the network was optimized or not, i.e. if neurons where deleted or not.
-
cicleTerminated
public void cicleTerminated(NeuralNetEvent e)
- Specified by:
cicleTerminatedin interfaceNeuralNetListener
-
errorChanged
public void errorChanged(NeuralNetEvent e)
- Specified by:
errorChangedin interfaceNeuralNetListener
-
netStarted
public void netStarted(NeuralNetEvent e)
- Specified by:
netStartedin interfaceNeuralNetListener
-
netStopped
public void netStopped(NeuralNetEvent e)
- Specified by:
netStoppedin interfaceNeuralNetListener
-
netStoppedError
public void netStoppedError(NeuralNetEvent e, java.lang.String error)
- Specified by:
netStoppedErrorin interfaceNeuralNetListener
-
netValidated
public void netValidated(NeuralValidationEvent event)
- Specified by:
netValidatedin interfaceNeuralValidationListener
-
getEpsilon
public double getEpsilon()
Gets epsilon, the threshold to decide if a neuron should be deleted or not.- Returns:
- the threshold epsilon.
-
setEpsilon
public void setEpsilon(double anEpsilon)
Sets epsilon, the threshold to decide if a neuron should be deleted or not.- Parameters:
anEpsilon- the new epsilon.
-
netConverged
public void netConverged(ConvergenceEvent anEvent, ConvergenceObserver anObserver)
Description copied from interface:ConvergenceListenerThis method is called whenever the network has converged according to someConvergenceObserver- Specified by:
netConvergedin interfaceConvergenceListener- Parameters:
anEvent- the event that is generated.anObserver- the observer that generated the event.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG