Trait Norm

Source
pub trait Norm {
    type Output;

    // Required methods
    fn l1_norm(&self) -> Self::Output;
    fn l2_norm(&self) -> Self::Output;
}
Expand description

The Norm trait serves as a unified interface for various normalization routnines. At the moment, the trait provides L1 and L2 techniques.

Required Associated Types§

Required Methods§

Source

fn l1_norm(&self) -> Self::Output

compute the L1 norm of the tensor or array

Source

fn l2_norm(&self) -> Self::Output

compute the L2 norm of the tensor or array

Implementors§

Source§

impl<U, V> Norm for U
where U: L1Norm<Output = V> + L2Norm<Output = V>,