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

Function sparse_dropout

gcn/layers.py:21–27  ·  view source on GitHub ↗

Dropout for sparse tensors.

(x, keep_prob, noise_shape)

Source from the content-addressed store, hash-verified

19
20
21def sparse_dropout(x, keep_prob, noise_shape):
22 """Dropout for sparse tensors."""
23 random_tensor = keep_prob
24 random_tensor += tf.random_uniform(noise_shape)
25 dropout_mask = tf.cast(tf.floor(random_tensor), dtype=tf.bool)
26 pre_out = tf.sparse_retain(x, dropout_mask)
27 return pre_out * (1./keep_prob)
28
29
30def dot(x, y, sparse=False):

Callers 2

_callMethod · 0.85
_callMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected