Class IndexLoss


  • public class IndexLoss
    extends Loss
    A wrapper for a Loss that evaluates on only a particular NDArray in the predictions and/or labels NDLists.
    • Constructor Detail

      • IndexLoss

        public IndexLoss​(Loss loss,
                         int index)
        Constructs an IndexLoss with the same index for both predictions and labels.
        Parameters:
        loss - the base evaluator
        index - the index for both predictions and labels
      • IndexLoss

        public IndexLoss​(Loss loss,
                         java.lang.Integer predictionsIndex,
                         java.lang.Integer labelsIndex)
        Constructs an IndexLoss.
        Parameters:
        loss - the base evaluator
        predictionsIndex - the predictions index
        labelsIndex - the labels index
    • Method Detail

      • evaluate

        public NDArray evaluate​(NDList labels,
                                NDList predictions)
        Calculates the evaluation between the labels and the predictions.
        Specified by:
        evaluate in class Evaluator
        Parameters:
        labels - the correct values
        predictions - the predicted values
        Returns:
        the evaluation result