From 11dbb4849d9999834845809904dfc94b938f9898 Mon Sep 17 00:00:00 2001 From: mapingshuo Date: Thu, 11 Oct 2018 20:00:00 +0800 Subject: [PATCH] if use_cuda is not set, automatically set it --- .../configs/basic_config.py | 3 +++ .../train_and_evaluate.sh | 20 +++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100755 fluid/text_matching_on_quora/train_and_evaluate.sh diff --git a/fluid/text_matching_on_quora/configs/basic_config.py b/fluid/text_matching_on_quora/configs/basic_config.py index 17791f2e..c6de4093 100755 --- a/fluid/text_matching_on_quora/configs/basic_config.py +++ b/fluid/text_matching_on_quora/configs/basic_config.py @@ -32,6 +32,9 @@ class config(object): def list_config(self): print("config", self.__dict__) + def has_member(self, var_name): + return var_name in self.__dict__ + if __name__ == "__main__": basic = config() basic.list_config() diff --git a/fluid/text_matching_on_quora/train_and_evaluate.sh b/fluid/text_matching_on_quora/train_and_evaluate.sh new file mode 100755 index 00000000..bb4672ac --- /dev/null +++ b/fluid/text_matching_on_quora/train_and_evaluate.sh @@ -0,0 +1,20 @@ +source ~/mapingshuo/.bash_mapingshuo_fluid + +export CUDA_VISIBLE_DEVICES=1 + +fluid train_and_evaluate.py \ + --model_name=cdssmNet \ + --config=cdssm_base + +#fluid train_and_evaluate.py \ +# --model_name=DecAttNet \ +# --config=decatt_glove + +#fluid train_and_evaluate.py \ +# --model_name=DecAttNet \ +# --config=decatt_word + + +#fluid train_and_evaluate.py \ +# --model_name=ESIMNet \ +# --config=esim_seq -- GitLab