diff --git a/dssm/infer.py b/dssm/infer.py index dc5595abceae44f985ab616025c8488d46456b8c..f0c65e44a8c5f9249172f0c1912dc9c195ce69c2 100644 --- a/dssm/infer.py +++ b/dssm/infer.py @@ -1,5 +1,6 @@ import argparse import itertools +import distutils.util import reader import paddle.v2 as paddle @@ -56,12 +57,12 @@ parser.add_argument( (ModelArch.CNN_MODE, ModelArch.FC_MODE, ModelArch.RNN_MODE)) parser.add_argument( '--share_network_between_source_target', - type=bool, + type=distutils.util.strtobool, default=False, help="whether to share network parameters between source and target") parser.add_argument( '--share_embed', - type=bool, + type=distutils.util.strtobool, default=False, help="whether to share word embedding between source and target") parser.add_argument( diff --git a/dssm/train.py b/dssm/train.py index bc7685ab9632a7c34acdb2c0cacf7feec7699985..a76948774b8ffe5f80b8c6b6fdc139780b3b388e 100644 --- a/dssm/train.py +++ b/dssm/train.py @@ -1,4 +1,5 @@ import argparse +import distutils.util import paddle.v2 as paddle from network_conf import DSSM @@ -35,8 +36,8 @@ parser.add_argument( '-b', '--batch_size', type=int, - default=10, - help="size of mini-batch (default:10)") + default=32, + help="size of mini-batch (default:32)") parser.add_argument( '-p', '--num_passes', @@ -62,12 +63,12 @@ parser.add_argument( (ModelArch.CNN_MODE, ModelArch.FC_MODE, ModelArch.RNN_MODE)) parser.add_argument( '--share_network_between_source_target', - type=bool, + type=distutils.util.strtobool, default=False, help="whether to share network parameters between source and target") parser.add_argument( '--share_embed', - type=bool, + type=distutils.util.strtobool, default=False, help="whether to share word embedding between source and target") parser.add_argument( @@ -80,7 +81,7 @@ parser.add_argument( '--num_workers', type=int, default=1, help="num worker threads, default 1") parser.add_argument( '--use_gpu', - type=bool, + type=distutils.util.strtobool, default=False, help="whether to use GPU devices (default: False)") parser.add_argument(