pub struct ConceptActivationVector<F: Float + Debug> {
pub concept_name: String,
pub layer_name: String,
pub activation_vector: ArrayD<F>,
pub confidence: f64,
pub num_examples: usize,
}
Expand description
Concept Activation Vector for concept-based explanations
Fields§
§concept_name: String
Concept name
layer_name: String
Layer name where concept is detected
activation_vector: ArrayD<F>
Activation vector representing the concept
confidence: f64
Confidence score for concept detection
num_examples: usize
Number of examples used to derive this concept
Implementations§
Source§impl<F> ConceptActivationVector<F>
impl<F> ConceptActivationVector<F>
Sourcepub fn new(
concept_name: String,
layer_name: String,
activation_vector: ArrayD<F>,
confidence: f64,
num_examples: usize,
) -> Self
pub fn new( concept_name: String, layer_name: String, activation_vector: ArrayD<F>, confidence: f64, num_examples: usize, ) -> Self
Create a new concept activation vector
Sourcepub fn compute_activation_score(&self, layer_activations: &ArrayD<F>) -> f64
pub fn compute_activation_score(&self, layer_activations: &ArrayD<F>) -> f64
Compute concept activation score for input
Trait Implementations§
Auto Trait Implementations§
impl<F> Freeze for ConceptActivationVector<F>
impl<F> RefUnwindSafe for ConceptActivationVector<F>where
F: RefUnwindSafe,
impl<F> Send for ConceptActivationVector<F>where
F: Send,
impl<F> Sync for ConceptActivationVector<F>where
F: Sync,
impl<F> Unpin for ConceptActivationVector<F>
impl<F> UnwindSafe for ConceptActivationVector<F>where
F: RefUnwindSafe,
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> 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