MPSMatrixSum(3) | MetalPerformanceShaders.framework | MPSMatrixSum(3) |
MPSMatrixSum
#import <MPSMatrixSum.h>
Inherits MPSKernel.
(nonnull instancetype) - initWithDevice:
(nonnull instancetype) - initWithDevice:count:rows:columns:transpose:
(void) - setNeuronType:parameterA:parameterB:parameterC:
(MPSCNNNeuronType) - neuronType
(void) -
encodeToCommandBuffer:sourceMatrices:resultMatrix:scaleVector:offsetVector:biasVector:startIndex:
(nullable instancetype) - initWithCoder:device:
NSUInteger rows
NSUInteger columns
NSUInteger count
BOOL transpose
float neuronParameterA
float neuronParameterB
float neuronParameterC
MPSMatrixSum.h MetalPerformanceShaders.framework
Copyright:
This depends on Metal.framework MPSMatrixSum performs a pointwise summation of N MPSMatrix objects and applies an optional bias term and neuron activation function.
MPSMatrix A = empty matrix; for (i = 0; i < N; ++i) A += alpha[i]*B[i];
if (bias) A += broadcast(bias);
if (neuron) A = applyNeuron(A);
Where B is the array of MPSMatrix objects, A is the destination MPSMatrix, alpha is an array of scalar values, bias is a vector which is broadcast and accumulated across each row of the intermediate result, and applyNeuron is a neuron activation function.
Each matrix in the array may have an independent origin.
Encode the operations to the command buffer
Parameters:
NSSecureCoding compatability See MPSKernel::initWithCoder.
Parameters:
Returns:
Reimplemented from MPSKernel.
Standard init with default properties per filter type
Parameters:
Returns:
Reimplemented from MPSKernel.
Initialize a MPSMatrixSum kernel.
Parameters:
Getter funtion for neuronType set using setNeuronType:parameterA:parameterB:parameterC method
Specifies a neuron activation function to be used.
This method can be used to add a neuron activation funtion of given type with associated scalar parameters A, B, and C that are shared across all output values. Note that this method can only be used to specify neurons which are specified by three (or fewer) parameters shared across all output values (or channels, in CNN nomenclature). It is an error to call this method for neuron activation functions like MPSCNNNeuronTypePReLU, which require per-channel parameter values. An MPSMatrixSum kernel is initialized with a default neuron function of MPSCNNNeuronTypeNone.
Parameters:
The number of columns to sum.
The number of matrices to sum.
Neuron parameter A.
Neuron parameter B.
Neuron parameter C.
The number of rows to sum.
The transposition used to initialize the kernel.
Generated automatically by Doxygen for MetalPerformanceShaders.framework from the source code.
Mon Jul 9 2018 | Version MetalPerformanceShaders-119.3 |