diff options
Diffstat (limited to 'nerv/examples/lmptb/unfold_ptb_main.lua')
-rw-r--r-- | nerv/examples/lmptb/unfold_ptb_main.lua | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/nerv/examples/lmptb/unfold_ptb_main.lua b/nerv/examples/lmptb/unfold_ptb_main.lua index 5affadf..eebab2b 100644 --- a/nerv/examples/lmptb/unfold_ptb_main.lua +++ b/nerv/examples/lmptb/unfold_ptb_main.lua @@ -174,7 +174,7 @@ function propagateFile(global_conf, dagL, fn, config) local dagL_input = {} for i = 1, global_conf.bptt + 1 do - dagL_input[i] = global_conf.cumat_type(1, global_conf.batch_size) --changed to row vector, debughtx + dagL_input[i] = global_conf.cumat_type(global_conf.batch_size, 1) --changed to row vector, debughtx end dagL_input[global_conf.bptt + 2] = global_conf.cumat_type(global_conf.batch_size, global_conf.hidden_size) dagL_input[global_conf.bptt + 3] = global_conf.cumat_type(global_conf.batch_size, global_conf.vocab:size()) @@ -210,7 +210,7 @@ function propagateFile(global_conf, dagL, fn, config) global_conf.timer:toc("dagL-propagate") hidden_store[tnow] = global_conf.cumat_type(global_conf.batch_size, global_conf.hidden_size) - hidden_store[tnow]:copy_fromd(sigmoidL_ref.outputs[1]) + hidden_store[tnow]:copy_fromd(sigmoidL_ref.outputs[1][1]) if (config.do_train == true) then global_conf.timer:tic("dagL-back_propagate") @@ -280,7 +280,7 @@ if (set == "ptb") then cumat_type = nerv.CuMatrixFloat, mmat_type = nerv.MMatrixFloat, - hidden_size = 200, + hidden_size = 50, batch_size = 10, bptt = 6, --train bptt_block's words. could be set to zero max_iter = 18, @@ -291,7 +291,7 @@ if (set == "ptb") then valid_fn = valid_fn, test_fn = test_fn, sche_log_pre = "[SCHEDULER]:", - log_w_num = 100000, --give a message when log_w_num words have been processed + log_w_num = 1000, --give a message when log_w_num words have been processed timer = nerv.Timer() } global_conf.work_dir = work_dir_base.."/h"..global_conf.hidden_size.."bp"..global_conf.bptt.."slr"..global_conf.lrate --..os.date("_%bD%dH%H") --comment this for testing @@ -304,7 +304,7 @@ elseif (set == "test") then global_conf = { lrate = 0.1, wcost = 1e-6, momentum = 0, cumat_type = nerv.CuMatrixFloat, - mmat_type = nerv.CuMatrixFloat, + mmat_type = nerv.MMatrixFloat, hidden_size = 5, batch_size = 1, |