Warmup Scheduler Pytorch
Description
A Warmup Scheduler in Pytorch to make the learning rate change at the beginning of training for warmup.
Install
Notice: need to install pytorch>=1.1.0 manually.
The official website is PyTorch
Then install as follows:
pip install warmup_scheduler_pytorch
Usage
Detail to see GitHub example.py file.
import torch
from torch.optim import SGD # example
from torch.optim.lr_scheduler import CosineAnnealingLR # example
from warmup_scheduler_pytorch import WarmUpScheduler
model = Model()
optimizer = SGD(model.parameters(), lr=0.1)
lr_scheduler = CosineAnnealingLR(optimizer, T_max=100, eta_min=0.01)
data_loader = torch.utils.data.DataLoader(...)
warmup_scheduler = WarmUpScheduler(optimizer, lr_scheduler,
len_loader=len(data_loader),
warmup_steps=100,
warmup_start_lr=0.01,
warmup_mode='linear')
epochs = 100
for epoch in range(epochs):
for batch_data in data_loader:
output = model(...)
# loss = loss_fn(output, ...)
# loss.backward()
optimizer.step()
optimizer.zero_grad()
warmup_scheduler.step()
# lr_scheduler.step() is no longer needed
Metadata
Release files for warmup-scheduler-pytorch 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| warmup_scheduler_pytorch-0.1.2.tar.gz | 5.1 kB | Without provenance | Details for warmup_scheduler_pytorch-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| warmup_scheduler_pytorch-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for warmup_scheduler_pytorch-0.1.2-py3-none-any.whl |
Total release size: 10.9 kB
Release files / warmup_scheduler_pytorch-0.1.2.tar.gz
| Download URL | warmup_scheduler_pytorch-0.1.2.tar.gz |
|---|---|
| Size | 5.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b3e67db7db952b3cb38801528a4c76107fb57143b29cf0c8e1aeef2561b1b31f
|
|
BLAKE2b-256 checksum How to use checksums |
58fe514711c5f50d8bb7324f6177eb24fb785a071abd7d986b1cd97c46930b8f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.9.7
|
Release files / warmup_scheduler_pytorch-0.1.2-py3-none-any.whl
| Download URL | warmup_scheduler_pytorch-0.1.2-py3-none-any.whl |
|---|---|
| Size | 5.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bdfb411fcd46d1da69cbc1634ac55c9292b13230600cb8ca8b7dfe1377647553
|
|
BLAKE2b-256 checksum How to use checksums |
af0a640dfb2fbddeaae89d8d7dd84307b75be7fe4dd668844c4f01a518e6cc4c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.9.7
|
Security for warmup-scheduler-pytorch 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.