First of all tf.contrib.layers
This is a packaged high-level Library in tensorflow1. X, in which there are many high-level packages of functions,
Convolution function tf.contrib.layers . conv2d(), pooling function tf.contrib.layers .max_ Pool2d() and tf.contrib.layers .avg_ Pool2d (), all join function tf.contrib.layers .fully_ Connected () and so on
Using this high-level library to develop programs will improve efficiency.
Here is an introduction tf.contrib.layers .xavier_ Initializer function
xavier_initializer(
uniform=True,
seed=None,
dtype=tf.float32
)
This function returns an initializer “Xavier” for initializing weights.
This initializer is used to make the variance of each layer output as equal as possible.
Parameters:
Uniform: use uniform or normal distribution to initialize randomly.
seed: can be regarded as seed used to generate random numbers
dtype: only supports floating-point numbers.
Return value:
Initializing the weight matrix
is necessary
Tensorflow2. X does not use contrib advanced library
solution: how to initialize weights by Xavier rules in tensorflow 2.0?