| # Auto-extracted class source (static) | |
| class RRF_Ultra_CNN(nn.Module): | |
| def __init__(self, input_dim=1, output_dim=1): | |
| super(RRF_Ultra_CNN, 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.fc1 = nn.Linear(128*160, 256) | |
| self.fc2 = nn.Linear(256, output_dim) | |
| def forward(self, x): | |
| x = F.relu(self.conv1(x)) | |
| x = F.relu(self.conv2(x)) | |
| x = torch.flatten(x, 1) | |
| x = F.relu(self.fc1(x)) | |
| return torch.sigmoid(self.fc2(x)) |