pub struct HgnnLayer { /* private fields */ }Expand description
A single HGNN convolution layer.
Stores the learnable weight matrix Θ of shape [in_dim × out_dim].
Optionally stores attention weight vectors when use_attention = true.
Implementations§
Source§impl HgnnLayer
impl HgnnLayer
Sourcepub fn new(config: HgnnLayerConfig, seed: u64) -> Self
pub fn new(config: HgnnLayerConfig, seed: u64) -> Self
Create a new HGNN layer with Xavier-uniform initialised weights.
§Arguments
config– layer configurationseed– RNG seed for reproducible weight initialisation
Sourcepub fn forward(
&self,
incidence: &Array2<f64>,
node_feats: &Array2<f64>,
edge_weights: Option<&Array1<f64>>,
) -> Result<Array2<f64>>
pub fn forward( &self, incidence: &Array2<f64>, node_feats: &Array2<f64>, edge_weights: Option<&Array1<f64>>, ) -> Result<Array2<f64>>
Forward pass: X' = Ã X Θ
à = D_v^{-1/2} H diag(w / D_e) H^T D_v^{-1/2}
§Arguments
incidence– incidence matrix H of shape[n_nodes × n_edges]node_feats– node feature matrix X of shape[n_nodes × in_dim]edge_weights– per-hyperedge weight vector (length = n_edges); ifNone, all weights default to 1.0
§Returns
Node feature matrix of shape [n_nodes × out_dim]
Auto Trait Implementations§
impl Freeze for HgnnLayer
impl RefUnwindSafe for HgnnLayer
impl Send for HgnnLayer
impl Sync for HgnnLayer
impl Unpin for HgnnLayer
impl UnsafeUnpin for HgnnLayer
impl UnwindSafe for HgnnLayer
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> 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 more