pub struct TuckerDecomposition {
pub core: Tensor,
pub factors: Vec<Matrix>,
}Expand description
Tucker decomposition result.
Represents a tensor as a core tensor multiplied by factor matrices:
X ≈ G ×_1 U^(1) ×_2 U^(2) ... ×_N U^(N)
Fields§
§core: TensorCore tensor with shape [R_1, R_2, ..., R_N].
factors: Vec<Matrix>Factor matrices, one per mode. Factor[n] is I_n × R_n.
Implementations§
Source§impl TuckerDecomposition
impl TuckerDecomposition
Sourcepub fn reconstruct(&self) -> SolverResult<Tensor>
pub fn reconstruct(&self) -> SolverResult<Tensor>
Reconstructs the full tensor from the Tucker factors.
Sourcepub fn fit_error(&self, original: &Tensor) -> SolverResult<f64>
pub fn fit_error(&self, original: &Tensor) -> SolverResult<f64>
Computes the relative fit error: ||X - X_hat|| / ||X||.
Sourcepub fn compression_ratio(&self, original_shape: &[usize]) -> f64
pub fn compression_ratio(&self, original_shape: &[usize]) -> f64
Compression ratio: original elements / decomposition elements.
Trait Implementations§
Source§impl Clone for TuckerDecomposition
impl Clone for TuckerDecomposition
Source§fn clone(&self) -> TuckerDecomposition
fn clone(&self) -> TuckerDecomposition
Returns a duplicate 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 moreAuto 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