bl.setIUpdater(new Sgd(lr)); break; case ADAM: double meanDecay = bl.getAdamMeanDecay(); double varDecay = bl.getAdamVarDecay(); bl.setIUpdater(Adam.builder().learningRate(lr).beta1(meanDecay).beta2(varDecay).epsilon(eps) .build()); break; case ADADELTA: bl.setIUpdater(new AdaDelta(rho, eps)); break; case NESTEROVS: Map<Integer, Double> momentumSchedule = bl.getMomentumSchedule(); double momentum = bl.getMomentum(); bl.setIUpdater(new Nesterovs(lr, momentum, momentumSchedule)); break; case ADAGRAD: bl.setIUpdater(new AdaGrad(lr, eps)); break; case RMSPROP: double rmsDecay = bl.getRmsDecay(); bl.setIUpdater(new RmsProp(lr, rmsDecay, eps)); break; case NONE: bl.setIUpdater(new NoOp()); break; case CUSTOM:
bLayer.setUpdater(updater); if (bLayer.getIUpdater() == null) { bLayer.setIUpdater(iUpdater.clone());
/** * Reset the learning related configs of the layer to default. When instantiated with a global neural network configuration * the parameters specified in the neural network configuration will be used. * For internal use with the transfer learning API. Users should not have to call this method directly. */ public void resetLayerDefaultConfig() { //clear the learning related params for all layers in the origConf and set to defaults this.setUpdater(null); this.setIUpdater(null); this.setMomentum(Double.NaN); this.setWeightInit(null); this.setBiasInit(Double.NaN); this.setDist(null); this.setLearningRate(Double.NaN); this.setBiasLearningRate(Double.NaN); this.setLearningRateSchedule(null); this.setMomentumSchedule(null); this.setL1(Double.NaN); this.setL2(Double.NaN); this.setRho(Double.NaN); this.setEpsilon(Double.NaN); this.setRmsDecay(Double.NaN); this.setAdamMeanDecay(Double.NaN); this.setAdamVarDecay(Double.NaN); this.setGradientNormalization(GradientNormalization.None); this.setGradientNormalizationThreshold(1.0); }
bl.setUpdater(updater); if (iUpdater != null) bl.setIUpdater(iUpdater); if (momentum != null) bl.setMomentum(momentum);