MCPcopy Index your code
hub / github.com/PyGCL/PyGCL / GConv

Class GConv

examples/MVGRL_node.py:17–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15
16
17class GConv(nn.Module):
18 def __init__(self, input_dim, hidden_dim, num_layers):
19 super(GConv, self).__init__()
20 self.layers = torch.nn.ModuleList()
21 self.activation = nn.PReLU(hidden_dim)
22 for i in range(num_layers):
23 if i == 0:
24 self.layers.append(GCNConv(input_dim, hidden_dim))
25 else:
26 self.layers.append(GCNConv(hidden_dim, hidden_dim))
27
28 def forward(self, x, edge_index, edge_weight=None):
29 z = x
30 for conv in self.layers:
31 z = conv(z, edge_index, edge_weight)
32 z = self.activation(z)
33 return z
34
35
36class Encoder(torch.nn.Module):

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected