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 int D  
    protected double EPS  
    protected deepboof.tensors.Tensor_F64 params  
    protected boolean requiresGammaBeta  
    protected int[] shapeVariables  
    protected deepboof.tensors.Tensor_F64 tensorDiffX  
    protected deepboof.tensors.Tensor_F64 tensorDMean  
    protected deepboof.tensors.Tensor_F64 tensorDVar  
    protected deepboof.tensors.Tensor_F64 tensorDXhat  
    protected deepboof.tensors.Tensor_F64 tensorMean  
    protected deepboof.tensors.Tensor_F64 tensorStd  
    protected deepboof.tensors.Tensor_F64 tensorTmp  
    protected deepboof.tensors.Tensor_F64 tensorXhat  

    Fields inherited from class deepboof.impl.backward.standard.BaseDFunction

    learningMode

    Fields 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 normalized
    double getEPS()  
    deepboof.tensors.Tensor_F64 getMean​(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_F64 getVariance​(deepboof.tensors.Tensor_F64 output)
    Returns the most recently computed variance for each variable.
    boolean hasGammaBeta()  
    void setEPS​(double EPS)  

    Methods inherited from class deepboof.impl.backward.standard.BaseDFunction

    _backwards, backwards, evaluating, isLearning, learning

    Methods inherited from class deepboof.impl.forward.standard.BaseFunction

    _forward, forward, getOutputShape, getParameters, getParameterShapes, initialize, setParameters

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface deepboof.DFunction

    backwards, evaluating, isLearning, learning

    Methods 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:
      _initialize in class deepboof.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

      public void _setParameters​(List<deepboof.tensors.Tensor_F64> parameters)
      Specified by:
      _setParameters in class deepboof.impl.forward.standard.BaseFunction<deepboof.tensors.Tensor_F64>
    • getEPS

      public double getEPS()
      Specified by:
      getEPS in interface deepboof.forward.BatchNorm
    • setEPS

      public void setEPS​(double EPS)
      Specified by:
      setEPS in interface deepboof.forward.BatchNorm
    • hasGammaBeta

      public boolean hasGammaBeta()
      Specified by:
      hasGammaBeta in interface deepboof.forward.BatchNorm
    • getTensorType

      public Class<deepboof.tensors.Tensor_F64> getTensorType()
      Specified by:
      getTensorType in interface deepboof.Function<deepboof.tensors.Tensor_F64>
    • getMean

      public deepboof.tensors.Tensor_F64 getMean​(deepboof.tensors.Tensor_F64 output)
      Description copied from interface: DBatchNorm
      Returns the most recently computed mean for each variable in the tensor.
      Specified by:
      getMean in interface DBatchNorm<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: DBatchNorm
      Returns 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:
      getVariance in interface DBatchNorm<deepboof.tensors.Tensor_F64>
      Parameters:
      output - Storage for variance tensor. Is reshaped. If null a new instance will be declared