espnet2.legacy.nets.pytorch_backend.transducer.vgg2l.VGG2L
Less than 1 minute
espnet2.legacy.nets.pytorch_backend.transducer.vgg2l.VGG2L
class espnet2.legacy.nets.pytorch_backend.transducer.vgg2l.VGG2L(idim: int, odim: int, pos_enc: Module = 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
