FluxML / FluxTraining.jl

A flexible neural net training library inspired by fast.ai
https://fluxml.ai/FluxTraining.jl
MIT License
117 stars 25 forks source link

Improve printing during training #125

Open KronosTheLate opened 2 years ago

KronosTheLate commented 2 years ago

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 │
└─────────────────┴───────┴─────────┴──────────┘
lorenzoh commented 2 years ago

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

KronosTheLate commented 1 year ago

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

lorenzoh commented 1 year ago

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!