Thanks! I added the missing reLU layer and removed the softmax.
If it does the loss internally is there no point computing the loss? I’m a bit confused there. I’ve changed the classes to only 8 to see if the results are accurate(should >95%)
Model looks like this:
class ModelKnown(torch.nn.Module):
    def __init__(self):
        super().__init__()
        self.TCP = torch.nn.Sequential(torch.nn.Conv1d(in_channels=2, out_channels=32, kernel_size=3),
                                       torch.nn.ReLU(),
                                       torch.nn.MaxPool1d(kernel_size=3),
                                       torch.nn.Conv1d(in_channels=32, out_channels=32, kernel_size=3),
                                       torch.nn.ReLU(),
                                       torch.nn.MaxPool1d(kernel_size=3),
                                       torch.nn.Conv1d(in_channels=32, out_channels=32, kernel_size=3),
                                       torch.nn.ReLU(),
                                       torch.nn.Flatten(),
                                       torch.nn.Linear(in_features=256, out_features=128),
                                       torch.nn.Linear(in_features=128, out_features=8))

    def forward(self, x):
        return self.TCP(x)
import torch.optim as optim

model = ModelKnown()
criterion = nn.CrossEntropyLoss()
optimizer = optim.Adam(model.parameters(), lr=0.1)

x = torch.from_numpy(data)
y = torch.from_numpy(labels.to_numpy())
# x.requires_grad=True

for epoch in range(5):  # loop over the dataset multiple times

    optimizer.zero_grad()
    outputs = model(x)
    loss = criterion(outputs, y)
    loss.backward()
    optimizer.step()

I’m fairly certain I’m doing something wrong, as I’m not getting accurate results, and my softmax values are negative?
preds = model(x)
preds
tensor([[-0.5422, -0.6145,  0.7050,  ...,  0.4405, -0.3194, -0.3350],
        [-0.5422, -0.6145,  0.7050,  ...,  0.4405, -0.3194, -0.3350],
        [-0.5422, -0.6145,  0.7050,  ...,  0.4405, -0.3194, -0.3350],
        ...,