tools.lossWeights
Help Info
Read in a model history json and calculate theprofile/counts loss ratio.
usage: lossWeights [-h] [--json JSON]
[--target-ratio TARGETRATIO]
[--prev-weight PREVWEIGHT]
Named Arguments
- --json
The name of the history json file
- --target-ratio
(optional) What counts loss weight do you want to have? A float from [0,∞), with 0 meaning no counts weight, 1 meaning equal weight between counts and profile. A normal setting would be 0.1. Use the output to set counts-loss-weight in your training configuration files.
Default:
0.0- --prev-weight
The counts-loss-weight you used to train your model. If provided, the printed ratios will be scaled by this number to reflect their actual contribution in your model.
Default:
1.0
Usage
This is a little utility to read in the training history json and calculate an appropriate counts loss weight parameter to get the loss balance you want. Since we only know how large the losses for profile and counts will be after we’ve trained a model, you have to use this script after training a burner model in order to find appropriate settings, then use those to re-train your model. How to use: First, pick a counts-loss-weight that sounds reasonable, like 10. Train a model. Run this script on the history json from that training, giving it a desired ratio of counts to profile loss.