speechbrain.lobes.models.Cnn14 模块
此文件实现了 https://arxiv.org/abs/1912.10211 中的 CNN14 模型
作者 * Cem Subakan 2022 * Francesco Paissan 2022
摘要
类
此类估计梅尔域显著性掩码 |
|
此类根据分类器表示估计 STFT 域上的显著图。 |
|
此类实现了 https://arxiv.org/abs/1912.10211 中的 Cnn14 模型 |
|
此类实现了 CNN14 中使用的卷积块 |
函数
初始化 Batchnorm 层。 |
|
初始化 Linear 或 Convolutional 层。 |
参考
- class speechbrain.lobes.models.Cnn14.ConvBlock(in_channels, out_channels, norm_type)[source]
基类:
Module
此类实现了 CNN14 中使用的卷积块
- 参数:
示例
>>> convblock = ConvBlock(10, 20, 'ln') >>> x = torch.rand(5, 10, 20, 30) >>> y = convblock(x) >>> print(y.shape) torch.Size([5, 20, 10, 15])
- class speechbrain.lobes.models.Cnn14.Cnn14(mel_bins, emb_dim, norm_type='bn', return_reps=False, l2i=False)[source]
基类:
Module
此类实现了 https://arxiv.org/abs/1912.10211 中的 Cnn14 模型
- 参数:
示例
>>> cnn14 = Cnn14(120, 256) >>> x = torch.rand(3, 400, 120) >>> h = cnn14.forward(x) >>> print(h.shape) torch.Size([3, 1, 256])
- class speechbrain.lobes.models.Cnn14.CNN14PSI(dim=128)[source]
基类:
Module
此类估计梅尔域显著性掩码
- 参数:
dim (int) – 嵌入的维度
示例
>>> from speechbrain.lobes.models.Cnn14 import Cnn14 >>> classifier_embedder = Cnn14(mel_bins=80, emb_dim=2048, return_reps=True) >>> x = torch.randn(2, 201, 80) >>> _, hs = classifier_embedder(x) >>> psimodel = CNN14PSI(2048) >>> xhat = psimodel.forward(hs) >>> print(xhat.shape) torch.Size([2, 1, 201, 80])
- class speechbrain.lobes.models.Cnn14.CNN14PSI_stft(dim=128, outdim=1)[source]
基类:
Module
此类根据分类器表示估计 STFT 域上的显著图。
示例
>>> from speechbrain.lobes.models.Cnn14 import Cnn14 >>> classifier_embedder = Cnn14(mel_bins=80, emb_dim=2048, return_reps=True) >>> x = torch.randn(2, 201, 80) >>> _, hs = classifier_embedder(x) >>> psimodel = CNN14PSI_stft(2048, 1) >>> xhat = psimodel.forward(hs) >>> print(xhat.shape) torch.Size([2, 1, 201, 513])