The news says machine learning is the Next Big Thing.
But machine learning is happening way over there, on servers, in universities and in big companies with big data. What is it really, and what does it mean for over here, on mobile, in Swift? Are we –gulp– legacy tech?
This talk will present a fast, concrete, down-to-earth survey of machine learning, from the perspective of iOS & Swift, summarizing the main techniques, tools, and learning resources. It’ll outline how TensorFlow is like AVFoundation, how model training is like UI design, and how you can use iOS to gather big (enough) data and to exercise modern models using fast native code.
ãã¥ã¼ã¹ã§ã¯ãæ©æ¢°å¦ç¿ã¯æ¬¡ã®å¤§ããªãã®ã ã¨è¨ã£ã¦ãã¾ãã
ãããæ©æ¢°å¦ç¿ã¯å¤§å¦ã大ããªä¼æ¥ã®ãµã¼ãã¼ã® ãã¡ãå´ ã§ããã°ãã¼ã¿ã¨ã¨ãã«è¡ããã¦ãã¾ããããã¯ãã£ããä½ãªã®ã§ããããï¼ ãã¡ãå´ ã§ããã¢ãã¤ã«ãSwiftã«ã¨ã£ã¦ä½ãæå³ããã®ã§ããããï¼ç§ãã¡ã¯ã¬ã¬ã·ã¼ãªæè¡ã –ãã£ã¤ãã¦ãã– ã®ã§ããããï¼
ãã®ãã¼ã¯ã§ã¯iOSã¨Swiftã®è¦³ç¹ããè¿ éã§å ·ä½çã§ç¾å®çãªæ©æ¢°å¦ç¿ã®èª¿æ»ãã主ãªãã¯ããã¯ããã¼ã«ãå¦ç¿ç´ æãã¾ã¨ãã¾ããTensorFlowãAVFoundationã®ãããªãã®ã§ãããã¨ãã¢ãã«ãã¬ã¼ãã³ã°ãUIãã¶ã¤ã³ã®ãããªãã®ã§ãããã¨ãããã¦é«éãªãã¤ãã£ãã³ã¼ãã使ã£ã¦ã©ã®ããã«iOSã§ååã«å¤§ãããã¼ã¿ãåéããææ°ã®ã¢ãã«ã®ã¨ã¯ãµãµã¤ãºãã§ããã¨ãããã¨ããä¼ããã¾ãã
Swiftéçºè ãç¥ãããã£ããã©èãã«ããæ©æ¢°å¦ç¿ã®ãã¹ã¦
ä»æ¥ã¯æ©æ¢°å¦ç¿ã®è©±ããSwiftã®éçºè ã¨ãã¦ã話ãã¾ãã
ã«ã¹ã¿ãã¤ãºããã¡ã¬ããä½ã£ã¦ãã¾ãã
é¡åçã®ã¢ãã«ããæ¡å¼µç¾å®ã使ã£ã¦ãããããªã¡ã¬ããä»ããæã®æ§åãã¿ãããããã«ãã¦ãã¾ãã
ã«ã¹ã¿ãã¤ãºãããã¡ã¬ããä½ãã¾ãã
ã³ã³ãã¥ã¼ã¿ã¼ãã¸ã§ã³ã«ã¯ãã·ã³ã©ã¼ãã³ã°ãæ¬ ããã¾ããã
æ©æ¢°å¦ç¿ã¯ãå¤åãæ¿ããã®ã§ææ°ã®æ å ±ã¯ãããã¾ããã
å®ç¾©ãããã¦ããã¾ãã
ããã°ã©ã ã¯èãã¦é¢æ°ãä½ãã¾ãã
ãã·ã³ã©ã¼ãã³ã°ã¯ããã¼ã¿ã使ã£ã¦äººéã®èããå ãã¦é¢æ°ãä½ãã¾ãã
ã¿ãªãããã身é·ã®å¹³åå¤ãéãã¦ãããè¿ãé¢æ°ãä½ãããã§ãã
ç·å¥³ã§åããã°éãå¹³åå¤ãåºããã¨ãã§ããå¤å°ã¢ãã«ãè¯ããªãã¾ãã
å¹´é½¢ãä½éãé´ã®ãµã¤ãºãå³ã£ã¦ä¿æ°ã使ããªããç©ç®ãã¦ãã
ããããã¨ããæ£ç¢ºãªæ°åãåºãã¾ãã
ãããã¯ãåç¥ã®éãç·å½¢å帰ã§ãã
ããã¯ãããããçµ±è¨ã§ã¯ããã¾ããã
ãªãæ©æ¢°å¦ç¿ã®è©±ã§ãããªå¤ãç©ã®è©±ããã¦ããã®ã§ãããã
ã¹ãããªã©ãæ§ã ãªãã¼ã¿ãéãã¦ãã¦ããã¾ããããã¦æ¼ç®è½åãæãã¾ããããã¦ãã®ãã¼ã¿ãé©ããããªçµæãåºãã¦ããã¾ãã
ãã¥ã¼ã©ã«ãããã¯ã¼ã¯ã§ãã1950å¹´å°ããèãããã¦ãã¾ããããæ©è½ã¯é²æãã¦ãã¾ããã§ããã
ããããã®3ã¤ã®å ¥åå¤ãå¢ãããçãä¸ã®å±¤ã48ã¬ã¤ã¤ã¼ã«ãã¦ãã£ã¦ã¿ã¾ããã
ãããInception-v3ã§ãã
è¨è ãã£ãã注:
âInception-v3ã®ãããã¯ã¼ã¯ã®æ¦ç¥å³ãref) Research Blog: Train your own image classifier with Inception in TensorFlow
Inception-v3ã¯GoogleãéçºããCNN(Convolutional Neural Network=ç³ã¿è¾¼ã¿ãã¥ã¼ã©ã«ãããã¯ã¼ã¯)ã®ã¢ãã«ãCNNã¯ä¸»ã«ç»åèªèã«å©ç¨ããããç¹å¾´ãæ½åºãããã£ã«ã¿ã§ããç³ã¿è¾¼ã¿å±¤ã¨æ½åºãããç¹å¾´ãå§ç¸®ãããã¼ãªã³ã°å±¤ãæã¤ãã¨ãç¹å¾´ã¨ããå¤å±¤ã®ãã¥ã¼ã©ã«ãããã¯ã¼ã¯ããã¥ã¼ã©ã«ãããã¯ã¼ã¯ã¨ã¯ãè¨ç®ã®ä»çµã¿ãè³ã®ãã¥ã¼ãã³ã®ä¿¡å·ä¼æã®æ§åã¨ä¼¼ã¦ãã(ã¨ä¸è¬ã«èª¬æããã¦ãã)ãã¨ããããå¼ã°ããããè¨ç®ã¦ãããã®åºåãå¥ã®ã¦ãããã®å ¥åã«ãªãè¨ç®ã¦ãããã®ãããã¯ã¼ã¯ãæ©æ¢°å¦ç¿ã¯ãã®è¨ç®ã¦ãããã®åºåãããå¤ãã¦ãããéã®çµå度åãã®èª¿æ´ãã³ã³ãã¥ã¼ã¿ã¼ã«ä»»ã(ãã¨ãã°æ師ãã¼ã¿ãä¸ãéç®ããããããªå½¢ã§)æé©å(å¦ç¿)ããããï¼ããããã£ããï¼
â»ã¡ããã¨åå¼·ããã人ã¸ããã®æ¬ã®79ãã¼ã¸ãããç³ã¿è¾¼ã¿ãã¥ã¼ã©ã«ããããã®ç« ã§ãã
深層å¦ç¿ (æ©æ¢°å¦ç¿ãããã§ãã·ã§ãã«ã·ãªã¼ãº)
- ä½è : 岡谷貴ä¹
- åºç社/ã¡ã¼ã«ã¼: è¬è«ç¤¾
- çºå£²æ¥: 2015/04/08
- ã¡ãã£ã¢: åè¡æ¬ï¼ã½ããã«ãã¼ï¼
- ãã®ååãå«ãããã° (13件) ãè¦ã
Appleããµã³ãã«ã³ã¼ããåºãããããiOSããã¤ã¹ã®ä¸ã§ãããã使ããã¨ãã§ãã¾ãã
ç´ æ´ãããã¨ããã¯ãæ§ã ãªã¬ã¤ã¤ã¼(層)ã§ã¼ãã£ã¨ãã¦ãããã®ãèªèãã¦ããããã§ãã
æ§ã ãªãã®ãåé¡ããã¦è¡ãããã®çµæãé©ããããªçµæã«ãªãããªã人ã ãããã«ããã»ã©ã¯ã¯ã¯ã¯ãã¦ããã®ãã
ã³ã³ãã¥ã¼ã¿ã¼ã®ãªãã§ãããããªãã¨ãããã®ã¯é£ãããã¨ããã®ã2014å¹´ã®ãã³ã¬ã
ãããä»ã§ã¯ã¡ãã£ã¨ã³ã³ãã¥ã¼ã¿ã¼ã¸ã®æãæ¹ãå¤ããã°ç°¡åã«ã§ããããã«ãªã£ãã
ãã·ã³ã©ã¼ãã³ã°ã¯åæããã¹ãã¼ãã®èªèãé£èºçã«ä¼¸ã³ãã¨ããã«ããã¾ãã
ãããããã¨ã¯ã¢ãã¤ã«ã¢ããªéçºã«å½±é¿ããã®ã§ããããï¼
é¡æ¤ç¥ãªã©ã«ä½¿ããã¦ãã¾ããããã¯åæã®æ©æ¢°å¦ç¿ã§ãã
é³å£°ã§(é³å£°ã対象ã«ãã¦ï¼)ã³ã¼ãã£ã³ã°ã¯é常ã«é£ããã£ãããã³ã¼ãä¸ã¤ã§ã§ããä¸çã«ãªã£ã¦ããã
æ°å¦è ãããªãã¦ãã¢ãã«ãä½ããã¨ã¯ã§ãã¾ãã
æ©æ¢°å¦ç¿ã¯Swiftã§è¨ãã¨1.0ã§ããSwiftã1.0ãåºãé ã¯ã¡ã¤ã³ã¹ããªã¼ã ããèããã¨å¤ãã£ã¦ããã¨ããããã£ãã®ã§ã¯ãªãã§ããããã
ããããã¾ã§ã¯ãSwiftã«æ²¢å±±ã®äººãéè¦ã ã¨æ³¨ç®ãéã¾ã£ã¦ãã¾ããæè²ãæ´ã£ã¦ãã¾ãããç¹å¥ã§ããããä»ã¯ã¡ã¤ã³ã¹ããªã¼ã ã§ãã
åããã¨ãæ©æ¢°å¦ç¿ã§èµ·ãã¦ãã¾ãã
è²ããªäººãè²ããªå½¢ã§èª¬æãããã¨ããããã«ãªã£ã¦ãã¾ãããGoogleã®TensorFlowãããã§ãããããªãªã©ãå ¬éããã¦ãã¾ãã使ãæ¹ã説æãã人ããããããã¾ãã
ã§ã¯æ©æ¢°å¦ç¿ãSwiftç°å¢ã§ä½¿ããã§ãããã
æ©æ¢°å¦ç¿ã«ã¯å¦ç¿ã¨ä½¿ãã¨ãã段éãæãã¾ããããã§Pythonã使ãã®ã¯ç§å¦ç°å¢ã§ãã使ããã¦ããããã§ãã
å±éãã段éã§Swiftã使ããã¨ãã§ãã¾ããTensorFlowã®å¦ç¿ãã¼ã¿ã(端æ«å ã«æã£ã¦)å©ç¨ããããSDKã使ã£ã¦ãããã¯ã¼ã¯çµç±ã§å©ç¨ãããã¨ãã§ãã¾ããAppleãæä¾ããç©ãããã¾ãã
AVFoundationã使ããããªãã®ã§ãã
ãããAPIãæ´»ç¨ããã¨ããã¬ãã«ã§ã®è¦ç¹ã«ãªãã¾ãã
æ©æ¢°å¦ç¿ãä½ããã¨ã¯UIãä½ããã¨ã«ä¼¼ã¦ãã¾ãã
ãªããã¾ãè¡ã£ãã®ãããªããã¾ãè¡ããªãã£ãã®ããã¯ã£ããã¨ã¯ãããã¾ããã
(è¨è ã®ãã£ãã注: åºæ¥ä¸ãã£ããã¥ã¼ã©ã«ãããã¯ã¼ã¯ã¯å¤å±¤ã®å ¥ãçµãã ãããã¯ã¼ã¯ã§ç¹å®ã®è¨ç®çµæãã©ã®ã¦ããããã¦ãããéã®çµåã«èµ·å ãã¦ããã®ããç°¡åã«èªã¿è§£ããããæåã§èª¿æ´ãã¦æå³ããã¨ããã®æåã«å¤æ´åºæ¥ããããªãã®ã§ã¯ãªããªã£ã¦ãã¾ããçãªãã¨ãè¨ã£ã¦ããã)
ã¢ã¦ããããã®è§£éãé£ãããã§ãã
ãã¶ã¤ã³ã¯ç´æçã«ãããè¯ãã®ã§ã¯ãªããã¨ããã®ããã£ããã¦ã¼ã¶ã¼ã«è¦ãã¦ã¿ãã¾ã§ããããªãããã·ã³ã©ã¼ãã³ã°ã¢ãã«ã¯ããã«ä¼¼ã¦ããã
iOSã¯ãã·ã³ã©ã¼ãã³ã°ã«ããç°å¢ã ã¨æãã¾ãããã©ã¼ã ãè¨å ¥ãã¦Yes/Noãªã©ã®ç²¾åº¦ã®é«ãæ å ±ãå ¥ã£ã¦ããããã§ã¯ããã¾ããã
ä¾ãã°åçã¯ãããããªè¦ç´ ãããã¾ããiOSããã¤ã¹ã¯ç´æ¥çããã®æã§ä½¿ããã®ã§ããã¯ã£ãããã¦ããªãä¸çã¨ããåããããã®ã§ãããã·ã³ã©ã¼ãã³ã°ã®ã½ããã¦ã§ã¢ã¯ããããææ§ãªä¸çãåãè¾¼ãã§ãå ·ä½çãªè§£éã«ãã¦ãããã¨ãã§ãã¾ãã
ç§ãã¡ã®ãããã¯ããã人éçãªäººã®é¡ããå ·ä½çãªå人ãç¹å®ãã¦ç²¾åº¦ã®é«ãæ示ã§ãããããã¬ã¼ã¶ã¼ã«å¯¾ãã¦ç´ æãåãè¾¼ãã§ããã
ä½ããã¯ããããè¯ãã§ããã
誰ãå°é家ã§ã¯ãªãã®ã§ããå§ãããã¨ãã§ãã¾ãã
TensorFlowã®ãã¥ã¼ããªã¢ã«ãã¹ã¿ã³ãã©ã¼ãã®è¬åº§ãYouTubeã«é¢ç½ããããªãå ¬éãã¦ãã人ãå± ã¾ãã
ã¾ã¨ã
- ããã¯ããããã¾ãã
- APIã®ããã«å©ç¨ã§ãã¾ãã
- æ·±æãããã¦ãããã¨ãã§ãã¾ãã
- ãããã¤ãããå ´åã«ã¯Pythonã使ã£ã¦ã¢ãã«ãè¨ç·´ããSwiftã使ã£ã¦äººã ã®æã«å±ãããã¨ãã§ãã¾ãã
Q&A
ãã£ããäºä¾ãããã¦ãã©ããã£ã¦ã¡ã¬ããä½ããã®è©±ããã£ãããã¬ã³ããªã³ã°ã¯ç«¯æ«å´ã§å¦çãã¦ããï¼ãµã¼ãã¼ã§å¦çãã¦ããï¼
é¡ã®å½¢ããµã¼ãã¼ã§ç®åºããçµæãã¯ã©ã¤ã¢ã³ãã«æµãã¾ããã¬ã³ããªã³ã°ã¯SceneKitã使ã£ã¦ã¯ã©ã¤ã¢ã³ãã§ãã£ã¦ãã¾ããããã§æµããããã«æä¾ã§ãã¾ãã ä»å¾ã¯ããã¯ã©ã¤ã¢ã³ãå´ã§åºæ¥ãããã«ãããã§ããé常ãµã¼ãã¼ã§ãããªããã°ãªããªãå¦çãã¯ã©ã¤ã¢ã³ãã§ã§ããããã«ãªãã¨ããã¡ãªãããæãã¾ãã
ã¿ããªã®åå¿
Courseraã®Andrewå çã®è¬ç¾©ã§ãã£ããã¤ã #tryswiftconf
— ããã«ãã (@giginet) 2017å¹´3æ2æ¥
é¡èªèãèªåã§å¦ç¿ãã¦ã¢ãã«ä½ããã¨ãããããååãªã¢ãã«ãä¸ã®ä¸ã«æº¢ãã¦ããããæ©æ¢°å¦ç¿ãããã¯ã試ãã®ã«åãã¦ã #tryswiftconf
— satoshi namai (@ainame) 2017å¹´3æ2æ¥
ã¾ãã WebService 使ã£ã¦ãé£æºãããã£ã¦æã«ãªã£ã¦ããããã#tryswiftconf
— ã¤ã«ã«ï¼ æ°ç±³ããã°ã©ãã¼ (@ikkitang) 2017å¹´3æ2æ¥
大å¦ã§è³ã«ã¿ã³ãã§ãããããèãã¦æ¥ãMachine LearningãDeep Learningã®ãããããä»ããã®ã¹ã©ã¤ããç解ããå½¹ã«ç«ã£ã¦ãã¦å人çã«å¬ãã#tryswiftconf
— TK (Cokaholic) (@TK_u_nya) 2017å¹´3æ2æ¥
ä»ã«Swiftã§TensorFlowã¨é£æºããæ¹æ³ã¨ãã¦ãTensorFlowã§å¦ç¿ããçµæãSwiftä¸ã§ä½¿ãã©ã¤ãã©ãªä½ã£ã¦ã¾ãã #tryswiftconfhttps://t.co/HIlAZkpZHi
— koher (@koher) 2017å¹´3æ2æ¥
æ©æ¢°å¦ç¿ã¯UIã¨åããã¯è¨ãå¾ã¦ãã¦ãªãã»ã©ã¨æã£ããè¯ãã証æã§ããªããçµé¨ã§ãããªã£ã¦ããã98%åã£ã¦ããã°ä¸ã æ³ããªã©ã #tryswiftconf
— Hirohito Kato â (@hkato193) 2017å¹´3æ2æ¥
iOSã§Tensor Flowã®è©±èãã¦ããTensor Flowã®ããããåç»ã£ã¦ã®ã¯ããã https://t.co/Josjm28yHI #tryswiftconf
— æè¤ç¥è¼ (@uskwitter) 2017å¹´3æ2æ¥
Togetter
æ°ã«å ¥ã£ãè¨äºã¯ ã¯ã¦ãªããã¯ãã¼ã¯
ã¯ã¦ãªããã¯ãã¼ã¯ã¢ããªiOSéçºãã¼ã ããæ¥ã¾ããï¼ ã¯ã¦ãªããã¯ãã¼ã¯ã«ã¯Swiftç¹éãããã¾ãï¼ è¯ãè¨äºãè¦éããªãããã«ããå©ç¨ãã ããï¼ http://b.hatena.ne.jp/hotentry/it/Swift
ããã¦(ãã®ããã°ã«éãã)è¯ãè¨äºããã£ãããã¯ã¦ãªããã¯ãã¼ã¯ã§ããã¯ãã¼ã¯ãã¾ãããï¼ try! Swift ã®è¨äºã§çãä¸ããã¨å¬ããã§ãï¼