pub struct CountSketch {
pub indices: Vec<usize>,
pub signs: Vec<f32>,
/* private fields */
}Expand description
Represents a count-sketch linear projection transformation for efficient dimensionality reduction. (See Kenneth L. Clarkson and David P. Woodruff. Low rank approximation and regression in input sparsity time. In STOC, 2013.)
Fields§
§indices: Vec<usize>§signs: Vec<f32>Implementations§
Source§impl CountSketch
impl CountSketch
Sourcepub fn new(in_dims: usize, out_dims: usize) -> CountSketch
pub fn new(in_dims: usize, out_dims: usize) -> CountSketch
Creates a CountSketch which projects from the specified in_dims to
the specified out_dims.
Sourcepub fn get_out_dimensions(&self) -> usize
pub fn get_out_dimensions(&self) -> usize
Gets the target dimension of the projection represented by this CountSketch
Sourcepub fn sketch(&self, v: ArrayView1<'_, f32>) -> Array1<f32>
pub fn sketch(&self, v: ArrayView1<'_, f32>) -> Array1<f32>
Projects the given input vector using the projection defined by this CountSketch.
Trait Implementations§
Source§impl Clone for CountSketch
impl Clone for CountSketch
Source§fn clone(&self) -> CountSketch
fn clone(&self) -> CountSketch
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 CountSketch
impl RefUnwindSafe for CountSketch
impl Send for CountSketch
impl Sync for CountSketch
impl Unpin for CountSketch
impl UnwindSafe for CountSketch
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