src/utils/procedure/expression/VarianceExpression.java
public void calculateGradient() throws MatrixException {
        if (!executeAsSingleStep()) return;
        if (result.getGradient() == null) throw new MatrixException(getExpressionName() + ": Result gradient not defined.");
        for (Integer index : argument1.keySet()) {
            if (!argument1.isStopGradient()) {
                Matrix varianceGradient = argument1.getMatrix(index).subtract(mean).multiply(2 / (double)argument1.size());
                argument1.cumulateGradient(index, result.getGradient().multiply(varianceGradient), false);
            }
        }
    }
/**
     * Calculates gradient of expression.
     *
     * @throws MatrixException throws exception if calculation fails.
     */
Calculates gradient of expression.
@throws MatrixException throws exception if calculation fails.
Calculates gradient of expression . @throws MatrixException throws exception if calculation fails .
public void calculateGradient() throws MatrixException {
        if (!executeAsSingleStep()) return;
        if (result.getGradient() == null) throw new MatrixException(getExpressionName() + ": Result gradient not defined.");
        for (Integer index : argument1.keySet()) {
            if (!argument1.isStopGradient()) {
                Matrix varianceGradient = argument1.getMatrix(index).subtract(mean).multiply(2 / (double)argument1.size());
                argument1.cumulateGradient(index, result.getGradient().multiply(varianceGradient), false);
            }
        }
    }
public void calculateGradient ( ) throws MatrixException { if ( ! executeAsSingleStep ( ) ) return ; if ( result . getGradient ( ) == null ) throw new MatrixException ( getExpressionName ( ) + ": Result gradient not defined." ) ; for ( Integer index : argument1 . keySet ( ) ) { if ( ! argument1 . isStopGradient ( ) ) { Matrix varianceGradient = argument1 . getMatrix ( index ) . subtract ( mean ) . multiply ( 2 / ( double ) argument1 . size ( ) ) ; argument1 . cumulateGradient ( index , result . getGradient ( ) . multiply ( varianceGradient ) , false ) ; } } }
Calculates gradient of expression.
Calculates gradient of expression .