I have a neural network that predicts 2 classes of a time series (bottom and top). Currenlty my Y labels are size 2: [1 0] for bottom and [0 1] for top. The NN has 2 output nodes.
Of course not every instance is a bottom or top. (Overwhelmingly) most of the time we have no bottom and no top.
Should I change my network (and Y labels) to have 3 outputs?
And what would be appropriate as a loss function. I guess with 3 outputs I could use entropy or focal loss. With 2 outputs I don't think entropy is correct.
Currently I use PyTorch (lightening), and I have:
self.lstm = nn.LSTM(input_size=n_features,
hidden_size=hidden_size,
num_layers=num_layers,
dropout=dropout,
batch_first=True)
self.linear = nn.Linear(hidden_size, 2)
def forward(self, x):
lstm_out, _ = self.lstm(x)
y_pred = self.linear(lstm_out[:,-1])
return y_pred
criterion = nn.CrossEntropyLoss()