added LPCNet torch implementation

Signed-off-by: Jan Buethe <jbuethe@amazon.de>
This commit is contained in:
Jan Buethe 2023-09-05 12:29:38 +02:00
parent 90a171c1c2
commit 35ee397e06
No known key found for this signature in database
GPG key ID: 9E32027A35B36314
38 changed files with 3200 additions and 0 deletions

View file

@ -0,0 +1,15 @@
import torch
from torch import nn
class DualFC(nn.Module):
def __init__(self, input_dim, output_dim):
super(DualFC, self).__init__()
self.dense1 = nn.Linear(input_dim, output_dim)
self.dense2 = nn.Linear(input_dim, output_dim)
self.alpha = nn.Parameter(torch.tensor([0.5]), requires_grad=True)
self.beta = nn.Parameter(torch.tensor([0.5]), requires_grad=True)
def forward(self, x):
return self.alpha * torch.tanh(self.dense1(x)) + self.beta * torch.tanh(self.dense2(x))