There are some small differences in your code.
While you are normalizing your input data in the PyTorch code, it looks like you just scale your data in the keras solution to [0, 1]. It shouldn’t make a big difference and normalizing could also work better than just scaling.
You are also missing a dropout layer in your PyTorch code and the loss function is different.
Could you try to use nn.BCEWithLogitsLoss 1 and set the number of output neurons to 1?