Skip to content

Instantly share code, notes, and snippets.

@himkt
Created December 11, 2019 12:40
Show Gist options
  • Save himkt/8d91a9d9f49688c1df515d7c56a99473 to your computer and use it in GitHub Desktop.
Save himkt/8d91a9d9f49688c1df515d7c56a99473 to your computer and use it in GitHub Desktop.
In [33]: a = chainer.initializers.GlorotUniform(rng=numpy.random.seed(1))
In [34]: a(b)
In [35]: b
Out[35]:
array([[-0.09089784, 0.24135339, -0.54759727, -0.21653382, -0.38695953,
-0.44657069, -0.34368472, -0.16917975, -0.11308557, 0.0425216 ],
[-0.08851797, 0.2028978 , -0.32375634, 0.4142069 , -0.51772095,
0.1867378 , -0.09058805, 0.06429149, -0.39393637, -0.33071325],
[ 0.32944917, 0.51295486, -0.20438357, 0.21067887, 0.41231366,
0.43226994, -0.45456129, -0.50494019, -0.36168265, 0.41423436],
[-0.439989 , -0.08642227, 0.50159285, 0.03633075, 0.21019085,
-0.2020925 , 0.20430153, 0.36656406, -0.52768875, 0.27401937],
[ 0.53552049, 0.27185185, -0.24051156, 0.31688963, -0.43464413,
-0.05707978, 0.44759395, -0.22608437, -0.23248047, -0.40528339],
[-0.52650712, 0.19590451, -0.31589557, -0.25683077, -0.00923114,
-0.48926682, 0.08119177, -0.38698946, 0.09782931, 0.21882432],
[-0.43562081, -0.09414695, 0.2129547 , -0.0940119 , -0.49300128,
0.03932254, 0.17942804, 0.01631021, 0.48702915, 0.0948163 ],
[ 0.44190466, -0.39712656, -0.39515296, 0.33673029, -0.11208941,
-0.36658611, 0.46831219, -0.16676415, 0.27475089, 0.24756839],
[ 0.41989079, 0.13547612, 0.27489366, -0.16552357, -0.25203137,
0.43367162, -0.07877215, 0.50920676, 0.17904119, 0.13331098],
[-0.42202464, 0.49239081, -0.05486851, 0.08587152, -0.10063109,
-0.28807251, 0.44188013, 0.08071183, -0.54457827, 0.12832582]])
In [36]: a = chainer.initializers.GlorotUniform(rng=numpy.random.seed(1))
In [37]: a(b)
In [38]: b
Out[38]:
array([[-0.09089784, 0.24135339, -0.54759727, -0.21653382, -0.38695953,
-0.44657069, -0.34368472, -0.16917975, -0.11308557, 0.0425216 ],
[-0.08851797, 0.2028978 , -0.32375634, 0.4142069 , -0.51772095,
0.1867378 , -0.09058805, 0.06429149, -0.39393637, -0.33071325],
[ 0.32944917, 0.51295486, -0.20438357, 0.21067887, 0.41231366,
0.43226994, -0.45456129, -0.50494019, -0.36168265, 0.41423436],
[-0.439989 , -0.08642227, 0.50159285, 0.03633075, 0.21019085,
-0.2020925 , 0.20430153, 0.36656406, -0.52768875, 0.27401937],
[ 0.53552049, 0.27185185, -0.24051156, 0.31688963, -0.43464413,
-0.05707978, 0.44759395, -0.22608437, -0.23248047, -0.40528339],
[-0.52650712, 0.19590451, -0.31589557, -0.25683077, -0.00923114,
-0.48926682, 0.08119177, -0.38698946, 0.09782931, 0.21882432],
[-0.43562081, -0.09414695, 0.2129547 , -0.0940119 , -0.49300128,
0.03932254, 0.17942804, 0.01631021, 0.48702915, 0.0948163 ],
[ 0.44190466, -0.39712656, -0.39515296, 0.33673029, -0.11208941,
-0.36658611, 0.46831219, -0.16676415, 0.27475089, 0.24756839],
[ 0.41989079, 0.13547612, 0.27489366, -0.16552357, -0.25203137,
0.43367162, -0.07877215, 0.50920676, 0.17904119, 0.13331098],
[-0.42202464, 0.49239081, -0.05486851, 0.08587152, -0.10063109,
-0.28807251, 0.44188013, 0.08071183, -0.54457827, 0.12832582]])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment