class MNIST_NN(nn.Module): def __init__(self, input_shape: int, hidden_units: int, output_shape: int): super().__init__() # Create a hidden layer with non-linearities self.layer_stack = nn.Sequential( nn.Flatten(), nn.Linear(in_features=input_shape, out_features=hidden_units), nn.ReLU(), nn.Linear(in_features=hidden_units, out_features=output_shape), nn.ReLU() ) def forward(self, x: torch.Tensor): return self.layer_stack(x)