【问题标题】:How to make a Flatten filter by using MPS (MetalPerformanceShaders)?如何使用 MPS(MetalPerformanceShaders)制作 Flatten 滤镜?
【发布时间】:2017-04-10 09:57:41
【问题描述】:

我正在为 iOS 上的 MNIST 运行 CNN 推理。 Apple 提供了一个很好的代码示例。 https://developer.apple.com/library/content/samplecode/MPSCNNHelloWorld/Introduction/Intro.html#//apple_ref/doc/uid/TP40017482-Intro-DontLinkElementID_2

但是,当我尝试使用 MPS 实现非常复杂的 CNN 模型(例如https://github.com/fchollet/keras/blob/master/examples/mnist_cnn.py)时,我发现没有“Flatten”过滤器的类。

我查看了 MPS 框架以找到重塑或更改维度的功能,但找不到合适的功能。 (例如,MPSImageConversion 似乎只用于转换颜色,而不用于转换尺寸。

如果有人知道 Flatten 的过滤器或如何将多维图像转换为 1D 图像,请告诉我。

【问题讨论】:

  • 我发现不需要Flatten层,因为MPS可以处理多维数据作为输入。

标签: ios image-processing flatten metal mnist


【解决方案1】:

不需要扁平层,因为 MPS 可以处理多维数据作为输入。

【讨论】:

    猜你喜欢
    • 2016-01-06
    • 2015-04-10
    • 2016-10-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-12-04
    • 1970-01-01
    相关资源
    最近更新 更多