espnet.nets.pytorch_backend.transducer.vgg2l.VGG2L
Less than 1 minute
espnet.nets.pytorch_backend.transducer.vgg2l.VGG2L
class espnet.nets.pytorch_backend.transducer.vgg2l.VGG2L(idim: int, odim: int, pos_enc: Module | None = None)
Bases: Module
VGG2L module for custom encoder.
- Parameters:
- idim – Input dimension.
- odim – Output dimension.
- pos_enc – Positional encoding class.
Construct a VGG2L object.
create_new_mask(feats_mask: Tensor) → Tensor
Create a subsampled mask of feature sequences.
- Parameters:feats_mask – Mask of feature sequences. (B, 1, F)
- Returns: Mask of VGG2L output sequences. (B, 1, sub(F))
- Return type: vgg_mask
forward(feats: Tensor, feats_mask: Tensor) → Tuple[Tensor, Tensor] | Tuple[Tuple[Tensor, Tensor], Tensor]
Forward VGG2L bottleneck.
Parameters:
- feats – Feature sequences. (B, F, D_feats)
- feats_mask – Mask of feature sequences. (B, 1, F)
Returns: VGG output sequences. : (B, sub(F), D_out) or ((B, sub(F), D_out), (B, sub(F), D_att))
vgg_mask: Mask of VGG output sequences. (B, 1, sub(F))
Return type: vgg_output