Skip to content

Instantly share code, notes, and snippets.

@princewang1994
Last active November 4, 2018 16:32
Show Gist options
  • Save princewang1994/bc6961577f334e9d0aaa09f87704f524 to your computer and use it in GitHub Desktop.
Save princewang1994/bc6961577f334e9d0aaa09f87704f524 to your computer and use it in GitHub Desktop.
tensorflow实现的xavier初始化
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