layer init for all sizes

This commit is contained in:
2020-10-21 08:48:16 -07:00
parent e3110c9922
commit 03fc6e8a49
+2 -2
View File
@@ -1,7 +1,7 @@
import numpy as np
def layer_init_uniform(m, h):
ret = np.random.uniform(-1., 1., size=(m,h))/np.sqrt(m*h)
def layer_init_uniform(*x):
ret = np.random.uniform(-1., 1., size=x)/np.sqrt(np.prod(x))
return ret.astype(np.float32)
def fetch_mnist():