src/core/layer/regularization/L2_Regularization.java
public double error() throws MatrixException, DynamicParamException {
        double weightSum = 0;
        for (Matrix weight : layerRegularizedWeights) {
            weightSum += weight.power(2).sum();
        }
        return lambda * weightSum;
    }
/**
     * Cumulates error from (L1 / L2 / Lp) regularization.
     *
     * @throws DynamicParamException throws exception if parameter (params) setting fails.
     * @throws MatrixException throws exception if matrix operation fails.
     * @return cumulated error from regularization.
     */
Cumulates error from (L1 / L2 / Lp) regularization.

@throws DynamicParamException throws exception if parameter (params) setting fails.
@throws MatrixException throws exception if matrix operation fails.
@return cumulated error from regularization.
Cumulates error from ( L1 / L2 / Lp ) regularization . @throws DynamicParamException throws exception if parameter ( params ) setting fails . @throws MatrixException throws exception if matrix operation fails . @return cumulated error from regularization .
public double error() throws MatrixException, DynamicParamException {
        double weightSum = 0;
        for (Matrix weight : layerRegularizedWeights) {
            weightSum += weight.power(2).sum();
        }
        return lambda * weightSum;
    }
public double error ( ) throws MatrixException , DynamicParamException { double weightSum = 0 ; for ( Matrix weight : layerRegularizedWeights ) { weightSum += weight . power ( 2 ) . sum ( ) ; } return lambda * weightSum ; }
Cumulates error from (L1 / L2 / Lp) regularization.
Cumulates error from ( L1 / L2 / Lp ) regularization .