common#
(s3prl.nn.common)
Common probing models
- Authors:
Leo 2022
FrameLevel#
- class s3prl.nn.common.FrameLevel(input_size: int, output_size: int, hidden_sizes: Optional[List[int]] = None, activation_type: Optional[str] = None, activation_conf: Optional[dict] = None)[source][source]#
Bases:
Module
The common frame-to-frame probing model
- Parameters:
input_size (int) – input size
output_size (int) – output size
hidden_sizes (List[int]) – a list of hidden layers’ hidden size. by default is [256] to project all different input sizes to the same dimension. set empty list to use the vanilla single layer linear model
activation_type (str) – the activation class name in
torch.nn
. Set None to disable activation and the model is pure linear. Default: Noneactivation_conf (dict) – the arguments for initializing the activation class. Default: empty dict
UtteranceLevel#
- class s3prl.nn.common.UtteranceLevel(input_size: int, output_size: int, hidden_sizes: Optional[List[int]] = None, activation_type: Optional[str] = None, activation_conf: Optional[dict] = None, pooling_type: str = 'MeanPooling', pooling_conf: Optional[dict] = None)[source][source]#
Bases:
Module
- Parameters:
input_size (int) – input_size
output_size (int) – output_size
hidden_sizes (List[int]) – a list of hidden layers’ hidden size. by default is [256] to project all different input sizes to the same dimension. set empty list to use the vanilla single layer linear model
activation_type (str) – the activation class name in
torch.nn
. Set None to disable activation and the model is pure linear. Default: Noneactivation_conf (dict) – the arguments for initializing the activation class. Default: empty dict
pooling_type (str) – the pooling class name in
s3prl.nn.pooling
. Default: MeanPoolingpooling_conf (dict) – the arguments for initializing the pooling class. Default: empty dict