This is my current code. I understand the in_size
and out_size
are the sizes of the input and output layers respectively. However, what does the self
parameter indicate and what is super().__init__()
used for?
class MnistModel(nn.Module):
"""Feedfoward neural network with 1 hidden layer"""
def __init__(self, in_size, out_size):
super().__init__()
# hidden layer
self.linear1 = nn.Linear(in_size, 16)
# hidden layer 2
self.linear2 = nn.Linear(16, 32)
# output layer
self.linear3 = nn.Linear(32, out_size)