neural-template-gen
neural-template-gen copied to clipboard
Neglogev is inf
When I run your code on my own dataset, formated as e2e dataset, the train neglogev is inf. But When I run only a snippet of the full data, the result is OK. I have debug for a long time, I can't find any solution.
My guess is this is related to the constraints: if you constrain the model to not segment a particular span which is longer than the maximum span length, you won't be able to assign any probability to that span, and you'll get something like -inf.
Yeah, I set the segment length parameter L
to be 10 which is longer than the previous one and the neglogev is normal. But at template extraction phase another question is arise. The RuntimeError is at infer.py Line 82 reporting that "The expanded size of the tensor (7) must match the existing size (10) at non-singleton dimension 0. Target sizes: [7, 15, 125]. Tensor sizes: [10, 1, 125]". It is interesting that only if the parameter L
is bigger than 4, the error is arised. Note that the segment length in my own dataset is limited 4.
Continue the above question. After I check the infer.py file and I am confused at line 71. if var jj iterates over L, we can't guarantee that the first dim of len_terms
equals to steps_back
. When I modify line 71 as
for jj in xrange(steps_back, -1, -1)
the above question disappears.
So I wonder whether var jj iterates over L or steps_back ?