espnet2.asr.layers.cgmlp.ConvolutionalSpatialGatingUnit
Less than 1 minute
espnet2.asr.layers.cgmlp.ConvolutionalSpatialGatingUnit
class espnet2.asr.layers.cgmlp.ConvolutionalSpatialGatingUnit(size: int, kernel_size: int, dropout_rate: float, use_linear_after_conv: bool, gate_activation: str)
Bases: Module
Convolutional Spatial Gating Unit (CSGU).
Initializes internal Module state, shared by both nn.Module and ScriptModule.
espnet_initialization_fn()
forward(x, gate_add=None)
Forward method
- Parameters:
- x (torch.Tensor) – (N, T, D)
- gate_add (torch.Tensor) – (N, T, D/2)
- Returns: (N, T, D/2)
- Return type: out (torch.Tensor)