method = train_config.learning_rate_decay_method
if not method or method == "none":
return train_config.initial_learning_rate
if method not in LEARNING_RATE_DECAY_METHODS:
raise ValueError("Invalid learning_rate method "{}"".format(method))
After Change
Raises:
ValueError: When the method used is not available.
lr_config = train_config.learning_rate.copy()
decay_method = lr_config.pop("decay_method", None)
if not decay_method or decay_method == "none":
return lr_config.get("value") or lr_config.get("learning_rate")