Skip to content

Commit

Permalink
Update decoder initialization (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
qubvel authored Sep 28, 2019
1 parent 7a348e2 commit 87691e4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion segmentation_models_pytorch/base/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ def __init__(self):
def initialize(self):
for m in self.modules():
if isinstance(m, nn.Conv2d):
nn.init.kaiming_normal_(m.weight, mode='fan_out', nonlinearity='relu')
nn.init.kaiming_uniform_(m.weight, mode='fan_in', nonlinearity='relu')
if m.bias is not None:
nn.init.constant_(m.bias, 0)
elif isinstance(m, nn.BatchNorm2d):
nn.init.constant_(m.weight, 1)
nn.init.constant_(m.bias, 0)

0 comments on commit 87691e4

Please sign in to comment.