Class RecurrentNetwork

java.lang.Object
net.bmahe.genetics4j.neat.RecurrentNetwork

public class RecurrentNetwork extends Object
Implements a recurrent neural network evaluator for NEAT chromosomes.

Unlike FeedForwardNetwork, this implementation can execute arbitrary directed graphs that include recurrent (cyclic) connections. Activations are propagated iteratively until they converge or a maximum number of iterations is reached, making it suitable for tasks that rely on short-term memory or feedback loops.

  • Field Details

    • logger

      public static final org.apache.logging.log4j.Logger logger
    • DEFAULT_MAX_ITERATIONS

      public static final int DEFAULT_MAX_ITERATIONS
      Default maximum number of recurrent iterations.
      See Also:
    • DEFAULT_CONVERGENCE_THRESHOLD

      public static final float DEFAULT_CONVERGENCE_THRESHOLD
      Default convergence threshold applied to node deltas between iterations.
      See Also:
    • DEFAULT_INITIAL_STATE_VALUE

      public static final float DEFAULT_INITIAL_STATE_VALUE
      Default value assigned to non-input nodes before the first iteration.
      See Also:
    • inputNodeIndices

      private final Set<Integer> inputNodeIndices
    • outputNodeIndices

      private final Set<Integer> outputNodeIndices
    • connections

      private final List<Connection> connections
    • backwardConnections

      private final Map<Integer,Set<Connection>> backwardConnections
    • evaluatedNodeIndices

      private final List<Integer> evaluatedNodeIndices
    • allNodeIndices

      private final Set<Integer> allNodeIndices
    • activationFunction

      private final Function<Float,Float> activationFunction
    • maxIterations

      private final int maxIterations
    • convergenceThreshold

      private final float convergenceThreshold
    • initialStateValue

      private final float initialStateValue
    • nodeState

      private final Map<Integer,Float> nodeState
  • Constructor Details

  • Method Details