(global_step: int)
| 770 | warmup_steps = np.ceil(0.002 * train_steps) |
| 771 | |
| 772 | def lr_lambda(global_step: int) -> float: |
| 773 | if global_step < warmup_steps: |
| 774 | return float(global_step) / float(max(1, warmup_steps)) |
| 775 | return max( |
| 776 | 0.0, |
| 777 | float(train_steps - global_step) |
| 778 | / float(max(1, train_steps - warmup_steps)), |
| 779 | ) |
| 780 | |
| 781 | scheduler = LambdaLR(optimizer=optimizer, lr_lambda=lr_lambda) |
| 782 |
nothing calls this directly
no outgoing calls
no test coverage detected