weka.classifiers.neural.singlelayerperceptron.Perceptron Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of wekaclassalgos Show documentation
Show all versions of wekaclassalgos Show documentation
Fork of the following defunct sourceforge.net project: https://sourceforge.net/projects/wekaclassalgos/
The newest version!
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
package weka.classifiers.neural.singlelayerperceptron;
import weka.classifiers.neural.common.NeuralModel;
import weka.classifiers.neural.common.SimpleNeuron;
import weka.classifiers.neural.common.WekaAlgorithmAncestor;
import weka.classifiers.neural.common.learning.LearningKernelFactory;
import weka.classifiers.neural.common.learning.LearningRateKernel;
import weka.classifiers.neural.common.training.TrainerFactory;
import weka.classifiers.neural.common.transfer.TransferFunction;
import weka.classifiers.neural.common.transfer.TransferFunctionFactory;
import weka.classifiers.neural.singlelayerperceptron.algorithm.PerceptronAlgorithm;
import weka.core.Instances;
import weka.core.Option;
import weka.core.SelectedTag;
import java.util.ArrayList;
import java.util.Collection;
/**
* Title: Weka Neural Implementation
* Description: ...
* Copyright: Copyright (c) 2003
* Company: N/A
*
* @author Jason Brownlee
* @version 1.0
*/
public class Perceptron extends WekaAlgorithmAncestor {
private final static int EXTRA_PARAM_LEARNING_RATE_FUNCTION = 0;
private final static String[] EXTRA_PARAMETERS =
{
"M" // learning rate function
};
private final static String[] EXTRA_PARAMETER_NOTES =
{
"" // learning rate function
};
// descriptions for all parameters
private final static String[] EXTRA_PARAM_DESCRIPTIONS =
{
"Learning rate function to use while training, static is typically better " + LearningKernelFactory.DESCRIPTION
};
public Perceptron() {
// set static values
transferFunction = TransferFunctionFactory.TRANSFER_SIGN;
trainingMode = TrainerFactory.TRAINER_ONLINE;
// set good initial values
trainingIterations = 500;
biasInput = SimpleNeuron.DEFAULT_BIAS_VALUE;
learningRate = 0.1;
learningRateFunction = LearningKernelFactory.LEARNING_FUNCTION_STATIC;
randomNumberSeed = 0;
}
protected Collection getAlgorithmOptions() {
ArrayList list = new ArrayList();
list.add("-" + EXTRA_PARAMETERS[EXTRA_PARAM_LEARNING_RATE_FUNCTION]);
list.add(Integer.toString(learningRateFunction));
return list;
}
protected Collection © 2015 - 2025 Weber Informatics LLC | Privacy Policy