src/core/network/NeuralNetwork.java
private void trainIteration() throws MatrixException, IOException, NeuralNetworkException, DynamicParamException {
        long startTime = System.nanoTime();
        for (NeuralNetworkLayer neuralNetworkLayer : neuralNetworkLayers) if (reset) neuralNetworkLayer.resetOptimizer();
        trainingMetric.reset();
        Sequence inputSequence = new Sequence(trainingSampler.getDepth());
        Sequence outputSequence = new Sequence(trainingSampler.getDepth());
        trainingSampler.getSamples(inputSequence, outputSequence);
        getOutputLayer().setTargets(outputSequence);
        getInputLayer().train(inputSequence);
        getOutputLayer().backward();
        getInputLayer().update();
        long endTime = System.nanoTime();
        trainingTime += endTime - startTime;
        trainingMetric.report(getOutputLayer().getTotalError());
        totalIterations++;
        if (autoValidationCycle > 0) {
            autoValidationCount++;
            if (autoValidationCount >= autoValidationCycle) {
                validateInput(false);
                if (earlyStopping != null) earlyStopping.evaluateValidationCondition(totalIterations);
                autoValidationCount = 0;
            }
        }
        if (earlyStopping != null) earlyStopping.evaluateTrainingCondition(totalIterations);
        if (verboseTraining) verboseTrainingStatus();
        if (persistence != null) persistence.cycle();
    }
/**
     * Trains single neural network iteration.
     *
     * @throws MatrixException throws exception if matrix operation fails.
     * @throws IOException throws exception if neural network persistence operation fails.
     * @throws NeuralNetworkException throws exception if neural network training fails.
     * @throws DynamicParamException throws exception if parameter (params) setting fails.
     */
Trains single neural network iteration.
@throws MatrixException throws exception if matrix operation fails.
@throws IOException throws exception if neural network persistence operation fails.
@throws NeuralNetworkException throws exception if neural network training fails.
@throws DynamicParamException throws exception if parameter (params) setting fails.
Trains single neural network iteration . @throws MatrixException throws exception if matrix operation fails . @throws IOException throws exception if neural network persistence operation fails . @throws NeuralNetworkException throws exception if neural network training fails . @throws DynamicParamException throws exception if parameter ( params ) setting fails .
private void trainIteration() throws MatrixException, IOException, NeuralNetworkException, DynamicParamException {
        long startTime = System.nanoTime();
        for (NeuralNetworkLayer neuralNetworkLayer : neuralNetworkLayers) if (reset) neuralNetworkLayer.resetOptimizer();
        trainingMetric.reset();
        Sequence inputSequence = new Sequence(trainingSampler.getDepth());
        Sequence outputSequence = new Sequence(trainingSampler.getDepth());
        trainingSampler.getSamples(inputSequence, outputSequence);
        getOutputLayer().setTargets(outputSequence);
        getInputLayer().train(inputSequence);
        getOutputLayer().backward();
        getInputLayer().update();
        long endTime = System.nanoTime();
        trainingTime += endTime - startTime;
        trainingMetric.report(getOutputLayer().getTotalError());
        totalIterations++;
        if (autoValidationCycle > 0) {
            autoValidationCount++;
            if (autoValidationCount >= autoValidationCycle) {
                validateInput(false);
                if (earlyStopping != null) earlyStopping.evaluateValidationCondition(totalIterations);
                autoValidationCount = 0;
            }
        }
        if (earlyStopping != null) earlyStopping.evaluateTrainingCondition(totalIterations);
        if (verboseTraining) verboseTrainingStatus();
        if (persistence != null) persistence.cycle();
    }
private void trainIteration ( ) throws MatrixException , IOException , NeuralNetworkException , DynamicParamException { long startTime = System . nanoTime ( ) ; for ( NeuralNetworkLayer neuralNetworkLayer : neuralNetworkLayers ) if ( reset ) neuralNetworkLayer . resetOptimizer ( ) ; trainingMetric . reset ( ) ; Sequence inputSequence = new Sequence ( trainingSampler . getDepth ( ) ) ; Sequence outputSequence = new Sequence ( trainingSampler . getDepth ( ) ) ; trainingSampler . getSamples ( inputSequence , outputSequence ) ; getOutputLayer ( ) . setTargets ( outputSequence ) ; getInputLayer ( ) . train ( inputSequence ) ; getOutputLayer ( ) . backward ( ) ; getInputLayer ( ) . update ( ) ; long endTime = System . nanoTime ( ) ; trainingTime += endTime - startTime ; trainingMetric . report ( getOutputLayer ( ) . getTotalError ( ) ) ; totalIterations ++ ; if ( autoValidationCycle > 0 ) { autoValidationCount ++ ; if ( autoValidationCount >= autoValidationCycle ) { validateInput ( false ) ; if ( earlyStopping != null ) earlyStopping . evaluateValidationCondition ( totalIterations ) ; autoValidationCount = 0 ; } } if ( earlyStopping != null ) earlyStopping . evaluateTrainingCondition ( totalIterations ) ; if ( verboseTraining ) verboseTrainingStatus ( ) ; if ( persistence != null ) persistence . cycle ( ) ; }
Trains single neural network iteration.
Trains single neural network iteration .