提交 854ccb9a authored 作者: Glenn Jocher's avatar Glenn Jocher

_print_weights()

上级 5bee6866
...@@ -125,6 +125,11 @@ class Model(nn.Module): ...@@ -125,6 +125,11 @@ class Model(nn.Module):
b = self.model[f].bias.detach().view(m.na, -1).T # conv.bias(255) to (3,85) b = self.model[f].bias.detach().view(m.na, -1).T # conv.bias(255) to (3,85)
print(('%g Conv2d.bias:' + '%10.3g' * 6) % (f, *b[:5].mean(1).tolist(), b[5:].mean())) print(('%g Conv2d.bias:' + '%10.3g' * 6) % (f, *b[:5].mean(1).tolist(), b[5:].mean()))
# def _print_weights(self):
# for m in self.model.modules():
# if type(m) is Bottleneck:
# print('%10.3g' % (m.w.detach().sigmoid() * 2)) # shortcut weights
def fuse(self): # fuse model Conv2d() + BatchNorm2d() layers def fuse(self): # fuse model Conv2d() + BatchNorm2d() layers
print('Fusing layers...') print('Fusing layers...')
for m in self.model.modules(): for m in self.model.modules():
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论