FluxTraining.jl
FluxTraining.jl copied to clipboard
Improve printing during training
With the single metric accuracy
, the output-tables (which I love) look like this:
Epoch 11 TrainingPhase(): 100%|███████████████████████████████████████████| Time: 0:00:00
┌───────────────┬───────┬─────────┬──────────┐
│ Phase │ Epoch │ Loss │ Accuracy │
├───────────────┼───────┼─────────┼──────────┤
│ TrainingPhase │ 11.0 │ 0.25969 │ 0.92827 │
└───────────────┴───────┴─────────┴──────────┘
┌─────────────────┬───────┬─────────┬──────────┐
│ Phase │ Epoch │ Loss │ Accuracy │
├─────────────────┼───────┼─────────┼──────────┤
│ ValidationPhase │ 11.0 │ 0.26323 │ 0.92731 │
└─────────────────┴───────┴─────────┴──────────┘
I suggest putting them into the same table, and making the Epoch
vector of element type Int64, to make it look like this:
Epoch 11 TrainingPhase(): 100%|███████████████████████████████████████████| Time: 0:00:00
┌────────--───────┬───────┬─────────┬──────────┐
│ Phase │ Epoch │ Loss │ Accuracy │
├──────────--─────┼───────┼─────────┼──────────┤
│ TrainingPhase │ 11 │ 0.25969 │ 0.92827 │
│ ValidationPhase │ 11 │ 0.26323 │ 0.92731 │
└─────────────────┴───────┴─────────┴──────────┘
The epoch number should definitely be rounded, but unfortunately combining both tables is not possible, since they are created individually at the end of each phase. There would be a progress bar in between for the validation phase if it took a little longer
But it is possible to make the epoch an Int to print prettier?
Yes, that should be a simple change in the call to PrettyTables.jl. To same some space, the top and bottom borders of the table could also be removed. Feel free to open a PR!