MCPcopy Create free account
hub / github.com/lazyprogrammer/machine_learning_examples / tensor_mul

Function tensor_mul

nlp_class2/rntn_tensorflow.py:21–30  ·  view source on GitHub ↗
(d, x1, A, x2)

Source from the content-addressed store, hash-verified

19
20
21def tensor_mul(d, x1, A, x2):
22 A = tf.reshape(A, [d, d*d])
23 # (1 x d) x (d x dd)
24 tmp = tf.matmul(x1, A)
25 # (1 x dd)
26 tmp = tf.reshape(tmp, [d, d])
27 # (d x d)
28 tmp = tf.matmul(tmp, tf.transpose(x2))
29 # (d x 1)
30 return tf.reshape(tmp, [1, d])
31
32
33def get_labels(tree):

Callers 1

get_output_recursiveMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected