Package apple.metalperformanceshaders
Class MPSCNNConvolutionDescriptor
- java.lang.Object
-
- org.moe.natj.general.NativeObject
-
- org.moe.natj.objc.ObjCObject
-
- apple.NSObject
-
- apple.metalperformanceshaders.MPSCNNConvolutionDescriptor
-
- All Implemented Interfaces:
NSCoding,NSCopying,NSSecureCoding,NSObject
- Direct Known Subclasses:
MPSCNNDepthWiseConvolutionDescriptor,MPSCNNSubPixelConvolutionDescriptor
public class MPSCNNConvolutionDescriptor extends NSObject implements NSSecureCoding, NSCopying
MPSCNNConvolutionDescriptor [@dependency] This depends on Metal.framework The MPSCNNConvolutionDescriptor specifies a convolution descriptor
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class apple.NSObject
NSObject.Function_instanceMethodForSelector_ret, NSObject.Function_methodForSelector_ret
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedMPSCNNConvolutionDescriptor(org.moe.natj.general.Pointer peer)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean_supportsSecureCoding()This property must return YES on all classes that allow secure coding.static booleanaccessInstanceVariablesDirectly()static MPSCNNConvolutionDescriptoralloc()static java.lang.ObjectallocWithZone(org.moe.natj.general.ptr.VoidPtr zone)static booleanautomaticallyNotifiesObserversForKey(java.lang.String key)static voidcancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)static voidcancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget, org.moe.natj.objc.SEL aSelector, java.lang.Object anArgument)static NSArray<java.lang.String>classFallbacksForKeyedArchiver()static org.moe.natj.objc.ClassclassForKeyedUnarchiver()static java.lang.ObjectcnnConvolutionDescriptorWithKernelWidthKernelHeightInputFeatureChannelsOutputFeatureChannels(long kernelWidth, long kernelHeight, long inputFeatureChannels, long outputFeatureChannels)Creates a convolution descriptor.static java.lang.ObjectcnnConvolutionDescriptorWithKernelWidthKernelHeightInputFeatureChannelsOutputFeatureChannelsNeuronFilter(long kernelWidth, long kernelHeight, long inputFeatureChannels, long outputFeatureChannels, MPSCNNNeuron neuronFilter)This method is deprecated.java.lang.ObjectcopyWithZone(org.moe.natj.general.ptr.VoidPtr zone)static java.lang.StringdebugDescription_static()static java.lang.Stringdescription_static()longdilationRateX()[@property] dilationRateX dilationRateX property can be used to implement dilated convolution as described in https://arxiv.org/pdf/1511.07122v3.pdf to aggregate global information in dense prediction problems.longdilationRateY()[@property] dilationRateY dilationRateY property can be used to implement dilated convolution as described in https://arxiv.org/pdf/1511.07122v3.pdf to aggregate global information in dense prediction problems.voidencodeWithCoder(NSCoder aCoder)MPSNNNeuronDescriptorfusedNeuronDescriptor()[@property] fusedNeuronDescriptor This mathod can be used to add a neuron activation funtion of given type with associated scalar parameters A and B that are shared across all output channels.longgroups()[@property] groups Number of groups input and output channels are divided into.static longhash_static()MPSCNNConvolutionDescriptorinit()MPSCNNConvolutionDescriptorinitWithCoder(NSCoder aDecoder)NS_DESIGNATED_INITIALIZERlonginputFeatureChannels()[@property] inputFeatureChannels The number of feature channels per pixel in the input image.static NSObject.Function_instanceMethodForSelector_retinstanceMethodForSelector(org.moe.natj.objc.SEL aSelector)static NSMethodSignatureinstanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)static booleaninstancesRespondToSelector(org.moe.natj.objc.SEL aSelector)static booleanisSubclassOfClass(org.moe.natj.objc.Class aClass)longkernelHeight()[@property] kernelHeight The height of the filter window.longkernelWidth()[@property] kernelWidth The width of the filter window.static NSSet<java.lang.String>keyPathsForValuesAffectingValueForKey(java.lang.String key)MPSCNNNeuronneuron()[@property] neuron MPSCNNNeuron filter to be applied as part of convolution.floatneuronParameterA()Getter funtion for neuronType set using setNeuronType:parameterA:parameterB methodfloatneuronParameterB()Getter funtion for neuronType set using setNeuronType:parameterA:parameterB methodintneuronType()Getter funtion for neuronType set using setNeuronType:parameterA:parameterB methodstatic java.lang.Objectnew_objc()longoutputFeatureChannels()[@property] outputFeatureChannels The number of feature channels per pixel in the output image.static booleanresolveClassMethod(org.moe.natj.objc.SEL sel)static booleanresolveInstanceMethod(org.moe.natj.objc.SEL sel)voidsetBatchNormalizationParametersForInferenceWithMeanVarianceGammaBetaEpsilon(org.moe.natj.general.ptr.ConstFloatPtr mean, org.moe.natj.general.ptr.ConstFloatPtr variance, org.moe.natj.general.ptr.ConstFloatPtr gamma, org.moe.natj.general.ptr.ConstFloatPtr beta, float epsilon)Adds batch normalization for inference, it copies all the float arrays provided, expecting outputFeatureChannels elements in each.voidsetDilationRateX(long value)[@property] dilationRateX dilationRateX property can be used to implement dilated convolution as described in https://arxiv.org/pdf/1511.07122v3.pdf to aggregate global information in dense prediction problems.voidsetDilationRateY(long value)[@property] dilationRateY dilationRateY property can be used to implement dilated convolution as described in https://arxiv.org/pdf/1511.07122v3.pdf to aggregate global information in dense prediction problems.voidsetFusedNeuronDescriptor(MPSNNNeuronDescriptor value)[@property] fusedNeuronDescriptor This mathod can be used to add a neuron activation funtion of given type with associated scalar parameters A and B that are shared across all output channels.voidsetGroups(long value)[@property] groups Number of groups input and output channels are divided into.voidsetInputFeatureChannels(long value)[@property] inputFeatureChannels The number of feature channels per pixel in the input image.voidsetKernelHeight(long value)[@property] kernelHeight The height of the filter window.voidsetKernelWidth(long value)[@property] kernelWidth The width of the filter window.voidsetNeuron(MPSCNNNeuron value)[@property] neuron MPSCNNNeuron filter to be applied as part of convolution.voidsetNeuronToPReLUWithParametersA(NSData A)Add per-channel neuron parameters A for PReLu neuron activation functions.voidsetNeuronTypeParameterAParameterB(int neuronType, float parameterA, float parameterB)Adds a neuron activation function to convolution descriptor.voidsetOutputFeatureChannels(long value)[@property] outputFeatureChannels The number of feature channels per pixel in the output image.voidsetStrideInPixelsX(long value)[@property] strideInPixelsX The output stride (downsampling factor) in the x dimension.voidsetStrideInPixelsY(long value)[@property] strideInPixelsY The output stride (downsampling factor) in the y dimension.static voidsetVersion_static(long aVersion)longstrideInPixelsX()[@property] strideInPixelsX The output stride (downsampling factor) in the x dimension.longstrideInPixelsY()[@property] strideInPixelsY The output stride (downsampling factor) in the y dimension.static org.moe.natj.objc.Classsuperclass_static()static booleansupportsSecureCoding()static longversion_static()-
Methods inherited from class apple.NSObject
accessibilityActivate, accessibilityActivationPoint, accessibilityAssistiveTechnologyFocusedIdentifiers, accessibilityAttributedHint, accessibilityAttributedLabel, accessibilityAttributedUserInputLabels, accessibilityAttributedValue, accessibilityContainerType, accessibilityCustomActions, accessibilityCustomRotors, accessibilityDecrement, accessibilityDragSourceDescriptors, accessibilityDropPointDescriptors, accessibilityElementAtIndex, accessibilityElementCount, accessibilityElementDidBecomeFocused, accessibilityElementDidLoseFocus, accessibilityElementIsFocused, accessibilityElements, accessibilityElementsHidden, accessibilityFrame, accessibilityHint, accessibilityIncrement, accessibilityLabel, accessibilityLanguage, accessibilityNavigationStyle, accessibilityPath, accessibilityPerformEscape, accessibilityPerformMagicTap, accessibilityRespondsToUserInteraction, accessibilityScroll, accessibilityTextualContext, accessibilityTraits, accessibilityUserInputLabels, accessibilityValue, accessibilityViewIsModal, addObserverForKeyPathOptionsContext, attemptRecoveryFromErrorOptionIndex, attemptRecoveryFromErrorOptionIndexDelegateDidRecoverSelectorContextInfo, autoContentAccessingProxy, awakeAfterUsingCoder, awakeFromNib, class_objc, classForCoder, classForKeyedArchiver, copy, dealloc, debugDescription, description, dictionaryWithValuesForKeys, didChangeValueForKey, didChangeValueForKeyWithSetMutationUsingObjects, didChangeValuesAtIndexesForKey, doesNotRecognizeSelector, fileManagerShouldProceedAfterError, fileManagerWillProcessPath, finalize_objc, forwardingTargetForSelector, forwardInvocation, hash, indexOfAccessibilityElement, isAccessibilityElement, isEqual, isKindOfClass, isMemberOfClass, isProxy, methodForSelector, methodSignatureForSelector, mutableArrayValueForKey, mutableArrayValueForKeyPath, mutableCopy, mutableOrderedSetValueForKey, mutableOrderedSetValueForKeyPath, mutableSetValueForKey, mutableSetValueForKeyPath, observationInfo, observeValueForKeyPathOfObjectChangeContext, performSelector, performSelectorInBackgroundWithObject, performSelectorOnMainThreadWithObjectWaitUntilDone, performSelectorOnMainThreadWithObjectWaitUntilDoneModes, performSelectorOnThreadWithObjectWaitUntilDone, performSelectorOnThreadWithObjectWaitUntilDoneModes, performSelectorWithObject, performSelectorWithObjectAfterDelay, performSelectorWithObjectAfterDelayInModes, performSelectorWithObjectWithObject, prepareForInterfaceBuilder, provideImageDataBytesPerRowOrigin_Size_UserInfo, removeObserverForKeyPath, removeObserverForKeyPathContext, replacementObjectForCoder, replacementObjectForKeyedArchiver, respondsToSelector, self, setAccessibilityActivationPoint, setAccessibilityAttributedHint, setAccessibilityAttributedLabel, setAccessibilityAttributedUserInputLabels, setAccessibilityAttributedValue, setAccessibilityContainerType, setAccessibilityCustomActions, setAccessibilityCustomRotors, setAccessibilityDragSourceDescriptors, setAccessibilityDropPointDescriptors, setAccessibilityElements, setAccessibilityElementsHidden, setAccessibilityFrame, setAccessibilityHint, setAccessibilityLabel, setAccessibilityLanguage, setAccessibilityNavigationStyle, setAccessibilityPath, setAccessibilityRespondsToUserInteraction, setAccessibilityTextualContext, setAccessibilityTraits, setAccessibilityUserInputLabels, setAccessibilityValue, setAccessibilityViewIsModal, setIsAccessibilityElement, setNilValueForKey, setObservationInfo, setShouldGroupAccessibilityChildren, setValueForKey, setValueForKeyPath, setValueForUndefinedKey, setValuesForKeysWithDictionary, shouldGroupAccessibilityChildren, superclass, validateValueForKeyError, validateValueForKeyPathError, valueForKey, valueForKeyPath, valueForUndefinedKey, willChangeValueForKey, willChangeValueForKeyWithSetMutationUsingObjects, willChangeValuesAtIndexesForKey
-
-
-
-
Method Detail
-
accessInstanceVariablesDirectly
public static boolean accessInstanceVariablesDirectly()
-
alloc
public static MPSCNNConvolutionDescriptor alloc()
-
allocWithZone
public static java.lang.Object allocWithZone(org.moe.natj.general.ptr.VoidPtr zone)
-
automaticallyNotifiesObserversForKey
public static boolean automaticallyNotifiesObserversForKey(java.lang.String key)
-
cancelPreviousPerformRequestsWithTarget
public static void cancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)
-
cancelPreviousPerformRequestsWithTargetSelectorObject
public static void cancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget, org.moe.natj.objc.SEL aSelector, java.lang.Object anArgument)
-
classFallbacksForKeyedArchiver
public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
-
classForKeyedUnarchiver
public static org.moe.natj.objc.Class classForKeyedUnarchiver()
-
cnnConvolutionDescriptorWithKernelWidthKernelHeightInputFeatureChannelsOutputFeatureChannelsNeuronFilter
public static java.lang.Object cnnConvolutionDescriptorWithKernelWidthKernelHeightInputFeatureChannelsOutputFeatureChannelsNeuronFilter(long kernelWidth, long kernelHeight, long inputFeatureChannels, long outputFeatureChannels, MPSCNNNeuron neuronFilter)This method is deprecated. Please use neuronType, neuronParameterA and neuronParameterB properites to fuse neuron with convolution.- Parameters:
kernelWidth- The width of the filter window. Must be > 0. Large values will take a long time.kernelHeight- The height of the filter window. Must be > 0. Large values will take a long time.inputFeatureChannels- The number of feature channels in the input image. Must be >= 1.outputFeatureChannels- The number of feature channels in the output image. Must be >= 1.neuronFilter- An optional neuron filter that can be applied to the output of convolution.- Returns:
- A valid MPSCNNConvolutionDescriptor object or nil, if failure.
-
debugDescription_static
public static java.lang.String debugDescription_static()
-
description_static
public static java.lang.String description_static()
-
hash_static
public static long hash_static()
-
instanceMethodForSelector
public static NSObject.Function_instanceMethodForSelector_ret instanceMethodForSelector(org.moe.natj.objc.SEL aSelector)
-
instanceMethodSignatureForSelector
public static NSMethodSignature instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)
-
instancesRespondToSelector
public static boolean instancesRespondToSelector(org.moe.natj.objc.SEL aSelector)
-
isSubclassOfClass
public static boolean isSubclassOfClass(org.moe.natj.objc.Class aClass)
-
keyPathsForValuesAffectingValueForKey
public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey(java.lang.String key)
-
new_objc
public static java.lang.Object new_objc()
-
resolveClassMethod
public static boolean resolveClassMethod(org.moe.natj.objc.SEL sel)
-
resolveInstanceMethod
public static boolean resolveInstanceMethod(org.moe.natj.objc.SEL sel)
-
setVersion_static
public static void setVersion_static(long aVersion)
-
superclass_static
public static org.moe.natj.objc.Class superclass_static()
-
version_static
public static long version_static()
-
copyWithZone
public java.lang.Object copyWithZone(org.moe.natj.general.ptr.VoidPtr zone)
- Specified by:
copyWithZonein interfaceNSCopying
-
groups
public long groups()
[@property] groups Number of groups input and output channels are divided into. The default value is 1. Groups lets you reduce the parameterization. If groups is set to n, input is divided into n groups with inputFeatureChannels/n channels in each group. Similarly output is divided into n groups with outputFeatureChannels/n channels in each group. ith group in input is only connected to ith group in output so number of weights (parameters) needed is reduced by factor of n. Both inputFeatureChannels and outputFeatureChannels must be divisible by n and number of channels in each group must be multiple of 4.
-
init
public MPSCNNConvolutionDescriptor init()
-
inputFeatureChannels
public long inputFeatureChannels()
[@property] inputFeatureChannels The number of feature channels per pixel in the input image.
-
kernelHeight
public long kernelHeight()
[@property] kernelHeight The height of the filter window. The default value is 3. Any positive non-zero value is valid, including even values. The position of the top edge of the filter window is given by offset.y - (kernelHeight>>1)
-
kernelWidth
public long kernelWidth()
[@property] kernelWidth The width of the filter window. The default value is 3. Any positive non-zero value is valid, including even values. The position of the left edge of the filter window is given by offset.x - (kernelWidth>>1)
-
neuron
public MPSCNNNeuron neuron()
[@property] neuron MPSCNNNeuron filter to be applied as part of convolution. This is applied after BatchNormalization in the end. Default is nil. This is deprecated. You dont need to create MPSCNNNeuron object to fuse with convolution. Use neuron properties in this descriptor.
-
outputFeatureChannels
public long outputFeatureChannels()
[@property] outputFeatureChannels The number of feature channels per pixel in the output image.
-
setGroups
public void setGroups(long value)
[@property] groups Number of groups input and output channels are divided into. The default value is 1. Groups lets you reduce the parameterization. If groups is set to n, input is divided into n groups with inputFeatureChannels/n channels in each group. Similarly output is divided into n groups with outputFeatureChannels/n channels in each group. ith group in input is only connected to ith group in output so number of weights (parameters) needed is reduced by factor of n. Both inputFeatureChannels and outputFeatureChannels must be divisible by n and number of channels in each group must be multiple of 4.
-
setInputFeatureChannels
public void setInputFeatureChannels(long value)
[@property] inputFeatureChannels The number of feature channels per pixel in the input image.
-
setKernelHeight
public void setKernelHeight(long value)
[@property] kernelHeight The height of the filter window. The default value is 3. Any positive non-zero value is valid, including even values. The position of the top edge of the filter window is given by offset.y - (kernelHeight>>1)
-
setKernelWidth
public void setKernelWidth(long value)
[@property] kernelWidth The width of the filter window. The default value is 3. Any positive non-zero value is valid, including even values. The position of the left edge of the filter window is given by offset.x - (kernelWidth>>1)
-
setNeuron
public void setNeuron(MPSCNNNeuron value)
[@property] neuron MPSCNNNeuron filter to be applied as part of convolution. This is applied after BatchNormalization in the end. Default is nil. This is deprecated. You dont need to create MPSCNNNeuron object to fuse with convolution. Use neuron properties in this descriptor.
-
setOutputFeatureChannels
public void setOutputFeatureChannels(long value)
[@property] outputFeatureChannels The number of feature channels per pixel in the output image.
-
setStrideInPixelsX
public void setStrideInPixelsX(long value)
[@property] strideInPixelsX The output stride (downsampling factor) in the x dimension. The default value is 1.
-
setStrideInPixelsY
public void setStrideInPixelsY(long value)
[@property] strideInPixelsY The output stride (downsampling factor) in the y dimension. The default value is 1.
-
strideInPixelsX
public long strideInPixelsX()
[@property] strideInPixelsX The output stride (downsampling factor) in the x dimension. The default value is 1.
-
strideInPixelsY
public long strideInPixelsY()
[@property] strideInPixelsY The output stride (downsampling factor) in the y dimension. The default value is 1.
-
cnnConvolutionDescriptorWithKernelWidthKernelHeightInputFeatureChannelsOutputFeatureChannels
public static java.lang.Object cnnConvolutionDescriptorWithKernelWidthKernelHeightInputFeatureChannelsOutputFeatureChannels(long kernelWidth, long kernelHeight, long inputFeatureChannels, long outputFeatureChannels)Creates a convolution descriptor.- Parameters:
kernelWidth- The width of the filter window. Must be > 0. Large values will take a long time.kernelHeight- The height of the filter window. Must be > 0. Large values will take a long time.inputFeatureChannels- The number of feature channels in the input image. Must be >= 1.outputFeatureChannels- The number of feature channels in the output image. Must be >= 1.- Returns:
- A valid MPSCNNConvolutionDescriptor object or nil, if failure.
-
dilationRateX
public long dilationRateX()
[@property] dilationRateX dilationRateX property can be used to implement dilated convolution as described in https://arxiv.org/pdf/1511.07122v3.pdf to aggregate global information in dense prediction problems. Default value is 1. When set to value > 1, original kernel width, kW is dilated to kW_Dilated = (kW-1)*dilationRateX + 1 by inserting d-1 zeros between consecutive entries in each row of the original kernel. The kernel is centered based on kW_Dilated.
-
dilationRateY
public long dilationRateY()
[@property] dilationRateY dilationRateY property can be used to implement dilated convolution as described in https://arxiv.org/pdf/1511.07122v3.pdf to aggregate global information in dense prediction problems. Default value is 1. When set to value > 1, original kernel height, kH is dilated to kH_Dilated = (kH-1)*dilationRateY + 1 by inserting d-1 rows of zeros between consecutive row of the original kernel. The kernel is centered based on kH_Dilated.
-
encodeWithCoder
public void encodeWithCoder(NSCoder aCoder)
- Specified by:
encodeWithCoderin interfaceNSCoding
-
initWithCoder
public MPSCNNConvolutionDescriptor initWithCoder(NSCoder aDecoder)
Description copied from interface:NSCodingNS_DESIGNATED_INITIALIZER- Specified by:
initWithCoderin interfaceNSCoding
-
neuronParameterA
public float neuronParameterA()
Getter funtion for neuronType set using setNeuronType:parameterA:parameterB method
-
neuronParameterB
public float neuronParameterB()
Getter funtion for neuronType set using setNeuronType:parameterA:parameterB method
-
neuronType
public int neuronType()
Getter funtion for neuronType set using setNeuronType:parameterA:parameterB method
-
setBatchNormalizationParametersForInferenceWithMeanVarianceGammaBetaEpsilon
public void setBatchNormalizationParametersForInferenceWithMeanVarianceGammaBetaEpsilon(org.moe.natj.general.ptr.ConstFloatPtr mean, org.moe.natj.general.ptr.ConstFloatPtr variance, org.moe.natj.general.ptr.ConstFloatPtr gamma, org.moe.natj.general.ptr.ConstFloatPtr beta, float epsilon)Adds batch normalization for inference, it copies all the float arrays provided, expecting outputFeatureChannels elements in each. This method will be used to pass in batch normalization parameters to the convolution during the init call. For inference we modify weights and bias going in convolution or Fully Connected layer to combine and optimize the layers. w: weights for a corresponding output feature channel b: bias for a corresponding output feature channel W: batch normalized weights for a corresponding output feature channel B: batch normalized bias for a corresponding output feature channel I = gamma / sqrt(variance + epsilon), J = beta - ( I * mean ) W = w * I B = b * I + J Every convolution has (OutputFeatureChannel * kernelWidth * kernelHeight * InputFeatureChannel) weights I, J are calculated, for every output feature channel separately to get the corresponding weights and bias Thus, I, J are calculated and then used for every (kernelWidth * kernelHeight * InputFeatureChannel) weights, and this is done OutputFeatureChannel number of times for each output channel. thus, internally, batch normalized weights are computed as: W[no][i][j][ni] = w[no][i][j][ni] * I[no] no: index into outputFeatureChannel i : index into kernel Height j : index into kernel Width ni: index into inputFeatureChannel One usually doesn't see a bias term and batch normalization together as batch normalization potentially cancels out the bias term after training, but in MPS if the user provides it, batch normalization will use the above formula to incorporate it, if user does not have bias terms then put a float array of zeroes in the convolution init for bias terms of each output feature channel. this comes from: https://arxiv.org/pdf/1502.03167v3.pdf Note: in certain cases the batch normalization parameters will be cached by the MPSNNGraph or the MPSCNNConvolution. If the batch normalization parameters change after either is made, behavior is undefined.- Parameters:
mean- Pointer to an array of floats of mean for each output feature channelvariance- Pointer to an array of floats of variance for each output feature channelgamma- Pointer to an array of floats of gamma for each output feature channelbeta- Pointer to an array of floats of beta for each output feature channelepsilon- A small float value used to have numerical stability in the code
-
setDilationRateX
public void setDilationRateX(long value)
[@property] dilationRateX dilationRateX property can be used to implement dilated convolution as described in https://arxiv.org/pdf/1511.07122v3.pdf to aggregate global information in dense prediction problems. Default value is 1. When set to value > 1, original kernel width, kW is dilated to kW_Dilated = (kW-1)*dilationRateX + 1 by inserting d-1 zeros between consecutive entries in each row of the original kernel. The kernel is centered based on kW_Dilated.
-
setDilationRateY
public void setDilationRateY(long value)
[@property] dilationRateY dilationRateY property can be used to implement dilated convolution as described in https://arxiv.org/pdf/1511.07122v3.pdf to aggregate global information in dense prediction problems. Default value is 1. When set to value > 1, original kernel height, kH is dilated to kH_Dilated = (kH-1)*dilationRateY + 1 by inserting d-1 rows of zeros between consecutive row of the original kernel. The kernel is centered based on kH_Dilated.
-
setNeuronToPReLUWithParametersA
public void setNeuronToPReLUWithParametersA(NSData A)
Add per-channel neuron parameters A for PReLu neuron activation functions. This method sets the neuron to PReLU, zeros parameters A and B and sets the per-channel neuron parameters A to an array containing a unique value of A for each output feature channel. If the neuron function is f(v,a,b), it will apply OutputImage(x,y,i) = f( ConvolutionResult(x,y,i), A[i], B[i] ) where i in [0,outputFeatureChannels-1] See https://arxiv.org/pdf/1502.01852.pdf for details. All other neuron types, where parameter A and parameter B are shared across channels must be set using -setNeuronOfType:parameterA:parameterB: If batch normalization parameters are set, batch normalization will occur before neuron application i.e. output of convolution is first batch normalized followed by neuron activation. This function automatically sets neuronType to MPSCNNNeuronTypePReLU. Note: in certain cases the neuron descriptor will be cached by the MPSNNGraph or the MPSCNNConvolution. If the neuron type changes after either is made, behavior is undefined.- Parameters:
A- An array containing per-channel float values for neuron parameter A. Number of entries must be equal to outputFeatureChannels.
-
setNeuronTypeParameterAParameterB
public void setNeuronTypeParameterAParameterB(int neuronType, float parameterA, float parameterB)Adds a neuron activation function to convolution descriptor. This mathod can be used to add a neuron activation funtion of given type with associated scalar parameters A and B that are shared across all output channels. Neuron activation fucntion is applied to output of convolution. This is a per-pixel operation that is fused with convolution kernel itself for best performance. Note that this method can only be used to fuse neuron of kind for which parameters A and B are shared across all channels of convoution output. It is an error to call this method for neuron activation functions like MPSCNNNeuronTypePReLU, which require per-channel parameter values. For those kind of neuron activation functions, use appropriate setter functions. Note: in certain cases, the neuron descriptor will be cached by the MPSNNGraph or the MPSCNNConvolution. If the neuron type changes after either is made, behavior is undefined.- Parameters:
neuronType- type of neuron activation function. For full list see MPSCNNNeuronType.hparameterA- parameterA of neuron activation that is shared across all channels of convolution output.parameterB- parameterB of neuron activation that is shared across all channels of convolution output.
-
supportsSecureCoding
public static boolean supportsSecureCoding()
-
_supportsSecureCoding
public boolean _supportsSecureCoding()
Description copied from interface:NSSecureCodingThis property must return YES on all classes that allow secure coding. Subclasses of classes that adopt NSSecureCoding and override initWithCoder: must also override this method and return YES. The Secure Coding Guide should be consulted when writing methods that decode data.- Specified by:
_supportsSecureCodingin interfaceNSSecureCoding
-
fusedNeuronDescriptor
public MPSNNNeuronDescriptor fusedNeuronDescriptor()
[@property] fusedNeuronDescriptor This mathod can be used to add a neuron activation funtion of given type with associated scalar parameters A and B that are shared across all output channels. Neuron activation fucntion is applied to output of convolution. This is a per-pixel operation that is fused with convolution kernel itself for best performance. Note that this method can only be used to fuse neuron of kind for which parameters A and B are shared across all channels of convoution output. It is an error to call this method for neuron activation functions like MPSCNNNeuronTypePReLU, which require per-channel parameter values. For those kind of neuron activation functions, use appropriate setter functions. Default is descriptor with neuronType MPSCNNNeuronTypeNone. Note: in certain cases the neuron descriptor will be cached by the MPSNNGraph or the MPSCNNConvolution. If the neuron type changes after either is made, behavior is undefined.
-
setFusedNeuronDescriptor
public void setFusedNeuronDescriptor(MPSNNNeuronDescriptor value)
[@property] fusedNeuronDescriptor This mathod can be used to add a neuron activation funtion of given type with associated scalar parameters A and B that are shared across all output channels. Neuron activation fucntion is applied to output of convolution. This is a per-pixel operation that is fused with convolution kernel itself for best performance. Note that this method can only be used to fuse neuron of kind for which parameters A and B are shared across all channels of convoution output. It is an error to call this method for neuron activation functions like MPSCNNNeuronTypePReLU, which require per-channel parameter values. For those kind of neuron activation functions, use appropriate setter functions. Default is descriptor with neuronType MPSCNNNeuronTypeNone. Note: in certain cases the neuron descriptor will be cached by the MPSNNGraph or the MPSCNNConvolution. If the neuron type changes after either is made, behavior is undefined.
-
-