MCPcopy Create free account
hub / github.com/alibaba/euler / to_sample

Method to_sample

tf_euler/python/mp_utils/base_gae.py:30–38  ·  view source on GitHub ↗
(self, inputs)

Source from the content-addressed store, hash-verified

28 self.num_negs = num_negs
29
30 def to_sample(self, inputs):
31 batch_size = tf.size(inputs)
32 src = tf.expand_dims(inputs, -1)
33 pos = tf_euler.sample_neighbor(inputs, self.edge_type,
34 self.num_negs, self.max_id + 1)[0]
35 negs = tf_euler.sample_node(batch_size * self.num_negs,
36 self.node_type)
37 negs = tf.reshape(negs, [batch_size, self.num_negs])
38 return src, pos, negs
39
40 def embed(self, n_id):
41 raise NotImplementedError

Callers 1

__call__Method · 0.95

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected