关于attention-weight的计算
wutengcoding opened this issue · comments
wutengcoding commented
大佬, 请问在model.py里计算softmax的时候,为什么要先计算tf.exp(x,1)呢, tf.exp(x,1) 不就刚好是x
cenyk1230 commented
@wutengcoding 你好,你指的具体是哪行?
wutengcoding commented
@wutengcoding 你好,你指的具体是哪行?
model.py 178以及244行, tf.pow(x, 1)
cenyk1230 commented
@wutengcoding 你好,这个是历史遗留产物,确实可以去掉。当时是想尝试tf.pow(x, p), 0<p<1的情况才写了这个。
wutengcoding commented
@wutengcoding 你好,这个是历史遗留产物,确实可以去掉。当时是想尝试tf.pow(x, p), 0<p<1的情况才写了这个。
了解了. 谢谢