🎉 | Start of a project

This commit is contained in:
2024-12-17 22:39:03 +02:00
parent d5a215fc60
commit 9db1932820
8 changed files with 263 additions and 1 deletions

24
generator.py Normal file
View File

@@ -0,0 +1,24 @@
import torch.nn as nn
class SISUGenerator(nn.Module):
def __init__(self): # No noise_dim parameter
super(SISUGenerator, self).__init__()
self.model = nn.Sequential(
nn.Conv1d(2, 64, kernel_size=7, stride=1, padding=3), # Input 2 channels (low-quality audio)
nn.LeakyReLU(0.2),
nn.Conv1d(64, 64, kernel_size=7, stride=1, padding=3),
nn.LeakyReLU(0.2),
nn.Conv1d(64, 128, kernel_size=5, stride=2, padding=2),
nn.LeakyReLU(0.2),
nn.Conv1d(128, 128, kernel_size=5, stride=1, padding=2),
nn.LeakyReLU(0.2),
nn.ConvTranspose1d(128, 64, kernel_size=4, stride=2, padding=1),
nn.LeakyReLU(0.2),
nn.Conv1d(64, 64, kernel_size=3, stride=1, padding=1),
nn.LeakyReLU(0.2),
nn.Conv1d(64, 2, kernel_size=3, stride=1, padding=1), # Output 2 channels (high-quality audio)
nn.Tanh()
)
def forward(self, x):
return self.model(x)