Pytorch : Loss function for binary classification - Data ...
datascience.stackexchange.com › questions › 48891Show activity on this post. Fairly newbie to Pytorch & neural nets world.Below is a code snippet from a binary classification being done using a simple 3 layer network : n_input_dim = X_train.shape [1] n_hidden = 100 # Number of hidden nodes n_output = 1 # Number of output nodes = for binary classifier # Build the network model = nn.Sequential ( nn.Linear (n_input_dim, n_hidden), nn.ELU (), nn.Linear (n_hidden, n_output), nn.Sigmoid ()) x_tensor = torch.from_numpy (X_train.values).float () ...