pub trait Gradient<T, S> {
// Required method
fn wrt(&self, v: T) -> S;
}
Expand description
Calculate gradients with respect to particular variables.
Required Methods§
Implementations on Foreign Types§
Source§impl<'a> Gradient<&Vec<Var<'a>>, Vec<f64>> for Vec<f64>
Calculate the gradient with respect to all variables in v
. Returns a vector, where the items
in the vector are the gradients with respect to the variable in the original list v
, in the
same order.
impl<'a> Gradient<&Vec<Var<'a>>, Vec<f64>> for Vec<f64>
Calculate the gradient with respect to all variables in v
. Returns a vector, where the items
in the vector are the gradients with respect to the variable in the original list v
, in the
same order.
Source§impl<'a> Gradient<&Var<'a>, f64> for Vec<f64>
Calculate the gradient with respect to variable v
.
impl<'a> Gradient<&Var<'a>, f64> for Vec<f64>
Calculate the gradient with respect to variable v
.
Source§impl<'a> Gradient<&[Var<'a>], Vec<f64>> for Vec<f64>
Calculate the gradient with respect to all variables in v
. Returns a vector, where the items
in the vector are the gradients with respect to the variable in the original list v
, in the
same order.
impl<'a> Gradient<&[Var<'a>], Vec<f64>> for Vec<f64>
Calculate the gradient with respect to all variables in v
. Returns a vector, where the items
in the vector are the gradients with respect to the variable in the original list v
, in the
same order.
Source§impl<'a, const N: usize> Gradient<&[Var<'a>; N], Vec<f64>> for Vec<f64>
Calculate the gradient with respect to all variables in v
. Returns a vector, where the items
in the vector are the gradients with respect to the variable in the original list v
, in the
same order.
impl<'a, const N: usize> Gradient<&[Var<'a>; N], Vec<f64>> for Vec<f64>
Calculate the gradient with respect to all variables in v
. Returns a vector, where the items
in the vector are the gradients with respect to the variable in the original list v
, in the
same order.
Source§impl<'a, const N: usize> Gradient<[Var<'a>; N], Vec<f64>> for Vec<f64>
Calculate the gradient with respect to all variables in v
. Returns a vector, where the items
in the vector are the gradients with respect to the variable in the original list v
, in the
same order.
impl<'a, const N: usize> Gradient<[Var<'a>; N], Vec<f64>> for Vec<f64>
Calculate the gradient with respect to all variables in v
. Returns a vector, where the items
in the vector are the gradients with respect to the variable in the original list v
, in the
same order.