From 68164329b97f5cd79a56372dc6cace4b038afce8 Mon Sep 17 00:00:00 2001 From: Volpeon Date: Sun, 1 Jan 2023 22:08:21 +0100 Subject: Update --- training/optimization.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'training') diff --git a/training/optimization.py b/training/optimization.py index a79944f..725599b 100644 --- a/training/optimization.py +++ b/training/optimization.py @@ -30,7 +30,7 @@ def get_one_cycle_schedule( return min_lr + progress * (1 - min_lr) lr = 0.5 * (1.0 + math.cos(math.pi * (1 + progress))) - lr = lr ** warmup_exp + lr = lr ** (warmup_exp - (warmup_exp - 1) * progress) return min_lr + lr * (1 - min_lr) if annealing == "linear": @@ -47,11 +47,11 @@ def get_one_cycle_schedule( if annealing == "half_cos": lr = 1.0 + math.cos(math.pi * (0.5 + 0.5 * progress)) - lr = lr ** annealing_exp + lr = lr ** (annealing_exp - (annealing_exp - 1) * progress) return lr lr = 0.5 * (1.0 + math.cos(math.pi * progress)) - lr = lr ** annealing_exp + lr = lr ** (annealing_exp - (annealing_exp - 1) * progress) return lr return LambdaLR(optimizer, lr_lambda, last_epoch) -- cgit v1.2.3-70-g09d2