summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nerv/examples/lmptb/bilstmlm_ptb_main.lua6
-rw-r--r--nerv/examples/lmptb/lstmlm_ptb_main.lua6
2 files changed, 8 insertions, 4 deletions
diff --git a/nerv/examples/lmptb/bilstmlm_ptb_main.lua b/nerv/examples/lmptb/bilstmlm_ptb_main.lua
index 0472588..e88eea2 100644
--- a/nerv/examples/lmptb/bilstmlm_ptb_main.lua
+++ b/nerv/examples/lmptb/bilstmlm_ptb_main.lua
@@ -345,7 +345,7 @@ end
lr_half = false --can not be local, to be set by loadstring
start_iter = -1
-start_lr = global_conf.lrate
+start_lr = nil
ppl_last = 100000
commands_str = "train:test"
commands = {}
@@ -371,7 +371,9 @@ global_conf.log_fn = global_conf.work_dir .. '/log_lstm_tnn_' .. commands_str ..
global_conf.log_fn, _ = string.gsub(global_conf.log_fn, ':', '-')
commands = nerv.SUtil.parse_commands_set(commands_str)
-global_conf.lrate = start_lr --starting lr can be set by user(arg[2])
+if start_lr ~= nil then
+ global_conf.lrate = start_lr --starting lr can be set by user(arg[2])
+end
nerv.printf("%s creating work_dir(%s)...\n", global_conf.sche_log_pre, global_conf.work_dir)
nerv.LMUtil.wait(2)
diff --git a/nerv/examples/lmptb/lstmlm_ptb_main.lua b/nerv/examples/lmptb/lstmlm_ptb_main.lua
index 6e3fab9..9bdd5ff 100644
--- a/nerv/examples/lmptb/lstmlm_ptb_main.lua
+++ b/nerv/examples/lmptb/lstmlm_ptb_main.lua
@@ -333,7 +333,7 @@ end
lr_half = false --can not be local, to be set by loadstring
start_iter = -1
-start_lr = global_conf.lrate
+start_lr = nil
ppl_last = 100000
commands_str = "train:test"
commands = {}
@@ -358,7 +358,9 @@ global_conf.log_fn = global_conf.work_dir .. '/log_lstm_tnn_' .. commands_str ..
global_conf.log_fn, _ = string.gsub(global_conf.log_fn, ':', '-')
commands = nerv.SUtil.parse_commands_set(commands_str)
-global_conf.lrate = start_lr
+if start_lr ~= nil then
+ global_conf.lrate = start_lr
+end
nerv.printf("%s creating work_dir(%s)...\n", global_conf.sche_log_pre, global_conf.work_dir)
nerv.LMUtil.wait(2)