.TH "MPSCNNNeuronGradient" 3 "Mon Jul 9 2018" "Version MetalPerformanceShaders-119.3" "MetalPerformanceShaders.framework" \" -*- nroff -*- .ad l .nh .SH NAME MPSCNNNeuronGradient .SH SYNOPSIS .br .PP .PP \fC#import \fP .PP Inherits \fBMPSCNNGradientKernel\fP\&. .SS "Instance Methods" .in +1c .ti -1c .RI "(nonnull instancetype) \- \fBinitWithDevice:\fP" .br .ti -1c .RI "(nonnull instancetype) \- \fBinitWithDevice:neuronDescriptor:\fP" .br .ti -1c .RI "(nullable instancetype) \- \fBinitWithCoder:device:\fP" .br .in -1c .SS "Properties" .in +1c .ti -1c .RI "\fBMPSCNNNeuronType\fP \fBneuronType\fP" .br .ti -1c .RI "float \fBa\fP" .br .ti -1c .RI "float \fBb\fP" .br .ti -1c .RI "float \fBc\fP" .br .ti -1c .RI "NSData * \fBdata\fP" .br .in -1c .SS "Additional Inherited Members" .SH "Detailed Description" .PP This depends on Metal\&.framework This filter is a backward filter for the neuron activation function filter\&. .PP The following filter types are supported: MPSCNNNeuronTypeNone ///< df/dx = 1 MPSCNNNeuronTypeLinear ///< df/dx = a MPSCNNNeuronTypeReLU ///< df/dx = [ 1, if x >= 0 [ a, if x < 0 MPSCNNNeuronTypeSigmoid ///< df/dx = e^x / (e^x + 1)^2 MPSCNNNeuronTypeHardSigmoid ///< df/dx = [ a, if (x >= 0) and (x <= 1) [ 0, otherwise MPSCNNNeuronTypeTanH ///< df/dx = a * b * (1 - tanh^2(b * x)) MPSCNNNeuronTypeAbsolute ///< df/dx = sign(x) MPSCNNNeuronTypeSoftPlus ///< df/dx = (a * b * exp(b * x)) / (exp(b * x) + 1) MPSCNNNeuronTypeSoftSign ///< df/dx = 1 / (|x| + 1)^2 MPSCNNNeuronTypeELU ///< df/dx = [ a * exp(x), x < 0 [ 1, x >= 0 MPSCNNNeuronTypePReLU ///< df/dx = [ 1, if x >= 0 [ aV, if x < 0 MPSCNNNeuronTypeReLUN ///< df/dx = [ 1, if x >= 0 [ a, if x < 0 [ b, if x >= b MPSCNNNeuronTypePower ///< df/dx = a * c * (a * x + b)^(c - 1) MPSCNNNeuronTypeExponential ///< df/dx = [ a * exp(a * x + b), if c == -1 [ a * log(c) * c^(a * x + b), if c != -1 MPSCNNNeuronTypeLogarithm ///< df/dx = [ a / (a * in + b), if c == -1 [ a / (log(c) * (a * in + b)), if c != -1 .PP The result of the above operation is multiplied with the gradient, computed by the preceeding filter (going backwards)\&. .SH "Method Documentation" .PP .SS "\- (nullable instancetype) \fBinitWithCoder:\fP (NSCoder *__nonnull) aDecoder(nonnull id< MTLDevice >) device" \fBNSSecureCoding\fP 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\&. .PP \fBParameters:\fP .RS 4 \fIaDecoder\fP The NSCoder subclass with your serialized \fBMPSKernel\fP .br \fIdevice\fP The MTLDevice on which to make the \fBMPSKernel\fP .RE .PP \fBReturns:\fP .RS 4 \fBA\fP new \fBMPSKernel\fP object, or nil if failure\&. .RE .PP .PP Reimplemented from \fBMPSCNNGradientKernel\fP\&. .SS "\- (nonnull instancetype) initWithDevice: (nonnull id< MTLDevice >) device" Standard init with default properties per filter type .PP \fBParameters:\fP .RS 4 \fIdevice\fP The device that the filter will be used on\&. May not be NULL\&. .RE .PP \fBReturns:\fP .RS 4 \fBA\fP pointer to the newly initialized object\&. This will fail, returning nil if the device is not supported\&. Devices must be MTLFeatureSet_iOS_GPUFamily2_v1 or later\&. .RE .PP .PP Reimplemented from \fBMPSCNNGradientKernel\fP\&. .SS "\- (nonnull instancetype) \fBinitWithDevice:\fP (nonnull id< MTLDevice >) device(\fBMPSNNNeuronDescriptor\fP *_Nonnull) neuronDescriptor" Initialize the neuron gradient filter with a neuron descriptor\&. .PP \fBParameters:\fP .RS 4 \fIdevice\fP The device the filter will run on\&. .br \fIneuronDescriptor\fP The neuron descriptor\&. For the neuron of type MPSCNNNeuronTypePReLU, the neuron descriptor references an NSData object containing a float array with the per feature channel value of PReLu parameter and, in this case, the \fBMPSCNNNeuronGradient\fP retains the NSData object\&. .RE .PP \fBReturns:\fP .RS 4 \fBA\fP valid \fBMPSCNNNeuronGradient\fP object or nil, if failure\&. .RE .PP .SH "Property Documentation" .PP .SS "\- (float) a\fC [read]\fP, \fC [nonatomic]\fP, \fC [assign]\fP" .SS "\- (float) b\fC [read]\fP, \fC [nonatomic]\fP, \fC [assign]\fP" .SS "\- (float) c\fC [read]\fP, \fC [nonatomic]\fP, \fC [assign]\fP" .SS "\- (NSData*) data\fC [read]\fP, \fC [nonatomic]\fP, \fC [retain]\fP" .SS "\- (\fBMPSCNNNeuronType\fP) neuronType\fC [read]\fP, \fC [nonatomic]\fP, \fC [assign]\fP" .SH "Author" .PP Generated automatically by Doxygen for MetalPerformanceShaders\&.framework from the source code\&.