Skip to content

Commit

Permalink
fix(batchnorm): init
Browse files Browse the repository at this point in the history
  • Loading branch information
marcpinet committed Dec 9, 2024
1 parent 1ae3158 commit 2b2e04b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion neuralnetlib/layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1222,7 +1222,7 @@ def __str__(self) -> str:
return f'BatchNormalization(momentum={self.momentum}, epsilon={self.epsilon})'

def forward_pass(self, input_data: np.ndarray, training: bool = True) -> np.ndarray:
if self.gamma is None:
if self.gamma is None or self.running_mean is None or self.running_var is None:
self.initialize_weights(input_data.shape[1:])

input_data = np.clip(input_data, -10, 10)
Expand Down

0 comments on commit 2b2e04b

Please sign in to comment.