| |
|
|
| class SavantRRF_Gauge(nn.Module): |
| def __init__(self, input_dim, hidden_dim, output_dim): |
| super(SavantRRF_Gauge, self).__init__() |
| self.conv1 = nn.Conv1d(input_dim, 64, kernel_size=3, padding=1) |
| self.conv2 = nn.Conv1d(64, 128, kernel_size=3, padding=1) |
| self.conv3 = nn.Conv1d(128, 256, kernel_size=3, padding=1) |
| self.dropout = nn.Dropout(0.25) |
| |
| |
| |
| self.fc1 = nn.Linear(256*160, 512) |
| self.fc2 = nn.Linear(512, 256) |
| self.fc3 = nn.Linear(256, output_dim) |
|
|
| def forward(self, x): |
| x = F.relu(self.conv1(x)) |
| x = F.relu(self.conv2(x)) |
| x = F.relu(self.conv3(x)) |
| x = torch.flatten(x, 1) |
| x = self.dropout(x) |
| x = F.relu(self.fc1(x)) |
| x = F.relu(self.fc2(x)) |
| return torch.sigmoid(self.fc3(x)) |