Enum rsrl::fa::Projection
source · pub enum Projection {
Dense(ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>),
Sparse(BTreeSet<usize, Global>),
}
Expand description
Projected feature vector representation.
Variants§
Dense(ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>)
Dense, floating-point activation vector.
Sparse(BTreeSet<usize, Global>)
Sparse, index-based activation vector.
Implementations§
source§impl Projection
impl Projection
sourcepub fn activity(&self) -> usize
pub fn activity(&self) -> usize
Return the maximum number of active features in the basis space.
sourcepub fn expanded(self, dim: usize) -> ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>
pub fn expanded(self, dim: usize) -> ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>
Expand the projection and convert it into a raw, dense vector.
sourcepub fn expanded_l1(
self,
dim: usize
) -> ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>
pub fn expanded_l1(
self,
dim: usize
) -> ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>
Return an expanded feature vector with L1 normalisation applied.
Trait Implementations§
source§impl Add<Projection> for Projection
impl Add<Projection> for Projection
§type Output = Projection
type Output = Projection
The resulting type after applying the
+
operator.source§fn add(self, rhs: Projection) -> Projection
fn add(self, rhs: Projection) -> Projection
Performs the
+
operation. Read moresource§impl Approximator<Projection> for ScalarFunction
impl Approximator<Projection> for ScalarFunction
type Value = f64
source§fn evaluate(&self, p: &Projection) -> Result<f64, EvaluationError>
fn evaluate(&self, p: &Projection) -> Result<f64, EvaluationError>
Evaluate the function and return its value.
source§fn update(&mut self, p: &Projection, error: f64) -> Result<(), UpdateError>
fn update(&mut self, p: &Projection, error: f64) -> Result<(), UpdateError>
Update the approximator’s estimate for the given input.
source§impl Approximator<Projection> for VectorFunction
impl Approximator<Projection> for VectorFunction
type Value = ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>
source§fn evaluate(
&self,
p: &Projection
) -> Result<ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>, EvaluationError>
fn evaluate(
&self,
p: &Projection
) -> Result<ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>, EvaluationError>
Evaluate the function and return its value.
source§impl Clone for Projection
impl Clone for Projection
source§fn clone(&self) -> Projection
fn clone(&self) -> Projection
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for Projection
impl Debug for Projection
source§impl<'de> Deserialize<'de> for Projection
impl<'de> Deserialize<'de> for Projection
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<Projection, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<Projection, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl FromIterator<f64> for Projection
impl FromIterator<f64> for Projection
source§fn from_iter<I>(iter: I) -> Projectionwhere
I: IntoIterator<Item = f64>,
fn from_iter<I>(iter: I) -> Projectionwhere
I: IntoIterator<Item = f64>,
Creates a value from an iterator. Read more
source§impl FromIterator<usize> for Projection
impl FromIterator<usize> for Projection
source§fn from_iter<I>(iter: I) -> Projectionwhere
I: IntoIterator<Item = usize>,
fn from_iter<I>(iter: I) -> Projectionwhere
I: IntoIterator<Item = usize>,
Creates a value from an iterator. Read more
source§impl Index<usize> for Projection
impl Index<usize> for Projection
source§impl PartialEq<Projection> for Projection
impl PartialEq<Projection> for Projection
source§fn eq(&self, rhs: &Projection) -> bool
fn eq(&self, rhs: &Projection) -> bool
source§impl Serialize for Projection
impl Serialize for Projection
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more