public static LossInfo mcxent(String outputName, SDVariable predictions, SDVariable label, SDVariable weights,
                                  Reduction reduction, int... dimensions) {
    """
	Multi-Class Cross Entropy loss function:<br>
	L = sum_i actual_i * log( predicted_i )
	
	@param outputName
	@param predictions
	@param label
	@param weights
	@param reduction
	@param dimensions
	@return
    """
        LossInfo.Builder b = validate("mcxent", predictions, label, reduction);
        SameDiff sd = predictions.getSameDiff();

        if(weights == null){
            weights = sd.one("mcxent_loss_weights", SCALAR);
        }

        String name = (reduction == Reduction.NONE ? outputName : null);
        SDVariable weightedLogProd = sd.log(predictions).mul(label).mul(name, weights);

        return doReduce(sd, outputName, false, b, reduction, weightedLogProd, label, weights, dimensions);
    }
public static LossInfo mcxent(String outputName, SDVariable predictions, SDVariable label, SDVariable weights,
                                  Reduction reduction, int... dimensions){
        LossInfo.Builder b = validate("mcxent", predictions, label, reduction);
        SameDiff sd = predictions.getSameDiff();

        if(weights == null){
            weights = sd.one("mcxent_loss_weights", SCALAR);
        }

        String name = (reduction == Reduction.NONE ? outputName : null);
        SDVariable weightedLogProd = sd.log(predictions).mul(label).mul(name, weights);

        return doReduce(sd, outputName, false, b, reduction, weightedLogProd, label, weights, dimensions);
    }
public static LossInfo mcxent ( String outputName , SDVariable predictions , SDVariable label , SDVariable weights , Reduction reduction , int ... dimensions ) { LossInfo . Builder b = validate ( "mcxent" , predictions , label , reduction ) ; SameDiff sd = predictions . getSameDiff ( ) ; if ( weights == null ) { weights = sd . one ( "mcxent_loss_weights" , SCALAR ) ; } String name = ( reduction == Reduction . NONE ? outputName : null ) ; SDVariable weightedLogProd = sd . log ( predictions ) . mul ( label ) . mul ( name , weights ) ; return doReduce ( sd , outputName , false , b , reduction , weightedLogProd , label , weights , dimensions ) ; }
Multi-Class Cross Entropy loss function:<br>
L = sum_i actual_i * log( predicted_i )

@param outputName
@param predictions
@param label
@param weights
@param reduction
@param dimensions
@return
Multi - Class Cross Entropy loss function : <br > L = sum_i actual_i * log ( predicted_i )