espnet2.asr_transducer.utils.get_convinput_module_parameters
Less than 1 minute
espnet2.asr_transducer.utils.get_convinput_module_parameters
espnet2.asr_transducer.utils.get_convinput_module_parameters(input_size: int, last_conv_size, subsampling_factor: int, is_vgg: bool = True) → Tuple[Tuple[int, int] | int, int]
Return the convolution module parameters.
This function calculates the parameters for a convolutional module based on the input size, last convolution size, subsampling factor, and whether the architecture follows a VGG-like structure.
- Parameters:
- input_size – Module input size.
- last_conv_size – Last convolution size for module output size computation.
- subsampling_factor – Total subsampling factor.
- is_vgg – Whether the module type is VGG-like. Defaults to True.
- Returns:
- First MaxPool2D kernel size or second Conv2D kernel size and stride.
- output_size: Convolution module output size.
- Return type: A tuple containing
Examples
>>> get_convinput_module_parameters(64, 32, 2, True)
(1, 15)
>>> get_convinput_module_parameters(64, 32, 4, False)
((3, 2), 12)
NOTE
The output size is computed based on the input size and the specified subsampling factor. For VGG-like architectures, the calculation may differ from standard convolutional networks.