Class Neuron

  • All Implemented Interfaces:
    Comparable<Provider<?>>

    public class Neuron
    extends Provider<INeuron>
    The Neuron class is a proxy implementation for the real neuron implementation in the class INeuron. Aika uses the provider pattern to store and reload rarely used neurons or logic nodes.
    Author:
    Lukas Molzberger
    • Field Detail

      • MIN_NEURON

        public static final Neuron MIN_NEURON
      • MAX_NEURON

        public static final Neuron MAX_NEURON
    • Constructor Detail

      • Neuron

        public Neuron​(Model m,
                      int id)
    • Method Detail

      • getLabel

        public String getLabel()
      • addInput

        public Activation addInput​(Document doc,
                                   int begin,
                                   int end)
        Propagate an input activation into the network.
        Parameters:
        doc - The current document
        begin - The range begin
        end - The range end
      • addInput

        public Activation addInput​(Document doc,
                                   Activation.Builder inputAct)
        Propagate an input activation into the network.
        Parameters:
        doc - The current document
        inputAct -
      • init

        public static Neuron init​(Neuron n,
                                  double bias,
                                  Neuron.Builder... inputs)
        Creates a neuron with the given bias.
        Parameters:
        n -
        bias -
        inputs -
        Returns:
      • init

        public static Neuron init​(Document doc,
                                  Neuron n,
                                  double bias,
                                  Neuron.Builder... inputs)
        Creates a neuron with the given bias.
        Parameters:
        n -
        bias -
        inputs -
        Returns:
      • setOutputText

        public void setOutputText​(String outputText)
      • getSynapseById

        public Synapse getSynapseById​(int synapseId)
      • getActivations

        public Stream<Activation> getActivations​(Document doc,
                                                 boolean onlyFinal)
        getFinalActivations is a convenience method to retrieve all activations of the given neuron that are part of the final interpretation. Before calling this method, the doc.process() needs to be called first. getFinalActivations requires that the doc.process() method has been called first.
        Parameters:
        doc - The current document
        Returns:
        A collection with all final activations of this neuron.
      • getActivation

        public Activation getActivation​(Document doc,
                                        int begin,
                                        int end,
                                        boolean onlyFinal)
      • getNewSynapseId

        public int getNewSynapseId()
      • registerSynapseId

        public void registerSynapseId​(int synId)
      • getActiveInputSynapses

        public Collection<Synapse> getActiveInputSynapses()
        Active input synapses are those synapses that are currently available in the main memory.
        Returns: