How to make a Flatten filter by using MPS (MetalPerformanceShaders)?
Asked Answered
D

1

6

I'm working on running CNN inference for MNIST on iOS. There is a good code sample from Apple to start. https://developer.apple.com/library/content/samplecode/MPSCNNHelloWorld/Introduction/Intro.html#//apple_ref/doc/uid/TP40017482-Intro-DontLinkElementID_2

However, When I tried to implement much complex CNN model (e.g. https://github.com/fchollet/keras/blob/master/examples/mnist_cnn.py) by using MPS, I found that there was no class for "Flatten" filter.

I looked through MPS framework to find the function to reshape or change a dimension, but I couldn't find the right one. (e.g. MPSImageConversion seems only for converting a color, but not for a dimension.

If someone knows the filter for Flatten or how to convert multi-dimension image to 1D image, please let me know.

Dextrality answered 26/11, 2016 at 2:55 Comment(1)
I found that Flatten layer is not required because MPS can handle multi-dimensional data as an input.Dextrality
D
0

Flatten layer is not required because MPS can handle multi-dimensional data as an input.

Dextrality answered 13/12, 2016 at 7:48 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.