Skip to content
Snippets Groups Projects
Commit dba59e23 authored by Frisinghelli Daniel's avatar Frisinghelli Daniel
Browse files

Changed weight initialization to: Kaiming Uniform with ReLu.

parent 5c94a9fb
No related branches found
No related tags found
No related merge requests found
......@@ -54,10 +54,15 @@ class Conv2dSame(nn.Conv2d):
"""
super().__init__(*args, **kwargs)
# initialize layer weights after He et al. (2015) (kaiming uniform) for
# ReLu non-linearity
nn.init.kaiming_uniform_(self.weight, nonlinearity='relu')
# define tensorflows "SAME" padding for stride = 1
x_pad = self.same_padding(self.dilation[1], self.kernel_size[1])
y_pad = self.same_padding(self.dilation[0], self.kernel_size[0])
# amount of padding to conserve shape of input
self.padding = (y_pad, x_pad)
@staticmethod
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment