def get_minimum_learning_rate(optimizer):
    """Get the smallest learning rate from a PyTorch optimizer.
    Useful for ReduceLROnPLateau stoppers. If the minimum learning rate drops below a set value, will stop training.
    """
    min_lr = 1e9
    for i, param_group in enumerate(optimizer.param_groups):
        lr = param_group['lr']
        if lr < min_lr:
            min_lr = lr
    return (min_lr)