• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java LearningRule类的典型用法和代码示例

java 1次浏览

本文整理汇总了Java中org.neuroph.core.learning.LearningRule的典型用法代码示例。如果您正苦于以下问题:Java LearningRule类的具体用法?Java LearningRule怎么用?Java LearningRule使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

LearningRule类属于org.neuroph.core.learning包,在下文中一共展示了LearningRule类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: run

点赞 2

import org.neuroph.core.learning.LearningRule; //导入依赖的package包/类
/**
 * Runs this sample
 */
public void run() {
	
    // create training set (logical XOR function)
    DataSet trainingSet = new DataSet(2, 1);
    trainingSet.addRow(new DataSetRow(new double[]{0, 0}, new double[]{0}));
    trainingSet.addRow(new DataSetRow(new double[]{0, 1}, new double[]{1}));
    trainingSet.addRow(new DataSetRow(new double[]{1, 0}, new double[]{1}));
    trainingSet.addRow(new DataSetRow(new double[]{1, 1}, new double[]{0}));

    // create multi layer perceptron
    MultiLayerPerceptron myMlPerceptron = new MultiLayerPerceptron(TransferFunctionType.TANH, 2, 3, 1);
    // enable batch if using MomentumBackpropagation
    if( myMlPerceptron.getLearningRule() instanceof MomentumBackpropagation ){
    	((MomentumBackpropagation)myMlPerceptron.getLearningRule()).setBatchMode(true);
    	((MomentumBackpropagation)myMlPerceptron.getLearningRule()).setMaxError(0.00001);
    }

    LearningRule learningRule = myMlPerceptron.getLearningRule();
    learningRule.addListener(this);
    
    // learn the training set
    System.out.println("Training neural network...");
    myMlPerceptron.learn(trainingSet);

    // test perceptron
    System.out.println("Testing trained neural network");
    testNeuralNetwork(myMlPerceptron, trainingSet);

    // save trained neural network
    myMlPerceptron.save("myMlPerceptron.nnet");

    // load saved neural network
    NeuralNetwork loadedMlPerceptron = NeuralNetwork.load("myMlPerceptron.nnet");

    // test loaded neural network
    System.out.println("Testing loaded neural network");
    testNeuralNetwork(loadedMlPerceptron, trainingSet);
}
 

开发者ID:East196,
项目名称:maker,
代码行数:42,
代码来源:XorMultiLayerPerceptronSample.java

示例2: LearningEvent

点赞 2

import org.neuroph.core.learning.LearningRule; //导入依赖的package包/类
public LearningEvent(LearningRule source) {
    super(source);
}
 

开发者ID:fiidau,
项目名称:Y-Haplogroup-Predictor,
代码行数:4,
代码来源:LearningEvent.java

示例3: learn

点赞 1

import org.neuroph.core.learning.LearningRule; //导入依赖的package包/类
/**
 * Learn the specified training set, using specified learning rule
 *
 * @param trainingSet set of training elements to learn
 * @param learningRule instance of learning rule to use for learning
 */
public void learn(DataSet trainingSet, LearningRule learningRule) {
    setLearningRule(learningRule);
    learningRule.learn(trainingSet);
}
 

开发者ID:fiidau,
项目名称:Y-Haplogroup-Predictor,
代码行数:11,
代码来源:NeuralNetwork.java

示例4: learnInNewThread

点赞 1

import org.neuroph.core.learning.LearningRule; //导入依赖的package包/类
/**
 * Starts learning with specified learning rule in new thread to learn the
 * specified training set, and immediately returns from method to the
 * current thread execution
 *
 * @param trainingSet set of training elements to learn
 * @param learningRule learning algorithm
 */
public void learnInNewThread(DataSet trainingSet, LearningRule learningRule) {
    setLearningRule(learningRule);
    learnInNewThread(trainingSet);
}
 

开发者ID:fiidau,
项目名称:Y-Haplogroup-Predictor,
代码行数:13,
代码来源:NeuralNetwork.java

示例5: getLearningRule

点赞 1

import org.neuroph.core.learning.LearningRule; //导入依赖的package包/类
/**
 * Returns the learning algorithm of this network
 *
 * @return algorithm for network training
 */
public LearningRule getLearningRule() {
    return this.learningRule;
}
 

开发者ID:fiidau,
项目名称:Y-Haplogroup-Predictor,
代码行数:9,
代码来源:NeuralNetwork.java

示例6: setLearningRule

点赞 1

import org.neuroph.core.learning.LearningRule; //导入依赖的package包/类
/**
 * Sets learning algorithm for this network
 *
 * @param learningRule learning algorithm for this network
 */
public void setLearningRule(LearningRule learningRule) {
    learningRule.setNeuralNetwork(this);
    this.learningRule = learningRule;
}
 

开发者ID:fiidau,
项目名称:Y-Haplogroup-Predictor,
代码行数:10,
代码来源:NeuralNetwork.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)