I’m not sure how you’ve initialized your model, but you should check the shapes of your input and target.
nn.Linear layers expect an input of [batch_size, *, nb_features].
Based on your code snippet I assume you are using 99 features and a single sample.
If that’s the case, you should unsqueeze the batch dimension for the input and target:
x = x.unsqueeze(0)
x_hat = model(x[:, :-1])
...
loss = criteria(x_hat, x[:, -1].unsqueeze(1))
...

Also, check your gradients after calling .backward():
print(model.layer3.weight.grad)