From 1889f12212927c8d7a4945d9308f6a367738cf5a Mon Sep 17 00:00:00 2001 From: Yibing Liu Date: Wed, 7 Mar 2018 11:50:00 +0000 Subject: [PATCH] Change optimizer & default learning rate --- fluid/DeepASR/tools/profile.py | 5 ++--- fluid/DeepASR/train.py | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/fluid/DeepASR/tools/profile.py b/fluid/DeepASR/tools/profile.py index 9d0b4769..49884844 100644 --- a/fluid/DeepASR/tools/profile.py +++ b/fluid/DeepASR/tools/profile.py @@ -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) diff --git a/fluid/DeepASR/train.py b/fluid/DeepASR/train.py index b5d2239e..1876927f 100644 --- a/fluid/DeepASR/train.py +++ b/fluid/DeepASR/train.py @@ -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 -- GitLab