Tensorflow.js tf.layers.batchNormalization() Function
The tf.layers.batchNormalization() function is used to apply the batch normalization operation on data. Batch normalisation is a method for training very deep neural networks that standardises each mini-inputs batch’s to a layer. This stabilises the learning process and significantly reduces the number of training epochs needed to create deep networks.
Input Shape: Arbitrary. When utilizing this layer as the initial layer in a model, use the inputShape configuration.
Output Shape: The output has the same shape as the input.
Parameters: It accepts the args object which can have the following properties:
- axis (number): The integer axis that should be normalized (typically the features axis). -1 is the default value.
- momentum (number): The moving average’s momentum. The default value is 0.99.
- epsilon (number): The small float is added to the variance to avoid division by zero. Defaults to 1e-3.
- center (boolean): If this is true, add the offset of beta to the normalized tensor. If false, beta isn’t taken into account. The value is set to true by default.
- scale (boolean): If this is true, multiplied by gamma. Gamma is not utilized if false. True is the default value.
- betaInitializer: This is the beta weight’s initializer. ‘zeroes’ is the default value.
- gammaInitializer: This is the gamma weight’s initializer. ‘ones’ is the default value.
- movingMeanInitializer: This is the moving mean’s initializer. ‘zeroes’ is the default value.
- movingVarianceInitializer: This is the moving variance’s initializer. ‘ones’ is the default value.
- betaConstraint: The constraint for the beta weight.
- gammaConstraint: The constraint for the gamma weight.
- betaRegularizer: The regularizer for the beta weight.
- gammaRegularizer: The regularizer for the beta weight.
Return Value: It returns an object (BatchNormalization).
Tensor [[1.1194404, -0.7996003, 1.8990507 ], [0.11994 , 0.2498751 , -3.3983014]]
Tensor [[[11.9940042, 3.1984012 ], [4.7976022 , 8.9955034 ], [9.9950037 , 2.4987509 ]], [[7.9960032 , 10.994504 ], [9.3953028 , 24.9875088], [24.8875599, 98.6506805]]]
Please Login to comment...