pub struct GraphLRP {
pub alpha: f32,
pub beta: f32,
pub epsilon: f32,
pub activations: HashMap<String, Tensor>,
pub relevances: HashMap<String, Tensor>,
}Expand description
Layer-wise Relevance Propagation for Graph Neural Networks
Implements LRP-based explainability methods adapted for graph structures, providing node-level and edge-level importance scores.
Fields§
§alpha: f32Alpha parameter for LRP-alpha-beta rule
beta: f32Beta parameter for LRP-alpha-beta rule
epsilon: f32Epsilon parameter for numerical stability
activations: HashMap<String, Tensor>Stored activations for each layer
relevances: HashMap<String, Tensor>Stored relevance scores for each layer
Implementations§
Source§impl GraphLRP
impl GraphLRP
Sourcepub fn with_alpha_beta(alpha: f32, beta: f32) -> Self
pub fn with_alpha_beta(alpha: f32, beta: f32) -> Self
Create with custom alpha-beta parameters
Sourcepub fn store_activation(&mut self, layer_name: String, activation: Tensor)
pub fn store_activation(&mut self, layer_name: String, activation: Tensor)
Store activations from a forward pass
Sourcepub fn compute_relevance_epsilon(
&self,
input: &Tensor,
_output: &Tensor,
weight: &Tensor,
output_relevance: &Tensor,
) -> Result<Tensor, Box<dyn Error>>
pub fn compute_relevance_epsilon( &self, input: &Tensor, _output: &Tensor, weight: &Tensor, output_relevance: &Tensor, ) -> Result<Tensor, Box<dyn Error>>
Compute relevance scores using LRP-epsilon rule
Sourcepub fn compute_relevance_alpha_beta(
&self,
input: &Tensor,
weight: &Tensor,
output_relevance: &Tensor,
) -> Result<Tensor, Box<dyn Error>>
pub fn compute_relevance_alpha_beta( &self, input: &Tensor, weight: &Tensor, output_relevance: &Tensor, ) -> Result<Tensor, Box<dyn Error>>
Compute relevance scores using LRP-alpha-beta rule
Sourcepub fn compute_graph_relevance(
&self,
graph: &GraphData,
node_relevance: &Tensor,
layer_name: &str,
) -> Result<GraphRelevanceResult, Box<dyn Error>>
pub fn compute_graph_relevance( &self, graph: &GraphData, node_relevance: &Tensor, layer_name: &str, ) -> Result<GraphRelevanceResult, Box<dyn Error>>
Compute graph-aware relevance propagation considering edge structure
Sourcepub fn analyze_relevance_patterns(
&self,
_graph: &GraphData,
relevance_result: &GraphRelevanceResult,
) -> RelevanceAnalysis
pub fn analyze_relevance_patterns( &self, _graph: &GraphData, relevance_result: &GraphRelevanceResult, ) -> RelevanceAnalysis
Analyze relevance patterns across the entire graph
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GraphLRP
impl RefUnwindSafe for GraphLRP
impl Send for GraphLRP
impl Sync for GraphLRP
impl Unpin for GraphLRP
impl UnsafeUnpin for GraphLRP
impl UnwindSafe for GraphLRP
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 more