title: How to access the network weights while using PyTorch 'nn.Sequential'?
body: <p>I'm building a neural network and I don't know how to access the model weights for each layer.  </p>
  
  <p>I've tried</p>
  
  <pre><code>model.input_size.weight
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>input_size = 784
  hidden_sizes = [128, 64]
  output_size = 10
  
  # Build a feed-forward network
  model = nn.Sequential(nn.Linear(input_size, hidden_sizes[0]),
                        nn.ReLU(),
                        nn.Linear(hidden_sizes[0], hidden_sizes[1]),
                        nn.ReLU(),
                        nn.Linear(hidden_sizes[1], output_size),
                        nn.Softmax(dim=1))
  </code></pre>
  
  <p>I expected to get the weights but I got </p>
  
  <blockquote>
    <p>'Sequential' object has no attribute 'input_size'</p>
  </blockquote>