Observed since 20 Oct, 18:46 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Slim implementation of the AdaBelief optimizer in Pytorch
This repository contains the code for the adabelief-slim Python package, from which you can use a Pytorch implementation of the AdaBelief optimizer.
Using Python 3.6 or higher:
pip install adabelief-slim
from adabelief import AdaBelief
model = ...
kwargs = ...
optimizer = AdaBelief(model.parameters(), **kwargs)
The following hyperparameters can be passed as keyword arguments:
lr: learning rate (default: 1e-3)betas: 2-tuple of coefficients used for computing the running averages of the gradient and its "variance" (see paper) (default: (0.9, 0.999))eps: term added to the denominator to improve numerical stability (default: 1e-8)weight_decay: weight decay coefficient (default: 1e-2)amsgrad: whether to use the AMSGrad variant of the algorithm (default: False)rectify: whether to use the RAdam variant of the algorithm (default: False)weight_decouple: whether to use the AdamW variant of this algorithm (default: True)Be aware that the AMSGrad and RAdam variants can't be used simultaneously.
As you're probably aware, one of the paper's main authors (Juntang Zhuang) released his code in this repository, which is used to maintain the adabelief_pytorch package. Thus, you may be wondering why this repository exists, and how it differs with his. The reason is actually pretty simple: the author made some decisions regarding his code which made it an unsuitable option for me. While it wasn't the only thing that bugged me, my main issue was with adding unnecessary packages as dependencies.
Regarding differences, the main ones are:
fixed_decay option, as the author's experiments showed it wasn't greatdegenerate_to_sgd option, as the author copied the RAdam codebase, but it seems recommended to always use itprint_change_log option1.4 should work), as I don't care for them.data property as it isn't recommended, and can be avoided with the torch.no_grad decoratorDownload counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.0.1 | 26 Feb 2021 | 1 |
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 18:46 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:710a42a42c8d5007cdb24965c90ae91048e7f91c8d49677ee54031e6f5a80f26