update conv bias

This commit is contained in:
zwy 2020-04-30 21:33:46 +08:00
parent 5f88c2e5c1
commit 9b0a4c1d8c
1 changed files with 1 additions and 3 deletions

View File

@ -352,9 +352,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.uniform([out_channels], dtype="float", low=-1, high=1)
else:
self.bias = None