I try to feed data into one deep regression model, but always can’t catch patterns.
When I use random forest, it works find and be able to catch patterns
But it failed when I want to use deep networks.
What I thought is using relu and linear to catch patterns, is there anything wrong?
import torch
import torch.nn.functional as FUNC
class Reg(torch.nn.Module):
def __init__(self, n_feature, n_hidden, n_output):
super(Reg, self).__init__()
self.name = self.__class__.__name__
self.hidden = torch.nn.Linear(n_feature, n_hidden) # hidden layer
self.F = FUNC.relu
self.out = torch.nn.Linear(n_hidden, n_output)
def forward(self, features):
x = self.hidden(x)
x = self.F(x)
x = self.out(x)
return x
optimizer=ADAM, criterion=torch.nn.MSELoss()
n_feature=2, n_hidden=256, n_output=1.