when i tested this code
def forward(self, x):
x = self.hidden0(x)
x = self.hidden1(x)
x = self.hidden2(x)
x = self.out(x)
return x
when i tested this code
def forward(self, x):
x = self.hidden0(x)
x = self.hidden1(x)
x = self.hidden2(x)
x = self.out(x)
return x
Unfortunately you are not explaining any issues in the post, so please try to describe the error as well as the expected behavior, and, if possible, post a minimal code snippet to reproduce the issue.
with torch.no_grad():
output1 = model(((train_x.float(),train_x1.float())))
softmax1 = torch.exp(output1).cpu()
prob1 = list(softmax1.numpy())
predictions1 = np.argmax(prob1, axis=1)
print('Validation accuracy train: {:.4f}%'.format(float(accuracy_score(train_y, predictions1)) * 100))
help me @ptrblck
Based on the error message the model expects (at least) two inputs, while you are passing a single tuple
to it, so you would need to remove the ()
around the tensors.