https://github.com/himkt/chainer_util
https://github.com/himkt/chainer_util
Last synced: 12 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/himkt/chainer_util
- Owner: himkt
- Created: 2019-09-25T08:35:19.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-04-20T18:39:08.000Z (about 5 years ago)
- Last Synced: 2025-01-13T05:08:54.987Z (over 1 year ago)
- Language: Python
- Size: 20.5 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Chainer Util
## Retrieve the best epoch from a log
```python
from chainer_util import retrieve_best_epoch
# `output_dir` is a directory chainer.training.Trainer creates
# Note that Trainer needs to extend chainer.training.logReport
retrieve_best_epoch({"metric": "validation/main/loss"}, output_dir)
# -> (24, 0.04) (just an example)
retrieve_best_epoch({"metric": "validation/main/fscore"}, output_dir)
# -> (32, 0.87)
```
## Fix random state
```python
from chainer_util import set_seed
set_seed(42)
```