Hi @Rahul_Seetharaman,
If I’ve understood your question correctly, you first defined the linear layer inside the forward() method, and after seeing the bad accuracy, you defined it in the constructor, what gave you a much better result?
If yes, everything that has trainable parameters should be defined in the constructor. By defining it in the forward method, you define your self.fc1 new every iteration, therefore training the layer will not make any difference as you override it in the next iteration.
I hope I could help you.
Regards,
Unity05