(self, y, t, calcrange=slice(0, None))
return np.array((self.correctProbs.get()[:, calcrange].mean(),
                         self.top1.get()[:, calcrange].mean(),
                         self.topk.get()[:, calcrange].mean()))
Returns a numpy array of metrics for: LogLoss, Top-1, and Top-K.

        Args:
            y (Tensor or OpTree): Output of previous layer or model
            t (Tensor or OpTree): True targets corresponding to y
            calcrange (slice, optional): Slice of data used for the metric (default: all)

        Returns:
            numpy array : Returns the metrics in a numpy array:
                          [LogLoss, Top 1 misclass, Top k misclass]
Returns a numpy array of metrics for: LogLoss, Top-1, and Top-K.
Returns a numpy array of metrics for : LogLoss Top - 1 and Top - K .
def __call__(self, y, t, calcrange=slice(0, None)):
        """
        Returns a numpy array of metrics for: LogLoss, Top-1, and Top-K.

        Args:
            y (Tensor or OpTree): Output of previous layer or model
            t (Tensor or OpTree): True targets corresponding to y
            calcrange (slice, optional): Slice of data used for the metric (default: all)

        Returns:
            numpy array : Returns the metrics in a numpy array:
                          [LogLoss, Top 1 misclass, Top k misclass]
        """
        be = self.be
        self.correctProbs[:] = be.sum(y * t, axis=0)
        nSlots = self.k - be.sum((y > self.correctProbs), axis=0)
        nEq = be.sum(y == self.correctProbs, axis=0)
        self.topk[:] = 1. - (nSlots > 0) * ((nEq <= nSlots) * (1 - nSlots / nEq) + nSlots / nEq)
        self.top1[:] = 1. - (be.max(y, axis=0) == self.correctProbs) / nEq
        self.correctProbs[:] = -be.safelog(self.correctProbs)
        return np.array((self.correctProbs.get()[:, calcrange].mean(),
                         self.top1.get()[:, calcrange].mean(),
                         self.topk.get()[:, calcrange].mean()))
def __call__ ( self , y , t , calcrange = slice ( 0 , None ) ) : be = self . be self . correctProbs [ : ] = be . sum ( y * t , axis = 0 ) nSlots = self . k - be . sum ( ( y > self . correctProbs ) , axis = 0 ) nEq = be . sum ( y == self . correctProbs , axis = 0 ) self . topk [ : ] = 1. - ( nSlots > 0 ) * ( ( nEq <= nSlots ) * ( 1 - nSlots / nEq ) + nSlots / nEq ) self . top1 [ : ] = 1. - ( be . max ( y , axis = 0 ) == self . correctProbs ) / nEq self . correctProbs [ : ] = - be . safelog ( self . correctProbs ) return np . array ( ( self . correctProbs . get ( ) [ : , calcrange ] . mean ( ) , self . top1 . get ( ) [ : , calcrange ] . mean ( ) , self . topk . get ( ) [ : , calcrange ] . mean ( ) ) )