pub struct GraphormerModel { /* private fields */ }Expand description
Graphormer model: degree / spatial / edge encodings + Transformer layers.
Implementations§
Source§impl GraphormerModel
impl GraphormerModel
Sourcepub fn new(config: &GraphormerConfig) -> Self
pub fn new(config: &GraphormerConfig) -> Self
Construct a new Graphormer from configuration.
Sourcepub fn forward(
&mut self,
graph: &GraphForTransformer,
) -> Result<GraphTransformerOutput>
pub fn forward( &mut self, graph: &GraphForTransformer, ) -> Result<GraphTransformerOutput>
Run the Graphormer forward pass.
Sourcepub fn get_degree_embedding(&self, degree: usize) -> Vec<f64>
pub fn get_degree_embedding(&self, degree: usize) -> Vec<f64>
Return the degree embedding for the given degree (for testing).
Sourcepub fn get_spatial_bias(&self, spd: usize) -> f64
pub fn get_spatial_bias(&self, spd: usize) -> f64
Return the spatial bias for a given SPD bucket index (for testing).
Auto Trait Implementations§
impl Freeze for GraphormerModel
impl RefUnwindSafe for GraphormerModel
impl Send for GraphormerModel
impl Sync for GraphormerModel
impl Unpin for GraphormerModel
impl UnsafeUnpin for GraphormerModel
impl UnwindSafe for GraphormerModel
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> 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