textboard

A thing to make text-based training loggers


License
WTFPL
Install
pip install textboard==0.1.0

Documentation

Terminal based training progress looker atter

wat

it makes nice graphs and stuff and prints them to the terminal for you

why

  • wandb once took 5 minutes to register a run
  • tensorboard is slow and doens't find new runs automatically
  • wandb once took down a training job several hours in because the server shat itself
  • attempting to see trends by performing a running average of printed numbers in my head is surprisingly hard

how

write a template

template = """plot(loss, title="Loss", height=2) plot(score, title="Score", height=2)


text("Next letter probabilities", bold=True)
hist1d(probs[0], height=2, labels=letters) hist1d(probs[1], height=2, labels=letters) hist1d(probs[3], height=2, labels=letters)
hist1d(probs[3], height=2, labels=letters) hist1d(probs[4], height=2, labels=letters) hist1d(probs[5], height=2, labels=letters)

text("Progress", bold=True)
progress(step, total)"""
board = TextBoard(template)

then pass it things in your training loop and call print:

args = {
    'loss': loss,
    'score': score,
    'probs': probs,
    'letters': string.ascii_lowercase,
    'step': 0,
    'total': 100
}

board = TextBoard(template)
board.print(args)
for i, el in data:
    rez = model(el)
    if i % 3 == 0:
        these_args['loss'] = rez['loss']
        these_args['score'] = rez['score']
        these_args['probs'] = rez['probs']
    these_args['step'] = i
    board.print(these_args)
    time.sleep(0.5)

and it will using the magic of eval it will print stuff like

Loss                                                  Score                                                
▆▅▄▄▃▂▁                          β–β–‚β–ƒβ–„β–…β–…β–†β–‡β–‡β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‡β–‡β–† ▆▅▄▄▃▂▁                          β–β–‚β–ƒβ–„β–…β–…β–†β–‡β–‡β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‡β–‡β–†
β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‡β–†β–…β–„β–ƒβ–ƒβ–‚β–β–β–β–β–β–β–β–β–β–‚β–‚β–ƒβ–ƒβ–„β–…β–†β–‡β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‡β–†β–…β–„β–ƒβ–ƒβ–‚β–β–β–β–β–β–β–β–β–β–‚β–‚β–ƒβ–ƒβ–„β–…β–†β–‡β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ


Next letter probabilities
              β–ˆ                β–ˆ                          β–ˆ   β–ƒ    ▁ β–ƒ          
β–‡β–‚β–β–‚β–β–ƒβ–‚β–β–‚β–‚β–„β–‚β–‚β–β–ˆβ–β–‡β–β–β–„β–β–‚β–β–ƒβ–β–ƒ β–…β–ƒβ–β–ƒβ–ˆβ–‚β–β–‚β–β–…β–β–†β–β–β–‚β–ˆβ–β–‚β–‚β–‚β–‚β–‚β–‚β–β–ƒβ– β–„β–‚β–ƒβ–„β–ˆβ–β–‚β–β–ˆβ–ˆβ–β–β–„β–ˆβ–‡β–ˆβ–β–ƒβ–†β–„β–β–‚β–‚β–„β–…β–
abcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz
    β–ˆ   β–ƒ    ▁ β–ƒ             β–…               β–ˆ                   β–ˆ              
β–„β–‚β–ƒβ–„β–ˆβ–β–‚β–β–ˆβ–ˆβ–β–β–„β–ˆβ–‡β–ˆβ–β–ƒβ–†β–„β–β–‚β–‚β–„β–…β– β–β–‚β–ˆβ–β–ƒβ–…β–‚β–ƒβ–…β–β–‚β–β–‚β–β–β–β–β–…β–ˆβ–‚β–‡β–β–‡β–ƒβ–β–ƒ β–β–β–β–β–β–β–β–β–β–β–β–ˆβ–β–‚β–β–β–β–β–β–‚β–β–β–β–β–β–
abcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz

Progress
β–Šβ–Šβ–Šβ–Šβ–Šβ–Šβ–Šβ–Šβ–Šβ–Šβ–Šβ–Šβ–Šβ–Šβ–Šβ–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–•β–• 16/100

(you can see this beauty by running python -m textboard)