MCPcopy
hub / github.com/tkipf/gcn / __init__

Method __init__

gcn/layers.py:87–111  ·  view source on GitHub ↗
(self, input_dim, output_dim, placeholders, dropout=0., sparse_inputs=False,
                 act=tf.nn.relu, bias=False, featureless=False, **kwargs)

Source from the content-addressed store, hash-verified

85class Dense(Layer):
86 """Dense layer."""
87 def __init__(self, input_dim, output_dim, placeholders, dropout=0., sparse_inputs=False,
88 act=tf.nn.relu, bias=False, featureless=False, **kwargs):
89 super(Dense, self).__init__(**kwargs)
90
91 if dropout:
92 self.dropout = placeholders['dropout']
93 else:
94 self.dropout = 0.
95
96 self.act = act
97 self.sparse_inputs = sparse_inputs
98 self.featureless = featureless
99 self.bias = bias
100
101 # helper variable for sparse dropout
102 self.num_features_nonzero = placeholders['num_features_nonzero']
103
104 with tf.variable_scope(self.name + '_vars'):
105 self.vars['weights'] = glorot([input_dim, output_dim],
106 name='weights')
107 if self.bias:
108 self.vars['bias'] = zeros([output_dim], name='bias')
109
110 if self.logging:
111 self._log_vars()
112
113 def _call(self, inputs):
114 x = inputs

Callers

nothing calls this directly

Calls 4

glorotFunction · 0.85
zerosFunction · 0.85
_log_varsMethod · 0.80
__init__Method · 0.45

Tested by

no test coverage detected