lightning/pytorch_lightning/trainer
Justus Schock 0ec4107697
Optimizer closure (#4190)
* closure for all optimizers

* rename hook and take care of alternating backwards

* add comment

* training_loop_fix

* closure whenever possible

* training_loop

* simple tests that count backward calls

* fix test to work with closure

* remove debugging statement

* better place

* check grads after backward

* start fixing manual optimization

* skip step when result returned by closure was None

* fix gradient clipping test to work with closure

* attribute dict result only for automatic optimization

* adjust backward calls in accelerator

* adjust where to call gradient clipping

* adjust backward calls in tests

* Apply suggestions from code review

Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>

* pass kwargs to xla optimizer

Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>
2020-10-21 19:34:29 +01:00
..
connectors make save fx part of model checkpoint cb (#4284) 2020-10-21 10:06:42 -04:00
__init__.py notices (#4118) 2020-10-13 07:18:07 -04:00
callback_hook.py added tests for the training epoch end (#3967) 2020-10-07 22:27:36 -04:00
configuration_validator.py ref: added data connector (#3285) 2020-08-31 11:08:22 -04:00
data_loading.py ref: accelerator names (#4066) 2020-10-11 01:05:14 -04:00
evaluation_loop.py Fixes #4141 (#4169) 2020-10-15 09:12:05 -04:00
ignored_warnings.py added copyright notices (#3062) 2020-08-19 22:03:22 -04:00
logging.py Use `raise .. from ..` to explicitly chain exceptions (#3750) 2020-10-01 21:45:44 +02:00
model_hooks.py CI: add flake8 (#4239) 2020-10-19 21:20:17 +01:00
optimizers.py Use `Optional` for arguments set to `None` by default (#4164) 2020-10-15 23:02:50 +02:00
properties.py CI: add flake8 (#4239) 2020-10-19 21:20:17 +01:00
states.py Make trainer.state a read-only property (#3109) 2020-08-24 16:49:33 +02:00
supporters.py Update to_disk to use fsspec for remote file support (#3930) 2020-10-07 07:28:23 -04:00
trainer.py CI: add flake8 (#4239) 2020-10-19 21:20:17 +01:00
training_loop.py Optimizer closure (#4190) 2020-10-21 19:34:29 +01:00
training_tricks.py CI: add flake8 (#4239) 2020-10-19 21:20:17 +01:00