Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta
#341 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
76/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
cpp

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.)

Lingua principale
C++
Stelle
955
Fork
183
Merge medio
36m
PR unite (30g)
4

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di sdatkinson/NeuralAmpModelerCore

Tutte le issue di sdatkinson/NeuralAmpModelerCore

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.