update conv bias

This commit is contained in:
zwy 2020-04-29 23:09:43 +08:00
parent dd58aace62
commit 85f5ac4362
1 changed files with 1 additions and 3 deletions

View File

@ -310,9 +310,7 @@ class Conv(Module):
self.weight = init.relu_invariant_gauss([out_channels, in_channels//groups, Kh, Kw], dtype="float", mode="fan_out")
if bias:
shape = self.weight.shape
bound = 1 / math.sqrt(shape[1] * shape[2] * shape[3])
self.bias = init.uniform([out_channels], dtype="float", low=-bound, high=bound)
self.bias = init.invariant_uniform(self.weight.shape, "float")
else:
self.bias = None