abs_profileaug.py 670 B

12345678910111213141516171819202122
  1. from typing import Optional
  2. from typing import Tuple
  3. import torch
  4. class AbsProfileAug(torch.nn.Module):
  5. """Abstract class for the augmentation of profile
  6. The process-flow:
  7. Frontend --> SpecAug -> Normalization -> Encoder -> Decoder
  8. `-> ProfileAug -> Speaker Encoder --'
  9. """
  10. def forward(
  11. self, x: torch.Tensor, x_lengths: torch.Tensor = None,
  12. profile: torch.Tensor = None, profile_lengths: torch.Tensor = None,
  13. binary_labels: torch.Tensor = None, labels_length: torch.Tensor = None,
  14. ) -> Tuple[torch.Tensor, Optional[torch.Tensor], Optional[torch.Tensor]]:
  15. raise NotImplementedError