PyTorch NN does not learn or learns poorly
I'm working with PyTorch tutorial, slightly modified to use Titanic dataset. I'm using very simple network of Linear(Dense) with ReLU... I'd like to predict survival status based on age, fare and sex for example.
I experienced a strange behavior with a simple neural network (I'm experimenting on Google Colab). Sometimes when I execute training, the accuracy doesn't change at all. It's strange because I'm recreating the model...
Accuracy: 59.4%, Avg loss: 0.693147
[...50 or more lines like this...]
Accuracy: 59.4%, Avg loss: 0.693147

Sometimes the accuracy is slowly increasing from 60% to 80%.
The other thing is, the accuracy is very low (varies from 60-80%), despite the fact I'm validating with... the very same training set!
I've tried several different combinations of learning rate, batch size and epochs count and also number of neurons, but it still behaves very... unpredictably and weak.
Could you point me why sometimes the network doesn't learn at all? And if I rerun it a few times it starts learning somehow. And what should be done to this network to improve it?
This is my Python notebook:
https://colab.research.google.com/drive/1-50BTqnMgiz_dozv1DjXS9advD1Rxd-B?usp=sharing
Thanks in advance!

As this is a classification problem, your neural network's last layer should not have a relu activation function.
Code Snippet:
class NeuralNetwork(nn.Module):
    def __init__(self):
        super(NeuralNetwork, self).__init__()
        self.fun = nn.Sequential(
            nn.Linear(3, 32),
            nn.ReLU(),
            nn.Linear(32, 1)
        )

    def forward(self, x):
        return self.fun(x)

