pub trait Gradient<IN, OUT> {
// Required method
fn wrt(&self, variables: IN) -> OUT;
}Expand description
Return the derivative/s with-respect-to the chosen variables. This allows you to get the gradient of a function with respect to any selection of variables, i.e. - a single variable, - a subset of the variables, - or all of the variables.
Required Methods§
Implementations on Foreign Types§
Source§impl<'v> Gradient<&Vec<Variable<'v>>, Vec<f64>> for Vec<f64>
wrt a borrowed vector of variables.
impl<'v> Gradient<&Vec<Variable<'v>>, Vec<f64>> for Vec<f64>
wrt a borrowed vector of variables.
Source§impl<'v, const N: usize> Gradient<&[Variable<'v>; N], Vec<f64>> for Vec<f64>
wrt a borrowed array of variables.
impl<'v, const N: usize> Gradient<&[Variable<'v>; N], Vec<f64>> for Vec<f64>
wrt a borrowed array of variables.
Source§impl<'v, const N: usize> Gradient<[Variable<'v>; N], Vec<f64>> for Vec<f64>
wrt an array of variables.
impl<'v, const N: usize> Gradient<[Variable<'v>; N], Vec<f64>> for Vec<f64>
wrt an array of variables.