espnet.nets.pytorch_backend.transformer.subsampling.Conv2dSubsampling1
Less than 1 minute
espnet.nets.pytorch_backend.transformer.subsampling.Conv2dSubsampling1
class espnet.nets.pytorch_backend.transformer.subsampling.Conv2dSubsampling1(idim, odim, dropout_rate, pos_enc=None)
Bases: Module
Similar to Conv2dSubsampling module, but without any subsampling performed.
- Parameters:
- idim (int) – Input dimension.
- odim (int) – Output dimension.
- dropout_rate (float) – Dropout rate.
- pos_enc (torch.nn.Module) – Custom position encoding layer.
Construct an Conv2dSubsampling1 object.
forward(x, x_mask)
Pass x through 2 Conv2d layers without subsampling.
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