Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split callbacks #849

Merged
merged 28 commits into from
Feb 23, 2020
Merged
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
bf9b67c
add .vscode in .gitignore
hadim Feb 16, 2020
579c99d
Split callbacks in individual files + add a property to Callback for…
hadim Feb 16, 2020
2558718
formatting
hadim Feb 16, 2020
df8a065
Add a conda env file for quick and easy env setup to develop on PL
hadim Feb 17, 2020
960c451
Adress comments
hadim Feb 17, 2020
0bd56b8
add fix to kth_best_model
hadim Feb 18, 2020
fc42428
add some typing to callbacks
hadim Feb 18, 2020
d22fc7e
fix typo
hadim Feb 18, 2020
72d5449
add autopep8 config to pyproject.toml
hadim Feb 18, 2020
e99e348
format again
hadim Feb 18, 2020
6fcbe84
format
hadim Feb 18, 2020
d51cdf3
fix toml
hadim Feb 18, 2020
875ff3a
fix toml again
hadim Feb 18, 2020
d67db86
consistent max line length in all config files
hadim Feb 18, 2020
4d0955b
remove conda env file
hadim Feb 19, 2020
33abad6
Update pytorch_lightning/callbacks/early_stopping.py
hadim Feb 19, 2020
6eae113
Update pytorch_lightning/callbacks/model_checkpoint.py
hadim Feb 19, 2020
9331417
docstring
hadim Feb 19, 2020
8234709
Update pytorch_lightning/callbacks/model_checkpoint.py
hadim Feb 19, 2020
5561188
Update pytorch_lightning/callbacks/model_checkpoint.py
hadim Feb 19, 2020
9931d7f
fix logic error
hadim Feb 19, 2020
2c3746e
format
hadim Feb 19, 2020
fcf3cae
simplify if/else
Borda Feb 19, 2020
b3757cf
format
hadim Feb 19, 2020
275673b
fix linting issue in changelog
hadim Feb 19, 2020
5a5d80f
edit changelog about new callback mechanism
hadim Feb 19, 2020
6b61f43
fix remaining formating issue on CHANGELOG
hadim Feb 19, 2020
2244f8c
remove lambda function because it's compatible with pickle (used duri…
hadim Feb 22, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
format
hadim committed Feb 21, 2020
commit 2c3746e89ce9cfefd93222767b0a012a5e6f6275
4 changes: 2 additions & 2 deletions pytorch_lightning/callbacks/model_checkpoint.py
Original file line number Diff line number Diff line change
@@ -176,7 +176,7 @@ def _do_check_save(self, filepath, current, epoch):
# monitor dict has reached k elements
_op = max if self.mode == 'min' else min
self.kth_best_model = _op(self.best_k_models,
key=self.best_k_models.get)
key=self.best_k_models.get)
self.kth_value = self.best_k_models[self.kth_best_model]

_op = min if self.mode == 'min' else max
@@ -187,4 +187,4 @@ def _do_check_save(self, filepath, current, epoch):
f'\nEpoch {epoch:05d}: {self.monitor} reached'
f' {current:0.5f} (best {self.best:0.5f}), saving model to'
f' {filepath} as top {self.save_top_k}')
self._save_model(filepath)
self._save_model(filepath)