Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/clementfarabet/lua---nnx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornicholas-leonard <nick@nikopia.org>2014-06-03 20:00:37 +0400
committernicholas-leonard <nick@nikopia.org>2014-06-03 20:00:37 +0400
commitf2b1a60fad4ab4cb8c51287743837142e21aabd4 (patch)
tree0196ab342c5a69bb47e66d4e87d8e002b2fcbc5d /generic
parentccd03d9820a78bfff07068997bab77c293d263de (diff)
fixed SoftMaxTree.__init bug
Diffstat (limited to 'generic')
-rw-r--r--generic/SoftMaxTree.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/generic/SoftMaxTree.c b/generic/SoftMaxTree.c
index 497e648..0c3b257 100644
--- a/generic/SoftMaxTree.c
+++ b/generic/SoftMaxTree.c
@@ -248,6 +248,7 @@ static int nn_(SoftMaxTree_accGradParameters)(lua_State *L)
while(1)
{
long parentId, parentIdx, childIdx, nChildren;
+ double count;
/* get next Node in Tree */
THIntTensor_select(node, childParent, 0, childId);
parentId = (long)(THIntTensor_get1d(node, 0)) - 1;
@@ -269,7 +270,7 @@ static int nn_(SoftMaxTree_accGradParameters)(lua_State *L)
/* updates will contain parentId (key) sum of scales (value)*/
lua_pushinteger(L, (int)(parentId+1));
lua_gettable(L, -2);
- double count = lua_tonumber(L, -1) + scale;
+ count = lua_tonumber(L, -1) + scale;
lua_pop(L, 1);
lua_pushinteger(L, (int)(parentId+1)); /* key */