Hi Josep!



 titoniubo:

Let’s say I have a classification problem, for which I have 20 numerical variables (500 raws each) and 1 label with 5 possible classes. I understand the output size is 5.
However, I do not know what is the input class, is it 1*20= 20?


Yes, this is correct – with the proviso that pytorch models expect
batches of inputs.
So, if your batch size were 7, the input to your model would be a
tensor of shape (7, 20).  (If you only want to feed one input sample
into your model, you still have to package it as a batch with a batch
size of 1; thus your input tensor would have shape (1, 20).)
For 20 input variables (without any spatial structure as an image
would have) and 5 classes, your network could be a simple as
something like:
model = nn.Sequential(
    nn.Linear (20, 50),
    nn.ReLU(),
    nn.Linear (50, 5),
)

(where I’ve chosen, for no particular reason to have 50 “hidden”
neurons).
Good luck!
K. Frank