Last active
November 4, 2018 16:32
-
-
Save princewang1994/bc6961577f334e9d0aaa09f87704f524 to your computer and use it in GitHub Desktop.
tensorflow实现的xavier初始化
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def xavier_init(size): | |
in_dim = size[0] | |
xavier_stddev = 1. / tf.sqrt(in_dim / 2.) | |
return tf.random_normal(shape=size, stddev=xavier_stddev) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment