Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Core ML vs MPS vs BNNS #fincwwdc

shu223
July 24, 2017

Core ML vs MPS vs BNNS #fincwwdc

2017.7.24 WWDC2017振り返り勉強会@FiNC
での発表資料です。

shu223

July 24, 2017
Tweet

More Decks by shu223

Other Decks in Programming

Transcript

  1. Metal Performance Shaders Accelerate (BNNS) Your App iOS 10 •

    iOS 10Ͱ΋࢖͑Δ • ౰વMetalͰॲཧ͞ΕΔʢMPSCNNͷ৔߹ʣ • ֶशଆ΋ɺTensorFlowͰ΋KerasͰ΋جຊతʹԿͰ΋OK ͜ΕͰ΋OK
  2. ֶशπʔϧɿͳΜͰ΋͍͍ ϞσϧͷϑΥʔϚοτɿͳΜͰ΋͍͍ Train Model (Trained Params) dat or hdf5 •

    χϡʔϥϧωοτϫʔΫͷʮॏΈʯ ͱʮόΠΞεʯͱ͍͏ύϥϝʔλ͕ ೖ͍ͬͯΔ • dat͸ͨͩͷόΠφϦϑΝΠϧ • iOSΞϓϦͰಡΈࠐΊ͑͢͞Ε͹ͳ ΜͰ΋͍͍ ʢ˞$//ͷֶश͕Ͱ͖ͯύϥϝʔλΛॻ͖ग़ͤΔ΋ͷͰ͋Ε͹ʣ
  3. MPSCNNConvolution MPSCNNFullyConnected MPSCNNPooling MPSCNNConvolution MPSCNNConvolution MPSCNNPooling CNNͷ֤૚ʹରԠͨ͠Ϋϥε͕MPSʹ༻ҙ͞Ε͍ͯΔ • Convolution Layer

    -> MPSCNNConvolution ͱ໊લ΋ͦͷ··ͳͷͰɺ࣮૷ʹͦΕ ΄Ͳ໎͏͜ͱ͸ͳ͍ • ΍΍͍͜͠ߦྻܭࢉ΍ɺGPUͰͷฒྻԋࢉͷ࠷దԽ౳Λࣗ෼Ͱҙࣝ͢Δඞཁ΋ͳ͍ • Step1Ͱֶͭͬͨ͘शࡁΈύϥϝʔλ͸ϑΝΠϧ͔ΒಡΜͰ͖ͯϙΠϯλΛ౉͢
  4. Input image MPSImage Result (UInt, etc.) CNN • Step 2Ͱ࣮૷ͨ͠ωοτϫʔΫ

    • Step 1Ͱֶͭͬͨ͘शࡁΈϞσϧ ʢύϥϝʔλʣΛಡΈࠐΜͰ͍Δ Do something
  5. BUT

  6. ·ͱΊ • Core ML͕͜Μͳʹ׻ܴ͞ΕͯΔͷʹʮࠓ͙͢ϦϦʔε൛Ͱ࢖͑ ΔʯMPSCNN͕͋·Γ࿩୊ʹͳͬͯͳ͍ - ৘ใ͕গͳ͘ɺ࢖͍ํ͕఻Θͬͯͳ͍͚ͩͰ͸ͳ͍͔ • MPSCNNΛར༻࣮ͨ͠૷खॱ3εςοϓ -

    Ϟσϧ࡞੒ˠωοτϫʔΫ࣮૷ˠਪ࿦࣮ߦ - େہతʹΈΕ͹ҙ֎ͱγϯϓϧʹ࢖͑Δ - ͔͠͠ਖ਼௚ͳͱ͜Ζେมͳ෦෼͸͋Δ • ͦ͜Λܶతʹ؆୯ʹͨ͠ͷ͕Core ML & Vision