speechbrain.nnet.complex_networks.c_ops 模块
- This library implements different operations needed by complex-
有价值的架构。 这项工作受到以下启发:Trabelsi C.等人的“深度复杂网络”。
- Authors
Titouan Parcollet 2020
摘要
函数:
应用给定的权重初始化函数到参数上。 |
|
应用给定的权重初始化函数到参数上。 |
|
检查线性层的复数值形状。 |
|
对输入数据应用复杂的卷积。 |
|
返回一个复数矩阵,初始化方式如《深度复数网络》中所述,作者:Trabelsi C. |
|
对输入数据应用复杂的线性变换。 |
|
返回输入复数的共轭(z = r - xi)。 |
|
返回复数输入的虚部。 |
|
返回复数值输入的实部。 |
|
对 |
|
返回一个由单位复数组成的矩阵。 |
参考
- speechbrain.nnet.complex_networks.c_ops.check_complex_input(input_shape)[source]
检查线性层的复数值形状。
- Parameters:
input_shape (tuple) – 输入的预期形状。
- speechbrain.nnet.complex_networks.c_ops.get_real(input, input_type='linear', channels_axis=1)[source]
返回复数值输入的实际部分。
- Parameters:
输入 (torch.Tensor) – 输入张量。
input_type (str,) – (卷积, 线性) (默认 “linear”)
channels_axis (int.) – 默认值为1。
- Return type:
复数值输入的实部。
- 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)。
- Parameters:
输入 (torch.Tensor) – 输入张量
input_type (str,) – (卷积, 线性) (默认 “linear”)
channels_axis (int.) – 默认值为1。
- Return type:
输入复数的共轭。
- speechbrain.nnet.complex_networks.c_ops.complex_linear_op(input, real_weight, imag_weight, bias)[source]
对输入数据应用复杂的线性变换。
- Parameters:
input (torch.Tensor) – 要进行变换的复数输入张量。
real_weight (torch.Parameter) – 该层四元数权重矩阵的实部。
imag_weight (torch.Parameter) – 该层四元数权重矩阵的第一个虚部。
偏差 (torch.Parameter)
- Return type:
应用复杂线性变换后的输出。
- speechbrain.nnet.complex_networks.c_ops.complex_conv_op(input, real_weight, imag_weight, bias, stride, padding, dilation, conv1d)[source]
对输入数据应用复杂的卷积。
- Parameters:
- Return type:
应用复杂卷积后的输出。
- 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. 等人。
- speechbrain.nnet.complex_networks.c_ops.affect_init(real_weight, imag_weight, init_func, criterion)[source]
将给定的权重初始化函数应用于参数。
- Parameters:
real_weight (torch.Parameters)
imag_weight (torch.Parameters)
init_func (function) – (unitary_init, complex_init)
criterion (str) – (glorot, he)