I'm trying to build a LSTM/RNN which receives a variable-size sequence and returns a single class number for that sequence (it's a binary problem). Seemed trivial but for a week now i'm struggling with it.
Other topic sugested to use a Sum()/Max() as a last layer to do it. I can forward it, but i simply cannot grasp how to define a criterion for training it. For example:
nn.SequencerCriterion(nn.ClassNLLCriterion()) --> Does not work when the sequence size is larger than 1. target should have as many elements as input (WHY!?!?)
nn.SequencerCriterion(nn.MSECriterion()) --> Does not work. attempt to index local 'target' (a number value)
I did not used MaskZero/MaskZeroCriterion simply because i'm passing a single sequence each step (batchSize = 1)...
How can I solve such problem?