summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortxh18 <[email protected]>2015-12-06 21:36:43 +0800
committertxh18 <[email protected]>2015-12-06 21:36:43 +0800
commit5e3f5996f053debe048e30e71d155e68bf6598b5 (patch)
tree64ec6268751aee6fd152e4f7864383fb214be019
parent27cf4ef1965ec900bb15b32c2b8de65a65c0cd8b (diff)
lm script change:user can set start_lr
-rw-r--r--nerv/examples/lmptb/bilstmlm_ptb_main.lua4
-rw-r--r--nerv/examples/lmptb/lstmlm_ptb_main.lua3
2 files changed, 7 insertions, 0 deletions
diff --git a/nerv/examples/lmptb/bilstmlm_ptb_main.lua b/nerv/examples/lmptb/bilstmlm_ptb_main.lua
index 2aba1d2..078d036 100644
--- a/nerv/examples/lmptb/bilstmlm_ptb_main.lua
+++ b/nerv/examples/lmptb/bilstmlm_ptb_main.lua
@@ -348,6 +348,7 @@ end
lr_half = false --can not be local, to be set by loadstring
start_iter = -1
+start_lr = global_conf.lrate
ppl_last = 100000
commands_str = "train:test"
commands = {}
@@ -372,6 +373,9 @@ global_conf.dropout_list = nerv.SUtil.parse_schedule(global_conf.dropout_str)
global_conf.log_fn = global_conf.work_dir .. '/log_lstm_tnn_' .. commands_str ..os.date("_TT%m_%d_%X",os.time())
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])
+
nerv.printf("%s creating work_dir(%s)...\n", global_conf.sche_log_pre, global_conf.work_dir)
nerv.LMUtil.wait(2)
os.execute("mkdir -p "..global_conf.work_dir)
diff --git a/nerv/examples/lmptb/lstmlm_ptb_main.lua b/nerv/examples/lmptb/lstmlm_ptb_main.lua
index 804438d..b76fab8 100644
--- a/nerv/examples/lmptb/lstmlm_ptb_main.lua
+++ b/nerv/examples/lmptb/lstmlm_ptb_main.lua
@@ -333,6 +333,7 @@ end
lr_half = false --can not be local, to be set by loadstring
start_iter = -1
+start_lr = global_conf.lrate
ppl_last = 100000
commands_str = "train:test"
commands = {}
@@ -357,6 +358,8 @@ 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
+
nerv.printf("%s creating work_dir(%s)...\n", global_conf.sche_log_pre, global_conf.work_dir)
nerv.LMUtil.wait(2)
os.execute("mkdir -p "..global_conf.work_dir)