FluxTraining.jl icon indicating copy to clipboard operation
FluxTraining.jl copied to clipboard

Improve printing during training

Open KronosTheLate opened this issue 2 years ago • 3 comments

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 │
└─────────────────┴───────┴─────────┴──────────┘

KronosTheLate avatar Jun 17 '22 14:06 KronosTheLate

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

lorenzoh avatar Jun 17 '22 14:06 lorenzoh

But it is possible to make the epoch an Int to print prettier?

KronosTheLate avatar Aug 04 '23 12:08 KronosTheLate

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!

lorenzoh avatar Aug 05 '23 07:08 lorenzoh