title: Implementing LeNet in Pytorch
body: <p>Sorry if this question is incredibly basic. I feel like there is a wealth of resources online, but most of them are half-complete or skip over the details that I want to know.</p>
  
  <p>I am trying to implement LeNet with Pytorch for practice.</p>
  
  <p><a href="https://pytorch.org/tutorials/beginner/blitz/neural_networks_tutorial.html" rel="nofollow noreferrer">https://pytorch.org/tutorials/beginner/blitz/neural_networks_tutorial.html</a></p>
  
  <ul>
  <li><p>How come in this examples and many examples online, they define the convolutional layers and the fc layers in init, but the subsampling and activation functions in forward?</p></li>
  <li><p>What is the purpose of using torch.nn.functional for some functions, and torch.nn for others? For example, you have convolution with torch.nn (<a href="https://pytorch.org/docs/stable/nn.html#conv1d" rel="nofollow noreferrer">https://pytorch.org/docs/stable/nn.html#conv1d</a>) and convolution with torch.nn.functional (<a href="https://pytorch.org/docs/stable/nn.functional.html#conv1d" rel="nofollow noreferrer">https://pytorch.org/docs/stable/nn.functional.html#conv1d</a>). Why choose one or the other?</p></li>
  <li><p>Let's say I want to try different image sizes, like 28x28 (MNIST). The tutorial recommends I resize MNIST. Is there a way to instead change the values of LeNet? What happens if I don't change them?</p></li>
  <li><p>What is the purpose of num_flat_features? If you wanted to flatten the features, couldn't you just do x = x.view(-1, 16*5*5)?</p></li>
  </ul>