I have a callback that computes a couple of additional metrics in on_epoch_end
for validation data and every 10 epochs for test data.
I also have a CSVLogger
callback that saves normal metrics to a log file.
Is there an easy way from my callback to add a column or two to the logs that gets properly written by CSVLogger
?
You can insert your additional metrics into the dictionary
logs
.Just remember to place this callback before
CSVLogger
in yourfit
call. Callbacks that appear later in the list would receive a modified version oflogs
. For example,Now if you take a look at the output log file, you'll see two additional columns
test_metric
andval_metric
: