PyTorch + Skorch: Make the TensorBoard callbakc keep track on manual scores defined by `EpochScoring`

90 Views Asked by At

I am using Skorch.

I created a new score logging using the EpochScoring callback.
While it appears on the history log, It doesn't show on TensorBoard (I am using the TensorBoard callback).

Is there a way to make the TensorBoard logger be aware of that key?

I know I can do a manual callback, but I wonder if there's a simple way to get the logger save an existing key from history.

1

There are 1 best solutions below

2
nemo On

It is possible that the call order matters in this case. Since both callbacks are doing their work on the end of the epoch the TensorBoard callback only has access to those keys in the history that were written at time of execution.

Your callback list for the net should therefore look like this:

net = NeuralNet(
   ...,
   callbacks=[
       EpochScoring(...),
       TensorBoard(...),
   ],
)

If it was the other way around the new score would not be written.