Explorar el Código

_print_weights()

5.0
Glenn Jocher hace 4 años
padre
commit
854ccb9a74
Se han modificado 1 ficheros con 5 adiciones y 0 borrados
  1. +5
    -0
      models/yolo.py

+ 5
- 0
models/yolo.py Ver fichero

@@ -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)
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
print('Fusing layers...')
for m in self.model.modules():

Cargando…
Cancelar
Guardar