DifferentiableArray

Trait DifferentiableArray 

Source
pub trait DifferentiableArray: ArrayProtocol {
    // Required methods
    fn gradient(
        &self,
        variables: &[Box<dyn DifferentiableArray>],
    ) -> Vec<Box<dyn DifferentiableArray>>;
    fn set_requiresgrad(&mut self, requiresgrad: bool);
    fn requiresgrad(&self) -> bool;
    fn grad(&self) -> Option<Box<dyn DifferentiableArray>>;
}
Expand description

Trait for arrays that support automatic differentiation.

Required Methods§

Source

fn gradient( &self, variables: &[Box<dyn DifferentiableArray>], ) -> Vec<Box<dyn DifferentiableArray>>

Compute the gradient of this array with respect to some variables.

Source

fn set_requiresgrad(&mut self, requiresgrad: bool)

Set whether to record operations for automatic differentiation.

Source

fn requiresgrad(&self) -> bool

Check if this array requires gradient computation.

Source

fn grad(&self) -> Option<Box<dyn DifferentiableArray>>

Get the gradient of this array.

Implementors§