'Compute the derivative of the cost function
Arguments:
inputs (Tensor): Tensor containing input values to be compared to
targets
targets_mask ((Tensor, Tensor)): Tuple with Tensor target values
and Tensor mask
Returns:
Tensor of same shape as the inputs containing their respective
deltas.'

def get_errors(self, inputs, targets_mask):

    (targets, mask) = targets_mask
    self.deltas[:] = ((self.costfunc.bprop(inputs, targets) * mask) * self.weights)
    return self.deltas
