提交 592bd60f 编写于 作者: W WenmuZhou

switch learning_rate and lr

上级 d9e921c7
...@@ -29,7 +29,7 @@ def build_lr_scheduler(lr_config, epochs, step_each_epoch): ...@@ -29,7 +29,7 @@ def build_lr_scheduler(lr_config, epochs, step_each_epoch):
lr_name = lr_config.pop('name') lr_name = lr_config.pop('name')
lr = getattr(learning_rate, lr_name)(**lr_config)() lr = getattr(learning_rate, lr_name)(**lr_config)()
else: else:
lr = lr_config['lr'] lr = lr_config['learning_rate']
return lr return lr
...@@ -37,8 +37,7 @@ def build_optimizer(config, epochs, step_each_epoch, parameters): ...@@ -37,8 +37,7 @@ def build_optimizer(config, epochs, step_each_epoch, parameters):
from . import regularizer, optimizer from . import regularizer, optimizer
config = copy.deepcopy(config) config = copy.deepcopy(config)
# step1 build lr # step1 build lr
lr = build_lr_scheduler( lr = build_lr_scheduler(config.pop('lr'), epochs, step_each_epoch)
config.pop('learning_rate'), epochs, step_each_epoch)
# step2 build regularization # step2 build regularization
if 'regularizer' in config and config['regularizer'] is not None: if 'regularizer' in config and config['regularizer'] is not None:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册