From bd6d0d8b72ec656dd8fa0c13aa602f4f6e022391 Mon Sep 17 00:00:00 2001 From: Determinant Date: Fri, 9 Oct 2015 18:42:09 +0800 Subject: enable user to set direct_update in gconf; use direct_update in the example --- nerv/examples/swb_baseline.lua | 1 + nerv/layer/affine.lua | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/nerv/examples/swb_baseline.lua b/nerv/examples/swb_baseline.lua index 8015884..8f72200 100644 --- a/nerv/examples/swb_baseline.lua +++ b/nerv/examples/swb_baseline.lua @@ -2,6 +2,7 @@ require 'htk_io' gconf = {lrate = 0.8, wcost = 1e-6, momentum = 0.9, cumat_type = nerv.CuMatrixFloat, mmat_type = nerv.MMatrixFloat, + direct_update = true, frm_ext = 5, frm_trim = 5, tr_scp = "/slfs1/users/mfy43/swb_ivec/train_bp.scp", diff --git a/nerv/layer/affine.lua b/nerv/layer/affine.lua index 00cbcfb..b81b2a4 100644 --- a/nerv/layer/affine.lua +++ b/nerv/layer/affine.lua @@ -42,7 +42,7 @@ function AffineLayer:__init(id, global_conf, layer_conf) self.dim_out = layer_conf.dim_out self.gconf = global_conf self:check_dim_len(1, 1) -- exactly one input and one output - self.direct_update = layer_conf.direct_update + self.direct_update = layer_conf.direct_update or global_conf.direct_update end function AffineLayer:init(batch_size) -- cgit v1.2.3-70-g09d2