pub struct LayerAnalyzer { /* private fields */ }Expand description
Layer analyzer for monitoring and analyzing individual layer behavior.
Implementations§
Source§impl LayerAnalyzer
impl LayerAnalyzer
Sourcepub fn with_config(config: LayerAnalysisConfig) -> Self
pub fn with_config(config: LayerAnalysisConfig) -> Self
Create a new layer analyzer with custom configuration.
Sourcepub fn record_layer_activations(
&mut self,
layer_name: &str,
stats: LayerActivationStats,
)
pub fn record_layer_activations( &mut self, layer_name: &str, stats: LayerActivationStats, )
Record layer activation statistics.
Sourcepub fn record_layer_stats(&mut self, stats: LayerActivationStats)
pub fn record_layer_stats(&mut self, stats: LayerActivationStats)
Record layer statistics (extracts layer name and calls record_layer_activations).
Sourcepub fn get_layer_activations(
&self,
layer_name: &str,
) -> Option<&[LayerActivationStats]>
pub fn get_layer_activations( &self, layer_name: &str, ) -> Option<&[LayerActivationStats]>
Get layer activation statistics for a specific layer.
Sourcepub fn perform_layer_by_layer_analysis(&self) -> Vec<LayerAnalysis>
pub fn perform_layer_by_layer_analysis(&self) -> Vec<LayerAnalysis>
Perform comprehensive layer-by-layer analysis.
Sourcepub fn analyze_single_layer(
&self,
layer_name: &str,
current_stats: &LayerActivationStats,
stats_history: &[LayerActivationStats],
) -> LayerAnalysis
pub fn analyze_single_layer( &self, layer_name: &str, current_stats: &LayerActivationStats, stats_history: &[LayerActivationStats], ) -> LayerAnalysis
Analyze a single layer comprehensively.
Sourcepub fn calculate_layer_health_score(&self, stats: &LayerActivationStats) -> f64
pub fn calculate_layer_health_score(&self, stats: &LayerActivationStats) -> f64
Calculate layer health score.
Sourcepub fn identify_layer_issues(
&self,
current_stats: &LayerActivationStats,
stats_history: &[LayerActivationStats],
) -> Vec<String>
pub fn identify_layer_issues( &self, current_stats: &LayerActivationStats, stats_history: &[LayerActivationStats], ) -> Vec<String>
Identify issues in a layer.
Sourcepub fn generate_layer_recommendations(
&self,
issues: &[String],
layer_type: &str,
) -> Vec<String>
pub fn generate_layer_recommendations( &self, issues: &[String], layer_type: &str, ) -> Vec<String>
Generate recommendations for layer improvement.
Sourcepub fn analyze_weight_distributions(
&self,
) -> HashMap<String, WeightDistribution>
pub fn analyze_weight_distributions( &self, ) -> HashMap<String, WeightDistribution>
Analyze weight distributions for all layers.
Sourcepub fn generate_activation_heatmaps(&self) -> HashMap<String, ActivationHeatmap>
pub fn generate_activation_heatmaps(&self) -> HashMap<String, ActivationHeatmap>
Generate activation heatmaps for visualization.
Sourcepub fn generate_attention_visualizations(
&self,
) -> HashMap<String, AttentionVisualization>
pub fn generate_attention_visualizations( &self, ) -> HashMap<String, AttentionVisualization>
Generate attention visualizations for attention layers.
Analyze hidden states for representational quality.
Trait Implementations§
Source§impl Debug for LayerAnalyzer
impl Debug for LayerAnalyzer
Auto Trait Implementations§
impl Freeze for LayerAnalyzer
impl RefUnwindSafe for LayerAnalyzer
impl Send for LayerAnalyzer
impl Sync for LayerAnalyzer
impl Unpin for LayerAnalyzer
impl UnwindSafe for LayerAnalyzer
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.