xavier initialization
(m)
| 54 | |
| 55 | |
| 56 | def weights_init(m): |
| 57 | """ |
| 58 | xavier initialization |
| 59 | """ |
| 60 | classname = m.__class__.__name__ |
| 61 | if classname.find('Conv') != -1 and m.weight is not None: |
| 62 | torch.nn.init.xavier_normal_(m.weight) |
| 63 | elif classname.find('BatchNorm') != -1: |
| 64 | m.weight.data.normal_() |
| 65 | m.bias.data.fill_(0) |
| 66 | |
| 67 | ''' |
| 68 | models |
nothing calls this directly
no outgoing calls
no test coverage detected