Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

conv-tasnet #2

Open
NJUPTgaf opened this issue Mar 4, 2022 · 0 comments
Open

conv-tasnet #2

NJUPTgaf opened this issue Mar 4, 2022 · 0 comments

Comments

@NJUPTgaf
Copy link

NJUPTgaf commented Mar 4, 2022

您好,您的conv-tasnet对我最近的学习帮助很大,但是也遇到了一些问题,请问conv_tasnet.py中的
` def pad_signal(self, input):

    # input is the waveforms: (B, T) or (B, 1, T)
    # reshape and padding
    if input.dim() not in [2, 3]:
        raise RuntimeError("Input can only be 2 or 3 dimensional.")
    
    if input.dim() == 2:
        input = input.unsqueeze(1)
    # print(input.shape)
    batch_size = input.size(0)
    nsample = input.size(2)
    rest = self.win - (self.stride + nsample % self.win) % self.win
    # print(self.win,rest)
    if rest > 0:
        pad = Variable(torch.zeros(batch_size, 1, rest)).type(input.type())
        input = torch.cat([input, pad], 2)
    
    pad_aux = Variable(torch.zeros(batch_size, 1, self.stride)).type(input.type())
    input = torch.cat([pad_aux, input, pad_aux], 2)

    return input, rest`

input中 waveforms的第二个维度T表示什么物理含义呀?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant