public class MPSCNNBatchNormalization extends MPSCNNKernel
MPSCNNBatchNormalization normalizes input images using per-channel means and variances.
for (c = 0; c < numberOfFeatureChannels; ++c) { input_image = in(:,:,c,:); output_image = (input_image - mean[c]) * gamma[c] / sqrt(variance[c] + epsilon) + beta[c]; out(:,:,c,:) = output_image; }
NSObject.Function_instanceMethodForSelector_ret, NSObject.Function_methodForSelector_ret| Modifier | Constructor and Description |
|---|---|
protected |
MPSCNNBatchNormalization(org.moe.natj.general.Pointer peer) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
_supportsSecureCoding()
This property must return YES on all classes that allow secure coding.
|
static boolean |
accessInstanceVariablesDirectly() |
static MPSCNNBatchNormalization |
alloc() |
static MPSCNNBatchNormalization |
allocWithZone(org.moe.natj.general.ptr.VoidPtr zone) |
static boolean |
automaticallyNotifiesObserversForKey(java.lang.String key) |
static void |
cancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget) |
static void |
cancelPreviousPerformRequestsWithTargetSelectorObject(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.Class |
classForKeyedUnarchiver() |
MPSCNNBatchNormalizationDataSource |
dataSource()
The data source the batch normalization was initialized with
|
static java.lang.String |
debugDescription_static() |
static java.lang.String |
description_static() |
void |
encodeToCommandBufferSourceImageBatchNormalizationStateDestinationImage(MTLCommandBuffer commandBuffer,
MPSImage sourceImage,
MPSCNNBatchNormalizationState batchNormalizationState,
MPSImage destinationImage)
Encode this kernel to a command buffer for a single image using
a batch normalization state.
|
float |
epsilon()
[@property] epsilon
|
static long |
hash_static() |
MPSCNNBatchNormalization |
init() |
MPSCNNBatchNormalization |
initWithCoder(NSCoder aDecoder)
NS_DESIGNATED_INITIALIZER
|
MPSCNNBatchNormalization |
initWithCoderDevice(NSCoder aDecoder,
java.lang.Object device)
NSSecureCoding compatability
|
MPSCNNBatchNormalization |
initWithDevice(java.lang.Object device)
Standard init with default properties per filter type
|
MPSCNNBatchNormalization |
initWithDeviceDataSource(MTLDevice device,
MPSCNNBatchNormalizationDataSource dataSource)
Initializes a batch normalization kernel using a data source.
|
MPSCNNBatchNormalization |
initWithDeviceDataSourceFusedNeuronDescriptor(MTLDevice device,
MPSCNNBatchNormalizationDataSource dataSource,
MPSNNNeuronDescriptor fusedNeuronDescriptor)
Initializes a batch normalization kernel using a data source and a neuron descriptor.
|
static NSObject.Function_instanceMethodForSelector_ret |
instanceMethodForSelector(org.moe.natj.objc.SEL aSelector) |
static NSMethodSignature |
instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector) |
static boolean |
instancesRespondToSelector(org.moe.natj.objc.SEL aSelector) |
static boolean |
isSubclassOfClass(org.moe.natj.objc.Class aClass) |
static NSSet<java.lang.String> |
keyPathsForValuesAffectingValueForKey(java.lang.String key) |
static MPSCNNBatchNormalization |
new_objc() |
long |
numberOfFeatureChannels()
[@property] numberOfFeatureChannels
|
void |
reloadDataSource(MPSCNNBatchNormalizationDataSource dataSource)
Reinitialize the filter using a data source.
|
void |
reloadGammaAndBetaFromDataSource()
Reinitialize the filter's gamma and beta values using the data source provided at kernel initialization.
|
void |
reloadGammaAndBetaWithCommandBufferGammaAndBetaState(MTLCommandBuffer commandBuffer,
MPSCNNNormalizationGammaAndBetaState gammaAndBetaState)
Reload data using new gamma and beta terms contained within an
MPSCNNNormalizationGammaAndBetaState object.
|
void |
reloadMeanAndVarianceFromDataSource()
Reinitialize the filter's mean and variance values using the data source provided at kernel initialization.
|
void |
reloadMeanAndVarianceWithCommandBufferMeanAndVarianceState(MTLCommandBuffer commandBuffer,
MPSCNNNormalizationMeanAndVarianceState meanAndVarianceState)
Reload data using new mean and variance terms contained within an
MPSCNNNormalizationMeanAndVarianceState object.
|
static boolean |
resolveClassMethod(org.moe.natj.objc.SEL sel) |
static boolean |
resolveInstanceMethod(org.moe.natj.objc.SEL sel) |
MPSCNNBatchNormalizationState |
resultStateForSourceImageSourceStatesDestinationImage(MPSImage sourceImage,
NSArray<? extends MPSState> sourceStates,
MPSImage destinationImage)
Return an MPSCNNBatchNormalizationState object which may be used with a MPSCNNBatchNormalization filter.
|
void |
setEpsilon(float value)
[@property] epsilon
|
static void |
setVersion_static(long aVersion) |
static org.moe.natj.objc.Class |
superclass_static() |
static boolean |
supportsSecureCoding() |
MPSCNNBatchNormalizationState |
temporaryResultStateForCommandBufferSourceImageSourceStatesDestinationImage(MTLCommandBuffer commandBuffer,
MPSImage sourceImage,
NSArray<? extends MPSState> sourceStates,
MPSImage destinationImage)
Return a temporary MPSCNNBatchNormalizationState object which may be used with
a MPSCNNBatchNormalization filter.
|
static long |
version_static() |
appendBatchBarrier, clipRect, destinationFeatureChannelOffset, destinationImageAllocator, destinationImageDescriptorForSourceImagesSourceStates, dilationRateX, dilationRateY, edgeMode, encodeToCommandBufferSourceImage, encodeToCommandBufferSourceImageDestinationImage, encodeToCommandBufferSourceImageDestinationStateDestinationImage, encodeToCommandBufferSourceImageDestinationStateDestinationStateIsTemporary, encodingStorageSizeForSourceImageSourceStatesDestinationImage, isBackwards, isResultStateReusedAcrossBatch, isStateModified, kernelHeight, kernelWidth, offset, padding, setClipRect, setDestinationFeatureChannelOffset, setDestinationImageAllocator, setEdgeMode, setOffset, setPadding, setSourceFeatureChannelMaxCount, setSourceFeatureChannelOffset, sourceFeatureChannelMaxCount, sourceFeatureChannelOffset, strideInPixelsX, strideInPixelsYcopyWithZone, copyWithZoneDevice, device, encodeWithCoder, label, options, setLabel, setOptionsaccessibilityActivate, 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, willChangeValuesAtIndexesForKeyprotected MPSCNNBatchNormalization(org.moe.natj.general.Pointer peer)
public static boolean accessInstanceVariablesDirectly()
public static MPSCNNBatchNormalization alloc()
public static MPSCNNBatchNormalization allocWithZone(org.moe.natj.general.ptr.VoidPtr zone)
public static boolean automaticallyNotifiesObserversForKey(java.lang.String key)
public static void cancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)
public static void cancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget,
org.moe.natj.objc.SEL aSelector,
java.lang.Object anArgument)
public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
public static org.moe.natj.objc.Class classForKeyedUnarchiver()
public MPSCNNBatchNormalizationDataSource dataSource()
public static java.lang.String debugDescription_static()
public static java.lang.String description_static()
public void encodeToCommandBufferSourceImageBatchNormalizationStateDestinationImage(MTLCommandBuffer commandBuffer, MPSImage sourceImage, MPSCNNBatchNormalizationState batchNormalizationState, MPSImage destinationImage)
commandBuffer - A valid command buffer to receive the kernel.sourceImage - The source MPSImage.batchNormalizationState - A MPSCNNBatchNormalizationState containing weights and/or
statistics to use for the batch normalization. If the state
is temporary its read count will be decremented.destinationImage - An MPSImage to contain the resulting normalized and scaled
image.public float epsilon()
The epsilon value used in the batch normalization formula to bias the variance when normalizing.
public static long hash_static()
public MPSCNNBatchNormalization init()
init in class MPSCNNKernelpublic MPSCNNBatchNormalization initWithCoder(NSCoder aDecoder)
NSCodinginitWithCoder in interface NSCodinginitWithCoder in class MPSCNNKernelpublic MPSCNNBatchNormalization initWithCoderDevice(NSCoder aDecoder, java.lang.Object device)
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 a subclass of NSCoder that
implements the
initWithCoderDevice in class MPSCNNKernelaDecoder - The NSCoder subclass with your serialized MPSKerneldevice - The MTLDevice on which to make the MPSKernelpublic MPSCNNBatchNormalization initWithDevice(java.lang.Object device)
MPSCNNKernelinitWithDevice in class MPSCNNKerneldevice - The device that the filter will be used on. May not be NULL.public MPSCNNBatchNormalization initWithDeviceDataSource(MTLDevice device, MPSCNNBatchNormalizationDataSource dataSource)
device - The MTLDevice on which this filter will be useddataSource - A pointer to a object that conforms to the MPSCNNBatchNormalizationDataSource
protocol. The data source provides filter weights and bias terms and, optionally,
image statistics which may be used to perform the normalization.public MPSCNNBatchNormalization initWithDeviceDataSourceFusedNeuronDescriptor(MTLDevice device, MPSCNNBatchNormalizationDataSource dataSource, MPSNNNeuronDescriptor fusedNeuronDescriptor)
device - The MTLDevice on which this filter will be useddataSource - A pointer to a object that conforms to the MPSCNNBatchNormalizationDataSource
protocol. The data source provides filter weights and bias terms and, optionally,
image statistics which may be used to perform the normalization.fusedNeuronDescriptor - A MPSNNNeuronDescriptor object which specifies a neuron activation function to
be applied to the result of the batch normalization.public static NSObject.Function_instanceMethodForSelector_ret instanceMethodForSelector(org.moe.natj.objc.SEL aSelector)
public static NSMethodSignature instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)
public static boolean instancesRespondToSelector(org.moe.natj.objc.SEL aSelector)
public static boolean isSubclassOfClass(org.moe.natj.objc.Class aClass)
public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey(java.lang.String key)
public static MPSCNNBatchNormalization new_objc()
public long numberOfFeatureChannels()
The number of feature channels in an image to be normalized.
public void reloadDataSource(MPSCNNBatchNormalizationDataSource dataSource)
dataSource - The data source which will provide the weights and, optionally, the
image batch statistics with which to normalize.public void reloadGammaAndBetaFromDataSource()
public void reloadGammaAndBetaWithCommandBufferGammaAndBetaState(MTLCommandBuffer commandBuffer, MPSCNNNormalizationGammaAndBetaState gammaAndBetaState)
commandBuffer - The command buffer on which to encode the reload.gammaAndBetaState - The state containing the updated weights which are to
be reloaded.public void reloadMeanAndVarianceFromDataSource()
public void reloadMeanAndVarianceWithCommandBufferMeanAndVarianceState(MTLCommandBuffer commandBuffer, MPSCNNNormalizationMeanAndVarianceState meanAndVarianceState)
commandBuffer - The command buffer on which to encode the reload.meanAndVarianceState - The state containing the updated statistics which are to
be reloaded.public static boolean resolveClassMethod(org.moe.natj.objc.SEL sel)
public static boolean resolveInstanceMethod(org.moe.natj.objc.SEL sel)
public MPSCNNBatchNormalizationState resultStateForSourceImageSourceStatesDestinationImage(MPSImage sourceImage, NSArray<? extends MPSState> sourceStates, MPSImage destinationImage)
resultStateForSourceImageSourceStatesDestinationImage in class MPSCNNKernelsourceImage - The MPSImage consumed by the associated -encode call.sourceStates - The list of MPSStates consumed by the associated -encode call,
for a batch size of 1.destinationImage - The destination image for the encode callpublic void setEpsilon(float value)
The epsilon value used in the batch normalization formula to bias the variance when normalizing.
public static void setVersion_static(long aVersion)
public static org.moe.natj.objc.Class superclass_static()
public static boolean supportsSecureCoding()
public boolean _supportsSecureCoding()
NSSecureCoding_supportsSecureCoding in interface NSSecureCoding_supportsSecureCoding in class MPSCNNKernelpublic MPSCNNBatchNormalizationState temporaryResultStateForCommandBufferSourceImageSourceStatesDestinationImage(MTLCommandBuffer commandBuffer, MPSImage sourceImage, NSArray<? extends MPSState> sourceStates, MPSImage destinationImage)
temporaryResultStateForCommandBufferSourceImageSourceStatesDestinationImage in class MPSCNNKernelcommandBuffer - The command buffer to allocate the temporary storage against
The state will only be valid on this command buffer.sourceImage - The MPSImage consumed by the associated -encode call.sourceStates - The list of MPSStates consumed by the associated -encode call,
for a batch size of 1.destinationImage - The destination image for the encode callpublic static long version_static()