Initializes network weights `W` with using the He uniform initialization strategy. Notes ----- The He uniform initializations trategy initializes thew eights in `W` using draws from Uniform(-b, b) where .. math:: b = \sqrt{\\frac{6}{\\text{fan_in}}} Devel
(weight_shape)
| 862 | |
| 863 | |
| 864 | def he_uniform(weight_shape): |
| 865 | """ |
| 866 | Initializes network weights `W` with using the He uniform initialization |
| 867 | strategy. |
| 868 | |
| 869 | Notes |
| 870 | ----- |
| 871 | The He uniform initializations trategy initializes thew eights in `W` using |
| 872 | draws from Uniform(-b, b) where |
| 873 | |
| 874 | .. math:: |
| 875 | |
| 876 | b = \sqrt{\\frac{6}{\\text{fan_in}}} |
| 877 | |
| 878 | Developed for deep networks with ReLU nonlinearities. |
| 879 | |
| 880 | Parameters |
| 881 | ---------- |
| 882 | weight_shape : tuple |
| 883 | The dimensions of the weight matrix/volume. |
| 884 | |
| 885 | Returns |
| 886 | ------- |
| 887 | W : :py:class:`ndarray <numpy.ndarray>` of shape `weight_shape` |
| 888 | The initialized weights. |
| 889 | """ |
| 890 | fan_in, fan_out = calc_fan(weight_shape) |
| 891 | b = np.sqrt(6 / fan_in) |
| 892 | return np.random.uniform(-b, b, size=weight_shape) |
| 893 | |
| 894 | |
| 895 | def he_normal(weight_shape): |
nothing calls this directly
no test coverage detected