import torch


def loss_fn(p, t, params):
    """
    Loss of predictions
    dim(p): (num_classes,)
    t: integer, index of p
    """
    assert p.shape == (params.num_classes,)
    return -torch.log(p[t])