(m)
| 10 | |
| 11 | |
| 12 | def Xavier(m): |
| 13 | if m.__class__.__name__ == 'Linear': |
| 14 | fan_in, fan_out = m.weight.data.size(1), m.weight.data.size(0) |
| 15 | std = 1.0 * math.sqrt(2.0 / (fan_in + fan_out)) |
| 16 | a = math.sqrt(3.0) * std |
| 17 | m.weight.data.uniform_(-a, a) |
| 18 | if m.bias is not None: |
| 19 | m.bias.data.fill_(0.0) |
| 20 | |
| 21 | |
| 22 | class MLP(nn.Module): |
nothing calls this directly
no outgoing calls
no test coverage detected