Hi,

I’m new to pytorch. I just did a course and I wanted to try doing a DNN to predict temperatures given the parameters. I have done this using keras and I found a mse of 0.02 which is good. But when I try doing the same thing on PyTorch I get higher values of errors. I have used the code used in the course and changed it to fit the regression instead of the classification of images problem. I wanna know what I am doing wrong. Thanks.

The model class is :

```
class Net(nn.Module):
# Constructor
def __init__(self, D_in, H1, H2, D_out):
super(Net, self).__init__()
self.linear1 = nn.Linear(D_in, H1)
self.linear2 = nn.Linear(H1, H2)
self.linear3 = nn.Linear(H2, D_out)
# Prediction
def forward(self, x):
x = torch.relu(self.linear1(x))
x = torch.relu(self.linear2(x))
x = self.linear3(x)
return x
model = Net(input_size, hidden_layer_size, hidden2, output)
```

and training the model is :

```
epochs = 100
i = 0
useful_stuff = {'training_loss': [],'validation_accuracy': []}
for epoch in range(epochs):
for i, (x, y) in enumerate(train_set):
optimizer.zero_grad()
z = model(x.view(-1,size).float())
loss = criterion(z, y.float())
loss.backward()
optimizer.step()
#loss for every iteration
useful_stuff['training_loss'].append(loss.data.item())
correct = 0
for x, y in test_set:
#validation
z = model(x.view(-1, size).float())
#print(z.detach().numpy())
abs_delta = np.abs(z.detach().numpy() - y.detach().numpy()[:, np.newaxis])
accuracy = np.mean(abs_delta)
useful_stuff['validation_accuracy'].append(accuracy)
```

the results are here: