C# 클래스 DigitDetection.SlimMPSCnnConvolution

The SlimMPSCNNConvolution is a wrapper class around MPSCNNConvolution used to encapsulate: - making an MPSCNNConvolutionDescriptor, - adding network parameters (weights and bias binaries by memory mapping the binaries) - getting our convolution layer
상속: MPSCnnConvolution
파일 보기 프로젝트 열기: xamarin/monotouch-samples 1 사용 예제들

공개 메소드들

메소드 설명
Create ( uint kernelWidth, uint kernelHeight, uint inputFeatureChannels, uint outputFeatureChannels, MPSCnnNeuron neuronFilter, IMTLDevice device, string kernelParamsBinaryName, bool padding, uint strideX, uint strideY, uint destinationFeatureChannelOffset, uint groupNum ) : SlimMPSCnnConvolution

Initializes a fully connected kernel. Returns: A valid SlimMPSCnnConvolution object or null, if failure.

EncodeToCommandBuffer ( IMTLCommandBuffer commandBuffer, MPSImage sourceImage, MPSImage destinationImage ) : void

Encode a MPSCnnKernel into a command Buffer. The operation shall proceed out-of-place. We calculate the appropriate offset as per how TensorFlow calculates its padding using input image size and stride here. This [Link](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/ops/nn.py) has an explanation in header comments how tensorFlow pads its convolution input images.

비공개 메소드들

메소드 설명
IntPtr_objc_msgSend_IntPtr_IntPtr_IntPtr_IntPtr_UInt64 ( IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, ulong arg5 ) : IntPtr
SlimMPSCnnConvolution ( IMTLDevice device, MPSCnnConvolutionDescriptor convolutionDescriptor, IntPtr kernelWeights, IntPtr biasTerms, MPSCnnConvolutionFlags flags ) : System

메소드 상세

Create() 공개 정적인 메소드

Initializes a fully connected kernel. Returns: A valid SlimMPSCnnConvolution object or null, if failure.
public static Create ( uint kernelWidth, uint kernelHeight, uint inputFeatureChannels, uint outputFeatureChannels, MPSCnnNeuron neuronFilter, IMTLDevice device, string kernelParamsBinaryName, bool padding, uint strideX, uint strideY, uint destinationFeatureChannelOffset, uint groupNum ) : SlimMPSCnnConvolution
kernelWidth uint Kernel Width
kernelHeight uint Kernel Height
inputFeatureChannels uint Number feature channels in input of this layer
outputFeatureChannels uint Number feature channels from output of this layer
neuronFilter MPSCnnNeuron A neuronFilter to add at the end as activation (could be null)
device IMTLDevice The IMTLDevice on which this SlimMPSCnnConvolution filter will be used
kernelParamsBinaryName string name of the layer to fetch kernelParameters by adding a prefix "weights_" or "bias_"
padding bool Bool value whether to use padding or not
strideX uint Stride of the filter
strideY uint Stride of the filter
destinationFeatureChannelOffset uint FeatureChannel no. in the destination MPSImage to start writing from, helps with concat operations
groupNum uint if grouping is used, default value is 1 meaning no groups
리턴 SlimMPSCnnConvolution

EncodeToCommandBuffer() 공개 메소드

Encode a MPSCnnKernel into a command Buffer. The operation shall proceed out-of-place. We calculate the appropriate offset as per how TensorFlow calculates its padding using input image size and stride here. This [Link](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/ops/nn.py) has an explanation in header comments how tensorFlow pads its convolution input images.
public EncodeToCommandBuffer ( IMTLCommandBuffer commandBuffer, MPSImage sourceImage, MPSImage destinationImage ) : void
commandBuffer IMTLCommandBuffer A valid MTLCommandBuffer to receive the encoded filter
sourceImage MPSImage A valid MPSImage object containing the source image.
destinationImage MPSImage A valid MPSImage to be overwritten by result image. destinationImage may not alias sourceImage
리턴 void