gammagl.models.Specformer¶
- class Specformer(nclass, n_feat, n_layer=2, hidden_dim=32, n_heads=4, tran_dropout=0.2, feat_dropout=0.4, prop_dropout=0.5, norm='none')[source]¶
The Specformer from the “Specformer:Spectral Graph Neural Networks Meet Transformers” paper
- Parameters:
nclass (int) – the number of node classes
n_feat (int) – the node feature input dimension
n_layer (int) – number of Speclayers
hidden_dim (int) – the eigvalue representation dimension and the node feature dimension
n_heads (int) – the number of attention heads
tran_dropout (int) – the probability of dropout
feat_dropout (int) – the probability of dropout
prop_dropout (float) – the probability of dropout
- forward(x, edge_index, e, u)[source]¶
Define the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.