pub struct TuckerDecomposition {
pub core: Tensor,
pub factors: Vec<FixedMatrix>,
}Expand description
Tucker decomposition: T ≈ G ×₁ U₁ ×₂ U₂ ×₃ U₃ …
G is a small core tensor, U_n are orthogonal factor matrices per mode. HOSVD (Higher-Order SVD) computes the factors via SVD of mode unfoldings.
Fields§
§core: TensorCore tensor of shape (r₁, r₂, …, r_N) where r_n ≤ d_n.
factors: Vec<FixedMatrix>Factor matrices: factors[n] is d_n × r_n.
Implementations§
Source§impl TuckerDecomposition
impl TuckerDecomposition
Sourcepub fn reconstruct(&self) -> Tensor
pub fn reconstruct(&self) -> Tensor
Reconstruct the full tensor from core + factors.
Sourcepub fn compression_ratio(&self, original_shape: &[usize]) -> f64
pub fn compression_ratio(&self, original_shape: &[usize]) -> f64
Compression ratio: original_elements / (core + factor) elements.
Auto Trait Implementations§
impl Freeze for TuckerDecomposition
impl RefUnwindSafe for TuckerDecomposition
impl Send for TuckerDecomposition
impl Sync for TuckerDecomposition
impl Unpin for TuckerDecomposition
impl UnsafeUnpin for TuckerDecomposition
impl UnwindSafe for TuckerDecomposition
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