Package libai.nn.supervised
Class RBF
- java.lang.Object
-
- 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
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Column
simulate(Column pattern)
Calculates the output for thepattern
.void
simulate(Column pattern, Column result)
Calculate the output for the pattern and left the result on result.void
train(Column[] patterns, Column[] answers, double alpha, int epochs, int offset, int length, double minerror)
Train the network using a hybrid scheme.-
Methods inherited from class libai.nn.NeuralNetwork
error, error, euclideanDistance2, euclideanDistance2, gaussian, getDefaultRandomGenerator, getPlotter, getProgressBar, initializeProgressBar, open, open, open, save, setPlotter, setProgressBar, train, train
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from class libai.nn.supervised.Perceptron
getWeights
-
Methods inherited from class libai.nn.supervised.SupervisedLearning
validatePreconditions
-
-
-
-
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 classAdaline
- Parameters:
patterns
- The patterns to be learned.answers
- The expected answers.alpha
- The learning rate.epochs
- The maximum number of iterationsoffset
- The first pattern positionlength
- 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 thepattern
.- Overrides:
simulate
in classPerceptron
- Parameters:
pattern
- Pattern to use as input.- Returns:
- The output for the neural network.
-
-