Class MPSNNFilterNode

    • Constructor Detail

      • MPSNNFilterNode

        protected MPSNNFilterNode​(org.moe.natj.general.Pointer peer)
    • Method Detail

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • 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()
      • 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()
      • 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)
      • label

        public java.lang.String label()
        [@property] label A string to help identify this object.
      • new_objc

        public static java.lang.Object new_objc()
      • paddingPolicy

        public MPSNNPadding paddingPolicy()
        The padding method used for the filter node The padding policy configures how the filter centers the region of interest in the source image. It principally is responsible for setting the MPSCNNKernel.offset and the size of the image produced, and sometimes will also configure .sourceFeatureChannelOffset, .sourceFeatureChannelMaxCount, and .edgeMode. It is permitted to set any other filter properties as needed using a custom padding policy. The default padding policy varies per filter to conform to consensus expectation for the behavior of that filter. In some cases, pre-made padding policies are provided to match the behavior of common neural networking frameworks with particularly complex or unexpected behavior for specific nodes. See MPSNNDefaultPadding class methods in MPSNeuralNetworkTypes.h for more. BUG: MPS doesn't provide a good way to reset the MPSKernel properties in the context of a MPSNNGraph after the kernel is finished encoding. These values carry on to the next time the graph is used. Consequently, if your custom padding policy modifies the property as a function of the previous value, e.g.: kernel.someProperty += 2; then the second time the graph runs, the property may have an inconsistent value, leading to unexpected behavior. The default padding computation runs before the custom padding method to provide it with a sense of what is expected for the default configuration and will reinitialize the value in the case of the .offset. However, that computation usually doesn't reset other properties. In such cases, the custom padding policy may need to keep a record of the original value to enable consistent behavior.
      • resolveClassMethod

        public static boolean resolveClassMethod​(org.moe.natj.objc.SEL sel)
      • resolveInstanceMethod

        public static boolean resolveInstanceMethod​(org.moe.natj.objc.SEL sel)
      • resultImage

        public MPSNNImageNode resultImage()
        Get the node representing the image result of the filter Except where otherwise noted, the precision used for the result image (see format property) is copied from the precision from the first input image node.
      • resultState

        public MPSNNStateNode resultState()
        convenience method for resultStates[0] If resultStates is nil, returns nil
      • resultStates

        public NSArray<? extends MPSNNStateNode> resultStates()
        Get the node representing the state result of the filter If more than one, see description of subclass for ordering.
      • setLabel

        public void setLabel​(java.lang.String value)
        [@property] label A string to help identify this object.
      • setPaddingPolicy

        public void setPaddingPolicy​(MPSNNPadding value)
        The padding method used for the filter node The padding policy configures how the filter centers the region of interest in the source image. It principally is responsible for setting the MPSCNNKernel.offset and the size of the image produced, and sometimes will also configure .sourceFeatureChannelOffset, .sourceFeatureChannelMaxCount, and .edgeMode. It is permitted to set any other filter properties as needed using a custom padding policy. The default padding policy varies per filter to conform to consensus expectation for the behavior of that filter. In some cases, pre-made padding policies are provided to match the behavior of common neural networking frameworks with particularly complex or unexpected behavior for specific nodes. See MPSNNDefaultPadding class methods in MPSNeuralNetworkTypes.h for more. BUG: MPS doesn't provide a good way to reset the MPSKernel properties in the context of a MPSNNGraph after the kernel is finished encoding. These values carry on to the next time the graph is used. Consequently, if your custom padding policy modifies the property as a function of the previous value, e.g.: kernel.someProperty += 2; then the second time the graph runs, the property may have an inconsistent value, leading to unexpected behavior. The default padding computation runs before the custom padding method to provide it with a sense of what is expected for the default configuration and will reinitialize the value in the case of the .offset. However, that computation usually doesn't reset other properties. In such cases, the custom padding policy may need to keep a record of the original value to enable consistent behavior.
      • 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()
      • gradientFilterWithSource

        public MPSNNGradientFilterNode gradientFilterWithSource​(MPSNNImageNode gradientImage)
        Return the gradient (backwards) version of this filter. The backwards training version of the filter will be returned. The non-gradient image and state arguments for the filter are automatically obtained from the target.
        Parameters:
        gradientImage - The gradient images corresponding with the resultImage of the target
      • gradientFilterWithSources

        public MPSNNGradientFilterNode gradientFilterWithSources​(NSArray<? extends MPSNNImageNode> gradientImages)
        Return the gradient (backwards) version of this filter. The backwards training version of the filter will be returned. The non-gradient image and state arguments for the filter are automatically obtained from the target.
        Parameters:
        gradientImages - The gradient images corresponding with the resultImage of the target
      • gradientFiltersWithSource

        public NSArray<? extends MPSNNGradientFilterNode> gradientFiltersWithSource​(MPSNNImageNode gradientImage)
        Return multiple gradient versions of the filter MPSNNFilters that consume multiple inputs generally result in multiple conjugate filters for the gradient computation at the end of training. For example, a single concatenation operation that concatenates multple images will result in an array of slice operators that carve out subsections of the input gradient image.
      • gradientFiltersWithSources

        public NSArray<? extends MPSNNGradientFilterNode> gradientFiltersWithSources​(NSArray<? extends MPSNNImageNode> gradientImages)
        Return multiple gradient versions of the filter MPSNNFilters that consume multiple inputs generally result in multiple conjugate filters for the gradient computation at the end of training. For example, a single concatenation operation that concatenates multple images will result in an array of slice operators that carve out subsections of the input gradient image.
      • trainingGraphWithSourceGradientNodeHandler

        public NSArray<? extends MPSNNFilterNode> trainingGraphWithSourceGradientNodeHandler​(MPSNNImageNode gradientImage,
                                                                                             MPSNNFilterNode.Block_trainingGraphWithSourceGradientNodeHandler nodeHandler)
        Build training graph from inference graph This method will iteratively build the training portion of a graph based on an inference graph. Self should be the last node in the inference graph. It is typically a loss layer, but can be anything. Typically, the "inference graph" used here is the desired inference graph with a dropout node and a loss layer node appended. The nodes that are created will have default properties. In certain cases, these may not be appropriate (e.g. if you want to do CPU based updates of convolution weights instead of default GPU updates.) In such cases, your application should use the nodeHandler to configure the new nodes as they are created. BUG: This method can not follow links to regions of the graph that are connected to the rest of the graph solely via MPSNNStateNodes. A gradient image input is required to construct a MPSNNGradientFilterNode from a inference filter node.
        Parameters:
        gradientImage - The input gradient image for the first gradient node in the training section of the graph. If nil, self.resultImage is used. This results in a standard monolithic training graph. If the graph is instead divided into multiple subgraphs (potentially to allow for your custom code to appear inbetween MPSNNGraph segments) a new MPSImageNode* may be substituted.
        nodeHandler - An optional block to allow for customization of gradient nodes and intermediate images as the graph is constructed. It may also be used to prune braches of the developing training graph. If nil, the default handler is used. It builds the full graph, and assigns any inferenceNodeSources[i].handle to their gradient counterparts.
        Returns:
        The list of new MPSNNFilterNode training graph termini. These MPSNNFilterNodes are not necessarily all MPSNNGradientFilterNodes. To build a full list of nodes created, use a custom nodeHandler. If no nodes are created nil is returned.