将log(p(T))改为log(p(S/T)),就是让问句和同义句尽可能相似吧,不过收敛困难,效果也比较一般,哭
This commit is contained in:
parent
e07a4d8981
commit
b671ec8592
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user