fix: use W_org matrix only where needed (#398)

* fix: minor change

use `W_org` matrix where needed...

* Update model.py

* Update model.py

* fix: Windows hash, remove BOM marker

* docs: Add info about test cases

* feat: Tests for row_normalization PRE & NONE

* feat: CI hash files for row_normalization PRE & NONE models

* feat: Documentation instructions about test suite

* add recommendation
This commit is contained in:
Vinay Umrethe
2026-07-01 16:13:14 +05:30
committed by GitHub
parent 680c43e1bf
commit 7470dfd7af
14 changed files with 215 additions and 15 deletions
+3 -1
View File
@@ -555,9 +555,11 @@ class Model:
# Flatten weight matrix to (out_features, in_features).
W = W.view(W.shape[0], -1)
if self.settings.row_normalization != RowNormalization.NONE:
if self.settings.row_normalization == RowNormalization.FULL:
# Keep a reference to the original weight matrix so we can subtract it later.
W_org = W
if self.settings.row_normalization != RowNormalization.NONE:
# Get the row norms.
W_row_norms = LA.vector_norm(W, dim=1, keepdim=True)
# Normalize the weight matrix along the rows.