官术网_书友最值得收藏!

Understanding mobile platform limitations

Now, if I have persuaded you to use ML on mobile devices, you should be aware of some limitations:

  • Computation complexity restriction. The more you load your CPU, the faster your battery will die. It's easy to transform your iPhone into a compact heater with the help of some ML algorithms.
  • Some models take a long time to train. On the server, you can let your neural networks train for weeks; but on a mobile device, even minutes are too long. iOS applications can run and process some data in background mode if they have some good reasons, like playing music. Unfortunately, ML is not on the list of good reasons, so most probably, you will not be able to run it in background mode.
  • Some models take a long time to run. You should think in terms of frames per second and good user experience.
  • Memory restrictions. Some models grow during the training process, while others remain a fixed size.
  • Model size restrictions. Some trained models can take hundreds of megabytes or even gigabytes. But who wants to download your application from the App Store if it is so huge?
  • Locally stored data is mostly restricted to different types of users' personal data, meaning that you will not be able to aggregate the data of different users and perform large-scale ML on mobile devices.
  • Many open source ML libraries are built on top of interpretable languages, like Python, R, and MATLAB, or on top of the JVM, which makes them incompatible with iOS.

Those are only the most obvious challenges. You'll see more as we start to develop real ML apps. But don't worry, there is a way to eat this elephant piece by piece. Efforts spent on it are paid off by a great user experience and users' love. Platform restrictions are not unique to mobile devices. Developers of autonomous devices (like drones), IoT developers, wearable device developers, and many others face the same problems and deal with them successfully.

Many of these problems can be addressed by training the models on powerful hardware, and then deploying them to mobile devices. You can also choose a compromise with two models: a smaller one on a device for offline work, and a large one on the server. For offline work you can choose models with fast inference, then compress and optimize them for parallel execution; for instance, on GPU. We'll talk more about this in Chapter 12, Optimizing Neural Networks for Mobile Devices.

主站蜘蛛池模板: 榆林市| 吉水县| 宁德市| 勃利县| 合山市| 黄大仙区| 渑池县| 京山县| 上饶市| 佛学| 鄱阳县| 鄂尔多斯市| 无锡市| 泗阳县| 奉化市| 玉屏| 青州市| 晋中市| 化州市| 陈巴尔虎旗| 蒙阴县| 同仁县| 三门县| 枞阳县| 昌宁县| 崇礼县| 鹤壁市| 自贡市| 嘉义市| 沁水县| 栾川县| 台江县| 吉木乃县| 深州市| 连州市| 伊金霍洛旗| 常山县| 寻乌县| 衡阳县| 万山特区| 银川市|