Package deepboof.impl.backward.standard
Class BaseDBatchNorm_F64
java.lang.Object
deepboof.impl.forward.standard.BaseFunction<T>
deepboof.impl.backward.standard.BaseDFunction<deepboof.tensors.Tensor_F64>
deepboof.impl.backward.standard.BaseDBatchNorm_F64
- All Implemented Interfaces:
DBatchNorm<deepboof.tensors.Tensor_F64>,deepboof.DFunction<deepboof.tensors.Tensor_F64>,deepboof.forward.BatchNorm,deepboof.Function<deepboof.tensors.Tensor_F64>
- Direct Known Subclasses:
DFunctionBatchNorm_F64,DSpatialBatchNorm_F64
public abstract class BaseDBatchNorm_F64 extends BaseDFunction<deepboof.tensors.Tensor_F64> implements DBatchNorm<deepboof.tensors.Tensor_F64>
Implements common functionality for all batch normalization implementations for
Tensor_F64.-
Field Summary
Fields Modifier and Type Field Description protected intDprotected doubleEPSprotected deepboof.tensors.Tensor_F64paramsprotected booleanrequiresGammaBetaprotected int[]shapeVariablesprotected deepboof.tensors.Tensor_F64tensorDiffXprotected deepboof.tensors.Tensor_F64tensorDMeanprotected deepboof.tensors.Tensor_F64tensorDVarprotected deepboof.tensors.Tensor_F64tensorDXhatprotected deepboof.tensors.Tensor_F64tensorMeanprotected deepboof.tensors.Tensor_F64tensorStdprotected deepboof.tensors.Tensor_F64tensorTmpprotected deepboof.tensors.Tensor_F64tensorXhatFields inherited from class deepboof.impl.backward.standard.BaseDFunction
learningModeFields inherited from class deepboof.impl.forward.standard.BaseFunction
miniBatchSize, parameters, shapeInput, shapeOutput, shapeParameters -
Constructor Summary
Constructors Constructor Description BaseDBatchNorm_F64(boolean requiresGammaBeta) -
Method Summary
Modifier and Type Method Description void_initialize()void_setParameters(List<deepboof.tensors.Tensor_F64> parameters)protected abstract int[]createShapeVariables(int[] shapeInput)Create the shape for all the variables which are being normalizeddoublegetEPS()deepboof.tensors.Tensor_F64getMean(deepboof.tensors.Tensor_F64 output)Returns the most recently computed mean for each variable in the tensor.Class<deepboof.tensors.Tensor_F64>getTensorType()deepboof.tensors.Tensor_F64getVariance(deepboof.tensors.Tensor_F64 output)Returns the most recently computed variance for each variable.booleanhasGammaBeta()voidsetEPS(double EPS)Methods inherited from class deepboof.impl.backward.standard.BaseDFunction
_backwards, backwards, evaluating, isLearning, learningMethods inherited from class deepboof.impl.forward.standard.BaseFunction
_forward, forward, getOutputShape, getParameters, getParameterShapes, initialize, setParametersMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface deepboof.DFunction
backwards, evaluating, isLearning, learningMethods inherited from interface deepboof.Function
forward, getOutputShape, getParameters, getParameterShapes, initialize, setParameters
-
Field Details
-
requiresGammaBeta
protected boolean requiresGammaBeta -
tensorMean
protected deepboof.tensors.Tensor_F64 tensorMean -
tensorStd
protected deepboof.tensors.Tensor_F64 tensorStd -
tensorXhat
protected deepboof.tensors.Tensor_F64 tensorXhat -
tensorDVar
protected deepboof.tensors.Tensor_F64 tensorDVar -
tensorDMean
protected deepboof.tensors.Tensor_F64 tensorDMean -
tensorDXhat
protected deepboof.tensors.Tensor_F64 tensorDXhat -
tensorDiffX
protected deepboof.tensors.Tensor_F64 tensorDiffX -
tensorTmp
protected deepboof.tensors.Tensor_F64 tensorTmp -
shapeVariables
protected int[] shapeVariables -
D
protected int D -
params
protected deepboof.tensors.Tensor_F64 params -
EPS
protected double EPS
-
-
Constructor Details
-
BaseDBatchNorm_F64
public BaseDBatchNorm_F64(boolean requiresGammaBeta)
-
-
Method Details
-
_initialize
public void _initialize()- Specified by:
_initializein classdeepboof.impl.forward.standard.BaseFunction<deepboof.tensors.Tensor_F64>
-
createShapeVariables
protected abstract int[] createShapeVariables(int[] shapeInput)Create the shape for all the variables which are being normalized- Parameters:
shapeInput- Shape of input tensor (without mini-batch)- Returns:
- shape of variables tensor
-
_setParameters
- Specified by:
_setParametersin classdeepboof.impl.forward.standard.BaseFunction<deepboof.tensors.Tensor_F64>
-
getEPS
public double getEPS()- Specified by:
getEPSin interfacedeepboof.forward.BatchNorm
-
setEPS
public void setEPS(double EPS)- Specified by:
setEPSin interfacedeepboof.forward.BatchNorm
-
hasGammaBeta
public boolean hasGammaBeta()- Specified by:
hasGammaBetain interfacedeepboof.forward.BatchNorm
-
getTensorType
- Specified by:
getTensorTypein interfacedeepboof.Function<deepboof.tensors.Tensor_F64>
-
getMean
public deepboof.tensors.Tensor_F64 getMean(deepboof.tensors.Tensor_F64 output)Description copied from interface:DBatchNormReturns the most recently computed mean for each variable in the tensor.- Specified by:
getMeanin interfaceDBatchNorm<deepboof.tensors.Tensor_F64>- Parameters:
output- Storage for mean tensor. Is reshaped. If null a new instance will be declared
-
getVariance
public deepboof.tensors.Tensor_F64 getVariance(deepboof.tensors.Tensor_F64 output)Description copied from interface:DBatchNormReturns the most recently computed variance for each variable. This will be the actual variance not something that has been adjusted by adding EPS to it.- Specified by:
getVariancein interfaceDBatchNorm<deepboof.tensors.Tensor_F64>- Parameters:
output- Storage for variance tensor. Is reshaped. If null a new instance will be declared
-