Jasper¶
Jasper Model¶
-
class
openspeech.models.jasper.model.
Jasper10x5Model
(configs: omegaconf.dictconfig.DictConfig, tokenizer: openspeech.tokenizers.tokenizer.Tokenizer)[source]¶ Jasper: An End-to-End Convolutional Neural Acoustic Model Paper: https://arxiv.org/pdf/1904.03288.pdf
- Parameters
configs (DictConfig) – configuration set.
tokenizer (Tokeizer) – tokenizer is in charge of preparing the inputs for a model.
- Inputs:
inputs (torch.FloatTensor): A input sequence passed to encoders. Typically for inputs this will be a padded FloatTensor of size
(batch, seq_length, dimension)
. input_lengths (torch.LongTensor): The length of input tensor.(batch)
- Returns
Result of model predictions that contains y_hats, logits, output_lengths
- Return type
outputs (dict)
-
class
openspeech.models.jasper.model.
Jasper5x3Model
(configs: omegaconf.dictconfig.DictConfig, tokenizer: openspeech.tokenizers.tokenizer.Tokenizer)[source]¶ Jasper: An End-to-End Convolutional Neural Acoustic Model Paper: https://arxiv.org/pdf/1904.03288.pdf
- Parameters
configs (DictConfig) – configuration set.
tokenizer (Tokenizer) – tokenizer is in charge of preparing the inputs for a model.
- Inputs:
inputs (torch.FloatTensor): A input sequence passed to encoders. Typically for inputs this will be a padded FloatTensor of size
(batch, seq_length, dimension)
. input_lengths (torch.LongTensor): The length of input tensor.(batch)
- Returns
Result of model predictions that contains y_hats, logits, output_lengths
- Return type
outputs (dict)
Jasper Configuration¶
-
class
openspeech.models.jasper.configurations.
Jasper10x5Config
(model_name: str = 'jasper10x5', num_blocks: int = 10, num_sub_blocks: int = 5, in_channels: str = '(None, 256, 256, 256, 384, 384, 512, 512, 640, 640, 768, 768, 896, 1024)', out_channels: str = '(256, 256, 256, 384, 384, 512, 512, 640, 640, 768, 768, 768, 896, 1024, None)', kernel_size: str = '(11, 11, 11, 13, 13, 17, 17, 21, 21, 25, 25, 29, 1, 1)', dilation: str = '(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1)', dropout_p: str = '(0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.3, 0.3, 0.3, 0.3, 0.4, 0.4, 0.0)', optimizer: str = 'novograd')[source]¶ This is the configuration class to store the configuration of a
Jasper10x5
.It is used to initiated an Jasper10x5 model.
Configuration objects inherit from :class: ~openspeech.dataclass.configs.OpenspeechDataclass.
- Parameters
model_name (str) – Model name (default: jasper10x5)
num_blocks (int) – Number of jasper blocks (default: 10)
num_sub_blocks (int) – Number of jasper sub blocks (default: 5)
in_channels (str) – Output channels of jasper block’s convolution
out_channels (str) – Output channels of jasper block’s convolution
kernel_size (str) – Kernel size of jasper block’s convolution
dilation (str) – Dilation of jasper block’s convolution
dropout_p (str) – Dropout probability
optimizer (str) – Optimizer for training.
-
class
openspeech.models.jasper.configurations.
Jasper5x3Config
(model_name: str = 'jasper5x3', num_blocks: int = 5, num_sub_blocks: int = 3, in_channels: str = '(None, 256, 256, 256, 384, 384, 512, 512, 640, 640, 768, 768, 896, 1024)', out_channels: str = '(256, 256, 256, 384, 384, 512, 512, 640, 640, 768, 768, 896, 1024, None)', kernel_size: str = '(11, 11, 11, 13, 13, 17, 17, 21, 21, 25, 25, 29, 1, 1)', dilation: str = '(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1)', dropout_p: str = '(0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.3, 0.3, 0.3, 0.3, 0.4, 0.4, 0.0)', optimizer: str = 'novograd')[source]¶ This is the configuration class to store the configuration of a
Jasper5x3
.It is used to initiated an Jasper5x3 model.
Configuration objects inherit from :class: ~openspeech.dataclass.configs.OpenspeechDataclass.
- Parameters
model_name (str) – Model name (default: jasper5x3)
num_blocks (int) – Number of jasper blocks (default: 5)
num_sub_blocks (int) – Number of jasper sub blocks (default: 3)
in_channels (str) – Output channels of jasper block’s convolution
out_channels (str) – Output channels of jasper block’s convolution
kernel_size (str) – Kernel size of jasper block’s convolution
dilation (str) – Dilation of jasper block’s convolution
dropout_p (str) – Dropout probability
optimizer (str) – Optimizer for training.