def output_func(self, input):
# P(Y|X) = softmax(W.X + b)
q, a = input[0], input[1]
# dot = T.batched_dot(q, T.batched_dot(a, self.W))
qdot = T.dot(q, self.Wq)
adot = T.dot(a, self.Wa)
dot = T.batched_dot(qdot, adot)
out = T.concatenate([dot.dimshuffle(0, 'x'), q, a], axis=1)
return out
评论列表
文章目录