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?
Read More:
- tf.layers.conv1d Function analysis (one dimensional convolution)
- Solve the problem of using in tensoft 2. X tf.contrib.slim No module named appears in the package: tensorflow.contrib problem
- Tensorflow with tf.Session The usage of () as sess
- Tensorflow in function tf.Print Method of outputting intermediate value
- In tensorflow tf.reduce_ Mean function
- The usage of Matlab function downsample
- The routine of benewake tfmini-s / tfmimi plus / tfluna / tf02 Pro / tf03 radar on Python
- The function and usage of argc and argv in C language
- Usage of pause function in MATLAB
- tf.gradients is not supported when eager execution is enabled. Use tf.GradientTape instead.
- Problem solving module ‘ tensorflow.compat . V2 ‘has no attribute’ contrib ‘and importerror cannot import name’ auto ‘
- Tensorflow tf.train.exponential_ Decay function (exponential decay method)
- Type definition error – one of the causes of type definition errors is WM in Oracle_ Concat function usage
- Cannot find module ‘vs/editor/contrib/inlineHints/inlineHintsController‘
- Array initializer is not allowed here
- 2021-11-08 error: could not convert ‘{0}‘ from ‘<brace-enclosed initializer list>‘ to
- tf.one_ How to use hot ()
- error: initializer element is not constant [How to Solve]
- [opencv + openvino] opencv-vino4.5.1 + opencv contrib installation
- raise RuntimeError(“tf.placeholder() is not compatible with “ RuntimeError: tf.placeholder() is not