Displaying a ML Model

PyTorch Qucikstart Model

Beam Element

                # Define model
                class NeuralNetwork(nn.Module):
                    def __init__(self):
                        super().__init__()
                        self.flatten = nn.Flatten()
                        self.linear_relu_stack = nn.Sequential(
                            nn.Linear(28*28, 512),
                            nn.ReLU(),
                            nn.Linear(512, 512),
                            nn.ReLU(),
                            nn.Linear(512, 10)
                        )

                    def forward(self, x):
                        x = self.flatten(x)
                        logits = self.linear_relu_stack(x)
                        return logits
                
Example adapted from: PyTorch, (2024). The Linux Foundation. Available at: https://pytorch.org/tutorials/beginner/basics/quickstart_tutorial.html