提交 1889f122 编写于 作者: Y Yibing Liu

Change optimizer & default learning rate

上级 75d242f4
......@@ -49,7 +49,7 @@ def parse_args():
parser.add_argument(
'--learning_rate',
type=float,
default=0.002,
default=0.00016,
help='Learning rate used to train. (default: %(default)f)')
parser.add_argument(
'--device',
......@@ -125,8 +125,7 @@ def profile(args):
class_num=1749,
parallel=args.parallel)
optimizer = fluid.optimizer.Momentum(
learning_rate=args.learning_rate, momentum=0.9)
optimizer = fluid.optimizer.Adam(learning_rate=args.learning_rate)
optimizer.minimize(avg_cost)
place = fluid.CPUPlace() if args.device == 'CPU' else fluid.CUDAPlace(0)
......
......@@ -58,7 +58,7 @@ def parse_args():
parser.add_argument(
'--learning_rate',
type=float,
default=0.002,
default=0.00016,
help='Learning rate used to train. (default: %(default)f)')
parser.add_argument(
'--device',
......@@ -143,8 +143,7 @@ def train(args):
class_num=1749,
parallel=args.parallel)
optimizer = fluid.optimizer.Momentum(
learning_rate=args.learning_rate, momentum=0.9)
optimizer = fluid.optimizer.Adam(learning_rate=args.learning_rate)
optimizer.minimize(avg_cost)
# program for test
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册