Merge pull request #571 from dyhuachi/dyhuachi-patch-1

[fix] Refactor get_lr function to include min_lr calculation
This commit is contained in:
jingyaogong 2025-12-09 12:59:11 +08:00 committed by GitHub
commit aa7dc0f61e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -23,7 +23,8 @@ def Logger(content):
def get_lr(current_step, total_steps, lr):
return lr / 10 + 0.5 * lr * (1 + math.cos(math.pi * current_step / total_steps))
min_lr = lr / 10
return min_lr + 0.5 * (lr - min_lr) * (1 + math.cos(math.pi * current_step / total_steps))
def init_distributed_mode():