I think it is not a fair comparison. Model architectures are different (the number of units in Keras dense layer does not match the PyTorch linear layer), and optimizers are not the same either(SGD vs Adam). Please fix these two issues, hope you get the same result.