FreeformNetwork
org.encog.neural.freeform

Class FreeformNetwork

    • Constructor Detail

      • FreeformNetwork

        public FreeformNetwork()
        Default constructor. Typically should not be directly used.
      • FreeformNetwork

        public FreeformNetwork(BasicNetwork network)
        Craete a freeform network from a basic network.
        Parameters:
        network - The basic network to use.
    • Method Detail

      • createElman

        public static FreeformNetwork createElman(int input,                          int hidden1,                          int output,                          ActivationFunction af)
        Construct an Elmann recurrent neural network.
        Parameters:
        input - The input count.
        hidden1 - The hidden count.
        output - The output count.
        af - The activation function.
        Returns:
        The newly created network.
      • createFeedforward

        public static FreeformNetwork createFeedforward(int input,                                int hidden1,                                int hidden2,                                int output,                                ActivationFunction af)
        Create a feedforward freeform neural network.
        Parameters:
        input - The input count.
        hidden1 - The first hidden layer count, zero if none.
        hidden2 - The second hidden layer count, zero if none.
        output - The output count.
        af - The activation function.
        Returns:
        The newly crated network.
      • calculateError

        public double calculateError(MLDataSet data)
        Calculate the error of the ML method, given a dataset.
        Specified by:
        calculateError in interface MLError
        Parameters:
        data - The dataset.
        Returns:
        The error.
      • classify

        public int classify(MLData input)
        Classify the input into a group.
        Specified by:
        classify in interface MLClassification
        Parameters:
        input - The input data to classify.
        Returns:
        The group that the data was classified into.
      • clearContext

        public void clearContext()
        Clear the context.
        Specified by:
        clearContext in interface MLContext
      • clone

        public Object clone()
        Return a clone of this neural network. Including structure, weights and bias values. This is a deep copy.
        Overrides:
        clone in class Object
        Returns:
        A cloned copy of the neural network.
      • compute

        public MLData compute(MLData input)
        Compute regression.
        Specified by:
        compute in interface MLRegression
        Parameters:
        input - The input data.
        Returns:
        The output data.
      • connectLayers

        public void connectLayers(FreeformLayer source,                 FreeformLayer target)
        Connect two layers. These layers will be connected with a TANH activation function in a non-recurrent way. A bias activation of 1.0 will be used, if needed.
        Parameters:
        source - The source layer.
        target - The target layer.
      • connectLayers

        public void connectLayers(FreeformLayer source,                 FreeformLayer target,                 ActivationFunction theActivationFunction,                 double biasActivation,                 boolean isRecurrent)
        Connect two layers.
        Parameters:
        source - The source layer.
        target - The target layer.
        theActivationFunction - The activation function to use.
        biasActivation - The bias activation to use.
        isRecurrent - True, if this is a recurrent connection.
      • ConnectLayers

        public void ConnectLayers(FreeformLayer source,                 FreeformLayer target,                 ActivationFunction theActivationFunction)
        Connect two layers, assume bias activation of 1.0 and non-recurrent connection.
        Parameters:
        source - The source layer.
        target - The target layer.
        theActivationFunction - The activation function.
      • createContext

        public FreeformLayer createContext(FreeformLayer source,                          FreeformLayer target)
        Create a context connection, such as those used by Jordan/Elmann.
        Parameters:
        source - The source layer.
        target - The target layer.
        Returns:
        The newly created context layer.
      • createInputLayer

        public FreeformLayer createInputLayer(int neuronCount)
        Create the input layer.
        Parameters:
        neuronCount - The input neuron count.
        Returns:
        The newly created layer.
      • createLayer

        public FreeformLayer createLayer(int neuronCount)
        Create a hidden layer.
        Parameters:
        neuronCount - The neuron count.
        Returns:
        The newly created layer.
      • createOutputLayer

        public FreeformLayer createOutputLayer(int neuronCount)
        Create the output layer.
        Parameters:
        neuronCount - The neuron count.
        Returns:
        The newly created output layer.
      • decodeFromArray

        public void decodeFromArray(double[] encoded)
        Decode an array to this object.
        Specified by:
        decodeFromArray in interface MLEncodable
        Parameters:
        encoded - The encoded array.
      • encodedArrayLength

        public int encodedArrayLength()
        Specified by:
        encodedArrayLength in interface MLEncodable
        Returns:
        The length of an encoded array.
      • encodeToArray

        public void encodeToArray(double[] encoded)
        Encode the object to the specified array.
        Specified by:
        encodeToArray in interface MLEncodable
        Parameters:
        encoded - The array.
      • getInputCount

        public int getInputCount()
        Specified by:
        getInputCount in interface MLInput
        Returns:
        The input.
      • getOutputCount

        public int getOutputCount()
        Specified by:
        getOutputCount in interface MLOutput
        Returns:
        The output count.
      • getOutputLayer

        public FreeformLayer getOutputLayer()
        Returns:
        The output layer.
      • performConnectionTask

        public void performConnectionTask(ConnectionTask task)
        Perform the specified connection task. This task will be performed over all connections.
        Parameters:
        task - The connection task.
      • performNeuronTask

        public void performNeuronTask(NeuronTask task)
        Perform the specified neuron task. This task will be executed over all neurons.
        Parameters:
        task -
      • reset

        public void reset()
        Reset the weights.
        Specified by:
        reset in interface MLResettable
      • reset

        public void reset(int seed)
        Reset the weights with a seed.
        Specified by:
        reset in interface MLResettable
        Parameters:
        seed - The seed value.
      • tempTrainingAllocate

        public void tempTrainingAllocate(int neuronSize,                        int connectionSize)
        Allocate temp training space.
        Parameters:
        neuronSize - The number of elements to allocate on each neuron.
        connectionSize - The number of elements to allocate on each connection.
      • tempTrainingClear

        public void tempTrainingClear()
        Clear the temp training data.
      • updateContext

        public void updateContext()
        Update context.

SCaVis 1.7 © jWork.org