[−][src]Trait lfa::core::Approximator
An interface for function approximators.
Associated Types
type Output
The type of value being approximated.
Required methods
fn n_outputs(&self) -> usize
Return the dimensionality of the output value Approximator::Output
.
fn evaluate(&self, features: &Features) -> EvaluationResult<Self::Output>
Evaluate the approximator and return its value.
fn jacobian(&self, features: &Features) -> Matrix<f64>
Return the Jacobian matrix df/dw for a given features vector.
Note: we use denominator layout such that rows and columns correspond to weights and outputs, respectively.
fn update_grad(
&mut self,
grad: &Matrix<f64>,
update: Self::Output
) -> UpdateResult<()>
&mut self,
grad: &Matrix<f64>,
update: Self::Output
) -> UpdateResult<()>
Update the approximator's estimate for a given gradient matrix.
Provided methods
fn update(
&mut self,
features: &Features,
update: Self::Output
) -> UpdateResult<()>
&mut self,
features: &Features,
update: Self::Output
) -> UpdateResult<()>
Update the approximator's estimate for the given input.
Implementors
impl Approximator for PairFunction
[src]
type Output = [f64; 2]
fn n_outputs(&self) -> usize
[src]
fn evaluate(&self, features: &Features) -> EvaluationResult<Self::Output>
[src]
fn jacobian(&self, features: &Features) -> Matrix<f64>
[src]
fn update_grad(
&mut self,
grad: &Matrix<f64>,
update: Self::Output
) -> UpdateResult<()>
[src]
&mut self,
grad: &Matrix<f64>,
update: Self::Output
) -> UpdateResult<()>
fn update(
&mut self,
features: &Features,
errors: Self::Output
) -> UpdateResult<()>
[src]
&mut self,
features: &Features,
errors: Self::Output
) -> UpdateResult<()>
impl Approximator for ScalarFunction
[src]
type Output = f64
fn n_outputs(&self) -> usize
[src]
fn evaluate(&self, features: &Features) -> EvaluationResult<Self::Output>
[src]
fn jacobian(&self, features: &Features) -> Matrix<f64>
[src]
fn update_grad(
&mut self,
grad: &Matrix<f64>,
update: Self::Output
) -> UpdateResult<()>
[src]
&mut self,
grad: &Matrix<f64>,
update: Self::Output
) -> UpdateResult<()>
fn update(
&mut self,
features: &Features,
error: Self::Output
) -> UpdateResult<()>
[src]
&mut self,
features: &Features,
error: Self::Output
) -> UpdateResult<()>
impl Approximator for TripleFunction
[src]
type Output = [f64; 3]
fn n_outputs(&self) -> usize
[src]
fn evaluate(&self, features: &Features) -> EvaluationResult<Self::Output>
[src]
fn jacobian(&self, features: &Features) -> Matrix<f64>
[src]
fn update_grad(
&mut self,
grad: &Matrix<f64>,
update: Self::Output
) -> UpdateResult<()>
[src]
&mut self,
grad: &Matrix<f64>,
update: Self::Output
) -> UpdateResult<()>
fn update(
&mut self,
features: &Features,
errors: Self::Output
) -> UpdateResult<()>
[src]
&mut self,
features: &Features,
errors: Self::Output
) -> UpdateResult<()>
impl Approximator for VectorFunction
[src]
type Output = Vector<f64>
fn n_outputs(&self) -> usize
[src]
fn evaluate(&self, features: &Features) -> EvaluationResult<Self::Output>
[src]
fn jacobian(&self, features: &Features) -> Matrix<f64>
[src]
fn update_grad(
&mut self,
grad: &Matrix<f64>,
update: Self::Output
) -> UpdateResult<()>
[src]
&mut self,
grad: &Matrix<f64>,
update: Self::Output
) -> UpdateResult<()>
fn update(
&mut self,
features: &Features,
errors: Self::Output
) -> UpdateResult<()>
[src]
&mut self,
features: &Features,
errors: Self::Output
) -> UpdateResult<()>
impl<P, E> Approximator for LFA<P, E> where
E: Approximator,
[src]
E: Approximator,
type Output = E::Output
fn n_outputs(&self) -> usize
[src]
fn evaluate(&self, features: &Features) -> EvaluationResult<Self::Output>
[src]
fn jacobian(&self, features: &Features) -> Matrix<f64>
[src]
fn update_grad(
&mut self,
grad: &Matrix<f64>,
update: Self::Output
) -> UpdateResult<()>
[src]
&mut self,
grad: &Matrix<f64>,
update: Self::Output
) -> UpdateResult<()>
fn update(
&mut self,
features: &Features,
update: Self::Output
) -> UpdateResult<()>
[src]
&mut self,
features: &Features,
update: Self::Output
) -> UpdateResult<()>
impl<P, E, T> Approximator for TransformedLFA<P, E, T> where
E: Approximator,
T: Transform<E::Output, Output = E::Output>,
T::Output: ElementwiseMul<T::Output> + IntoVector,
[src]
E: Approximator,
T: Transform<E::Output, Output = E::Output>,
T::Output: ElementwiseMul<T::Output> + IntoVector,
type Output = T::Output
fn n_outputs(&self) -> usize
[src]
fn evaluate(&self, features: &Features) -> EvaluationResult<Self::Output>
[src]
fn jacobian(&self, features: &Features) -> Matrix<f64>
[src]
fn update_grad(
&mut self,
grad: &Matrix<f64>,
update: Self::Output
) -> UpdateResult<()>
[src]
&mut self,
grad: &Matrix<f64>,
update: Self::Output
) -> UpdateResult<()>
fn update(
&mut self,
features: &Features,
update: Self::Output
) -> UpdateResult<()>
[src]
&mut self,
features: &Features,
update: Self::Output
) -> UpdateResult<()>