W3cubDocs

/TensorFlow C++

tensorflow::ops::FusedBatchNormV2

#include <nn_ops.h>

Batch normalization.

Summary

Note that the size of 4D Tensors are defined by either "NHWC" or "NCHW". The size of 1D Tensors matches the dimension C of the 4D Tensors.

Arguments:

  • scope: A Scope object
  • x: A 4D Tensor for input data.
  • scale: A 1D Tensor for scaling factor, to scale the normalized x.
  • offset: A 1D Tensor for offset, to shift to the normalized x.
  • mean: A 1D Tensor for population mean. Used for inference only; must be empty for training.
  • variance: A 1D Tensor for population variance. Used for inference only; must be empty for training.

Optional attributes (see Attrs):

  • epsilon: A small float number added to the variance of x.
  • data_format: The data format for x and y. Either "NHWC" (default) or "NCHW".
  • is_training: A bool value to indicate the operation is for training (default) or inference.

Returns:

  • Output y: A 4D Tensor for output data.
  • Output batch_mean: A 1D Tensor for the computed batch mean, to be used by TensorFlow to compute the running mean.
  • Output batch_variance: A 1D Tensor for the computed batch variance, to be used by TensorFlow to compute the running variance.
  • Output reserve_space_1: A 1D Tensor for the computed batch mean, to be reused in the gradient computation.
  • Output reserve_space_2: A 1D Tensor for the computed batch variance (inverted variance in the cuDNN case), to be reused in the gradient computation.
Constructors and Destructors
FusedBatchNormV2(const ::tensorflow::Scope & scope, ::tensorflow::Input x, ::tensorflow::Input scale, ::tensorflow::Input offset, ::tensorflow::Input mean, ::tensorflow::Input variance)
FusedBatchNormV2(const ::tensorflow::Scope & scope, ::tensorflow::Input x, ::tensorflow::Input scale, ::tensorflow::Input offset, ::tensorflow::Input mean, ::tensorflow::Input variance, const FusedBatchNormV2::Attrs & attrs)
Public attributes
batch_mean
batch_variance
reserve_space_1
reserve_space_2
y
Public static functions
DataFormat(StringPiece x)
Epsilon(float x)
IsTraining(bool x)
Structs
tensorflow::ops::FusedBatchNormV2::Attrs

Optional attribute setters for FusedBatchNormV2.

Public attributes

batch_mean

::tensorflow::Output batch_mean

batch_variance

::tensorflow::Output batch_variance

reserve_space_1

::tensorflow::Output reserve_space_1

reserve_space_2

::tensorflow::Output reserve_space_2

y

::tensorflow::Output y

Public functions

FusedBatchNormV2

 FusedBatchNormV2(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input x,
  ::tensorflow::Input scale,
  ::tensorflow::Input offset,
  ::tensorflow::Input mean,
  ::tensorflow::Input variance
)

FusedBatchNormV2

 FusedBatchNormV2(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input x,
  ::tensorflow::Input scale,
  ::tensorflow::Input offset,
  ::tensorflow::Input mean,
  ::tensorflow::Input variance,
  const FusedBatchNormV2::Attrs & attrs
)

Public static functions

DataFormat

Attrs DataFormat(
  StringPiece x
)

Epsilon

Attrs Epsilon(
  float x
)

IsTraining

Attrs IsTraining(
  bool x
)

© 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/cc/class/tensorflow/ops/fused-batch-norm-v2.html