Skip to content

Commit d5c3e84

Browse files
authored
Update GANDLF/optimizers/README.md
1 parent 7ed6649 commit d5c3e84

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

GANDLF/optimizers/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44

55
- For an optimizer defined in PyTorch [[ref](https://pytorch.org/docs/stable/optim.html#algorithms)], update the `GANDLF.optimizers.wrap_torch.py` submodule.
66
- For a custom optimizer, create a new submodule called `GANDLF.optimizers.${awesome_optimizer}.py`.
7-
- For a third-party optimizer (where the code is available from an external repository), add the relevant code under the `GANDLF.optimizers.thirdparty` submodule.
7+
- For a third-party optimizer (i.e., where the code is available from an external source/repository):
8+
- Add the relevant code under the `GANDLF.optimizers.thirdparty` submodule.
9+
- Add a wrapper which takes in GaNDLF's `parameter` dictionary as input and creates a `torch.optim.Optimizer` object as output.
10+
- Add the wrapper to the `GANDLF.optimizers.thirdparty.__init__.py` so that it can be called from `GANDLF.optimizers.__init__.py`.
11+
- See `GANDLF.optimizers.thirdparty.adopy.py` as an example.
812
- If a new dependency needs to be used, update GaNDLF's [`setup.py`](https://github.com/mlcommons/GaNDLF/blob/master/setup.py) with the new requirement.
913
- Define a new submodule under `GANDLF.optimizers` as `GANDLF.optimizers.wrap_${package_name}.py`.
1014
- Ensure that the new algorithm is wrapped in a function which returns an object with the PyTorch optimizer type. Use any of the optimizers in `GANDLF.optimizers.wrap_torch.py` as an example.

0 commit comments

Comments
 (0)