Skip to main content

GraphClassifier

Trait GraphClassifier 

Source
pub trait GraphClassifier {
    // Required methods
    fn forward(&self, graph: &GraphData) -> Result<Tensor, TorshError>;
    fn parameters(&self) -> Vec<Tensor>;
    fn num_classes(&self) -> usize;
}
Expand description

Graph classification model trait

Required Methods§

Source

fn forward(&self, graph: &GraphData) -> Result<Tensor, TorshError>

Forward pass for graph classification Forward pass producing graph-level logits

§Errors

Returns an error when the graph does not match the classifier’s shapes.

Source

fn parameters(&self) -> Vec<Tensor>

Get model parameters

Source

fn num_classes(&self) -> usize

Get number of output classes

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§