def METHOD_NAME(self, batch, return_output=False):
    """
    Compute and return the loss for the given batch.
    """
    if return_output:
        loss, model_output = super().METHOD_NAME(batch, return_output)
    else:
        loss = super().METHOD_NAME(batch, return_output)
    if self.opt['hash_layer'] != -1:
        loss = loss + self.dummy_loss()
    if return_output:
        return (loss, model_output)
    else:
        return loss