pub struct SelfSupervisedAutoencoder<T: FloatBounds + ScalarOperand> { /* private fields */ }Expand description
Autoencoder for Self-Supervised Representation Learning
Implements simple autoencoder architecture for unsupervised feature learning.
Implementations§
Source§impl<T: FloatBounds + ScalarOperand + Debug> SelfSupervisedAutoencoder<T>
impl<T: FloatBounds + ScalarOperand + Debug> SelfSupervisedAutoencoder<T>
Sourcepub fn new(
input_dim: usize,
hidden_dims: Vec<usize>,
config: AutoencoderConfig<T>,
) -> Result<Self, SklearsError>
pub fn new( input_dim: usize, hidden_dims: Vec<usize>, config: AutoencoderConfig<T>, ) -> Result<Self, SklearsError>
Create a new self-supervised autoencoder
Sourcepub fn encode(&mut self, input: &Array2<T>) -> Result<Array2<T>, SklearsError>
pub fn encode(&mut self, input: &Array2<T>) -> Result<Array2<T>, SklearsError>
Encode input to latent representation
Sourcepub fn decode(&mut self, latent: &Array2<T>) -> Result<Array2<T>, SklearsError>
pub fn decode(&mut self, latent: &Array2<T>) -> Result<Array2<T>, SklearsError>
Decode latent representation to output
Sourcepub fn forward(&mut self, input: &Array2<T>) -> Result<Array2<T>, SklearsError>
pub fn forward(&mut self, input: &Array2<T>) -> Result<Array2<T>, SklearsError>
Forward pass through autoencoder
Sourcepub fn reconstruction_loss(
&self,
input: &Array2<T>,
output: &Array2<T>,
) -> Result<T, SklearsError>
pub fn reconstruction_loss( &self, input: &Array2<T>, output: &Array2<T>, ) -> Result<T, SklearsError>
Compute reconstruction loss
Sourcepub fn sparsity_penalty(&self, latent: &Array2<T>) -> Result<T, SklearsError>
pub fn sparsity_penalty(&self, latent: &Array2<T>) -> Result<T, SklearsError>
Compute sparsity penalty
Trait Implementations§
Source§impl<T: Clone + FloatBounds + ScalarOperand> Clone for SelfSupervisedAutoencoder<T>
impl<T: Clone + FloatBounds + ScalarOperand> Clone for SelfSupervisedAutoencoder<T>
Source§fn clone(&self) -> SelfSupervisedAutoencoder<T>
fn clone(&self) -> SelfSupervisedAutoencoder<T>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Debug + FloatBounds + ScalarOperand> Debug for SelfSupervisedAutoencoder<T>
impl<T: Debug + FloatBounds + ScalarOperand> Debug for SelfSupervisedAutoencoder<T>
Auto Trait Implementations§
impl<T> Freeze for SelfSupervisedAutoencoder<T>where
T: Freeze,
impl<T> RefUnwindSafe for SelfSupervisedAutoencoder<T>where
T: RefUnwindSafe,
impl<T> Send for SelfSupervisedAutoencoder<T>
impl<T> Sync for SelfSupervisedAutoencoder<T>
impl<T> Unpin for SelfSupervisedAutoencoder<T>where
T: Unpin,
impl<T> UnsafeUnpin for SelfSupervisedAutoencoder<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for SelfSupervisedAutoencoder<T>where
T: UnwindSafe + RefUnwindSafe,
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,
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