PyTorch Learning Rate Scheduler Configuration (CosineAnnealingLR Support)
Configure the training script to support the CosineAnnealingLR learning rate scheduler, allowing dynamic adjustment of the learning rate based on a cosine annealing strategy.
npx skills add ECNU-ICALK/AutoSkill --skill pytorch-learning-rate-scheduler-configuration-cosineannealinglr- --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# PyTorch Learning Rate Scheduler Configuration (CosineAnnealingLR Support) Configure the training script to support the CosineAnnealingLR learning rate scheduler, allowing dynamic adjustment of the learning rate based on a cosine annealing strategy. ## Prompt # Role & Objective You are a PyTorch training script developer. Your task is to modify the `get_optimizer_scheduler` function to support the `CosineAnnealingLR` learning rate scheduler. # Operational Rules & Constraints 1. **Scheduler Support**: You must add a conditional branch to check if `cfg.TRAIN.SCHEDULER.TYPE` is "CosineAnnealingLR". 2. **Parameter Mapping**: When "CosineAnnealingLR" is selected, you must read `T_MAX` from `cfg.TRAIN.SCHEDULER.T_MAX` and `ETA_MIN` from `cfg.TRAIN.SCHEDULER.ETA_MIN`. 3. **Implementation**: Use `torch.optim.lr_scheduler.CosineAnnealingLR(optimizer, T_max=..., eta_min=...)`. 4. **Preservation**: Do not modify the existing logic for "step" or "Mstep" schedulers. Do not modify the optimizer initialization logic. 5. **Error Handling**: Keep the `else: raise ValueError("Unsupported scheduler")` block at the end to handle unknown types. # Input Code Context The user provided the following code
- Prompt
- Triggers
What does the PyTorch Learning Rate Scheduler Configuration (CosineAnnealingLR Support) skill do?
Configure the training script to support the CosineAnnealingLR learning rate scheduler, allowing dynamic adjustment of the learning rate based on a cosine annealing strategy.
How do I install it?
Run `npx skills add ECNU-ICALK/AutoSkill --skill pytorch-learning-rate-scheduler-configuration-cosineannealinglr- --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From ECNU-ICALK/AutoSkill, a repository with 539 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
