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

Method __init__

gcn/layers.py:134–161  ·  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

132class GraphConvolution(Layer):
133 """Graph convolution layer."""
134 def __init__(self, input_dim, output_dim, placeholders, dropout=0.,
135 sparse_inputs=False, act=tf.nn.relu, bias=False,
136 featureless=False, **kwargs):
137 super(GraphConvolution, self).__init__(**kwargs)
138
139 if dropout:
140 self.dropout = placeholders['dropout']
141 else:
142 self.dropout = 0.
143
144 self.act = act
145 self.support = placeholders['support']
146 self.sparse_inputs = sparse_inputs
147 self.featureless = featureless
148 self.bias = bias
149
150 # helper variable for sparse dropout
151 self.num_features_nonzero = placeholders['num_features_nonzero']
152
153 with tf.variable_scope(self.name + '_vars'):
154 for i in range(len(self.support)):
155 self.vars['weights_' + str(i)] = glorot([input_dim, output_dim],
156 name='weights_' + str(i))
157 if self.bias:
158 self.vars['bias'] = zeros([output_dim], name='bias')
159
160 if self.logging:
161 self._log_vars()
162
163 def _call(self, inputs):
164 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