Skip to content

conv-tasnet #2

@NJUPTgaf

Description

@NJUPTgaf

您好,您的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表示什么物理含义呀?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions