Documentation of 'org.neuroph.core.Layer' Java class
Layer
org.neuroph.core

Class Layer

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Iterable<Neuron>
    Direct Known Subclasses:
    CompetitiveLayer, FeatureMapLayer, FeatureMapsLayer, InputLayer


    public class Layer
    extends java.lang.Object
    implements java.lang.Iterable<Neuron>, java.io.Serializable
     Layer of neurons in a neural network. The Layer is basic neuron container (a collection of neurons),
     and it provides methods for manipulating neurons (add, remove, get, set, calculate, ...).
     
    See Also:
    Neuron, Serialized Form
    • Constructor Summary

      Constructors 
      Constructor and Description
      Layer()
      Creates an instance of empty Layer
      Layer(int neuronsCount)
      Creates an instance of empty Layer for specified number of neurons
      Layer(int neuronsCount, NeuronProperties neuronProperties)
      Creates an instance of Layer with the specified number of neurons with specified neuron properties
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void addNeuron(int index, Neuron neuron)
      Adds specified neuron to this layer,at specified index position Throws IllegalArgumentException if neuron is null, or index is illegal value (index<0 or index>neuronsCount)
      void addNeuron(Neuron neuron)
      Adds specified neuron to this layer
      void calculate()
      Performs calculaton for all neurons in this layer
      java.lang.String getLabel()
      Get layer label
      Neuron getNeuronAt(int index)
      Returns neuron at specified index position in this layer
      java.util.List<Neuron> getNeurons()
      Returns array neurons in this layer as array
      int getNeuronsCount()
      Returns number of neurons in this layer
      NeuralNetwork getParentNetwork()
      Returns reference to parent network
      int indexOf(Neuron neuron)
      Returns the index position in layer for the specified neuron
      void initializeWeights(double value)
      Initialize connection weights for the whole layer to to specified value
      boolean isEmpty() 
      java.util.Iterator<Neuron> iterator() 
      void removeAllNeurons() 
      void removeNeuron(Neuron neuron)
      Removes neuron from layer
      void removeNeuronAt(int index)
      Removes neuron at specified index position in this layer
      void reset()
      Resets the activation and input levels for all neurons in this layer
      void setLabel(java.lang.String label)
      Set layer label
      void setNeuron(int index, Neuron neuron)
      Sets (replace) the neuron at specified position in layer
      void setParentNetwork(NeuralNetwork parent)
      Sets reference on parent network
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Constructor Detail

      • Layer

        public Layer()
        Creates an instance of empty Layer
      • Layer

        public Layer(int neuronsCount)
        Creates an instance of empty Layer for specified number of neurons
        Parameters:
        neuronsCount - number of neurons in this layer
      • Layer

        public Layer(int neuronsCount,
                     NeuronProperties neuronProperties)
        Creates an instance of Layer with the specified number of neurons with specified neuron properties
        Parameters:
        neuronsCount - number of neurons in layer
        neuronProperties - properties of neurons in layer
    • Method Detail

      • setParentNetwork

        public final void setParentNetwork(NeuralNetwork parent)
        Sets reference on parent network
        Parameters:
        parent - parent network
      • getParentNetwork

        public final NeuralNetwork getParentNetwork()
        Returns reference to parent network
        Returns:
        reference on parent neural network
      • getNeurons

        public final java.util.List<Neuron> getNeurons()
        Returns array neurons in this layer as array
        Returns:
        array of neurons in this layer
      • addNeuron

        public final void addNeuron(Neuron neuron)
        Adds specified neuron to this layer
        Parameters:
        neuron - neuron to add
      • addNeuron

        public final void addNeuron(int index,
                                    Neuron neuron)
        Adds specified neuron to this layer,at specified index position Throws IllegalArgumentException if neuron is null, or index is illegal value (index<0 or index>neuronsCount)
        Parameters:
        neuron - neuron to add
        index - index position at which neuron should be added
      • setNeuron

        public final void setNeuron(int index,
                                    Neuron neuron)
        Sets (replace) the neuron at specified position in layer
        Parameters:
        index - index position to set/replace
        neuron - new Neuron object to set
      • removeNeuron

        public final void removeNeuron(Neuron neuron)
        Removes neuron from layer
        Parameters:
        neuron - neuron to remove
      • removeNeuronAt

        public final void removeNeuronAt(int index)
        Removes neuron at specified index position in this layer
        Parameters:
        index - index position of neuron to remove
      • removeAllNeurons

        public final void removeAllNeurons()
      • getNeuronAt

        public Neuron getNeuronAt(int index)
        Returns neuron at specified index position in this layer
        Parameters:
        index - neuron index position
        Returns:
        neuron at specified index position
      • indexOf

        public int indexOf(Neuron neuron)
        Returns the index position in layer for the specified neuron
        Parameters:
        neuron - neuron object
        Returns:
        index position of specified neuron
      • getNeuronsCount

        public int getNeuronsCount()
        Returns number of neurons in this layer
        Returns:
        number of neurons in this layer
      • calculate

        public void calculate()
        Performs calculaton for all neurons in this layer
      • reset

        public void reset()
        Resets the activation and input levels for all neurons in this layer
      • initializeWeights

        public void initializeWeights(double value)
        Initialize connection weights for the whole layer to to specified value
        Parameters:
        value - the weight value
      • getLabel

        public java.lang.String getLabel()
        Get layer label
        Returns:
        layer label
      • setLabel

        public void setLabel(java.lang.String label)
        Set layer label
        Parameters:
        label - layer label to set
      • isEmpty

        public boolean isEmpty()
      • iterator

        public java.util.Iterator<Neuron> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<Neuron>

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.