Actualy it is a binary classification problem. So, I used a single neuron at the final layer, so the output I got out of the model was [50x1]. This gave rise to the following error at loss calculation,
RuntimeError: Assertioncur_target >= 0 && cur_target < n_classes’ failed. at /opt/conda/conda-bld/pytorch_1503968623488/work/torch/lib/THNN/generic/ClassNLLCriterion.c:62.
Now I squeezed the output so, that it matches the labels size of 50. But, after that, I got another problem, and I changed the output to two neurons, and it worked.
Why can’t i use a single neuron at the end?