Trait gad::store::GradientStore[][src]

pub trait GradientStore<Id, T>: GradientReader<Id, T> {
    fn insert(&mut self, id: Id, gradient: T);
fn get_mut(&mut self, id: Id) -> Option<&mut T>; fn get(&self, id: Id) -> Option<&T> { ... }
fn add_gradient<A, G: ?Sized>(
        &mut self,
        graph: &mut G,
        id: Id,
        value: &T
    ) -> Result<()>
    where
        G: CoreAlgebra<A, Value = T>,
        Id: Copy,
        T: Clone + 'static
, { ... } }

Trait for accessing gradient values of type T given a handle of type Id.

Required methods

fn insert(&mut self, id: Id, gradient: T)[src]

fn get_mut(&mut self, id: Id) -> Option<&mut T>[src]

Loading content...

Provided methods

fn get(&self, id: Id) -> Option<&T>[src]

fn add_gradient<A, G: ?Sized>(
    &mut self,
    graph: &mut G,
    id: Id,
    value: &T
) -> Result<()> where
    G: CoreAlgebra<A, Value = T>,
    Id: Copy,
    T: Clone + 'static, 
[src]

Update a gradient during backward propagation. This is used to define operators together with Graph::make_node. The parameter graph is used for higher-order differentials (see GraphN).

Loading content...

Implementors

impl<T: 'static> GradientStore<GradientId<T>, Value<T>> for GenericGradientMapN[src]

impl<T: 'static> GradientStore<GradientId<T>, T> for GenericGradientMap1[src]

Loading content...