speechbrain.nnet.complex_networks.c_ops 模块
- 该库实现了复数网络所需的各种操作。
这项工作受到 Trabelsi C. 等人的“Deep Complex Networks”启发。
- 作者
Titouan Parcollet 2020
概要
函数
将给定的权重初始化函数应用于参数。 |
|
将给定的权重初始化函数应用于参数。 |
|
检查线性层的复数值形状。 |
|
对输入数据应用复数卷积。 |
|
返回一个复数矩阵,按照 Trabelsi C. 等人的“Deep Complex Networks”中的描述进行初始化。 |
|
对输入数据应用复数线性变换。 |
|
返回输入复数的共轭 (z = r - xi)。 |
|
返回复数值输入的虚部。 |
|
返回复数值输入的实部。 |
|
对 |
|
返回一个酉复数矩阵。 |
参考
- speechbrain.nnet.complex_networks.c_ops.check_complex_input(input_shape)[source]
检查线性层的复数值形状。
- 参数:
input_shape (tuple) – 期望的输入形状。
- speechbrain.nnet.complex_networks.c_ops.get_real(input, input_type='linear', channels_axis=1)[source]
返回复数值输入的实部。
- 参数:
input (torch.Tensor) – 输入张量。
input_type (str,) – (convolution, linear) (默认 “linear”)
channels_axis (int.) – 默认 1。
- 返回类型:
复数值输入的实部。
- speechbrain.nnet.complex_networks.c_ops.get_imag(input, input_type='linear', channels_axis=1)[source]
返回复数值输入的虚部。
- speechbrain.nnet.complex_networks.c_ops.get_conjugate(input, input_type='linear', channels_axis=1)[source]
返回输入复数的共轭 (z = r - xi)。
- 参数:
input (torch.Tensor) – 输入张量
input_type (str,) – (convolution, linear) (默认 “linear”)
channels_axis (int.) – 默认 1。
- 返回类型:
输入复数的共轭。
- speechbrain.nnet.complex_networks.c_ops.complex_linear_op(input, real_weight, imag_weight, bias)[source]
对输入数据应用复数线性变换。
- 参数:
input (torch.Tensor) – 要转换的复数输入张量。
real_weight (torch.Parameter) – 此层的四元数权重矩阵的实部。
imag_weight (torch.Parameter) – 此层的四元数权重矩阵的第一个虚部。
bias (torch.Parameter)
- 返回类型:
应用复数线性变换后的输出。
- speechbrain.nnet.complex_networks.c_ops.complex_conv_op(input, real_weight, imag_weight, bias, stride, padding, dilation, conv1d)[source]
对输入数据应用复数卷积。
- 参数:
input (torch.Tensor) – 要转换的复数输入张量。
real_weight (torch.Parameter) – 此层的四元数权重矩阵的实部。
imag_weight (torch.Parameter) – 此层的四元数权重矩阵的第一个虚部。
bias (torch.Parameter)
stride (int) – 卷积滤波器的步幅因子。
padding (int) – 填充量。更多信息请参阅 torch.nn 文档。
dilation (int) – 卷积滤波器的膨胀因子。
conv1d (bool) – 如果为 true,将应用 1D 卷积操作。否则,调用 2D 卷积。
- 返回类型:
应用复数卷积后的输出。
- speechbrain.nnet.complex_networks.c_ops.unitary_init(in_features, out_features, kernel_size=None, criterion='glorot')[source]
返回一个酉复数矩阵。
- speechbrain.nnet.complex_networks.c_ops.complex_init(in_features, out_features, kernel_size=None, criterion='glorot')[source]
返回一个复数矩阵,按照 Trabelsi C. 等人的“Deep Complex Networks”中的描述进行初始化。
- speechbrain.nnet.complex_networks.c_ops.affect_init(real_weight, imag_weight, init_func, criterion)[source]
将给定的权重初始化函数应用于参数。
- 参数:
real_weight (torch.Parameters)
imag_weight (torch.Parameters)
init_func (function) – (unitary_init, complex_init)
criterion (str) – (glorot, he)