Model weights apparently not being modified

Sorry, i didn’t explain myself correcly!

My data is 402 observations, each one made of 2151 features with length 1 (only one channel). I was a bit confused on how to use conv1d, so, i tried to use the input as a (402,2151) tensor and code all the NN accordingly (using an (1,n) conv. kernel), but i got the error that the kernel must be 3 dimensions at least, so i reshaped the input tensor to (402,1,2151) and the same with the labels. I wasn’t sure if that may be the issue, maybe when there is only one channel the reshape must be done differently, etc.

I tried your solution, but i get similar results, the weights are not updating with each step.

About the same, for categorical labels, i’m using a one-hot encoder with shape (402,1,102), for the 102 classes i have, but i think i read that pytorch can work with numerical categories also, is that correct?

I checked this post: Model weights not being updated

And the solution posted there, changing the losses to MSEloss and the softmax to sigmoid worked for me, by doing that, the weights update on each step, but i’m not sure (based on what you wrote), if what i’m doing is correct.