espnet.nets.pytorch_backend.transformer.subsampling_without_posenc.Conv2dSubsamplingWOPosEnc
Less than 1 minute
espnet.nets.pytorch_backend.transformer.subsampling_without_posenc.Conv2dSubsamplingWOPosEnc
class espnet.nets.pytorch_backend.transformer.subsampling_without_posenc.Conv2dSubsamplingWOPosEnc(idim, odim, dropout_rate, kernels, strides)
Bases: Module
Convolutional 2D subsampling.
- Parameters:
- idim (int) – Input dimension.
- odim (int) – Output dimension.
- dropout_rate (float) – Dropout rate.
- kernels (list) – kernel sizes
- strides (list) – stride sizes
Construct an Conv2dSubsamplingWOPosEnc object.
forward(x, x_mask)
Subsample x.
Parameters:
- x (torch.Tensor) – Input tensor (#batch, time, idim).
- x_mask (torch.Tensor) – Input mask (#batch, 1, time).
Returns: Subsampled tensor (#batch, time’, odim), : where time’ = time // 4.
torch.Tensor: Subsampled mask (#batch, 1, time’), : where time’ = time // 4.
Return type: torch.Tensor