MCPcopy Create free account
hub / github.com/modelscope/FunASR / __init__

Method __init__

funasr/models/sense_voice/model.py:496–617  ·  view source on GitHub ↗

Initialize SenseVoiceEncoderSmall. Args: input_size: Size/dimension parameter. output_size: Size/dimension parameter. attention_heads: TODO. linear_units: TODO. num_blocks: TODO. tp_b

(
        self,
        input_size: int,
        output_size: int = 256,
        attention_heads: int = 4,
        linear_units: int = 2048,
        num_blocks: int = 6,
        tp_blocks: int = 0,
        dropout_rate: float = 0.1,
        positional_dropout_rate: float = 0.1,
        attention_dropout_rate: float = 0.0,
        stochastic_depth_rate: float = 0.0,
        input_layer: Optional[str] = "conv2d",
        pos_enc_class=SinusoidalPositionEncoder,
        normalize_before: bool = True,
        concat_after: bool = False,
        positionwise_layer_type: str = "linear",
        positionwise_conv_kernel_size: int = 1,
        padding_idx: int = -1,
        kernel_size: int = 11,
        sanm_shfit: int = 0,
        selfattention_layer_type: str = "sanm",
        **kwargs,
    )

Source from the content-addressed store, hash-verified

494 """
495
496 def __init__(
497 self,
498 input_size: int,
499 output_size: int = 256,
500 attention_heads: int = 4,
501 linear_units: int = 2048,
502 num_blocks: int = 6,
503 tp_blocks: int = 0,
504 dropout_rate: float = 0.1,
505 positional_dropout_rate: float = 0.1,
506 attention_dropout_rate: float = 0.0,
507 stochastic_depth_rate: float = 0.0,
508 input_layer: Optional[str] = "conv2d",
509 pos_enc_class=SinusoidalPositionEncoder,
510 normalize_before: bool = True,
511 concat_after: bool = False,
512 positionwise_layer_type: str = "linear",
513 positionwise_conv_kernel_size: int = 1,
514 padding_idx: int = -1,
515 kernel_size: int = 11,
516 sanm_shfit: int = 0,
517 selfattention_layer_type: str = "sanm",
518 **kwargs,
519 ):
520 """Initialize SenseVoiceEncoderSmall.
521
522 Args:
523 input_size: Size/dimension parameter.
524 output_size: Size/dimension parameter.
525 attention_heads: TODO.
526 linear_units: TODO.
527 num_blocks: TODO.
528 tp_blocks: TODO.
529 dropout_rate: TODO.
530 positional_dropout_rate: TODO.
531 attention_dropout_rate: TODO.
532 stochastic_depth_rate: TODO.
533 input_layer: TODO.
534 pos_enc_class: TODO.
535 normalize_before: TODO.
536 concat_after: TODO.
537 positionwise_layer_type: TODO.
538 positionwise_conv_kernel_size: Size/dimension parameter.
539 padding_idx: TODO.
540 kernel_size: Size/dimension parameter.
541 sanm_shfit: TODO.
542 selfattention_layer_type: TODO.
543 **kwargs: Additional keyword arguments.
544 """
545 super().__init__()
546 self._output_size = output_size
547
548 self.embed = SinusoidalPositionEncoder()
549
550 self.normalize_before = normalize_before
551
552 positionwise_layer = PositionwiseFeedForward
553 positionwise_layer_args = (

Callers

nothing calls this directly

Calls 4

EncoderLayerSANMClass · 0.70
LayerNormClass · 0.70
__init__Method · 0.45

Tested by

no test coverage detected