pub struct ImportanceGuidedEncoder { /* private fields */ }Expand description
Importance-guided spectral encoder.
Adjusts retention based on tensor importance:
- High importance tensors get more retention
- Low importance tensors can be compressed more aggressively
Implementations§
Source§impl ImportanceGuidedEncoder
impl ImportanceGuidedEncoder
Sourcepub fn new(base_retention: f32, importance_map: ImportanceMap) -> Self
pub fn new(base_retention: f32, importance_map: ImportanceMap) -> Self
Create encoder with base retention and importance map.
Sourcepub fn with_heuristics(base_retention: f32) -> Self
pub fn with_heuristics(base_retention: f32) -> Self
Create encoder with heuristic-only importance.
Sourcepub fn with_min_retention(self, min: f32) -> Self
pub fn with_min_retention(self, min: f32) -> Self
Set minimum retention.
Sourcepub fn with_max_retention(self, max: f32) -> Self
pub fn with_max_retention(self, max: f32) -> Self
Set maximum retention.
Sourcepub fn effective_retention(&self, tensor_name: &str) -> f32
pub fn effective_retention(&self, tensor_name: &str) -> f32
Calculate effective retention for a tensor based on its importance.
Sourcepub fn encode(
&self,
data: &[f32],
width: usize,
height: usize,
tensor_name: &str,
) -> Result<ImportanceCompressedWeight>
pub fn encode( &self, data: &[f32], width: usize, height: usize, tensor_name: &str, ) -> Result<ImportanceCompressedWeight>
Encode a 2D tensor with importance-guided retention.
Sourcepub fn importance_map(&self) -> &ImportanceMap
pub fn importance_map(&self) -> &ImportanceMap
Get the importance map.
Trait Implementations§
Source§impl Clone for ImportanceGuidedEncoder
impl Clone for ImportanceGuidedEncoder
Auto Trait Implementations§
impl Forget for ImportanceGuidedEncoder
impl Freeze for ImportanceGuidedEncoder
impl RefUnwindSafe for ImportanceGuidedEncoder
impl Send for ImportanceGuidedEncoder
impl Sync for ImportanceGuidedEncoder
impl Unpin for ImportanceGuidedEncoder
impl UnsafeUnpin for ImportanceGuidedEncoder
impl UnwindSafe for ImportanceGuidedEncoder
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