NTMC-Community / MatchZoo

Facilitating the design, comparison and sharing of deep text matching models.
Apache License 2.0
3.82k stars 898 forks source link

save model #824

Open xuezzz opened 4 years ago

xuezzz commented 4 years ago

How to save the best model of dev data,and use this model to evaluate test data ? Thanks!

faneshion commented 4 years ago

You can refer the EvaluateAllMetrics in the matchzoo/engine/callbacks to see the policy of saving models. We save the models according the params once_every.

xuezzz commented 4 years ago

So I can save models every epoch, but i can't only save the best model?

luozhouyang commented 4 years ago

tf.keras.callbacks.ModelCheckpoint has an arugument save_best_only, you can use this callback to save the best model.

ModelCheckpoint