scxpand.util.train_util#
Functions
|
|
|
|
|
Get an optimizer that applies weight decay selectively. |
|
Report current score to Optuna trial and handle pruning, with duplicate prevention. |
|
Update the learning rate scheduler. |
- scxpand.util.train_util.check_early_stopping(current_score, log_manager, patience_counter, patience_limit, epoch)#
- scxpand.util.train_util.get_lr_scheduler(optimizer, lr_scheduler_params, n_epochs, train_loader, init_learning_rate)#
- Return type:
- scxpand.util.train_util.get_optimizer(model, optimizer_params)#
Get an optimizer that applies weight decay selectively.
Excludes LayerNorm weights and biases from weight decay following best practices.
- Return type:
- scxpand.util.train_util.report_to_optuna_and_handle_pruning(trial, current_score, epoch)#
Report current score to Optuna trial and handle pruning, with duplicate prevention.
This function prevents duplicate epoch reports that can occur when resuming from checkpoints, ensuring the Optuna dashboard shows accurate progress.
- scxpand.util.train_util.update_lr_scheduler(lr_scheduler, lr_scheduler_params, score)#
Update the learning rate scheduler.