(current_step)
| 953 | min_lr_multiplier: float = 0.01 |
| 954 | ): |
| 955 | def lr_lambda(current_step): |
| 956 | if current_step < num_warmup_steps: |
| 957 | return float(current_step) / float(max(1, num_warmup_steps)) |
| 958 | progress = float(current_step - num_warmup_steps) / float( |
| 959 | max(1, num_training_steps - num_warmup_steps) |
| 960 | ) |
| 961 | return max( |
| 962 | min_lr_multiplier, 0.5 * (1.0 + math.cos(math.pi * float(num_cycles) * 2.0 * progress)) |
| 963 | ) |
| 964 | |
| 965 | return LambdaLR(optimizer, lr_lambda, last_epoch) |
| 966 |
nothing calls this directly
no outgoing calls
no test coverage detected