ApexMixedPrecisionPlugin¶
- class pytorch_lightning.plugins.precision.ApexMixedPrecisionPlugin(amp_level='O2')[source]¶
Bases:
pytorch_lightning.plugins.precision.mixed.MixedPrecisionPlugin
Mixed Precision Plugin based on Nvidia/Apex (https://github.com/NVIDIA/apex)
- backward(model, closure_loss, optimizer, optimizer_idx, *args, **kwargs)[source]¶
Run before precision plugin executes backward.
- load_state_dict(state_dict)[source]¶
Called when loading a checkpoint, implement to reload precision plugin state given precision plugin state_dict.
- main_params(optimizer)[source]¶
The main params of the model.
Returns the plain model params here. Maybe different in other precision plugins.