diff options
author | nicholas-leonard <nick@nikopia.org> | 2016-01-28 01:05:35 +0300 |
---|---|---|
committer | nicholas-leonard <nick@nikopia.org> | 2016-01-28 01:05:35 +0300 |
commit | c4dfc088376d3749825f8ee4685bae0f71ae89f9 (patch) | |
tree | b48d1dd9ed360def0b301a4ed3bc80896da2804d | |
parent | a335f9ae41c0c56251b526d7a502a03feb513e59 (diff) |
fix SoftMaxTree
-rw-r--r-- | SoftMaxTree.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/SoftMaxTree.lua b/SoftMaxTree.lua index e1bd3e1..7aa8750 100644 --- a/SoftMaxTree.lua +++ b/SoftMaxTree.lua @@ -113,8 +113,8 @@ function SoftMaxTree:__init(inputSize, hierarchy, rootId, accUpdate, static, ver treeSize, pathSize = getSize(parentId) treeSize = treeSize + nChildren pathSize = pathSize + 1 - treeSizes[parentId] = treeSize - pathSizes[parentId] = pathSize + treeSizes[nodeId] = treeSize + pathSizes[nodeId] = pathSize end return treeSize, pathSize end @@ -271,7 +271,7 @@ function SoftMaxTree:zeroGradParameters() end end -function SoftMaxTree:type(type) +function SoftMaxTree:type(type, typecache) if type == torch.type(self.weight) then return self end @@ -295,7 +295,7 @@ function SoftMaxTree:type(type) local parentIds = self.parentIds self.parentIds = nil - parent.type(self, type) + parent.type(self, type, typecache) self.hierarchy = hierarchy self.parentChildren = parentChildren |