MCPcopy Create free account
hub / github.com/pytorch/examples / __init__

Method __init__

gcn/main.py:33–44  ·  view source on GitHub ↗
(self, input_dim, output_dim, use_bias=False)

Source from the content-addressed store, hash-verified

31 D: The degree matrix.
32 """
33 def __init__(self, input_dim, output_dim, use_bias=False):
34 super(GraphConv, self).__init__()
35
36 # Initialize the weight matrix W (in this case called `kernel`)
37 self.kernel = nn.Parameter(torch.Tensor(input_dim, output_dim))
38 nn.init.xavier_normal_(self.kernel) # Initialize the weights using Xavier initialization
39
40 # Initialize the bias (if use_bias is True)
41 self.bias = None
42 if use_bias:
43 self.bias = nn.Parameter(torch.Tensor(output_dim))
44 nn.init.zeros_(self.bias) # Initialize the bias to zeros
45
46 def forward(self, input_tensor, adj_mat):
47 """

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected