⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 batchlearner.java

📁 一个纯java写的神经网络源代码
💻 JAVA
字号:
package org.joone.engine;import org.joone.engine.extenders.*;/** BatchLearner stores the weight/bias changes during the batch and updates them *  after the batch is done. * * IMPORTANT:   If you want to have standard batch learning, i.e. the BatchSize equals *              the number of training patterns available, just use monitor. *              setBatchSize(monitor.getTrainingPatterns()); */public class BatchLearner extends ExtendableLearner {        public BatchLearner() {        setUpdateWeightExtender(new BatchModeExtender());        // please be careful of the order of extenders...        addDeltaRuleExtender(new MomentumExtender());    }        /**     * @deprecated use BatchLearner() and set the batch size     * with monitor.setBatchSize()     */    public BatchLearner(int batchSize) {        super();        setBatchSize(batchSize);    }            /**     * @deprecated not used, the BatchModeExtender takes care of everything     */    public void initiateNewBatch() {        // if you want to call it any, probably the next lines are the best...        if (learnable instanceof LearnableLayer) {            theUpdateWeightExtender.preBiasUpdate(null);        } else if (learnable instanceof LearnableSynapse) {            theUpdateWeightExtender.preWeightUpdate(null, null);        }    }                /**     * @deprecated use monitor.setBatchSize()     */    public void setBatchSize(int newBatchSize) {        ((BatchModeExtender)theUpdateWeightExtender).setBatchSize(newBatchSize);    }        /**     * @deprecated use monitor.getBatchSize()     */    public int getBatchSize() {        return ((BatchModeExtender)theUpdateWeightExtender).getBatchSize();    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -