public SDVariable meanSquaredError(String name, @NonNull SDVariable label, @NonNull SDVariable predictions,
                                       SDVariable weights, @NonNull LossReduce lossReduce) {
        validateFloatingPoint("mean squared error loss", "predictions", predictions);
        validateNumerical("mean squared error loss", "labels", label);
        if (weights == null)
            weights = sd.scalar(null, predictions.dataType(), 1.0);
        SDVariable result = f().lossMeanSquaredError(label, predictions, weights, lossReduce);
        result = updateVariableNameAndReference(result, name);
        result.markAsLoss();
        return result;
    }
public SDVariable meanSquaredError ( String name , @ NonNull SDVariable label , @ NonNull SDVariable predictions , SDVariable weights , @ NonNull LossReduce lossReduce ) { validateFloatingPoint ( "mean squared error loss" , "predictions" , predictions ) ; validateNumerical ( "mean squared error loss" , "labels" , label ) ; if ( weights == null ) weights = sd . scalar ( null , predictions . dataType ( ) , 1.0 ) ; SDVariable result = f ( ) . lossMeanSquaredError ( label , predictions , weights , lossReduce ) ; result = updateVariableNameAndReference ( result , name ) ; result . markAsLoss ( ) ; return result ; }
Mean squared error loss function. Implements {@code (label[i] - prediction[i])^2} - i.e., squared error on a per-element basis.
When averaged (using {@link LossReduce#MEAN_BY_WEIGHT} or {@link LossReduce#MEAN_BY_NONZERO_WEIGHT_COUNT} (the default))
this is the mean squared error loss function.

@param name        Name of the operation
@param label       Label array
@param predictions Predictions array
@param weights     Weights array. May be null. If null, a weight of 1.0 is used
@param lossReduce  Reduction type for the loss. See {@link LossReduce} for more details. Default: {@link LossReduce#MEAN_BY_NONZERO_WEIGHT_COUNT}
@return Loss variable