MCPcopy Create free account
hub / github.com/AnswerDotAI/ModernBERT / build_scheduler

Function build_scheduler

eval.py:119–129  ·  view source on GitHub ↗
(cfg)

Source from the content-addressed store, hash-verified

117
118
119def build_scheduler(cfg):
120 if cfg.name == "constant_with_warmup":
121 return ConstantWithWarmupScheduler(t_warmup=cfg.t_warmup)
122 elif cfg.name == "cosine_with_warmup":
123 return CosineAnnealingWithWarmupScheduler(t_warmup=cfg.t_warmup, alpha_f=cfg.alpha_f)
124 elif cfg.name == "linear_decay_with_warmup":
125 return LinearWithWarmupScheduler(t_warmup=cfg.t_warmup, alpha_f=cfg.alpha_f)
126 elif cfg.name == "warmup_stable_decay":
127 return WarmupStableDecayScheduler(t_warmup=cfg.t_warmup, alpha_f=cfg.alpha_f)
128 else:
129 raise ValueError(f"Not sure how to build scheduler: {cfg.name}")
130
131
132def build_optimizer(cfg, model):

Callers 1

run_job_workerFunction · 0.70

Calls 1

Tested by

no test coverage detected