public interface FunctionBatchNorm<T extends Tensor<T>> extends Function<T>, BatchNorm
Implementation of a forward only Batch Normalization. It applies a previously computed linear transform which will ensure that the training data will have an output with zero mean and standard deviation (stdev) of one. The optional gamma and beta transform can also be applied.
See BatchNorm for a general discussion of Batch Normalization
| Modifier and Type | Method and Description |
|---|---|
void |
forward(T input,
T output)
Applies batch normalization to each variable in the input.
|
void |
setParameters(java.util.List<T> parameters)
See
forward(T, T) for a description of parameters. |
getOutputShape, getParameters, getParameterShapes, getTensorType, initializegetEPS, hasGammaBeta, setEPSvoid forward(T input, T output)
Applies batch normalization to each variable in the input.
Either two or four variables are stored in the parameter tensor as interleaved variables. If
BatchNorm.hasGammaBeta() returns true then mean, variance, gamma, and beta are saved. Otherwise just
mean, and variance are saved. These are also the order in which variables are interleaved together.
Summary Table
-------------------------------------------------
Input shape = (N, d[i], ... , d[k])
Output shape = (N, d[i], ... , d[k])
Params shape = (d[i], ... , d[k], M)
-------------------------------------------------
N = Size of mini-batch
d[i] = length of a dimension
M = Number of parameters. 2 or 4 if gamma-beta is being used.
in order of: mean, variance OR mean, variance, gamma, beta
NOTE: Interleaving is used instead of multiple tensors to improve memory locality, which reduces cache misses.
void setParameters(java.util.List<T> parameters)
forward(T, T) for a description of parameters.setParameters in interface Function<T extends Tensor<T>>parameters - Variable tensor. (d[i], ... , d[k], M), where M is 2 or 4. Not modified.