Hi,

I have again problem with my PyTorch code. I just started learning PyTorch so probably this is easy to solve for pros.

```
class NeuralNetwork(nn.Module):
def __init__(self, num_classes=1):
super(NeuralNetwork, self).__init__()
self.layer1 = nn.Linear(num_input,num_classes)
def forward(self, x):
out = self.layer1(x)
return out
# Loss and optimizer
criterion = nn.MSELoss()
optimizer = torch.optim.Adam(model.parameters(), lr=learning_rate)
total_step = int(len(x_train) / batch_size)
for epoch in range(epochs):
for i, (x,y) in enumerate(train_loader):
# Forward pass
outputs = model(x.float())
loss = criterion(outputs, y[:,None].float())
# Backward and optimize
optimizer.zero_grad()
loss.backward()
optimizer.step()
if (i+1) % 100 == 0:
print ('Epoch [{}/{}], Step [{}/{}], Loss: {:.4f}'
.format(epoch+1, num_epochs, i+1, total_step, loss.item()))
from sklearn.metrics import r2_score
# Test the model
model.eval() # eval mode (batchnorm uses moving mean/variance instead of mini-batch mean/variance)
with torch.no_grad():
r_squares = []
for x, y in test_loader:
outputs = model(Variable(x).float())
_, predicted = torch.max(outputs.data, 1)
y = Variable(y).type(torch.LongTensor)
print("y:",y)
print("y_hat:",predicted)
r2_score(y.numpy(),predicted.numpy())
print("r2:",r2_score)
print('Test Accuracy of the model on the 10000 test images: {} %'.format(np.mean(r_squares)))
```

So I printed the predictions and all were zeros.