Interface DFunctionBatchNorm<T extends deepboof.Tensor<T>>
- All Superinterfaces:
deepboof.forward.BatchNorm,DBatchNorm<T>,deepboof.DFunction<T>,deepboof.Function<T>
- All Known Implementing Classes:
DFunctionBatchNorm_F64
public interface DFunctionBatchNorm<T extends deepboof.Tensor<T>> extends DBatchNorm<T>
Implementation of Batch Normalization for training networks. This has distinctly
different behavior from forward only implementations. In this learning implementation, statistics of
the input parameters are recomputed every time forward(T, T) is invoked. While for the forward only
implementation those statistics are known already and not recomputed.
The above described change in behavior also changes how parameters are specified. mean and variance are no longer input parameters but are computed dynamically in the forwards pass.
NOTES:- Variance is computed the unbiased formulation, i.e. divide by N-1 instead of N
-
Method Summary
Modifier and Type Method Description voidforward(T input, T output)Applies batch normalization to each variable in the input.voidsetParameters(List<T> parameters)Seeforward(T, T)for a description of parameters.Methods inherited from interface deepboof.forward.BatchNorm
getEPS, hasGammaBeta, setEPSMethods inherited from interface deepboof.backward.DBatchNorm
getMean, getVarianceMethods inherited from interface deepboof.DFunction
backwards, evaluating, isLearning, learningMethods inherited from interface deepboof.Function
getOutputShape, getParameters, getParameterShapes, getTensorType, initialize
-
Method Details
-
forward
Applies batch normalization to each variable in the input.
There is only a parameter tensor if
BatchNorm.hasGammaBeta()returns true. If true then gamma, and beta are encoded in a single tensor in an interleaved fashion (gamma, beta).Summary Table ------------------------------------------------- Input shape = (N, d[i], ... , d[k]) Output shape = (N, d[i], ... , d[k]) Params shape = (d[i], ... , d[k], 2) ------------------------------------------------- N = Size of mini-batch d[i] = length of a dimension
NOTE: Interleaving is used in the parameters instead of multiple tensors to improve memory locality, which reduces cache misses.
-
setParameters
Seeforward(T, T)for a description of parameters.
-