提交 fe149e5a 编写于 作者: Z zhoushiyu 提交者: Thunderbrook

fix paddlerec/ctr/dcn use_bn argument (#3933)

上级 c49db154
......@@ -10,6 +10,12 @@ from network import DCN
import utils
def boolean_string(s):
if s.lower() not in {'false', 'true'}:
raise ValueError('Not a valid boolean string')
return s.lower() == 'true'
def parse_args():
parser = argparse.ArgumentParser("dcn cluster train.")
parser.add_argument(
......@@ -62,7 +68,7 @@ def parse_args():
help='Cross net l2 regularizer coefficient')
parser.add_argument(
'--use_bn',
type=bool,
type=boolean_string,
default=True,
help='Whether use batch norm in dnn part')
parser.add_argument(
......
......@@ -4,6 +4,12 @@ global params
"""
def boolean_string(s):
if s.lower() not in {'false', 'true'}:
raise ValueError('Not a valid boolean string')
return s.lower() == 'true'
def parse_args():
parser = argparse.ArgumentParser(description="PaddleFluid DCN demo")
parser.add_argument(
......@@ -61,7 +67,7 @@ def parse_args():
help='Cross net l2 regularizer coefficient')
parser.add_argument(
'--use_bn',
type=bool,
type=boolean_string,
default=True,
help='Whether use batch norm in dnn part')
parser.add_argument(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册