-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix: saved `meta_dict` contains excessive data - `meta_dict` contains training and evaluation metrics objects, but it's unnecessary to save objects -- only their values are needed. - A more serious problem is with the `LR` metric, which stores a reference to the optimizer. This will result in the entire optimizer being saved in the meta-info. - Solution is two parts: 1) save only the metric values; 2) store the optimizer as a weakref. * Fix: don't close files when calling test in train - `_open_files` and `_close_files` are called at the beginning and end of `train` and `test`, to prevent holding on to an open file object for an unnecessarily long amount of time. - However, it's possible that we call `test` within `train`. For instance, calling `test` in a action triggered by the validation event. In this case, the file will be closed before training ends. - Solution is to check whether we need to open files, and if we don't, then don't open nor close them. * Fix: missing call to tracker in `_validate_loop` This is so stupid: for some reason I forgot to call `_valid_tracker.add` in `_validate_loop`, so the status is never updated during validation. * Revert c89e0e4: fix `meta_dict` issue - It turns out we must store the metric objects -- otherwise we can't even compare two metric values. - So I just changed the pickle behavior for `LR` so that it doesn't save the optimizer. Seems like a hack, but let's just leave it at this. * Fix doc building issues
- Loading branch information
Showing
4 changed files
with
41 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters