pub struct LinearSketch { /* private fields */ }Expand description
A representation of a linear “sketch”, or projection from a higher dimension to a lower-dimension. This struct represents both the sketching matrix itself and information about its pseudoinverse and kernel.
Implementations§
Source§impl LinearSketch
impl LinearSketch
Sourcepub fn new(
in_dimensions: usize,
out_dimensions: usize,
alpha: f32,
) -> LinearSketch
pub fn new( in_dimensions: usize, out_dimensions: usize, alpha: f32, ) -> LinearSketch
Generates a new LinearSketch with projection matrix with entries drawn
from a zero-centered normal distribution with standard deviation alpha.
Sourcepub fn trivial_sketch(dimensions: usize) -> LinearSketch
pub fn trivial_sketch(dimensions: usize) -> LinearSketch
Creates a LinearSketch which is actually just the identity matrix on the
given number of dimensions.
Sourcepub fn compress_schmear(&self, schmear: &Schmear) -> Schmear
pub fn compress_schmear(&self, schmear: &Schmear) -> Schmear
Given a Schmear, computes its image under this LinearSketch.
Sourcepub fn get_projection_matrix(&self) -> &Array2<f32>
pub fn get_projection_matrix(&self) -> &Array2<f32>
Gets the matrix representation of this LinearSketch.
Sourcepub fn get_kernel_matrix(&self) -> &Option<Array2<f32>>
pub fn get_kernel_matrix(&self) -> &Option<Array2<f32>>
Gets the kernel of the sketching matrix of this LinearSketch. See kernel.
Sourcepub fn get_expansion_matrix(&self) -> &Array2<f32>
pub fn get_expansion_matrix(&self) -> &Array2<f32>
Gets the pseudoinverse of the sketching matrix
pub fn get_output_dimension(&self) -> usize
pub fn get_input_dimension(&self) -> usize
Trait Implementations§
Source§impl Clone for LinearSketch
impl Clone for LinearSketch
Source§fn clone(&self) -> LinearSketch
fn clone(&self) -> LinearSketch
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 LinearSketch
impl RefUnwindSafe for LinearSketch
impl Send for LinearSketch
impl Sync for LinearSketch
impl Unpin for LinearSketch
impl UnwindSafe for LinearSketch
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