这里为什么是定一个假设的结构,而不是训练时候使用的结构体?

#2
by yingchaox - opened

定义一个假设的 ASR 模型结构

class ASRModel(torch.nn.Module):
def init(self):
super(ASRModel, self).init()
self.lstm = torch.nn.LSTM(input_size=160, hidden_size=256, num_layers=3, batch_first=True)
self.linear = torch.nn.Linear(256, 29) # 假设有 29 个输出类用于字符

def forward(self, x):
    x, _ = self.lstm(x)
    x = self.linear(x)
    return x

官方文档里没有给得太清楚,我这里在尝试,目前也还没走通。如果知道应该怎么改,望赐教,不胜感激

hhh,我以为你是官方的space,,,我也在尝试,但是没法成功推理

Sign up or log in to comment