How to avoid create a network structure properly
I tried to define a feedforwad function in my neural network model:

class FeedForward(nn.Module):
    def __init__(self):
        super(FeedForward,self).__init__() 
        self.fc1 = nn.Linear(784, 256)
        self.fc2 = nn.Linear(256, 64)
        self.fc2 = nn.Linear(64, 10)

    def feedforward(self, x):
        x = x.view(x.shape[0], -1)  # make sure inputs are flattened 

        x = F.relu(self.fc1(x))
        x = F.relu(self.fc2(x))
        x = F.relu(self.fc3(x))
        x= F.log_softmax(x, dim=1)  # preserve batch dim

        return x


The message says: 


  NotImplementedError


I am not sure what I have missing.

The method name must be forward and not feedforward:

class FeedForward(nn.Module):
    def __init__(self):
        super(FeedForward,self).__init__() 
        self.fc1 = nn.Linear(784, 256)
        self.fc2 = nn.Linear(256, 64)
        self.fc2 = nn.Linear(64, 10)

    def forward(self, x):  # this is what pytorch expects
        x = x.view(x.shape[0], -1)  # make sure inputs are flattened 

        x = F.relu(self.fc1(x))
        x = F.relu(self.fc2(x))
        x = F.relu(self.fc3(x))
        x= F.log_softmax(x, dim=1)  # preserve batch dim

        return x

