Core MLのアップデートを3倍楽しむ方法 #wwdctokyo

Core MLのアップデートを3倍楽しむ方法 #wwdctokyo

19d7ae634445d4bd9b10c7961a462260?s=128

shu223

June 22, 2020
Tweet

Transcript

  1. Core MLͷΞοϓσʔτ Λ3ഒָ͠Ήํ๏ #wwdctokyo

  2. Core MLͷ৽ػೳɺ Ͳ͏৘ใऩू͠·͔͢ʁ

  3. WWDCͷηογϣϯΛݟΔ

  4. ˚

  5. WWDCηογϣϯͰ͸ ͢΂ͯͷ৽API΍ͦͷ࣮૷ํ๏Λ ղઆ͍ͯ͠ΔΘ͚Ͱ͸ͳ͍

  6. ྫɿ Core ML 3Ͱ௥Ճ͞Εͨ100Ҏ্ͷ৽ϨΠϠʔ • WWDCͰͷݴٴ͸͜Ε͚ͩʗ௥ՃϨΠϠʔͷҰཡ͢Βͳ͍

  7. Core MLͷ৽ػೳɺ Ͳ͏৘ใऩू͠·͔͢ʁ

  8. Core MLͷAPIϦϑΝϨϯεΛݟΔ

  9. ˚

  10. • CoreML.framework͸࠷ऴతͳϞσϧʢmlmodelʣΛiOSͰѻ ͏෦෼͔͠ఏڙ͠ͳ͍

  11. • CoreML.framework͸࠷ऴతͳϞσϧʢmlmodelʣΛiOSͰѻ ͏෦෼͔͠ఏڙ͠ͳ͍ ʮCore MLͰͰ͖Δ͜ͱʯ͸ϞσϧʹӅṭ͞Ε͍ͯΔ͜ͱ΋ଟ ͍

  12. ৽ػೳͷৄࡉ͕CoreML.framework ͷAPI͔Β͸ݟ͑ͯ͜ͳ͍͜ͱ΋ଟ͍

  13. ྫɿ • ͲΜͳ৽ϨΠϠʔ͕αϙʔτ͞Εͨͷ͔ʁ • ΫΥϯλΠζʢϞσϧαΠζΛখ͘͢͞Δػೳʣ • ΦϯσόΠεֶश͸Կ͕Ͱ͖ͯԿ͕Ͱ͖ͳ͍ͷ͔ʁ

  14. ΋ͬͱָ͠Ήʹ͸

  15. coremltoolsϦϙδτϦΛݟΔʂ

  16. ಛʹ͜͜: mlmodel/formatϑΥϧμ

  17. • Core MLϞσϧϑΝΠϧʢ.mlmodelʣ͸ɺProtocol Buffers Λϕʔεͱ͢ΔΦʔϓϯͳϑΥʔϚοτ • Ϟσϧ࢓༷͸coremltoolsϦϙδτϦͰެ։͞Ε͍ͯΔ • → mlmodel/format഑Լʹ͋Δ.protoϑΝΠϧ܈͕ͦΕ

  18. ྫɿ NeuralNetwork.proto χϡʔϥϧωοτϫʔΫʹ͓͍ͯར༻ՄೳͳϨΠϠʔ͕͜͜Ͱ ఆٛ͞Ε͍ͯΔ ConvolutionLayerParams convolution = 100; PoolingLayerParams pooling

    = 120; ActivationParams activation = 130; InnerProductLayerParams innerProduct = 140; EmbeddingLayerParams embedding = 150; ... → ίϛοτཤྺ͔Β༰қʹʮ৽ͨʹ௥Ճ͞ΕͨϨΠϠʔ͸ͲΕ ͳͷ͔ʯΛ֬ೝͰ͖Δ
  19. ྫɿ Model.proto • Core MLϞσϧ࢓༷ͷϧʔτతͳprotoϑΝΠϧ • େ࿮ͱͯ͠Ͳ͏͍͏ػೳ͕௥Ճ͞Ε͔ͨ͸͜͜Ͱ͔ͭΊΔ message Model {

    int32 specificationVersion = 1; ModelDescription description = 2; bool isUpdatable = 10; oneof Type { // pipeline starts at 200 PipelineClassifier pipelineClassifier = 200; PipelineRegressor pipelineRegressor = 201; Pipeline pipeline = 202; // regressors start at 300 GLMRegressor glmRegressor = 300; ...
  20. examplesϑΥϧμ΋௒༗ӹ • ৽ػೳΛ࢖͏αϯϓϧ͕ஔ͍ͯ͋Δ • ৄࡉͳղઆίϝϯτ͖ͭ

  21. ͞Βʹָ͠Ήʹ͸

  22. ެࣜϞσϧ഑෍ϖʔδΛݟΔ

  23. • ಉ༷ͷϞσϧ͕໺ྑͰطʹग़͍ͯΔ৔߹΋ଟ͍͕ɺ΍͸Γެ ࣜͷํ͕඼࣭͕ߴ͍͜ͱ͕ଟ͍ • ࡢ೥΋৽APIൃදͷλΠϛϯάͰ͍͔ͭ͘௥Ճ͞Εͨɹ

  24. Create ML΍Turi CreateͷΞοϓσʔτ΋ݟΔ • Create ML͸खܰʹϞσϧΛͭ͘ΕΔ͕ʮΦϞνϟʯͰ͸શ વͳ͍ • TensorFlow΍PyTorchͰ࡞੒ͨ͠ϞσϧΑΓ΋༏Ε͍ͯΔ఺ ͢Β͋Δ

    • खܰʹຊ֨తͳΧελϜϞσϧΛ࡞੒Ͱ͖ΔΑ͏ʹͳΔͷͩ ͔ΒɺʮԿ͕Ͱ͖Δ͔ʯ͙Β͍͸೺Ѳ͓͍ͯͨ͠ํ͕Α͍
  25. ظ଴͢ΔΞοϓσʔτ

  26. noteʹॻ͖·ͨ͠

  27. ·ͱΊ • Core MLͷ৽ػೳΛΩϟονΞοϓ͢Δʹ͸WWDCηογϣ ϯ΍Core MLϑϨʔϜϫʔΫͷAPIϦϑΝϨϯεͰ͸ෆे෼ • coremltoolsϦϙδτϦΛݟΑ͏ • Core

    MLϞσϧʢ.mlmodelʣ͸ϓϩτίϧόοϑΝϕʔε ͷΦʔϓϯͳϑΥʔϚοτɻͦͷఆٛ͸͢΂ͯ͜ͷϦϙδ τϦʹ͋Δɻ • αϯϓϧϑΥϧμ΋༗ӹ
  28. ࠷ޙʹએ఻

  29. Core ML ToolsຊɺηʔϧதͰ͢ • 3500ԁˠ1500ԁʢࢴ+ిࢠͷηοτʣ • ిࢠ൛͸Ξοϓσʔτ͞ΕΔͷͰҰ੾ଛ͸͋Γ·ͤΜʂ

  30. WWDC2020Ͱษڧͨ͜͠ͱΛॻ͍͍ͯ͘༗ྉϚΨδϯ • ·ͩهࣄ͕ͳ͍ͷͰࠓͳΒͨͬͨͷ500ԁʂ • ʢαϒεΫͰ͸ͳ͘ങ͍੾ΓͰ͢ʣ