You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: GANDLF/optimizers/README.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,11 @@
4
4
5
5
- For an optimizer defined in PyTorch [[ref](https://pytorch.org/docs/stable/optim.html#algorithms)], update the `GANDLF.optimizers.wrap_torch.py` submodule.
6
6
- 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.
8
12
- 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.
9
13
- Define a new submodule under `GANDLF.optimizers` as `GANDLF.optimizers.wrap_${package_name}.py`.
10
14
- 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