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
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]
&mut self,
graph: &mut G,
id: Id,
value: &T
) -> Result<()> where
G: CoreAlgebra<A, Value = T>,
Id: Copy,
T: Clone + 'static,
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
).