In the training loop, I see the following code which I have trouble understanding:
for i in range(inputSeq.size(0)):
outVal, hidden_, hid = model.forward(outVal, hidden_,return_hiddens=True)
outVals.append(outVal)
So, first off, the variable i is used in an outer loop, so I am not sure if this has any detrimental or some side effect. I am guessing not but might be a good idea to change the variable names.
Most importantly, I was wondering the loop does not seem to go through the sequence. I was expecting that the model is going to see the sequence one point/token at a time but thatis not what seems to be happening. Could you kindly elaborate on this?
In the training loop, I see the following code which I have trouble understanding:
So, first off, the variable
i
is used in an outer loop, so I am not sure if this has any detrimental or some side effect. I am guessing not but might be a good idea to change the variable names.Most importantly, I was wondering the loop does not seem to go through the sequence. I was expecting that the model is going to see the sequence one point/token at a time but thatis not what seems to be happening. Could you kindly elaborate on this?