modules/loss.py
def one_errors(c: Tensor, y: Tensor) -> Tensor:
    """
    compute the one-error function
    """
    p, _ = c.size()
    return (y[0, torch.argmax(c, dim=1)] != 1).float().sum() / p

    compute the one-error function
    
compute the one-error function
compute the one - error function
def one_errors(c: Tensor, y: Tensor) -> Tensor:
    p, _ = c.size()
    return (y[0, torch.argmax(c, dim=1)] != 1).float().sum() / p
def one_errors ( c : Tensor , y : Tensor ) -> Tensor : p , _ = c . size ( ) return ( y [ 0 , torch . argmax ( c , dim = 1 ) ] != 1 ) . float ( ) . sum ( ) / p
compute the one-error function
compute the one - error function
"""
    compute the one-error function
    """
c
Tensor
y
Tensor