Skip to content

Save optimizer state, improve docs and typing

Compare
Choose a tag to compare
@lRomul lRomul released this 15 Dec 10:07
· 108 commits to master since this release

New Features

  • Add saving of optimizer state for argus.Model and checkpoint callbacks.
    model.save('models/model.pth', optimizer_state=True)
    
    checkpoint = Checkpoint(dir_path='models/', optimizer_state=True)
  • Add get_device method to argus.Model.
  • Typing and fixing most cases of mypy errors.

Fix

  • Remove torch.optim._multi_tensor optimizers from defaults (torch >= 1.7.0).

Docs

  • Section argus.engine.
  • Section argus.metrics.
  • Section argus.utils with deep conversions.
  • Add docs for decorator callbacks.
  • Add docs for argus.Model methods: __init__, set_device, get_device, get_nn_module.
  • Update examples section.
  • Proofread and improve docs. Many small docstring fixes.

Internal changes

  • Use abstract container classes from collections.abc.
  • Now Engine and State only work with the argus.Model methods as a step_method. Phase name takes from the method name.
  • Simplify default logging.

Breaking Changes

  • Change optimizer state in argus.load_model. Now change_state_dict_func takes two arguments nn_state_dict and optimizer_state_dict (example).
  • Remove handler_kwargs_dict from the attach method of argus.callbacks.Callback.