将log(p(T))改为log(p(S/T)),就是让问句和同义句尽可能相似吧,不过收敛困难,效果也比较一般,哭

This commit is contained in:
yongzhuo 2019-04-21 22:00:00 +08:00 committed by GitHub
parent e07a4d8981
commit b671ec8592
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -82,12 +82,20 @@ def train_and_dev(params):
x, xl, y, yl = next(flow)
x = np.flip(x, axis=1)
add_loss = model.train(sess,
dummy_encoder_inputs,
dummy_encoder_inputs_lengths,
y, yl, loss_only=True)
# add_loss = model.train(sess,
# dummy_encoder_inputs,
# dummy_encoder_inputs_lengths,
# y, yl, loss_only=True)
add_loss *= -0.5
# add_loss *= -0.5
loss_aq = model.train(sess,
y, yl,
x, xl,
loss_only=True)
add_loss = 0.1 * loss_aq
cost, lr = model.train(sess, x, xl, y, yl,
return_lr=True, add_loss=add_loss)