Skip to content

Commit 4c4b26b

Browse files
committed
docs: Usage
1 parent 251c5ce commit 4c4b26b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,13 @@ optimizer = AdamP(model.parameters())
4646

4747
from pytorch_optimizer import load_optimizer
4848

49-
model = YourModel()
50-
opt = load_optimizer(optimizer='adamp')
49+
optimizer = load_optimizer(optimizer='adamp')(model.parameters())
50+
51+
# if you install `bitsandbytes` optimizer, you can use `8-bit` optimizers from `pytorch-optimizer`.
52+
53+
from pytorch_optimizer import load_optimizer
54+
55+
opt = load_optimizer(optimizer='bnb_adamw8bit')
5156
optimizer = opt(model.parameters())
5257
```
5358

0 commit comments

Comments
 (0)