import torch.nn as nn from torch_geometric.nn import GCNConv class MyModel(nn.Module): def __init__(self): super(MyModel, self).__init__() self.conv1 = GCNConv(in_channels=16, out_channels=32) self.conv2 = GCNConv(in_channels=32, out_channels=64) def forward(self, x, edge_index): x = self.conv1(x, edge_index) x = self.conv2(x, edge_index) return x
import torch.nn as nn from torch_geometric.nn import GCNConv class MyModel(nn.Module): def __init__(self): super(MyModel, self).__init__() self.conv = GCNConv(in_channels=16, out_channels=32) def forward(self, x, edge_index): x = self.conv(x, edge_index) return xThis is a simple one-layer GCN model that takes input node features as x and edge index as edge_index. The convolutional layer has 16 input features and 32 output features. The torch_geometric.nn package is a PyTorch package that provides several neural network modules for working with graph data.