Batch normalization.
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.
Nested Classes
| class | FusedBatchNorm.Options | Optional attributes for FusedBatchNorm
|
|
Constants
| String | OP_NAME | The name of this op, as known by TensorFlow core engine |
Public Methods
| Output<U> |
batchMean()
A 1D Tensor for the computed batch mean, to be used by TensorFlow
to compute the running mean.
|
| Output<U> |
batchVariance()
A 1D Tensor for the computed batch variance, to be used by
TensorFlow to compute the running variance.
|
| static <T extends TNumber, U extends TNumber> FusedBatchNorm<T, U> | |
| static FusedBatchNorm.Options |
dataFormat(String dataFormat)
|
| static FusedBatchNorm.Options |
epsilon(Float epsilon)
|
| static FusedBatchNorm.Options |
exponentialAvgFactor(Float exponentialAvgFactor)
|
| static FusedBatchNorm.Options |
isTraining(Boolean isTraining)
|
| Output<U> |
reserveSpace1()
A 1D Tensor for the computed batch mean, to be reused
in the gradient computation.
|
| Output<U> |
reserveSpace2()
A 1D Tensor for the computed batch variance (inverted variance
in the cuDNN case), to be reused in the gradient computation.
|
| Output<U> |
reserveSpace3()
A 1D Tensor for some intermediate results, to be reused in the gradient
computation for better efficiency.
|
| Output<T> |
y()
A 4D Tensor for output data.
|
Inherited Methods
Constants
public static final String OP_NAME
The name of this op, as known by TensorFlow core engine
Public Methods
public Output<U> batchMean ()
A 1D Tensor for the computed batch mean, to be used by TensorFlow to compute the running mean.
public Output<U> batchVariance ()
A 1D Tensor for the computed batch variance, to be used by TensorFlow to compute the running variance.
public static FusedBatchNorm<T, U> create (Scope scope, Operand<T> x, Operand<U> scale, Operand<U> offset, Operand<U> mean, Operand<U> variance, Options... options)
Factory method to create a class wrapping a new FusedBatchNorm operation.
Parameters
| scope | current scope |
|---|---|
| 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. |
| options | carries optional attributes values |
Returns
- a new instance of FusedBatchNorm
public static FusedBatchNorm.Options dataFormat (String dataFormat)
Parameters
| dataFormat | The data format for x and y. Either "NHWC" (default) or "NCHW". |
|---|
public static FusedBatchNorm.Options epsilon (Float epsilon)
Parameters
| epsilon | A small float number added to the variance of x. |
|---|
public static FusedBatchNorm.Options isTraining (Boolean isTraining)
Parameters
| isTraining | A bool value to indicate the operation is for training (default) or inference. |
|---|
public Output<U> reserveSpace1 ()
A 1D Tensor for the computed batch mean, to be reused in the gradient computation.
public Output<U> reserveSpace2 ()
A 1D Tensor for the computed batch variance (inverted variance in the cuDNN case), to be reused in the gradient computation.
public Output<U> reserveSpace3 ()
A 1D Tensor for some intermediate results, to be reused in the gradient computation for better efficiency.