def METHOD_NAME(self, input_train, target_train, input_valid, target_valid):
    if self.unrolled:
        params_grads = self._backward_step_unrolled(
            input_train, target_train, input_valid, target_valid)
        self.optimizer.apply_gradients(params_grads)
    else:
        loss = self._backward_step(input_valid, target_valid)
        self.optimizer.minimize(loss)
    self.optimizer.clear_gradients()