pub struct FeatureFusion { /* private fields */ }Expand description
Feature fusion module
Combines GNN embeddings, min-cut features, and boundary features into a unified representation for error prediction.
Implementations§
Source§impl FeatureFusion
impl FeatureFusion
Sourcepub fn new(config: FusionConfig) -> Result<Self>
pub fn new(config: FusionConfig) -> Result<Self>
Create a new feature fusion module
Sourcepub fn fuse_simple(
&self,
gnn_features: &Array2<f32>,
mincut_features: &Array2<f32>,
) -> Result<Array2<f32>>
pub fn fuse_simple( &self, gnn_features: &Array2<f32>, mincut_features: &Array2<f32>, ) -> Result<Array2<f32>>
Sourcepub fn fuse(
&self,
gnn_features: &Array2<f32>,
mincut_features: &Array2<f32>,
boundary_features: &Array2<f32>,
confidences: Option<&[f32]>,
) -> Result<Array2<f32>>
pub fn fuse( &self, gnn_features: &Array2<f32>, mincut_features: &Array2<f32>, boundary_features: &Array2<f32>, confidences: Option<&[f32]>, ) -> Result<Array2<f32>>
Fuse features from multiple sources
§Arguments
gnn_features- GNN embeddings (num_nodes, gnn_dim)mincut_features- MinCut features (num_nodes, mincut_dim)boundary_features- Boundary features (num_nodes, 8)confidences- Optional confidence scores for adaptive weighting
§Returns
Fused features (num_nodes, output_dim)
Sourcepub fn fuse_all(
&self,
gnn_embeddings: &Array2<f32>,
adjacency: &HashMap<usize, Vec<usize>>,
edge_weights: &HashMap<(usize, usize), f32>,
positions: &[(f32, f32)],
grid_size: usize,
) -> Result<Array2<f32>>
pub fn fuse_all( &self, gnn_embeddings: &Array2<f32>, adjacency: &HashMap<usize, Vec<usize>>, edge_weights: &HashMap<(usize, usize), f32>, positions: &[(f32, f32)], grid_size: usize, ) -> Result<Array2<f32>>
Convenience method to compute all features and fuse them
§Arguments
gnn_embeddings- GNN node embeddingsadjacency- Graph adjacency listedge_weights- Edge weights for min-cutpositions- Node positionsgrid_size- Grid size for boundary computation
Sourcepub fn config(&self) -> &FusionConfig
pub fn config(&self) -> &FusionConfig
Get configuration
Sourcepub fn output_dim(&self) -> usize
pub fn output_dim(&self) -> usize
Get output dimension
Trait Implementations§
Source§impl Clone for FeatureFusion
impl Clone for FeatureFusion
Source§fn clone(&self) -> FeatureFusion
fn clone(&self) -> FeatureFusion
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FeatureFusion
impl Debug for FeatureFusion
Source§impl<'de> Deserialize<'de> for FeatureFusion
impl<'de> Deserialize<'de> for FeatureFusion
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for FeatureFusion
impl RefUnwindSafe for FeatureFusion
impl Send for FeatureFusion
impl Sync for FeatureFusion
impl Unpin for FeatureFusion
impl UnwindSafe for FeatureFusion
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