def get_lr(optimizer):
    """From: https://stackoverflow.com/questions/52660985/pytorch-how-to-get-learning-rate-during-training
    :param optimizer: torch.optim.
    :return param_group['lr']: A floating point of learning rate in optimizer.
    """
    for param_group in optimizer.param_groups:
        return param_group['lr']