chainer.backward

chainer.backward(outputs, grad_outputs=None, *, enable_double_backprop=False)[source]

Runs backpropagation from variables simultaneously.

Warning

This feature is experimental. The interface can change in the future.

Parameters
  • outputs (tuple or list of Variable) – A sequence of output variables from which backprop starts.

  • grad_outputs (None or tuple or list of Variable) – A sequence of variables that gives the initial value of each output gradient. If this argument is None, backprop uses grad_var of outputs.

  • enable_double_backprop (bool) – If True, computational trace of the whole backpropagation procedure is recorded to the computational graph so that one can further do backpropagation from the resulting gradients. Note that enabling it results in larger memory consumption needed to store the gradients w.r.t intermediate variables that are required for the second gradient computation.