'Returns the multiclass cross entropy cost
Args:
y (Tensor or OpTree): Output of previous layer or model
t (Tensor or OpTree): True targets corresponding to y
Returns:
OpTree: Returns the multiclass cross entropy cost'

def __call__(self, y, t):

    if (y.shape != t.shape):
        raise ValueError('CrossEntropy    requires    network    output    shape    to    match    targets.    Network    output    shape    was    {}    and    targets    shape    was    {}'.format(y.shape, t.shape))
    return self.be.sum((((- t) * self.logscale) * self.be.safelog(y)), axis=0)
