WideNet

Remark
A simple WideNet
a very wide (512 neurons) neural net with one hidden layer and nn.Tanh() activation function
class WideNet(nn.Module): """ A Wide neural network with a single hidden layer Structure is as follows: nn.Sequential( nn.Linear(1, n_cells) + nn.Tanh(), # Fully connected layer with tanh activation nn.Linear(n_cells, 1) # Final fully connected layer ) """ def __init__(self): """ Initializing the parameters of WideNet Args: None Returns: Nothing """ n_cells = 512 super().__init__() self.layers = nn.Sequential( nn.Linear(1, n_cells), nn.Tanh(), nn.Linear(n_cells, 1), ) def forward(self, x): """ Forward pass of WideNet Args: x: torch.Tensor 2D tensor of features Returns: Torch tensor of model predictions """ return self.layers(x)