pub struct OMPEncoder { /* private fields */ }Expand description
Orthogonal Matching Pursuit encoder
Implementations§
Source§impl OMPEncoder
impl OMPEncoder
pub fn new(config: OMPConfig) -> Self
Sourcepub fn encode(
&self,
dictionary: &Array2<Float>,
signal: &Array1<Float>,
) -> Result<OMPResult>
pub fn encode( &self, dictionary: &Array2<Float>, signal: &Array1<Float>, ) -> Result<OMPResult>
Perform OMP sparse coding
Orthogonal Matching Pursuit is a greedy algorithm for sparse approximation. It iteratively selects the dictionary atom most correlated with the residual, then updates coefficients via least squares projection.
§Arguments
dictionary- Dictionary matrix where each column is an atom (n_features × n_atoms)signal- Signal to encode (n_features)
§Returns
Sparse representation with coefficients, residual norm, and iteration count
Trait Implementations§
Source§impl Clone for OMPEncoder
impl Clone for OMPEncoder
Source§impl Debug for OMPEncoder
impl Debug for OMPEncoder
Source§impl<'de> Deserialize<'de> for OMPEncoder
impl<'de> Deserialize<'de> for OMPEncoder
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for OMPEncoder
impl RefUnwindSafe for OMPEncoder
impl Send for OMPEncoder
impl Sync for OMPEncoder
impl Unpin for OMPEncoder
impl UnsafeUnpin for OMPEncoder
impl UnwindSafe for OMPEncoder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more