Posts

Post not yet marked as solved
0 Replies
295 Views
Assume that I have a CNNNode with the dimensions h1xw1xchannel1 (kernel sizes do not matter). This node is "converted" by a fully connected node to the dimensions 1x1xchannel2. The condition is that h1xw1xchannel1 >> channel2. Afterwards, there are some batch normalizations, ReLU and one or two more fully connected layers. Is there any performance benefit to do the reshaping from 1x1xchannel2 to channel2x1x1 or doesn't it matter at all? Is there a memory benefit?
Posted
by Hardy.
Last updated
.
Post not yet marked as solved
1 Replies
495 Views
Theoretically, I can also add a couple of images to MPSImage to support batch operation. Why do I need an MPSImageBatch? Besides the fact that some methods use as a parameter MPSImageBatch (but have at the same time the same method using MPSImage).
Posted
by Hardy.
Last updated
.
Post not yet marked as solved
1 Replies
511 Views
What is the maximum global variable size or memory space that iOS can handle?Example:static uint8_t g_Variable[???];It seems to be that a bit more than 2MB is too large. Is there any documentation? But probably this limit also depends on the device?!
Posted
by Hardy.
Last updated
.
Post not yet marked as solved
0 Replies
381 Views
The MPSCNNBatchNormalizationDataSource's optional methods updateGammaAndBetaWithCommandBuffer:batchNormalizationState: and updateMeanAndVarianceWithCommandBuffer:bathNormalizationState: should be used to update the state. To calculate the new state values (beta, gamma, mean and variance), MPSBatchNormalizationStatistics should be used, I suppose.Naturally, MPSBatchNormalizationStatistics requires for the calculation of these new values "source images" (e.g. encodeBatchToCommandBuffer:sourceImage:batchNormalizationState:). The source images should be the source images of the batch normalization node. But how do I access the input of the batch normalization node when updateGammaAndBetaWithCommandBuffer:batchNormalizationState: is called? I could not find any possibility to access these data. Any clues?
Posted
by Hardy.
Last updated
.
Post not yet marked as solved
0 Replies
413 Views
In case I am increasing the batch size in Controls.h to a number larger than 64 (e.g. 80) the app stops with an error:validateComputeFunctionArguments:882: failed assertion `Compute Function(cnnConvArray_32x32_64): incorrect type of texture (MTLTextureType2DArray) bound at texture binding at index 16 (expect MTLTextureType2D) for Adest[16].'I have no clue what this error wants to tell me. Does anybody have any clues?
Posted
by Hardy.
Last updated
.
Post marked as solved
1 Replies
481 Views
I am using a neural network with a data type MPSDataTypeFloat32 but it seems to be that the final MPSCNNSoftMaxNode for the inference run returns an image using MPSDataTypeFloat16. Is this always the case? How do the nodes determine the output data type? Can I change them?
Posted
by Hardy.
Last updated
.
Post not yet marked as solved
0 Replies
351 Views
Is it possible to use a convolution node with a data type MPSDataTypeFloat16 when training the network?In the optimizer's (Adam optimizer) method encodeToCommandBuffer:convolutionGradientState:...resultState: method I get the following error message when using MPSDataTypeFloat16:/BuildRoot/Library/Caches/com.apple.xbs/Sources/MetalPerformanceShaders/MetalPerformanceShaders-121.4.2/MPSMatrix/LinearAlgebra/MPSMatrix.mm, line 585: error '[MPSVector initWithBuffer:length:dataType] buffer is too small (600) for vector size (1200 bytes)Yes, I have initialized the gradients with MPSDataTypeFloat16 and then the buffer size has to be 600 bytes. But it seems to be that the method assumes to get a vector of data type MPSDataTypeFloat32.
Posted
by Hardy.
Last updated
.
Post not yet marked as solved
0 Replies
337 Views
For training the model I need a special loss filter. Though Metal implements a couple of loss filters I need another one. Is it possible to create your own loss filter and if how?PS: Actually I need a combination of a cross entropy and a mean squared average error filter.PPS: The MPSCNN documentation is really sparse or not existing. Does anybody know a site that describes a bit the functionality?
Posted
by Hardy.
Last updated
.
Post not yet marked as solved
2 Replies
392 Views
Hi,when running my app on a simulator the UIDocumentPickerController correctly opens and displays all files. But when picking one of the files the controller does not send to the delegate a message that one of the items has been picked.The app works correctly on a real device. Is this a known issue or is UIDocumentPickerController not supported on simulators?
Posted
by Hardy.
Last updated
.
Post not yet marked as solved
6 Replies
2.4k Views
I have seen that a similar question has been asked in 2017 but no there hasn't been a satisfactory answer.I am adding a bar button item with a custom view to the toolbar. How do I adjust the height of the item to the maximum supported size of the toolbar (taking portrait and landscape orientations on an iPhone into consideration)?
Posted
by Hardy.
Last updated
.
Post marked as solved
2 Replies
1.1k Views
Assume I have a couple of buttons. Whenever the user touches (and holds) one of the buttons an associated scroll view is scrolling up, down, left or right. It stops scrolling when the user releases the button or the end of the content is reached.How can I make this scrolling smooth? Or better what is the best method?I came up with a couple of ideas:- call setContentOffset:animated: and call it repeatedly- install a timer changing the content offset in small time intervalsBoth proposals I do not like. The first one is not continuous, the second one is a bit over the top. Are there alternatives?
Posted
by Hardy.
Last updated
.
Post not yet marked as solved
4 Replies
551 Views
There is actually no documentation about the methods- presentationControllerDidAttemptToDismiss:- presentationControllerDidDismiss:- presentationControllerShouldDismiss:- presentationControllerWillDismiss:When implementing a custom UIPresentationController I assume that the derived class has to send these messages to the delegate at the appropriate times, or?
Posted
by Hardy.
Last updated
.
Post not yet marked as solved
0 Replies
419 Views
Since Xcode 11 commenting C++ code becomes a bit of a problem.Adding a comment into one line like/// This is a commentand hitting afterwards <return> adds automatically a line with the comment delimiters in the next line. How can I stop this behaviour?/// This is a comment /// (but I do not like to have a comment in this line)
Posted
by Hardy.
Last updated
.