MPSCNNNeuron(3) | MetalPerformanceShaders.framework | MPSCNNNeuron(3) |
MPSCNNNeuron
#import <MPSCNNNeuron.h>
Inherits MPSCNNKernel.
Inherited by MPSCNNNeuronAbsolute, MPSCNNNeuronELU, MPSCNNNeuronExponential, MPSCNNNeuronHardSigmoid, MPSCNNNeuronLinear, MPSCNNNeuronLogarithm, MPSCNNNeuronPower, MPSCNNNeuronPReLU, MPSCNNNeuronReLU, MPSCNNNeuronReLUN, MPSCNNNeuronSigmoid, MPSCNNNeuronSoftPlus, MPSCNNNeuronSoftSign, and MPSCNNNeuronTanH.
(nonnull instancetype) - initWithDevice:
(nonnull instancetype) - initWithDevice:neuronDescriptor:
(nullable instancetype) - initWithCoder:device:
MPSCNNNeuronType neuronType
MPSCNNNeuronType float a
float b
float c
NSData * data
This depends on Metal.framework This filter applies a neuron activation function. You must use one of the sub-classes of MPSCNNNeuron.
The following filter types are supported: MPSCNNNeuronTypeNone ///< f(x) = x MPSCNNNeuronTypeLinear ///< f(x) = a * x + b MPSCNNNeuronTypeReLU ///< f(x) = x >= 0 ? x : a * x MPSCNNNeuronTypeSigmoid ///< f(x) = 1 / (1 + e^-x) MPSCNNNeuronTypeHardSigmoid ///< f(x) = clamp((x * a) + b, 0, 1) MPSCNNNeuronTypeTanH ///< f(x) = a * tanh(b * x) MPSCNNNeuronTypeAbsolute ///< f(x) = fabs(x) MPSCNNNeuronTypeSoftPlus ///< f(x) = a * log(1 + e^(b * x)) MPSCNNNeuronTypeSoftSign ///< f(x) = x / (1 + abs(x)) MPSCNNNeuronTypeELU ///< f(x) = x >= 0 ? x : a * (exp(x) - 1) MPSCNNNeuronTypePReLU ///< Same as ReLU except parameter a is per channel MPSCNNNeuronTypeReLUN ///< f(x) = min((x >= 0 ? x : a * x), b) MPSCNNNeuronTypePower ///< f(x) = (a * x + b) ^ c MPSCNNNeuronTypeExponential ///< f(x) = c ^ (a * x + b) MPSCNNNeuronTypeLogarithm ///< f(x) = log_c(a * x + b)
NSSecureCoding compatability While the standard NSSecureCoding/NSCoding method -initWithCoder: should work, since the file can't know which device your data is allocated on, we have to guess and may guess incorrectly. To avoid that problem, use initWithCoder:device instead.
Parameters:
Returns:
Reimplemented from MPSCNNKernel.
Standard init with default properties per filter type
Parameters:
Returns:
Reimplemented from MPSCNNKernel.
Reimplemented in MPSCNNNeuronLinear, MPSCNNNeuronReLU, MPSCNNNeuronPReLU, MPSCNNNeuronSigmoid, MPSCNNNeuronHardSigmoid, MPSCNNNeuronTanH, MPSCNNNeuronAbsolute, MPSCNNNeuronSoftPlus, MPSCNNNeuronSoftSign, MPSCNNNeuronELU, MPSCNNNeuronReLUN, MPSCNNNeuronPower, MPSCNNNeuronExponential, and MPSCNNNeuronLogarithm.
Initialize the neuron filter with a neuron descriptor.
Parameters:
Returns:
Generated automatically by Doxygen for MetalPerformanceShaders.framework from the source code.
Mon Jul 9 2018 | Version MetalPerformanceShaders-119.3 |