| 14 | |
| 15 | |
| 16 | class GConv(torch.nn.Module): |
| 17 | def __init__(self, input_dim, hidden_dim): |
| 18 | super(GConv, self).__init__() |
| 19 | self.act = torch.nn.PReLU() |
| 20 | self.bn = torch.nn.BatchNorm1d(2 * hidden_dim, momentum=0.01) |
| 21 | self.conv1 = GCNConv(input_dim, 2 * hidden_dim, cached=False) |
| 22 | self.conv2 = GCNConv(2 * hidden_dim, hidden_dim, cached=False) |
| 23 | |
| 24 | def forward(self, x, edge_index, edge_weight=None): |
| 25 | z = self.conv1(x, edge_index, edge_weight) |
| 26 | z = self.bn(z) |
| 27 | z = self.act(z) |
| 28 | z = self.conv2(z, edge_index, edge_weight) |
| 29 | return z |
| 30 | |
| 31 | |
| 32 | class Encoder(torch.nn.Module): |