pytorchtester0:

model.eval()


I was wondering if you’re setting model.eval() but not back to model.train() for the next batch.
Although the Universal Approximation Theorem says that we should be able to approximate most functions with just 1 hidden layer, your architecture looks too simple to learn even vs odd. So, as mentioned by @ptrblck, try increasing the layer size or add more linear layers and see if the results improve.