Skip to content

Commit 6d76f31

Browse files
committed
remove check for linear
1 parent 5eea426 commit 6d76f31

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

model2vec/train/classifier.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,8 @@ def construct_head(self) -> nn.Sequential:
8484
if linear_modules:
8585
*initial, last = linear_modules
8686
for module in initial:
87-
if isinstance(module, nn.Linear):
88-
nn.init.kaiming_uniform_(module.weight, nonlinearity="relu")
89-
nn.init.zeros_(module.bias)
87+
nn.init.kaiming_uniform_(module.weight, nonlinearity="relu")
88+
nn.init.zeros_(module.bias)
9089
# Final layer does not kaiming
9190
nn.init.xavier_uniform_(last.weight)
9291
nn.init.zeros_(last.bias)

0 commit comments

Comments
 (0)