Thank you so much! Very easy to understand implementation!
However, I do have 2 questions:


your x (line 112) has shappe (1,3,96,96) (i assume (batch_size,nb_channels,heigth, width)), your y (line 113) has shape (1,96,96) and your model output has shape (batch_size, nb_classes, 96,96).
–> How is your loss function calculated. Shouldn’t y and output have the same dimensions? Or is that something special NLLLoss does?


How did you know that your model output will have the same height and width like your input image (,,96,96)?
I mean all the parameters (stride, padding, etc.) are directly influencing the output shape. How did you know that the parameters you choose (e.g. when instantiating the model (line 115 - 120) or your upconv-layer (line 53)) will lead to the same output shape? Is it just try and error or is there some trick? 


Thanks again for sharing the code with me!