ML utils

Some helper functions for machine learning tasks.

source

LRSchedulerPerStep

 LRSchedulerPerStep (optimizer:torch.optim.optimizer.Optimizer,
                     base_learning_rate:float=0.0001, warmup:int=4000)

Learning rate scheduler from Attention is all you need paper (https://arxiv.org/abs/1706.03762) One ajustment: Added base LR as tunable parameter rather than setting it automated based on model dimension

Type Default Details
optimizer Optimizer Optimizer to adjust learning rate for
base_learning_rate float 0.0001
warmup int 4000