src/core/layer/regularization/L2_Regularization.java
protected void defineProcedure() throws NeuralNetworkException {
        if (!(getNextLayer() instanceof OutputLayer)) throw new NeuralNetworkException("L2 Regularization must be final layer prior output layer.");

        NeuralNetworkLayer previousNeuralNetworkLayer = getPreviousLayer();
        while (previousNeuralNetworkLayer != null) {
            HashSet<Matrix> regularizedWeights = previousNeuralNetworkLayer.getRegularizedWeights();
            if (regularizedWeights != null) layerRegularizedWeights.addAll(regularizedWeights);
            previousNeuralNetworkLayer = previousNeuralNetworkLayer.getPreviousLayer();
        }
    }
/**
     * Defines layer procedure for forward and backward calculation (automatic gradient) by applying procedure factory.<br>
     *
     * @throws NeuralNetworkException thrown if initialization of layer fails.
     */
Defines layer procedure for forward and backward calculation (automatic gradient) by applying procedure factory.

@throws NeuralNetworkException thrown if initialization of layer fails.
Defines layer procedure for forward and backward calculation ( automatic gradient ) by applying procedure factory . @throws NeuralNetworkException thrown if initialization of layer fails .
protected void defineProcedure() throws NeuralNetworkException {
        if (!(getNextLayer() instanceof OutputLayer)) throw new NeuralNetworkException("L2 Regularization must be final layer prior output layer.");
        NeuralNetworkLayer previousNeuralNetworkLayer = getPreviousLayer();
        while (previousNeuralNetworkLayer != null) {
            HashSet<Matrix> regularizedWeights = previousNeuralNetworkLayer.getRegularizedWeights();
            if (regularizedWeights != null) layerRegularizedWeights.addAll(regularizedWeights);
            previousNeuralNetworkLayer = previousNeuralNetworkLayer.getPreviousLayer();
        }
    }
protected void defineProcedure ( ) throws NeuralNetworkException { if ( ! ( getNextLayer ( ) instanceof OutputLayer ) ) throw new NeuralNetworkException ( "L2 Regularization must be final layer prior output layer." ) ; NeuralNetworkLayer previousNeuralNetworkLayer = getPreviousLayer ( ) ; while ( previousNeuralNetworkLayer != null ) { HashSet < Matrix > regularizedWeights = previousNeuralNetworkLayer . getRegularizedWeights ( ) ; if ( regularizedWeights != null ) layerRegularizedWeights . addAll ( regularizedWeights ) ; previousNeuralNetworkLayer = previousNeuralNetworkLayer . getPreviousLayer ( ) ; } }
Defines layer procedure for forward and backward calculation (automatic gradient) by applying procedure factory.<br>
Defines layer procedure for forward and backward calculation ( automatic gradient ) by applying procedure factory . <br >