coreML 初窥

coreML 初窥

本文章主要介绍对于CoreML Foundation的简单实用,不深入涉及Machine Learn(自己对于ML知识还很浅):

  • CoreML相关简介

  • 例子使用讲解


CoreML相关简介

2017-06-06 Apple 在WWDC2017大会上推出CoreML框架

  • Core ML lets you integrate a broad variety of machine learning model types into your app. In addition to supporting extensive deep learning with over 30 layer types, it also supports standard models such as tree ensembles, SVMs, and generalized linear models. Because it’s built on top of low level technologies like Metal and Accelerate, Core ML seamlessly takes advantage of the CPU and GPU to provide maximum performance and efficiency. You can run machine learning models on the device so data doesn’t need to leave the device to be analyzed.

  • 以上内容大概翻译过来就是:CoreML可以集成多种机器学习模型类型到您的应用程序。它除了支持超多30 layer的机器学习,还支持多种标准的模型,比如: tree ensembles, SVMs, and generalized linear models。它建立于底层的技术类似Metal 和 Accelertate,因此能最大的利用CPU和GPU提供性能和效率。并且您可以直接在设备上直接运行机器模型,不需要数据离开设备进行分析。


例子使用讲解

  • 建立的工程导入CoreML 框架

  • 导入*.mlmodel, 通过Xcode可以看到这个mlmodel的相关信息,包括model的类型,作者,Model Class ,输入参数,输出参数等信息;这里写图片描述

  • 根据Apple的说法,导入mlmodel后,Xcode也根据model信息自动生成一个自定义编程接口模型,可以用它来与模型交互的代码。具体它什么时候转出代码,目前我还没找到。刚开始我根据它的swift例子编写obj例子,我把mlmodel导入的时候,然后编译了好久都没看到自动生成的接口model,然后我就不停的command+b,突然我就能看到了。然后在我的一个新项目中,使用了另外一个mlmodel,编译好久也还没看到生成的接口模型。这里比较奇怪,也还没找到对应的说法,也可能是xcode问题,稍后会研究。

[1]: https://developer.apple.com/machine-learning/ apple关于machine learning的介绍

[2]: https://developer.apple.com/documentation/coreml/integrating_a_core_ml_model_into_your_app apple 关于coreML例子

[3]: https://github.com/hxming2919/IntegratingaCoreMLModelintoYourApp_obj 使用obj重写apple coreML例子

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 4
    评论
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值