[−][src]Struct lfa::LFA
Linear function approximator.
Fields
basis: B
Basis representation used to generate feature vectors.
weights: W
Weights collection.
optimiser: O
Optimisation routine used during updates.
Implementations
impl<B, W, O> LFA<B, W, O>
[src]
pub fn new(basis: B, weights: W, optimiser: O) -> Self
[src]
Construct an arbitrary LFA
using a given basis representation, initial
collection of weights and optimisation routine.
impl<B, O> LFA<B, ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>, O>
[src]
pub fn scalar(basis: B, optimiser: O) -> Self where
B: Space,
[src]
B: Space,
Construct an ScalarLFA
using a given basis representation and
optimisation routine. The weights are initialised with a vector of
zeros.
pub fn evaluate<I>(&self, input: I) -> Result<f64> where
B: Basis<I, Value = Features>,
[src]
B: Basis<I, Value = Features>,
Evaluate the function approximator for a given input
.
pub fn update<I>(&mut self, input: I, error: f64) -> Result<()> where
B: Basis<I, Value = Features>,
O: Optimiser,
[src]
B: Basis<I, Value = Features>,
O: Optimiser,
Update the function approximator for a given input
and error
.
pub fn update_with<I>(
&mut self,
input: I,
f: impl Fn(&Features, f64) -> f64
) -> Result<()> where
B: Basis<I, Value = Features>,
O: Optimiser,
[src]
&mut self,
input: I,
f: impl Fn(&Features, f64) -> f64
) -> Result<()> where
B: Basis<I, Value = Features>,
O: Optimiser,
Update the function approximator for a given input
, deferring the
error computation to a closure provided by the user.
impl<B, O> LFA<B, ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>, O>
[src]
pub fn vector(basis: B, optimiser: O, n_outputs: usize) -> Self where
B: Space,
[src]
B: Space,
Construct an VectorLFA
with a chosen number of outputs using a given
basis representation and optimisation routine. The weights are
initialised with a matrix of zeros.
pub fn n_outputs(&self) -> usize
[src]
Return the dimensionality of the output..
pub fn evaluate<I>(&self, input: I) -> Result<Array1<f64>> where
B: Basis<I, Value = Features>,
[src]
B: Basis<I, Value = Features>,
Evaluate the function approximator for a given input
.
pub fn evaluate_index<I>(&self, input: I, index: usize) -> Result<f64> where
B: Basis<I, Value = Features>,
[src]
B: Basis<I, Value = Features>,
Evaluate the i
th output of the function approximator for a given
input
.
pub fn iter<'a, I>(&'a self, input: I) -> OutputIter<'a> where
B: Basis<I, Value = Features>,
[src]
B: Basis<I, Value = Features>,
Iterate sequentially over the outputs of the function approximator for a
given input
.
Panics if the basis computation fails.
pub fn try_iter<'a, I>(&'a self, input: I) -> Result<OutputIter<'a>> where
B: Basis<I, Value = Features>,
[src]
B: Basis<I, Value = Features>,
Iterate sequentially over the outputs of the function approximator for a
given input
.
pub fn update<I, E>(&mut self, input: I, errors: E) -> Result<()> where
B: Basis<I, Value = Features>,
O: Optimiser,
E: IntoIterator<Item = f64>,
[src]
B: Basis<I, Value = Features>,
O: Optimiser,
E: IntoIterator<Item = f64>,
Update the function approximator for a given input
and error
.
pub fn update_index<I>(
&mut self,
input: I,
index: usize,
error: f64
) -> Result<()> where
B: Basis<I, Value = Features>,
O: Optimiser,
[src]
&mut self,
input: I,
index: usize,
error: f64
) -> Result<()> where
B: Basis<I, Value = Features>,
O: Optimiser,
Update the i
th output of the function approximator for a given input
and error
.
pub fn update_with<I>(
&mut self,
input: I,
f: impl Fn(&Features, Array1<f64>) -> Array1<f64>
) -> Result<()> where
B: Basis<I, Value = Features>,
O: Optimiser,
[src]
&mut self,
input: I,
f: impl Fn(&Features, Array1<f64>) -> Array1<f64>
) -> Result<()> where
B: Basis<I, Value = Features>,
O: Optimiser,
Update the function approximator for a given input
, deferring the
error computation to a closure provided by the user.
Trait Implementations
impl<B: Clone, W: Clone, O: Clone> Clone for LFA<B, W, O>
[src]
impl<B: Debug, W: Debug, O: Debug> Debug for LFA<B, W, O>
[src]
Auto Trait Implementations
impl<B, W, O> RefUnwindSafe for LFA<B, W, O> where
B: RefUnwindSafe,
O: RefUnwindSafe,
W: RefUnwindSafe,
B: RefUnwindSafe,
O: RefUnwindSafe,
W: RefUnwindSafe,
impl<B, W, O> Send for LFA<B, W, O> where
B: Send,
O: Send,
W: Send,
B: Send,
O: Send,
W: Send,
impl<B, W, O> Sync for LFA<B, W, O> where
B: Sync,
O: Sync,
W: Sync,
B: Sync,
O: Sync,
W: Sync,
impl<B, W, O> Unpin for LFA<B, W, O> where
B: Unpin,
O: Unpin,
W: Unpin,
B: Unpin,
O: Unpin,
W: Unpin,
impl<B, W, O> UnwindSafe for LFA<B, W, O> where
B: UnwindSafe,
O: UnwindSafe,
W: UnwindSafe,
B: UnwindSafe,
O: UnwindSafe,
W: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,