pub fn update_with<I>(&mut self, input: I, f: impl Fn(&Features, f64) -> f64) -> Result<()>
    where
        B: basis::Basis<I, Value = Features>,
        O: optim::Optimiser,
    {
        self.basis
            .project(input)
            .map(|b| (b.dot(&self.weights.view()), b))
            .map(|(v, b)| (f(&b, v), b))
            .and_then(|(e, b)| {
                self.optimiser
                    .step_scaled(&mut self.weights.view_mut(), &b, e)
            })
    }
/// Update the function approximator for a given `input`, deferring the
/// error computation to a closure provided by the user.
Update the function approximator for a given `input`, deferring the
error computation to a closure provided by the user.
Update the function approximator for a given ` input ` deferring the error computation to a closure provided by the user .
pub fn update_with<I>(&mut self, input: I, f: impl Fn(&Features, f64) -> f64) -> Result<()>
    where
        B: basis::Basis<I, Value = Features>,
        O: optim::Optimiser,
    {
        self.basis
            .project(input)
            .map(|b| (b.dot(&self.weights.view()), b))
            .map(|(v, b)| (f(&b, v), b))
            .and_then(|(e, b)| {
                self.optimiser
                    .step_scaled(&mut self.weights.view_mut(), &b, e)
            })
    }
pub fn update_with < I > ( & mut self , input : I , f : impl Fn ( & Features , f64 ) -> f64 ) -> Result < ( ) > where B : basis :: Basis < I , Value = Features > , O : optim :: Optimiser , { self . basis . project ( input ) . map ( | b | ( b . dot ( & self . weights . view ( ) ) , b ) ) . map ( | ( v , b ) | ( f ( & b , v ) , b ) ) . and_then ( | ( e , b ) | { self . optimiser . step_scaled ( & mut self . weights . view_mut ( ) , & b , e ) } ) }
Update the function approximator for a given `input`, deferring the
error computation to a closure provided by the user.
Update the function approximator for a given ` input ` deferring the error computation to a closure provided by the user .
&mut self
input
I
f
impl Fn(&Features, f64) -> f64
&mut self
input
I
f
impl Fn(&Features, f64) -> f64