speechbrain.lobes.models.EnhanceResnet 模块
用于语音增强的宽残差网络。
- Author
彼得·普兰廷加 2022
摘要
类:
卷积块,包括压缩和激励。 |
|
基于Wide ResNet的增强模型。 |
|
压缩和激励块。 |
参考
- class speechbrain.lobes.models.EnhanceResnet.EnhanceResnet(n_fft=512, win_length=32, hop_length=16, sample_rate=16000, channel_counts=[128, 128, 256, 256, 512, 512], dense_count=2, dense_nodes=1024, activation=GELU(approximate='none'), normalization=<class 'speechbrain.nnet.normalization.BatchNorm2d'>, dropout=0.1, mask_weight=0.99)[source]
基础:
Module基于Wide ResNet的增强模型。
完整模型描述请访问:https://arxiv.org/pdf/2112.06068.pdf
- Parameters:
n_fft (int) – 傅里叶变换中的点数,参见
speechbrain.processing.features.STFTwin_length (int) – STFT窗口的长度,单位为毫秒,参见
speechbrain.processing.features.STFThop_length (int) – 窗口之间的时间间隔(以毫秒为单位),请参阅
speechbrain.processing.features.STFTsample_rate (int) – 输入音频每秒的采样数。
channel_counts (list of ints) – 每个CNN块中的输出通道数。决定块的数量。
dense_count (int) – 密集层的数量。
dense_nodes (int) – 密集层中的节点数。
activation (function) – 在卷积层之前应用的函数。
normalization (class) – 用于构建归一化层的类名。
dropout (float) – 在训练期间丢弃的层输出部分(介于0和1之间)。
mask_weight (float) – 给予掩码的权重。0 - 无掩码,1 - 完全掩码。
Example
>>> inputs = torch.rand([10, 16000]) >>> model = EnhanceResnet() >>> outputs, feats = model(inputs) >>> outputs.shape torch.Size([10, 15872]) >>> feats.shape torch.Size([10, 63, 257])
- class speechbrain.lobes.models.EnhanceResnet.ConvBlock(input_shape, channels, activation=GELU(approximate='none'), normalization=<class 'speechbrain.nnet.normalization.LayerNorm'>, dropout=0.1)[source]
基础:
Module卷积块,包括压缩和激励。
- Parameters:
Example
>>> inputs = torch.rand([10, 20, 30, 128]) >>> block = ConvBlock(input_shape=inputs.shape, channels=256) >>> outputs = block(inputs) >>> outputs.shape torch.Size([10, 20, 15, 256])
- class speechbrain.lobes.models.EnhanceResnet.SEblock(input_size)[source]
基础:
Module压缩和激励块。
定义:https://arxiv.org/abs/1709.01507
- Parameters:
input_size (tuple of ints) – 输入张量的预期大小
Example
>>> inputs = torch.rand([10, 20, 30, 256]) >>> se_block = SEblock(input_size=inputs.shape[-1]) >>> outputs = se_block(inputs) >>> outputs.shape torch.Size([10, 1, 1, 256])