lua---nnx
lua---nnx copied to clipboard
SoftMaxTree updateGradInput problem after unserializing a model previously serialized by calling dpnn.Serial():mediumSerial()
Using nnx.SoftmaxTree() in a model saved using the module dpnn.Serial():mediumSerial() causes gradInput table to be cleared. This is a problem because if you'd like to unserialize the model and then continue training where you left off, then the return of updateGradInput is going to be an empty table. One fix would be to modify the code block at SoftmaxTree.lua:181 to say something like,
if self.gradInput then
if #self.gradInput==0 then
self.gradInput = {self._gradInput, self._gradTarget}
end
input.nn.SoftMaxTree_updateGradInput(self, input, gradOutput, target)
end