[][src]Trait lfa::basis::Projector

pub trait Projector<I: ?Sized>: Space<Value = Projection> {
    fn project(&self, input: &I) -> Projection;

    fn project_expanded(&self, input: &I) -> DenseT { ... }
}

Trait for basis projectors.

Required methods

fn project(&self, input: &I) -> Projection

Project data from an input space onto the basis.

use lfa::basis::{Projector, Projection, fixed::Constant};

let projector = Constant::ones(2);

assert!(projector.project(&[0.0]).is_dense());
assert_eq!(
    projector.project(&[0.0]),
    Projection::from(vec![1.0, 1.0])
);
Loading content...

Provided methods

fn project_expanded(&self, input: &I) -> DenseT

Project data from an input space onto the basis and expand into a dense vector form using Projection::expanded(self.dim()).

use lfa::basis::{Projector, Projection, fixed::Indices};

let projector = Indices::new(2, vec![0, 1]);

assert!(projector.project(&[0.0]).is_sparse());
assert_eq!(
    projector.project(&[0.0]),
    Projection::from(vec![0, 1]),
);
assert_eq!(
    projector.project_expanded(&[0.0]),
    vec![1.0, 1.0].into(),
);
Loading content...

Implementors

impl Projector<[f64]> for Fourier[src]

fn project_expanded(&self, input: &I) -> DenseT[src]

impl Projector<[f64]> for Polynomial[src]

fn project_expanded(&self, input: &I) -> DenseT[src]

impl Projector<[f64]> for Chebyshev[src]

fn project_expanded(&self, input: &I) -> DenseT[src]

impl Projector<[f64]> for UniformGrid[src]

fn project_expanded(&self, input: &I) -> DenseT[src]

impl Projector<Vec<f64>> for Chebyshev where
    Chebyshev: Projector<[f64]>, 
[src]

fn project_expanded(&self, input: &I) -> DenseT[src]

impl Projector<Vec<f64>> for Fourier where
    Fourier: Projector<[f64]>, 
[src]

fn project_expanded(&self, input: &I) -> DenseT[src]

impl Projector<Vec<f64>> for Polynomial where
    Polynomial: Projector<[f64]>, 
[src]

fn project_expanded(&self, input: &I) -> DenseT[src]

impl Projector<Vec<f64>> for UniformGrid where
    UniformGrid: Projector<[f64]>, 
[src]

fn project_expanded(&self, input: &I) -> DenseT[src]

impl Projector<ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>> for Chebyshev where
    Chebyshev: Projector<[f64]>, 
[src]

fn project_expanded(&self, input: &I) -> DenseT[src]

impl Projector<ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>> for Fourier where
    Fourier: Projector<[f64]>, 
[src]

fn project_expanded(&self, input: &I) -> DenseT[src]

impl Projector<ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>> for Polynomial where
    Polynomial: Projector<[f64]>, 
[src]

fn project_expanded(&self, input: &I) -> DenseT[src]

impl Projector<ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>> for UniformGrid where
    UniformGrid: Projector<[f64]>, 
[src]

fn project_expanded(&self, input: &I) -> DenseT[src]

impl<H: BuildHasher> Projector<[f64]> for TileCoding<H>[src]

fn project_expanded(&self, input: &I) -> DenseT[src]

impl<H: BuildHasher> Projector<Vec<f64>> for TileCoding<H>[src]

fn project_expanded(&self, input: &I) -> DenseT[src]

impl<H: BuildHasher> Projector<ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>> for TileCoding<H>[src]

fn project_expanded(&self, input: &I) -> DenseT[src]

impl<I, K: Kernel<I>> Projector<I> for KernelProjector<I, K>[src]

fn project_expanded(&self, input: &I) -> DenseT[src]

impl<I: ?Sized> Projector<I> for Constant[src]

fn project_expanded(&self, input: &I) -> DenseT[src]

impl<I: ?Sized> Projector<I> for Indices[src]

fn project_expanded(&self, input: &I) -> DenseT[src]

impl<I: ?Sized, D: Distribution<f64>> Projector<I> for Random<D>[src]

fn project_expanded(&self, input: &I) -> DenseT[src]

impl<I: ?Sized, P1: Projector<I>, P2: Projector<I>> Projector<I> for Product<P1, P2>[src]

fn project_expanded(&self, input: &I) -> DenseT[src]

impl<I: ?Sized, P1: Projector<I>, P2: Projector<I>> Projector<I> for Stack<P1, P2>[src]

fn project_expanded(&self, input: &I) -> DenseT[src]

impl<I: ?Sized, P1: Projector<I>, P2: Projector<I>> Projector<I> for Sum<P1, P2>[src]

fn project_expanded(&self, input: &I) -> DenseT[src]

impl<I: ?Sized, P: Projector<I>> Projector<I> for IFDD<P>[src]

fn project_expanded(&self, input: &I) -> DenseT[src]

impl<I: ?Sized, P: Projector<I>> Projector<I> for L1Normalise<P>[src]

fn project_expanded(&self, input: &I) -> DenseT[src]

impl<I: ?Sized, P: Projector<I>> Projector<I> for L2Normalise<P>[src]

fn project_expanded(&self, input: &I) -> DenseT[src]

impl<I: ?Sized, P: Projector<I>> Projector<I> for LinfNormalise<P>[src]

fn project_expanded(&self, input: &I) -> DenseT[src]

impl<I: ?Sized, P: Projector<I>> Projector<I> for LpNormalise<P>[src]

fn project_expanded(&self, input: &I) -> DenseT[src]

impl<I: ?Sized, P: Projector<I>> Projector<I> for Negate<P>[src]

fn project_expanded(&self, input: &I) -> DenseT[src]

impl<I: ?Sized, P: Projector<I>> Projector<I> for Reciprocal<P>[src]

fn project_expanded(&self, input: &I) -> DenseT[src]

impl<I: ?Sized, P: Projector<I>> Projector<I> for Scale<P>[src]

fn project_expanded(&self, input: &I) -> DenseT[src]

impl<I: ?Sized, P: Projector<I>> Projector<I> for Shift<P>[src]

fn project_expanded(&self, input: &I) -> DenseT[src]

Loading content...