def get_lr(optimizer):
    """get learning rate from optimizer

    Args:
        optimizer (torch.optim.Optimizer): the optimizer

    Returns:
        float: the learning rate
    """
    for param_group in optimizer.param_groups:
        return param_group['lr']