speechbrain.nnet.complex_networks.c_CNN 模块
实现复数卷积神经网络的库。
- Authors
Titouan Parcollet 2020
摘要
类:
此函数实现了复数一维卷积。 |
|
此函数实现了复数一维卷积。 |
参考
- class speechbrain.nnet.complex_networks.c_CNN.CConv1d(out_channels, kernel_size, input_shape, stride=1, dilation=1, padding='same', groups=1, bias=True, padding_mode='reflect', init_criterion='glorot', weight_init='complex')[source]
基础:
Module此函数实现了复数一维卷积。
- Parameters:
out_channels (int) – 输出通道数。请注意 这些是复数值的神经元。如果指定了256 个通道,输出维度 将是512。
kernel_size (int) – 卷积滤波器的核大小。
input_shape (tuple) – 输入张量的预期形状。
stride (int, 可选) – 卷积滤波器的步长因子(默认为1)。
dilation (int, 可选) – 卷积滤波器的膨胀因子(默认为1)。
padding (str, 可选) – (same, valid, causal). 如果为“valid”,则不进行填充。 如果为“same”且步幅为1,输出形状与输入形状相同。 “causal”会导致因果(扩张)卷积。(默认值为“same”)
groups (int, 可选) – 此选项指定卷积组。有关更多信息,请参阅 torch.nn 文档(默认值为 1)。
bias (bool, 可选) – 如果为True,则采用加法偏置b(默认为True)。
padding_mode (str, 可选) – 此标志指定填充的类型。有关更多信息,请参阅 torch.nn 文档(默认为“reflect”)。
init_criterion (str, 可选) – (glorot, he). 此参数控制权重的初始化标准。 它与weights_init结合使用,以构建复数权重的初始化方法。(默认值为“glorot”)
weight_init (str, optional) – (complex, unitary). 此参数定义了复数值权重的初始化过程。“complex”将根据init_criterion和复极坐标形式生成随机复数值权重。“unitary”将权重归一化到单位圆上。(默认“complex”) 更多详情请参阅:“Deep Complex Networks”,Trabelsi C. 等人。
Example
>>> inp_tensor = torch.rand([10, 16, 30]) >>> cnn_1d = CConv1d( ... input_shape=inp_tensor.shape, out_channels=12, kernel_size=5 ... ) >>> out_tensor = cnn_1d(inp_tensor) >>> out_tensor.shape torch.Size([10, 16, 24])
- class speechbrain.nnet.complex_networks.c_CNN.CConv2d(out_channels, kernel_size, input_shape, stride=1, dilation=1, padding='same', groups=1, bias=True, padding_mode='reflect', init_criterion='glorot', weight_init='complex')[source]
基础:
Module此函数实现了复数一维卷积。
- Parameters:
out_channels (int) – 输出通道数。请注意 这些是复数值的神经元。如果指定了256 个通道,输出维度 将是512。
kernel_size (int) – 卷积滤波器的核大小。
input_shape (tuple) – 输入的预期形状。
stride (int, 可选) – 卷积滤波器的步长因子(默认为1)。
dilation (int, 可选) – 卷积滤波器的膨胀因子(默认为1)。
padding (str, 可选) – (same, valid, causal). 如果为“valid”,则不进行填充。 如果为“same”且步幅为1,输出形状与输入形状相同。 “causal”会导致因果(扩张)卷积。(默认值为“same”)
groups (int, 可选) – 此选项指定卷积组(默认值为1)。有关更多信息,请参阅 torch.nn 文档。
bias (bool, 可选) – 如果为True,则采用加法偏置b(默认为True)。
padding_mode (str, 可选) – 此标志指定填充的类型(默认为“reflect”)。 有关更多信息,请参阅 torch.nn 文档。
init_criterion (str , optional) – (glorot, he). 此参数控制权重的初始化标准(默认为“glorot”)。 它与weights_init结合使用,以构建复数权重的初始化方法。
weight_init (str, 可选) – (complex, unitary). 此参数定义了复数权重的初始化过程(默认为complex)。"complex"将根据init_criterion和复数极坐标形式生成随机复数权重。 "unitary"将权重归一化到单位圆上。 更多详情请参阅:“Deep Complex Networks”,Trabelsi C. 等人。
Example
>>> inp_tensor = torch.rand([10, 16, 30, 30]) >>> cnn_2d = CConv2d( ... input_shape=inp_tensor.shape, out_channels=12, kernel_size=5 ... ) >>> out_tensor = cnn_2d(inp_tensor) >>> out_tensor.shape torch.Size([10, 16, 30, 24])