<filename>dlp/models/fullyconnected.py
from torch import nn


class FullyConnected(nn.Module):
    """
    Fully connected neural network with one hidden layer.
    """

    def __init__(self, input_size, hidden_size, num_classes):
        super().__init__()
        self.flatten = nn.Flatten()
        self.fully_connected_stack = nn.Sequential(
            nn.Linear(input_size, hidden_size),
            nn.ReLU(),
            nn.Linear(hidden_size, hidden_size),
            nn.ReLU(),
            nn.Linear(hidden_size, num_classes),
        )

    def forward(self, x):
        x = self.flatten(x)
        output = self.fully_connected_stack(x)
        return output

<filename>dlp/models/fullyconnected.py
from torch import nn


class FullyConnected(nn.Module):
    """
    Fully connected neural network with one hidden layer.
    """

    def __init__(self, input_size, hidden_size, num_classes):
        super().__init__()
        self.flatten = nn.Flatten()
        self.fully_connected_stack = nn.Sequential(
            nn.Linear(input_size, hidden_size),
            nn.ReLU(),
            nn.Linear(hidden_size, hidden_size),
            nn.ReLU(),
            nn.Linear(hidden_size, num_classes),
        )

    def forward(self, x):
        x = self.flatten(x)
        output = self.fully_connected_stack(x)
        return output

Fully connected neural network with one hidden layer.