Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

[BUG] Inactive layer1x1 drops the activation from the WaveNet residual path

Abierto
#341 0 comentarios 0 reacciones 0 asignados Ver en GitHub

@andrenepomuceno ya está trabajando en esto.

Desde el 27/9/2026.

  • #343 de @andrenepomuceno — abierto

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

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-layer1x1 branch (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:
    layer_output = post_activation
    if self._layer1x1 is not None:
        layer_output = self._layer1x1(layer_output)
        ...
    residual = x[:, :, -layer_output.shape[2]:] + layer_output
    
    i.e. with layer1x1 inactive the residual is x + post_activation, not x.

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

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de sdatkinson/NeuralAmpModelerCore

Todos los issues de sdatkinson/NeuralAmpModelerCore

Issues similares

Más issues de C++

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.