contrib.layers.xavier_initializer

tf.contrib.layers.xavier_initializer

tf.contrib.layers.xavier_initializer

tf.contrib.layers.xavier_initializer_conv2d

xavier_initializer(
    uniform=True,
    seed=None,
    dtype=tf.float32
)

Defined in tensorflow/contrib/layers/python/layers/initializers.py.

See the guide: Layers (contrib) > Initializers

Returns an initializer performing "Xavier" initialization for weights.

This function implements the weight initialization from:

Xavier Glorot and Yoshua Bengio (2010): Understanding the difficulty of training deep feedforward neural networks. International conference on artificial intelligence and statistics.

This initializer is designed to keep the scale of the gradients roughly the same in all layers. In uniform distribution this ends up being the range: x = sqrt(6. / (in + out)); [-x, x] and for normal distribution a standard deviation of sqrt(3. / (in + out)) is used.

Args:

  • uniform: Whether to use uniform or normal distributed random initialization.
  • seed: A Python integer. Used to create random seeds. See tf.set_random_seed for behavior.
  • dtype: The data type. Only floating point types are supported.

Returns:

An initializer for a weight matrix.

© 2017 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/python/tf/contrib/layers/xavier_initializer

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部