Class RBF

  • All Implemented Interfaces:
    java.io.Serializable

    public class RBF
    extends Adaline
    Radial Basis Function or RBF. Is an hybrid neural network with 3 layers (1-input, 1-hidden, 1-output). The hidden layers is trained using a stochastic clustering algorithm: k-means. The final layer is trained using the Adaline rule. The k-means algorithm is used to set up the position of the "centers" of the radial basis functions, as this process is regardless of the output and invariant over the input, could be used a highly efficient algorithm. This implementation uses only Gaussian functions as radial basis functions.
    See Also:
    Serialized Form
    • Field Detail

      • nperlayer

        protected final int[] nperlayer
      • sigma

        protected final double[] sigma
    • Constructor Detail

      • RBF

        public RBF​(int[] nperlayer)
        Constructor. Receives an array with the information of the number of neurons per layer. Layer[0] is the input layer. Layer[1] is the hidden layer and represents the number radial functions to use. layer[2] is the output layer.
        Parameters:
        nperlayer - Neurons Per Layer.
      • RBF

        public RBF​(int[] nperlayer,
                   java.util.Random rand)
        Constructor. Receives an array with the information of the number of neurons per layer. Layer[0] is the input layer. Layer[1] is the hidden layer and represents the number radial functions to use. layer[2] is the output layer.
        Parameters:
        nperlayer - Neurons Per Layer.
        rand - Random generator used for creating matrices
    • Method Detail

      • train

        public void train​(Column[] patterns,
                          Column[] answers,
                          double alpha,
                          int epochs,
                          int offset,
                          int length,
                          double minerror)
        Train the network using a hybrid scheme. First set the centers of the radial basis functions using k-means algorithm. After that the radius of the function is calculated using n-nearest neighbors. When n = the number of inputs. Then the output for the hidden layer are precalculated and used as input for the Adaline training.
        Overrides:
        train in class Adaline
        Parameters:
        patterns - The patterns to be learned.
        answers - The expected answers.
        alpha - The learning rate.
        epochs - The maximum number of iterations
        offset - The first pattern position
        length - How many patterns will be used.
        minerror - The minimal error expected.
      • simulate

        public Column simulate​(Column pattern)
        Description copied from class: NeuralNetwork
        Calculates the output for the pattern.
        Overrides:
        simulate in class Perceptron
        Parameters:
        pattern - Pattern to use as input.
        Returns:
        The output for the neural network.
      • simulate

        public void simulate​(Column pattern,
                             Column result)
        Description copied from class: Adaline
        Calculate the output for the pattern and left the result on result. result = W * pattern + b
        Overrides:
        simulate in class Adaline
        Parameters:
        pattern - The input pattern
        result - The output result.