xnmt icon indicating copy to clipboard operation
xnmt copied to clipboard

Customizable logging

Open pmichel31415 opened this issue 7 years ago • 4 comments

It would be nice if one could customize the log message during training/evaluating, by e.g. providing the formatting string as an option in YAML. Ideally this would enable the user to specify

  1. Which metrics to display among a list of available and documented metrics (log likelihood, l2 regularization term, words/s vs sents/s, decimal epoch number vs percentage in current epoch...)
  2. The precision ('%.5f'/'%.1e'/...)
  3. For BLEU score the option of showing on the 0-100 scale

This would be super convenient.

pmichel31415 avatar Apr 19 '18 17:04 pmichel31415

Agree, and this would be quite easy to do:

  • make DevLossTracker and TrainLossTracker Serializable
  • pass them as arguments (with bare default values) to SimpleTrainingTask (for dev loss tracker) / to all TrainingRegimen implementations (for train loss tracker)
  • add arguments to __init__ of both loss trackers to configure them as desired

msperber avatar Apr 19 '18 17:04 msperber

@msperber I have a question regarding serialization in general:

say I so what you said (make DevLossTracker and TrainLossTracker Serializable), will this be backward compatible? As in will I be able to load models trained on eg the current master?

And more generally what kind of changes break backward compatibility?

pmichel31415 avatar Apr 20 '18 15:04 pmichel31415

It will be backward compatible as long as you specify default arguments. So basically when adding stuff, if your updated code can still parse the old model file, things should be fine. Removing or renaming arguments is more likely to break backward compatibility.

msperber avatar Apr 20 '18 15:04 msperber

That's good to know

pmichel31415 avatar Apr 20 '18 15:04 pmichel31415