I have a table with 100 rows and 11 columns, first 10 columns represent the explanatory variables (X1 to X10) and the last column represents the response variable (Y), should my input data be 100 by 10 matrix and output data be 100 by 1 column vector? does the feedforward operation in PyTorch go by xW+b rather than Wx+b?
Example:
X = torch.Tensor(matrix(100, 10))
Y = torch.Tensor(vector(100, 1))
class NN(nn.Module):
def __init__(self, input_dim = 10, output_dim=1):
super(NN, self).__init__()
self.lin1 = nn.Linear(input_dim, 5)
self.lin2 = nn.Linear(5, output_dim)
def forward(self, x):
x = self.lin1(x)
x = F.sigmoid(x)
x = self.lin2(x)
return x
Sorry for the primitive question.