makeLossPlots

Help Info

Takes in a model history file (json format) and generates plots of all the components of the loss during training.

usage: makeLossPlots [-h] [--json JSON] [--output OUTPUT]
                     [--dpi DPI]
                     [--exclude EXCLUDE [EXCLUDE ...]]
                     [--start-from STARTFROM] [--verbose]
                     [--total-only]

Named Arguments

--json

The name of the json-format model history file.

--output

The name of the png-format image file that should be written.

--dpi

(optional) The resolution of the image that should be saved.

Default: 300

--exclude

(optional) Don’t include loss plots from these components of the loss. Specified as a regex, may be specified multiple times.

--start-from

(optional) Instead of starting at epoch 0, start at epoch N

Default: 0

--verbose

Display extra information as the losses are being processed.

Default: False

--total-only

(optional) Instead of plotting all the loss components, just show the total loss.

Default: False

Usage

A little utility to plot loss values during training.

bpreveal.makeLossPlots.getParser()

Generate the argument parser.

Return type:

ArgumentParser

bpreveal.makeLossPlots.reweightCountsLosses(history, lossTypes)

Add corrections for the adaptive counts loss algorithm.

Parameters:
  • history (dict) – The loss history, straight from the json.

  • lossTypes (list[list[str]]) – The losses that should be plotted.

Returns:

The weight history, and also edits history and lossTypes.

bpreveal.makeLossPlots.main()

Make the plots.

bpreveal.makeLossPlots.plotLosses(lossTypes, history, startFrom)

Given all the loss data, plot them in a grid.