MCPcopy Create free account
hub / github.com/chengsen/PyTorch_TextGCN / __init__

Method __init__

layer.py:13–22  ·  view source on GitHub ↗
(self, in_features, out_features, bias=True)

Source from the content-addressed store, hash-verified

11 """
12
13 def __init__(self, in_features, out_features, bias=True):
14 super(GraphConvolution, self).__init__()
15 self.in_features = in_features
16 self.out_features = out_features
17 self.weight = Parameter(th.FloatTensor(in_features, out_features))
18 if bias:
19 self.bias = Parameter(th.FloatTensor(out_features))
20 else:
21 self.register_parameter('bias', None)
22 self.reset_parameters()
23
24 def reset_parameters(self):
25 stdv = 1. / math.sqrt(self.weight.size(1))

Callers

nothing calls this directly

Calls 2

reset_parametersMethod · 0.95
__init__Method · 0.45

Tested by

no test coverage detected