I have four input parameters and I want to predict 500 values (representing the value of the electric field in function of the frequency), so my dataset has approximately 50000 data and y=50000*500… The goal here is to deduce the resonance frequencies based on the peaks of E
I have tried using a simple CNN (with two convulational layers) :
class CNN(nn.Module):
def init(self):
super(CNN, self).init()
self.conv1 = nn.Conv1d(in_channels=1, out_channels=16, kernel_size=3, stride=1, padding=1)
self.conv2 = nn.Conv1d(in_channels=16, out_channels=32, kernel_size=3, stride=1, padding=1)
self.fc = nn.Linear(32 * 1, 500)
def forward(self, x):
x = F.relu(self.conv1(x))
x = F.max_pool1d(x, kernel_size=2, stride=2)
x = F.relu(self.conv2(x))
x = F.max_pool1d(x, kernel_size=2, stride=2)
x = x.view(-1, 32 * 1)
x = self.fc(x)
return x
but the MSE I obtain are huge :
Epoch [1/6], Train Loss: 26878214.0000, Val Loss: 27697948.0000
Epoch [2/6], Train Loss: 24366062.0000, Val Loss: 27761616.0000
Epoch [3/6], Train Loss: 28823276.0000, Val Loss: 27700362.0000
Epoch [4/6], Train Loss: 20534644.0000, Val Loss: 27853372.0000
Epoch [5/6], Train Loss: 26829138.0000, Val Loss: 29004308.0000
Epoch [6/6], Train Loss: 21424500.0000, Val Loss: 28001668.0000
Mean Squared Error (MSE) on Test Set: 29475708.0`
What can I do to better fit my problem ? What is the problem with the model ?
Julie Martin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.