'Compute the cost function over the inputs and targets.
Arguments:
inputs (Tensor): Tensor containing input values to be compared to
targets
targets (Tensor): Tensor containing target values.
cost_type (String, default None): Cost type for GAN models
Returns:
Tensor containing cost'

def get_cost(self, inputs, targets, cost_type=None):

    self.outputs[:] = self.costfunc(inputs, targets, cost_type)
    self.be.mean(self.outputs, axis=1, out=self.cost_buffer)
    self.cost = self.cost_buffer.get()
    return self.cost
