HsiaoYetGun / ESIM

TensorFlow implementation of the ESIM model (Enhanced LTSM for natural language inference)
77 stars 27 forks source link

ESIM中Attention问题 #10

Open showintime opened 4 years ago

showintime commented 4 years ago

https://github.com/HsiaoYetGun/ESIM/blob/master/Model.py#L169

attentionSoft_b = tf.nn.softmax(tf.transpose(attentionWeights))

这里对attentionWeights进行transpose后,生成的张量的形状为 ( seq_length, seq_length, batch_size ) 然后在对上一步的结果进行softmax,tf.nn.softmax默认在最后一个维度作softmax, 那岂不是在batch上作softmax ?求相互指教。