|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.mahout.classifier.mlp.NeuralNetwork
org.apache.mahout.classifier.mlp.MultilayerPerceptron
public class MultilayerPerceptron
A Multilayer Perceptron (MLP) is a kind of feed-forward artificial neural network, which is a mathematical model inspired by the biological neural network. The Multilayer Perceptron can be used for various machine learning tasks such as classification and regression. A detailed introduction about MLP can be found at http://ufldl.stanford.edu/wiki/index.php/Neural_Networks. For this particular implementation, the users can freely control the topology of the MLP, including: 1. The size of the input layer; 2. The number of hidden layers; 3. The size of each hidden layer; 4. The size of the output layer. 5. The cost function. 6. The squashing function. The model is trained in an online learning approach, where the weights of neurons in the MLP is updated incremented using backPropagation algorithm proposed by (Rumelhart, D. E., Hinton, G. E., and Williams, R. J. (1986) Learning representations by back-propagating errors. Nature, 323, 533--536.)
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.apache.mahout.classifier.mlp.NeuralNetwork |
---|
NeuralNetwork.TrainingMethod |
Field Summary |
---|
Fields inherited from class org.apache.mahout.classifier.mlp.NeuralNetwork |
---|
costFunctionName, finalLayerIdx, layerSizeList, learningRate, modelPath, modelType, momentumWeight, prevWeightUpdatesList, regularizationWeight, squashingFunctionList, trainingMethod, weightMatrixList |
Constructor Summary | |
---|---|
MultilayerPerceptron()
The default constructor. |
|
MultilayerPerceptron(String modelPath)
Initialize the MLP by specifying the location of the model. |
Method Summary | |
---|---|
void |
close()
Prepares the classifier for classification and deallocates any temporary data structures. |
void |
train(int actual,
Vector instance)
Updates the model using a particular target variable value and a feature vector. |
void |
train(long trackingKey,
int actual,
Vector instance)
Updates the model using a particular target variable value and a feature vector. |
void |
train(long trackingKey,
String groupKey,
int actual,
Vector instance)
Updates the model using a particular target variable value and a feature vector. |
Methods inherited from class org.apache.mahout.classifier.mlp.NeuralNetwork |
---|
addLayer, forward, getLayerSize, getLayerSizeList, getLearningRate, getModelPath, getModelType, getMomentumWeight, getOutput, getOutputInternal, getRegularizationWeight, getTrainingMethod, getWeightMatrices, getWeightsByLayer, readFields, readFromModel, setCostFunction, setLearningRate, setModelPath, setMomentumWeight, setRegularizationWeight, setTrainingMethod, setWeightMatrices, setWeightMatrix, trainByInstance, trainOnline, updateWeightMatrices, write, writeModelToFile |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MultilayerPerceptron()
public MultilayerPerceptron(String modelPath)
modelPath
- The path of the model.Method Detail |
---|
public void train(int actual, Vector instance)
OnlineLearner
train
in interface OnlineLearner
actual
- The value of the target variable. This value should be in the half-open
interval [0..n) where n is the number of target categories.instance
- The feature vector for this example.public void train(long trackingKey, String groupKey, int actual, Vector instance)
OnlineLearner
train
in interface OnlineLearner
trackingKey
- The tracking key for this training example.groupKey
- An optional value that allows examples to be grouped in the computation of
the update to the model.actual
- The value of the target variable. This value should be in the half-open
interval [0..n) where n is the number of target categories.instance
- The feature vector for this example.public void train(long trackingKey, int actual, Vector instance)
OnlineLearner
train
in interface OnlineLearner
trackingKey
- The tracking key for this training example.actual
- The value of the target variable. This value should be in the half-open
interval [0..n) where n is the number of target categories.instance
- The feature vector for this example.public void close()
OnlineLearner
close
in interface Closeable
close
in interface OnlineLearner
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |