public class LibMatrixDNN extends Object
Modifier and Type | Class and Description |
---|---|
static class |
LibMatrixDNN.PoolingType |
Constructor and Description |
---|
LibMatrixDNN() |
Modifier and Type | Method and Description |
---|---|
static void |
addBias(double[] a,
double[] bias,
double biasMultiplier,
int N,
int K,
int PQ) |
static void |
batchNorm2D(MatrixBlock image,
MatrixBlock scale,
MatrixBlock bias,
MatrixBlock runningMean,
MatrixBlock runningVar,
String phase,
double epsilon,
double mu,
MatrixBlock ret,
MatrixBlock retRunningMean,
MatrixBlock retRunningVar,
MatrixBlock resultSaveMean,
MatrixBlock resultSaveInvVariance) |
static void |
batchNorm2DBackward(MatrixBlock image,
MatrixBlock dout,
MatrixBlock scale,
double epsilon,
MatrixBlock resultSaveMean,
MatrixBlock resultSaveInvVariance,
MatrixBlock dX,
MatrixBlock dScale,
MatrixBlock dBias) |
static void |
biasAdd(MatrixBlock input,
MatrixBlock bias,
MatrixBlock outputBlock,
int numThreads)
Performs the operation corresponding to the DML script:
ones = matrix(1, rows=1, cols=Hout*Wout)
output = input + matrix(bias %*% ones, rows=1, cols=F*Hout*Wout)
This operation is often followed by conv2d and hence we have introduced bias_add(input, bias) built-in function
|
static void |
biasMultiply(MatrixBlock input,
MatrixBlock bias,
MatrixBlock outputBlock,
int numThreads)
Performs the operation corresponding to the DML script:
ones = matrix(1, rows=1, cols=Hout*Wout)
output = input * matrix(bias %*% ones, rows=1, cols=F*Hout*Wout)
This operation is often followed by conv2d and hence we have introduced bias_multiply(input, bias) built-in function
|
static void |
channelSums(MatrixBlock input,
MatrixBlock outputBlock,
int C,
int HW)
Perform channel sum operation
|
static void |
conv2d(MatrixBlock input,
MatrixBlock filter,
MatrixBlock outputBlock,
DnnParameters params)
This method performs convolution (i.e.
|
static void |
conv2dBackwardData(MatrixBlock filter,
MatrixBlock dout,
MatrixBlock outputBlock,
DnnParameters params)
This method computes the backpropogation errors for previous layer of convolution operation
|
static void |
conv2dBackwardFilter(MatrixBlock input,
MatrixBlock dout,
MatrixBlock outputBlock,
DnnParameters params)
This method computes the backpropogation errors for filter of convolution operation
|
static void |
multBias(double[] a,
double[] bias,
int N,
int K,
int PQ) |
static void |
pooling(MatrixBlock input,
MatrixBlock output,
DnnParameters params,
LibMatrixDNN.PoolingType poolType) |
static void |
poolingBackward(MatrixBlock input,
MatrixBlock dout,
MatrixBlock outputBlock,
DnnParameters params,
boolean performReluBackward,
LibMatrixDNN.PoolingType poolType)
This method computes the backpropogation errors for previous layer of pooling operation
|
static void |
reluBackward(MatrixBlock input,
MatrixBlock dout,
MatrixBlock outputBlock,
int numThreads)
This method computes the backpropagation errors for previous layer of relu operation
|
static void |
resetStatistics() |
public static void resetStatistics()
public static void conv2d(MatrixBlock input, MatrixBlock filter, MatrixBlock outputBlock, DnnParameters params)
input
- input batchfilter
- filteroutputBlock
- output of convolutionparams
- convolution parameterspublic static void conv2dBackwardData(MatrixBlock filter, MatrixBlock dout, MatrixBlock outputBlock, DnnParameters params)
filter
- filter used in conv2ddout
- errors from next layeroutputBlock
- output errorsparams
- convolution parameterspublic static void conv2dBackwardFilter(MatrixBlock input, MatrixBlock dout, MatrixBlock outputBlock, DnnParameters params)
input
- input imagedout
- errors from next layeroutputBlock
- output errorsparams
- convolution parameterspublic static void pooling(MatrixBlock input, MatrixBlock output, DnnParameters params, LibMatrixDNN.PoolingType poolType)
public static void poolingBackward(MatrixBlock input, MatrixBlock dout, MatrixBlock outputBlock, DnnParameters params, boolean performReluBackward, LibMatrixDNN.PoolingType poolType)
input
- input matrixdout
- dout matrixoutputBlock
- output matrixparams
- convolution parametersperformReluBackward
- perform ReLU backwardpoolType
- type of poolingpublic static void reluBackward(MatrixBlock input, MatrixBlock dout, MatrixBlock outputBlock, int numThreads)
input
- input matrixdout
- errors from next layeroutputBlock
- output matrixnumThreads
- number of threadspublic static void biasAdd(MatrixBlock input, MatrixBlock bias, MatrixBlock outputBlock, int numThreads)
input
- input matrixbias
- bias matrixoutputBlock
- output matrixnumThreads
- number of threadspublic static void channelSums(MatrixBlock input, MatrixBlock outputBlock, int C, int HW)
input
- input matrix blockoutputBlock
- output matrix blockC
- number of channelsHW
- height X widthpublic static void batchNorm2DBackward(MatrixBlock image, MatrixBlock dout, MatrixBlock scale, double epsilon, MatrixBlock resultSaveMean, MatrixBlock resultSaveInvVariance, MatrixBlock dX, MatrixBlock dScale, MatrixBlock dBias)
public static void batchNorm2D(MatrixBlock image, MatrixBlock scale, MatrixBlock bias, MatrixBlock runningMean, MatrixBlock runningVar, String phase, double epsilon, double mu, MatrixBlock ret, MatrixBlock retRunningMean, MatrixBlock retRunningVar, MatrixBlock resultSaveMean, MatrixBlock resultSaveInvVariance)
public static void addBias(double[] a, double[] bias, double biasMultiplier, int N, int K, int PQ)
public static void multBias(double[] a, double[] bias, int N, int K, int PQ)
public static void biasMultiply(MatrixBlock input, MatrixBlock bias, MatrixBlock outputBlock, int numThreads)
input
- input matrixbias
- bias matrixoutputBlock
- output matrixnumThreads
- number of threadsCopyright © 2020 The Apache Software Foundation. All rights reserved.