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

def __call__(self, y, t):

    return self.func(y, t)
