Regression using Pytorch Geometric

HI. I’m new at geometric deep learning and gcnn. I want to train a gcnn model for predicting a feature as a regression problem. my code is below

import torch
import torch.nn.functional as F
from torch_geometric.nn import GCNConv

class GCN(torch.nn.Module):
    def __init__(self):
        self.conv1 = GCNConv(data.num_node_features, 100)
        self.conv2 = GCNConv(100, 16)
        self.conv3 = GCNConv(16, data.num_node_features)
        self.linear1 = torch.nn.Linear(104,1)

    def forward(self, data):
        x, edge_index = data.x, data.edge_index

        x = self.conv1(x, edge_index)
        x = F.relu(x)
        x = F.dropout(x,
        x = self.conv2(x, edge_index)
        x = self.conv3(x, edge_index)
        x = self.linear1(x)
        return F.log_softmax(x, dim=1)

import torch.nn as nn
device = torch.device('cpu')
model = GCN().to(device)
model = model.double()
data =
optimizer = torch.optim.Adam(model.parameters(), lr=0.01, weight_decay=5e-4)

for epoch in range(5):
    out = model(data)
    loss = F.mse_loss(out.squeeze(), data.y.squeeze())
    print(f'Epoch: {epoch}, Loss: {loss}')

I am getting nan loss. what are the problems with this?

Also is there any blogs of solving regression problem using pytorch geometric?

The usage of F.log_softmax looks wrong or at least uncommon for a regression use case. Could you describe what your target is containing?

Thanks for replying.
My dataset is a traffic dataset. Where target is predicting time for a vehicle from the other features. Here y is time, x is the node_features and in edge_attr edge indexs are saved.
Moreover, I tried not using F.log_softmax
in that case I returned ```x`` but the nan error is same.