skorch-dev/skorch

Can History be more powerful?

Open

#804 opened on Sep 28, 2021

 (7 comments) (0 reactions) (0 assignees)Jupyter Notebook (414 forks)auto 404
enhancementgood first issue

Repository metrics

Stars
 (6,171 stars)
PR merge metrics
 (PR metrics pending)

Description

The current History class has some limitations: (ver 0.10.0)

  1. Currently the history is saved as JSON, as a result, those recorded values are limited to simple numbers and strings. Other objects can not be saved in history files directly.
  2. Saving as JSON takes lots of time and space because numbers are stored in decimal. It's getting worse when the training epoch is increasing.
  3. In some cases, additional contents (e.g. best_loss, ...) need to be saved. But because History is a list, these contents that do not belong to any epoch are unable to be saved in History directly.

According to the above-mentioned limitations, maybe it is better for History to be saved as binary files (In my computer I've modified history.py and changed all json to pickle and it works pretty well). Besides, adding a dict into History class (like attrs dict in pandas.DataFrame) so that additional contents can be easily saved.

Contributor guide