pub struct NodeEmbeddings {
pub node_names: Vec<String>,
pub embeddings: Vec<Vec<f64>>,
pub dim: usize,
}Expand description
Container for node feature embeddings
Fields§
§node_names: Vec<String>Node index to name mapping (optional)
embeddings: Vec<Vec<f64>>Feature matrix (n_nodes × embedding_dim)
dim: usizeEmbedding dimensionality
Implementations§
Source§impl NodeEmbeddings
impl NodeEmbeddings
Sourcepub fn new(embeddings: Vec<Vec<f64>>) -> Result<Self>
pub fn new(embeddings: Vec<Vec<f64>>) -> Result<Self>
Create embeddings from raw feature matrix
Sourcepub fn apply_layer<L: MessagePassingLayer>(
&self,
layer: &L,
adjacency: &[(usize, usize, f64)],
) -> Result<NodeEmbeddings>
pub fn apply_layer<L: MessagePassingLayer>( &self, layer: &L, adjacency: &[(usize, usize, f64)], ) -> Result<NodeEmbeddings>
Apply a GNN layer to these embeddings
Trait Implementations§
Source§impl Clone for NodeEmbeddings
impl Clone for NodeEmbeddings
Source§fn clone(&self) -> NodeEmbeddings
fn clone(&self) -> NodeEmbeddings
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 moreAuto Trait Implementations§
impl Freeze for NodeEmbeddings
impl RefUnwindSafe for NodeEmbeddings
impl Send for NodeEmbeddings
impl Sync for NodeEmbeddings
impl Unpin for NodeEmbeddings
impl UnsafeUnpin for NodeEmbeddings
impl UnwindSafe for NodeEmbeddings
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