List of usage examples for org.deeplearning4j.nn.multilayer MultiLayerNetwork pretrainLayer
public void pretrainLayer(int layerIdx, INDArray features)
From source file:org.knime.ext.dl4j.base.nodes.learn.AbstractDLLearnerNodeModel.java
License:Open Source License
/** * Performs one epoch of pretraining of the specified {@link MultiLayerNetwork}. Checks {@link LearningMonitor} of * this learner if learning should be prematurely stopped. * * @param mln the network to train//from w ww . ja v a 2 s .c om * @param data the data to train on * @param exec used to check for cancelled execution and stop learning * @throws CanceledExecutionException */ protected void pretrainOneEpoch(final MultiLayerNetwork mln, final DataSetIterator data, final ExecutionContext exec) throws CanceledExecutionException { for (int i = 0; i < mln.getnLayers(); i++) { exec.setMessage("Performing Pretraining on Layer: " + (i + 1)); while (data.hasNext()) { exec.checkCanceled(); if (m_learningMonitor.checkStopLearning()) { break; } mln.pretrainLayer(i, data.next().getFeatureMatrix()); } data.reset(); } }