[BUG] Inactive layer1x1 drops the activation from the WaveNet residual path
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 76/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- cpp
- Área
- machine-learning
Línea de trabajo
Start in NAM/wavenet/model.cpp at _Layer::Process and inspect the inactive-layer1x1 branch in both the Eigen and NAM_USE_INLINE_GEMM paths. Compare its residual handling with nam/models/wavenet/_layer_array.py, lines 755–773, where the trainer adds post_activation to x. Done means the core output matches the trainer for an inactive layer1x1 model, including the reported residual-path comparison.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Summary
When a WaveNet layer has "layer1x1": {"active": false} (.nam 0.7 format), the core passes the residual input through unchanged instead of adding the layer's activation output to it. The trainer (neural-amp-modeler) computes x + post_activation in that case, so the core's output diverges from the trainer's for such models.
Where
- Core (
main@ 0b3d3c97b0, also v0.5.4):NAM/wavenet/model.cpp,_Layer::Process…inactive-layer1x1branch (around line 385):// If layer1x1 is inactive, residual connection is just the input (identity) ...memcpy(... input.data() ...) // NAM_USE_INLINE_GEMM path this->_output_next_layer.leftCols(num_frames).noalias() = input.leftCols(num_frames); // Eigen path - Trainer (
main@ 0072676419):nam/models/wavenet/_layer_array.py, lines ~755–773:
i.e. withlayer_output = post_activation if self._layer1x1 is not None: layer_output = self._layer1x1(layer_output) ... residual = x[:, :, -layer_output.shape[2]:] + layer_outputlayer1x1inactive the residual isx + post_activation, notx.
Impact
On a model exported by neural-amp-modeler 0.13.0 with layer1x1 inactive on one layer array, the core's output differed from the trainer's PyTorch output (pad_start=True) by up to ~0.4 on that array and ~1.9e-3 at the model output. With the residual add restored, the core matches the trainer to ~6e-8.
Suggested fix
In the inactive branch, add the activation output (the bottleneck rows of _z) to the input instead of copying it, in both the Eigen path and the NAM_USE_INLINE_GEMM path, e.g. for the Eigen path:
this->_output_next_layer.leftCols(num_frames).noalias() =
input.leftCols(num_frames) + this->_z.topRows(bottleneck).leftCols(num_frames);
(Assuming bottleneck == channels is required when layer1x1 is inactive, as the residual shapes imply.)
- Lenguaje dominante
- C++
- Estrellas
- 977
- Forks
- 185
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de sdatkinson/NeuralAmpModelerCore
-
[BUG] Hardtanh ignores min_val/max_val from the .nam configPosiblemente ocupada @andrenepomuceno la tomó hace 28 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
-
get_dsp() aborts the process on well-formed JSON that is not a NAM modelPosiblemente ocupada @guicybercode la tomó hace 35 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
-
documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
sdatkinson/NeuralAmpModelerCore#305 · 1 comentario ·
-
Build on FreeBSD: "minor" and "major" in get_dsp.h cause build errorPosiblemente ocupada @Helshr la tomó hace 61 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
sdatkinson/NeuralAmpModelerCore#304 · 2 comentarios ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
sdatkinson/NeuralAmpModelerCore#327 · 1 reacción ·
Todos los issues de sdatkinson/NeuralAmpModelerCore
Issues similares
-
bug IO
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
MrNeRF/LichtFeld-Studio#3824 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
-
bug code-review testing tooling
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
aristocratos/btop#1945 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
boykopovar/AnyPS5#11291 ·
Los mantenedores suelen responder en 1 día