src/utils/matrix/operation/UnaryMatrixOperation.java
public Matrix applyGradient(Matrix first, Matrix outputGradient) throws MatrixException {
        return switch (unaryFunctionType) {
            case SOFTMAX, GUMBEL_SOFTMAX -> first.softmaxGrad().dot(outputGradient);
            default -> outputGradient.multiply(first.apply(matrixGradientUnaryOperation));
        };
    }
/**
     * Calculates inner gradient.
     *
     * @param first first matrix.
     * @param outputGradient output gradient.
     * @return input gradient
     * @throws MatrixException throws exception if matrix operation fails.
     */
Calculates inner gradient.

@param first first matrix.
@param outputGradient output gradient.
@return input gradient
@throws MatrixException throws exception if matrix operation fails.
Calculates inner gradient . @param first first matrix . @param outputGradient output gradient . @return input gradient @throws MatrixException throws exception if matrix operation fails .
public Matrix applyGradient(Matrix first, Matrix outputGradient) throws MatrixException {
        return switch (unaryFunctionType) {
            case SOFTMAX, GUMBEL_SOFTMAX -> first.softmaxGrad().dot(outputGradient);
            default -> outputGradient.multiply(first.apply(matrixGradientUnaryOperation));
        };
    }
public Matrix applyGradient ( Matrix first , Matrix outputGradient ) throws MatrixException { return switch ( unaryFunctionType ) { case SOFTMAX , GUMBEL_SOFTMAX -> first . softmaxGrad ( ) . dot ( outputGradient ) ; default -> outputGradient . multiply ( first . apply ( matrixGradientUnaryOperation ) ) ; } ; }
Calculates inner gradient.
Calculates inner gradient .