logo

Trait neuronika::Backward[][src]

pub trait Backward: Overwrite {
    fn backward(&self);
fn no_grad(&self);
fn with_grad(&self); }
Expand description

Back-propagation behavior.

This trait is implemented by all the internal backward components of VarDiff.

The main method it provides is the .backward() method that is used to back-propagate gradients from the root variables to the graph’s leaves.

The other two methods, namely .no_grad() and .with_grad() are used to shut down gradients’ computation.

Required methods

Propagates the computations backwards.

It also defines the logic for the back-propagation of the node.

Shuts down the computation of the gradient for the node self and de-allocates its gradient.

Switches back on the computation of the gradient for the node self and re-allocates its gradient.

Implementors