Skip to content

Commit 2b2e04b

Browse files
committed
fix(batchnorm): init
1 parent 1ae3158 commit 2b2e04b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

neuralnetlib/layers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1222,7 +1222,7 @@ def __str__(self) -> str:
12221222
return f'BatchNormalization(momentum={self.momentum}, epsilon={self.epsilon})'
12231223

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

12281228
input_data = np.clip(input_data, -10, 10)

0 commit comments

Comments
 (0)