Enum lfa::Projection [−][src]
Projected feature vector representation.
Variants
Dense(DenseT)
Dense, floating-point activation vector.
Sparse(SparseT)
Sparse, index-based activation vector.
Methods
impl Projection
[src]
impl Projection
pub fn remove(&mut self, idx: usize)
[src]
pub fn remove(&mut self, idx: usize)
Remove/set to zero one feature entry of the projection.
pub fn z(&self) -> ActivationT
[src]
pub fn z(&self) -> ActivationT
Compute the l1 normalisation constant of the projection.
pub fn activity(&self) -> usize
[src]
pub fn activity(&self) -> usize
Return the maximum number of active features in the basis space.
pub fn expanded(self, dim: usize) -> DenseT
[src]
pub fn expanded(self, dim: usize) -> DenseT
Expand and normalise a given projection, and convert into a raw, dense vector.
Trait Implementations
impl Approximator<Projection> for Simple
[src]
impl Approximator<Projection> for Simple
type Value = f64
fn evaluate(&self, p: &Projection) -> EvaluationResult<f64>
[src]
fn evaluate(&self, p: &Projection) -> EvaluationResult<f64>
Evaluate the function and return its value.
fn update(&mut self, p: &Projection, error: f64) -> UpdateResult<()>
[src]
fn update(&mut self, p: &Projection, error: f64) -> UpdateResult<()>
Update the approximator's estimate for the given input.
fn adapt(
&mut self,
new_features: &HashMap<IndexT, IndexSet>
) -> AdaptResult<usize>
[src]
fn adapt(
&mut self,
new_features: &HashMap<IndexT, IndexSet>
) -> AdaptResult<usize>
Adapt the approximator in light of newly discovered features.
impl Approximator<Projection> for Multi
[src]
impl Approximator<Projection> for Multi
type Value = Vector<f64>
fn evaluate(&self, p: &Projection) -> EvaluationResult<Vector<f64>>
[src]
fn evaluate(&self, p: &Projection) -> EvaluationResult<Vector<f64>>
Evaluate the function and return its value.
fn update(&mut self, p: &Projection, errors: Vector<f64>) -> UpdateResult<()>
[src]
fn update(&mut self, p: &Projection, errors: Vector<f64>) -> UpdateResult<()>
Update the approximator's estimate for the given input.
fn adapt(
&mut self,
new_features: &HashMap<IndexT, IndexSet>
) -> AdaptResult<usize>
[src]
fn adapt(
&mut self,
new_features: &HashMap<IndexT, IndexSet>
) -> AdaptResult<usize>
Adapt the approximator in light of newly discovered features.
impl Debug for Projection
[src]
impl Debug for Projection
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Clone for Projection
[src]
impl Clone for Projection
fn clone(&self) -> Projection
[src]
fn clone(&self) -> Projection
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl PartialEq<Projection> for Projection
[src]
impl PartialEq<Projection> for Projection
fn eq(&self, rhs: &Projection) -> bool
[src]
fn eq(&self, rhs: &Projection) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl Add<Projection> for Projection
[src]
impl Add<Projection> for Projection
type Output = Projection
The resulting type after applying the +
operator.
fn add(self, rhs: Projection) -> Projection
[src]
fn add(self, rhs: Projection) -> Projection
Performs the +
operation.
impl Index<usize> for Projection
[src]
impl Index<usize> for Projection
type Output = f64
The returned type after indexing.
fn index(&self, idx: usize) -> &f64
[src]
fn index(&self, idx: usize) -> &f64
Performs the indexing (container[index]
) operation.
impl Into<Projection> for DenseT
[src]
impl Into<Projection> for DenseT
fn into(self) -> Projection
[src]
fn into(self) -> Projection
Performs the conversion.
impl Into<Projection> for Vec<ActivationT>
[src]
impl Into<Projection> for Vec<ActivationT>
fn into(self) -> Projection
[src]
fn into(self) -> Projection
Performs the conversion.
impl FromIterator<ActivationT> for Projection
[src]
impl FromIterator<ActivationT> for Projection
fn from_iter<I: IntoIterator<Item = ActivationT>>(iter: I) -> Self
[src]
fn from_iter<I: IntoIterator<Item = ActivationT>>(iter: I) -> Self
Creates a value from an iterator. Read more
impl Into<Projection> for SparseT
[src]
impl Into<Projection> for SparseT
fn into(self) -> Projection
[src]
fn into(self) -> Projection
Performs the conversion.
impl Into<Projection> for Vec<IndexT>
[src]
impl Into<Projection> for Vec<IndexT>
fn into(self) -> Projection
[src]
fn into(self) -> Projection
Performs the conversion.
impl FromIterator<IndexT> for Projection
[src]
impl FromIterator<IndexT> for Projection
fn from_iter<I: IntoIterator<Item = IndexT>>(iter: I) -> Self
[src]
fn from_iter<I: IntoIterator<Item = IndexT>>(iter: I) -> Self
Creates a value from an iterator. Read more
Auto Trait Implementations
impl Send for Projection
impl Send for Projection
impl Sync for Projection
impl Sync for Projection