pub struct ImportanceAnalyzer { /* private fields */ }Expand description
Analyzer for computing head importance
Implementations§
Source§impl ImportanceAnalyzer
impl ImportanceAnalyzer
Sourcepub fn with_samples(self, count: usize) -> Self
pub fn with_samples(self, count: usize) -> Self
Set target number of samples
Sourcepub fn record_sample(
&mut self,
attention_weights: Vec<Vec<f32>>,
category: String,
step: u32,
)
pub fn record_sample( &mut self, attention_weights: Vec<Vec<f32>>, category: String, step: u32, )
Record an activation sample
Sourcepub fn analyze(&self, model_id: &str) -> Result<HeadAnalysis>
pub fn analyze(&self, model_id: &str) -> Result<HeadAnalysis>
Analyze collected samples and produce head importance
Auto Trait Implementations§
impl Freeze for ImportanceAnalyzer
impl RefUnwindSafe for ImportanceAnalyzer
impl Send for ImportanceAnalyzer
impl Sync for ImportanceAnalyzer
impl Unpin for ImportanceAnalyzer
impl UnsafeUnpin for ImportanceAnalyzer
impl UnwindSafe for ImportanceAnalyzer
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