'How to apply full neural network to every signal window?

I have the following neural network and divided the signal into windows

class AudioClassifier(nn.Module):
    def __init__(
        self):
        super().__init__()
        self.mlp = nn.Sequential(
          nn.Linear(612, 64),
          nn.ReLU(),
          nn.BatchNorm1d(64),
          nn.Linear(64, 16),
          nn.ReLU()
        )
      def forward(self, x, lens) -> torch.Tensor:
        batch_windows = x.unfold(1, 612, 64)

And I am sruggling to apply the network to each window in function forward, couldn't find anything similar in the internet. Can smb give a clue how to do that or knows some web sources with explanation and examples?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source