{"record":{"id":"652b55dc2203cf50","repo":"babysor/MockingBird","slug":"unknown-pos-enc-layer-652b55","errorCode":null,"errorMessage":"unknown pos_enc_layer: ","messagePattern":"unknown pos_enc_layer: ","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"models/ppg_extractor/encoder/encoder.py","lineNumber":98,"sourceCode":"        selfattention_layer_type=\"selfattn\",\n        activation_type=\"swish\",\n        use_cnn_module=False,\n        cnn_module_kernel=31,\n        padding_idx=-1,\n    ):\n        \"\"\"Construct an Encoder object.\"\"\"\n        super(Encoder, self).__init__()\n\n        activation = get_activation(activation_type)\n        if pos_enc_layer_type == \"abs_pos\":\n            pos_enc_class = PositionalEncoding\n        elif pos_enc_layer_type == \"scaled_abs_pos\":\n            pos_enc_class = ScaledPositionalEncoding\n        elif pos_enc_layer_type == \"rel_pos\":\n            assert selfattention_layer_type == \"rel_selfattn\"\n            pos_enc_class = RelPositionalEncoding\n        else:\n            raise ValueError(\"unknown pos_enc_layer: \" + pos_enc_layer_type)\n\n        if input_layer == \"linear\":\n            self.embed = torch.nn.Sequential(\n                torch.nn.Linear(idim, attention_dim),\n                torch.nn.LayerNorm(attention_dim),\n                torch.nn.Dropout(dropout_rate),\n                pos_enc_class(attention_dim, positional_dropout_rate),\n            )\n        elif input_layer == \"conv2d\":\n            self.embed = Conv2dSubsampling(\n                idim,\n                attention_dim,\n                dropout_rate,\n                pos_enc_class(attention_dim, positional_dropout_rate),\n            )\n        elif input_layer == \"vgg2l\":\n            self.embed = VGG2L(idim, attention_dim)\n        elif input_layer == \"embed\":","sourceCodeStart":80,"sourceCodeEnd":116,"githubUrl":"https://github.com/babysor/MockingBird/blob/28dc5e14f12d7c754612af2fde8e78a4b03f8616/models/ppg_extractor/encoder/encoder.py#L80-L116","documentation":"Same as the conformer variant: the vanilla transformer Encoder constructor rejects pos_enc_layer_type values outside {'abs_pos','scaled_abs_pos','rel_pos'}.","triggerScenarios":"Constructing models/ppg_extractor/encoder/encoder.py's Encoder with an invalid pos_enc_layer_type string.","commonSituations":"Config drift from ESPnet versions; typo; combining rel_pos without rel_selfattn triggers the assert just above.","solutions":["Use 'abs_pos', 'scaled_abs_pos', or 'rel_pos'","For 'rel_pos' also set selfattention_layer_type='rel_selfattn'","Validate config against a working transformer example"],"exampleFix":"# before\npos_enc_layer_type: abspos\n\n# after\npos_enc_layer_type: abs_pos","handlingStrategy":"validation","validationCode":"assert pos_enc_layer_type in {'abs_pos','scaled_abs_pos','rel_pos'}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Centralize encoder-option validation in your config loader","Copy configs from this repo's examples, not upstream ESPnet"],"tags":["transformer","encoder","positional-encoding","config"],"backgroundTag":"invalid-enum-value","analyzedSha":"28dc5e14f12d7c754612af2fde8e78a4b03f8616","analyzedAt":"2026-08-27T02:26:53.589Z","schemaVersion":2},"datasetVersion":"2026-08-27T03:17:27.898Z"}