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

get-started-with-machine-learning-on-aws-20170401

 get-started-with-machine-learning-on-aws-20170401

IoT ALGYAN @ 20170401

ryo nakamaru

April 01, 2017
Tweet

More Decks by ryo nakamaru

Other Decks in Programming

Transcript

  1. AWS Ͱ࢝ΊΑ͏ʂ͸͡Ίͯͷػցֶश
    IoT ALGYAN @ 2017.04.01

    View full-size slide

  2. @pottava
    (AWS Certified) SA, DevOps Engineer Pro
    ❤ Amazon ECS, AWS Batch, IAM

    View full-size slide

  3. גࣜձࣾεϐϯϑ

    View full-size slide

  4. ɹɹػցֶशͷ͓͞Β͍
    • ػցֶशͱ͸
    • ػցֶशͱਂ૚ֶश
    ɹɹֶश
    • σʔλͷ४උ
    • ࢼߦࡨޡ / POC
    • ֶश
    ɹɹਪ࿦
    ɹɹAWS ར༻ Tips
    ࠓ೔͓࿩͢͠Δ͜ͱ
    4

    View full-size slide

  5. ػցֶशͷ͓͞Β͍

    View full-size slide

  6. Կ͔ಛఆͷ໰୊͕͋Δͱͯ͠ɻ
    ίϯϐϡʔλʹ ٬؍తࣄ࣮ͷΈ Λ༩͑Δ͜ͱͰ
    ۩ମతͳճ౴ΛಘΔɺ·ͨ͸ͦΕΛվળ͢Δ͜ͱɻ
    ػցֶशͱ͸
    7

    View full-size slide

  7. y = ax + b
    a, b Λਓ͕ؒࣄલʹܾΊΔͷ͕Ұൠతϓϩάϥϛϯάɻ
    ࣮σʔλ͔Βίϯϐϡʔλʹܭࢉͤ͞Δͷ͕ػցֶशɻ
    ػցֶशͱ͸
    8

    View full-size slide

  8. y = ax + b
    ྫʣ
    x : ࠷ۙ஌Γ߹ͬͨਓͷಛ௃
    y : ͜ͷͻͱͱকདྷ݁ࠗͨ͠Β޾ͤʹͳΕΔ͔
    ػցֶशͱ͸
    9

    View full-size slide

  9. y = ax + b
    ྫʣ
    ਓؒʮ y = 0.7 * ੑ֨x + 0.2 * ֎ݟx + 0.1 * ऩೖx ͰΑΖʯ
    ػցʮաڈͷσʔλ͔Β͍͑͹
    ɹɹɹy = 0.4 * ੑ֨x + 0.1 * ֎ݟx + 0.5 * ऩೖx ͕ద੾ʯ
    ػցֶशͱ͸
    10

    View full-size slide

  10. y = ax + b
    a, b ΛܾΊΔͨΊͷ࡞ۀΛֶशɺ
    ܾ·ͬͨ a, b ͷ͜ͱΛֶशࡁΈϞσϧͱݴ͏ɻ
    ֶशࡁΈϞσϧΛ࢖ͬͯ
    ࣮ࡍʹ x Λ౤ೖ͠ y ΛಘΔͷ͕ਪ࿦ɻ
    ֶशͱਪ࿦
    11

    View full-size slide

  11. y = ax + b
    Ϗδωε্ॏཁͳͷ͸ɺ༏Εͨਪ࿦͕Ͱ͖Δ͔ɻ
    ༏Εͨਪ࿦Λ͢ΔͨΊʹ͸ɺ༏ΕͨϞσϧ͕ඞཁɻ
    ༏Εͨ a, b ΛܾΊΔͨΊͷֶश͕ɺ࿹ͷݟͤͲ͜Ζɻ
    ֶशͱਪ࿦
    12

    View full-size slide

  12. y = ax + b
    σʔλ͔Β a, b ΛٻΊΔํ๏͸ͨ͘͞Μ͋Δɻ
    ղ͖͍ͨ໰୊ʹΑͬͯɺద੾ͳํ๏ΛબͿඞཁ͕͋Δɻ
    ֶशΞϧΰϦζϜ
    13

    View full-size slide

  13. y = ax + b
    σʔλ͔Β a, b ΛؼೲతʹٻΊΔ۩ମతͳํ๏ͷ͜ͱɻ
    • A / B Ͳͬͪʁ໰୊ → ϩδεςΟοΫճؼ
    • ച্Λ༧ଌ͍ͨ͠ → ઢܗճؼ
    • ސ٬Ληάϝϯτ෼͚͍ͨ͠ → k ฏۉ๏
    • ϨίϝϯυΛग़͍ͨ͠ → ڠௐϑΟϧλϦϯά
    • …
    ֶशΞϧΰϦζϜ
    14

    View full-size slide

  14. IoT ͰूΊͨσʔλ͔Β༏ΕͨϞσϧΛ࡞Γਪ࿦͢Δɻ
    ͖ͬ͞ͷֶशΞϧΰϦζϜɺ࢖͑ͦ͏Ͱ͢ΑͶʁ
    • ΋͏͙͢ނো͢Δʁ͠ͳ͍ʁ
    • ऩ֭ྔ͸Ͳͷ͘Β͍ʹͳΔͩΖ͏ʁ
    • ࣅ௨ͬͨάϧʔϓʹ෼͚͍ͨ
    • ௥Ճ஫จͯ͘͠Εͦ͏ͳαΠυϝχϡʔ͸ԿͩΖ͏ʁ
    IoT × ػցֶश
    15

    View full-size slide

  15. Ұํɺࠓ೔΋࿩୊ͷ

    View full-size slide

  16. σΟʔϓϥʔχϯάɻ
    ଟ૚ߏ଄ͷωοτϫʔΫΛ༻͍ͨػցֶशͷ͜ͱɻ
    ྫʣ 4 ૚ͷωοτϫʔΫྫ
    ਂ૚ֶशͱ͸
    18

    View full-size slide

  17. ੨ؙʹ஋Λೖྗ͢Δͱɺ྘ؙʹ౴͕͑ग़ྗ͞ΕΔɻ
    ྫʣ͍҆ɺඒຯ͍͠ → ങ͏΂͖ 0.9ɺങΘͳ͍΂͖ 0.1
    ਂ૚ֶशͱ͸
    19

    View full-size slide

  18. 2 ૚໨Ҏ߱ͷ֤ϊʔυ˓͕ɺલͷ૚͔ΒͷೖྗΛجʹ
    y = ax + b Λ࢖ͬͯࣗ෼ࣗ਎ͷ஋Λܭࢉɻ
    ਂ૚ֶशͱ͸
    20

    View full-size slide

  19. ΑΓ΋ͬͱ΋Β͍͠౴͑Λฦͨ͢Ίʹ
    ֤ϊʔυͷ a, b ΛࣄલʹܾΊΔͷ͕ɺֶशɻ
    શϊʔυͷ a, b ͕ܾ·Ε͹ɺͦΕֶ͕शࡁΈϞσϧɻ
    ਂ૚ֶशͱ͸
    21

    View full-size slide

  20. ػցֶशશൠɺղܾ͍ͨ͠໰୊͝ͱʹબ୒͢Δͷ͕
    ֶशΞϧΰϦζϜɻਂ૚ֶश΋ྫ֎Ͱ͸ͳ͍ɾɾ
    ྫʣ
    • ͜ͷ͖Ύ͏Γ͸ S? M? L? → ৞ΈࠐΈχϡʔϥϧωοτϫʔΫ (CNN)
    • ࠓͷൃݴ͸ϙδςΟϒʁ → ࠶ؼܕχϡʔϥϧωοτϫʔΫ (RNN)
    • ਓ͕ඈͼग़͖ͯͨ͠ʂंΛݮ଎ʂʂ → ͋Ε͜Ε૊Έ߹Θͤ
    • …
    ਂ૚ֶशΞϧΰϦζϜ
    22

    View full-size slide

  21. ඒ͍͠૊Έ߹ΘͤͷྫɺAlphaGoɻ
    ʢ࿦จ: http://www.nature.com/nature/journal/v529/n7587/abs/nature16961.html ʣ
    • 4 ͭͷσΟʔϓχϡʔϥϧωοτϫʔΫΛར༻
    • ͦΕͧΕ ॳڃऀ pπ / தڃऀ pσ / ্ڃऀ pρ / ৘੎൑அ vθ ͱ͍ͬͨҐஔ෇͚
    • pπ ͸ਓؒͷ 800 ສͷ൫໘σʔλΛݩʹֶशɻਫ਼౓͸௿͍͕ߴ଎ʹղΛಘΔɻ
    • pσ ͸ 13 ૚ͷ CNNɻ3,000 ສ൫໘Λ 50 GPU Ͱ 3.4 ԯεςοϓɺ3 िֶؒशɻ
    ϓϩͷࢦ͠खΛ 57.0% ͷਫ਼౓Ͱ༧૝Ͱ͖Δɻ
    • pρ ͸ 50 GPU Ͱ 1 ೔͔͚128 ສճࣗݾରઓɻطଘιϑτʹ 85% ͷѹ౗తউ཰ɻ
    • vθ ͸ pσ ͰϥϯμϜʹ 3,000 ສ൫໘Λੜ੒͠ɺpρ Ͱ 1 ԯ 6,000 ສճϩʔϧΞ΢τͨ͠উ཰Λ
    ڭࢣσʔλʹɺ50 GPU ͰҰिؒ 5,000 ສճ֬཰ޯ഑߱Լ๏Λ࣮ࢪɻ
    • ࣮ରઓͰ͸1,202 CPU + 176 GPU͕࢖ΘΕɺpσ Ͱ࣍ͷखબ୒ɺvθ Ͱ൫໘ධՁɻ
    • উ཰͸͍͍͕ཧ٧Ίͷ pρ ΑΓɺਓؒͷบΛֶΜͩ pσ Λ࢖͔ͬͨɻ
    • উҼ͸ pρ ͷపఈతͳڧԽֶशʹՃ͑ɺϞϯςΧϧϩ໦୳ࡧͱ CNN ͷ૊߹͔ͤɻ
    ਂ૚ֶशΞϧΰϦζϜ
    23

    View full-size slide

  22. ࣮ફతͳωοτϫʔΫɺ
    ࣮ࡍʹ͸ͲΕ͘Β͍σΟʔϓͳϨΠϠʔͳͷʁ
    ྫʣ ৞ΈࠐΈχϡʔϥϧωοτϫʔΫͷҰछɺResNet ͸ 152 ૚
    ਂ૚ֶशΞϧΰϦζϜ
    https://research.googleblog.com/2016/08/improving-inception-and-image.html
    24

    View full-size slide

  23. ͓ɺ͓͏ɾɾ
    Ϟσϧͱܾͯ͠ΊΔม਺ͲΕ͚ͩ͋Δͷɾɾ 

    ֶशʹͲΕ͚͔͔ͩ࣌ؒΔͷɾɾ
    ͱ͍͏͔ɺϨΠϠʔఆٛ͢Δ͚ͩͰ৺͕ંΕͦ͏ɻ
    ࣗલͰ࣮૷ʁ·͋ແཧͰ͢ΑͶɾɾ
    ਂ૚ֶशΞϧΰϦζϜ
    25

    View full-size slide

  24. ਂ૚ֶशϑϨʔϜϫʔΫ

    View full-size slide

  25. ར༻ऀ͸ΞϧΰϦζϜͷ࣮૷Λ͢Δ͜ͱͳ͘
    ֤छύϥϝλͷࢦఆ͚ͩͰֶशɾਪ࿦͕Ͱ͖Δɻ
    ྫʣTensorFlow ʹΑΔ৞ΈࠐΈχϡʔϥϧωοτϫʔΫ (CNN) ఆٛ
    ɹ ͲΜͳॱংͰͲΜͳ૚Λܦ༝͢Δ͔ɺ௚ײతʹΘ͔Δ
    ਂ૚ֶशϑϨʔϜϫʔΫ
    28

    View full-size slide

  26. ΞϧΰϦζϜͷ࣮૷͸ͦͷಓͷϓϩʹ͓೚ͤͭͭ͠ɾɾ
    ࢲͨͪ͸΍Γ͍ͨ͜ͱ͚ͩͰ͖Δ࣌୅ɺ౸དྷɻ
    ྫʣը૾ʹ͍ࣸͬͯΔਓ͕஌Γ͍ͨ
    → TensorFlow Ͱ CNN Λ࢖͑͹ֶशɾਪ࿦Ͱ͖Δʂ
    ≒ Golang Ͱ HTTP/2 Λ࢖͑͹ηΩϡΞͳ௨৴΋؆୯ʂ
    ਂ૚ֶशϑϨʔϜϫʔΫ
    29

    View full-size slide

  27. TensorFlowɺMXNetɺCaffeɺChainerɺTheanoɾɾ
    ͦΕͧΕͷಛ௃ΛؑΈͯͲΕΛ࢖͏ͷ͔ɻ
    • ରԠΞϧΰϦζϜ
    • ಈ࡞୺຤ɾ؀ڥ
    • ܭࢉ଎౓ / Ϧιʔεར༻ޮ཰
    • ར༻Մೳͳݴޠ / खଓతɾએݴత
    • εέʔϥϏϦςΟ / ෳ਺ GPUɺฒྻαʔόରԠ
    • ৘ใͷ๛෋͞ / ΤίγεςϜ / ঎༻αϙʔτ
    • …
    ਂ૚ֶशϑϨʔϜϫʔΫ
    30

    View full-size slide

  28. ʮ2 ͔݄લ͔ΒूΊͨσʔλ͔Β

    ໨ඪମॏ·Ͱ͋ͱԿϲ݄

    ͔͔Δ͔༧ଌ͍ͨ͠ʯ

    View full-size slide

  29. ࣍ͷͲΕΛ࢖͏ɾɾʁ

    View full-size slide

  30. ϩδεςΟοΫճؼ
    ઢܗճؼ
    ৞ΈࠐΈχϡʔϥϧωοτϫʔΫ
    Ҩ఻తϓϩάϥϛϯά

    View full-size slide

  31. ࣮ફ͢Δલͷɺେ੾ͳϙΠϯτ

    View full-size slide

  32. ʮ͋ͳͨͷۀ຿ʹػցֶशΛ׆༻͢Δ 5 ͭͷϙΠϯτʯ
    https://www.slideshare.net/shoheihido/5-38372284
    גࣜձࣾ Preferred Infrastructure ൺށ কฏ͞Μ
    ͱͯ΋͍͍εϥΠυͰͨ͠ɻ
    36

    View full-size slide

  33. ֶशͷྲྀΕΛ࠶֬ೝ

    View full-size slide

  34. ػցֶशͷྲྀΕ
    2. σʔλલॲཧ 3. ֶश 4. ਪ࿦
    1. σʔλऩू
    39

    View full-size slide

  35. Ҏ߱ɺ͜ͷྲྀΕʹԊ͍ɺAWS ΛͲ͏࢖͑͹͍͍ͷ͔
    ར༻λΠϛϯάͱ໨తผʹ͝঺հ͠·͢ɻ
    ػցֶशͷྲྀΕ
    2. σʔλલॲཧ 3. ֶश 4. ਪ࿦
    1. σʔλऩू
    40

    View full-size slide

  36. σʔλͷ४උ

    View full-size slide

  37. 1ɹσʔλͷऩू
    ΋ͪΖΜɺIoT ͔ΒಘΒΕΔηϯασʔλ͸༗༻ʂʂ
    ͱ͸͍͑ɺ·ͣػցֶशΛࢼͯ͠ΈΔ͚ͩͳΒ
    Ұൠެ։͞ΕͨσʔλΛ׆༻͢Δͷ͕؆୯Ͱ͢ɻ
    43

    View full-size slide

  38. Ұൠެ։͞Εͨը૾ू
    ݚڀ΋ίϯςετ΋੝ΜͰɺͨ͘͞Μ͋Γ·͢ɻ
    • MNIST
    ɹ http://yann.lecun.com/exdb/mnist/
    • CIFAR-10 & CIFAR-100
    ɹ https://www.cs.toronto.edu/~kriz/cifar.html
    • ImageNet
    ɹ http://www.image-net.org/
    • …
    44

    View full-size slide

  39. AWS Public Datasets
    https://aws.amazon.com/jp/public-datasets/
    45

    View full-size slide

  40. Public Datasets | Google Cloud Platform
    https://cloud.google.com/public-datasets/
    46

    View full-size slide

  41. Public data sets for Azure analytics
    https://docs.microsoft.com/en-us/azure/sql-database/sql-database-public-data-sets
    47

    View full-size slide

  42. Datasets « Deep Learning
    http://deeplearning.net/datasets/
    48

    View full-size slide

  43. http://www.data.go.jp/data/dataset
    49
    ͜Μͳͷ΋͋Δ

    View full-size slide

  44. ؔ࿈αʔϏε܈

    View full-size slide

  45. σʔλऩूʹศརͳαʔϏε
    • AWS IoT
    • Amazon Kinesis Streams
    • Amazon CloudWatch Logs
    • Amazon S3
    • Amazon DynamoDB
    • Amazon Cognito + AWS SDK
    • Amazon API Gateway
    52

    View full-size slide

  46. 2ɹσʔλͷલॲཧ
    Python ͚ͩͰࡁΉͳΒͦΕͰ͍͍΋ͷͷɺ
    ෳ਺ͷσʔλιʔε͔ΒϝλσʔλΛऔಘͨ͠Γ
    େن໛ͳϑΝΠϧ͔ΒσʔλΛൈ͖ग़͢ͳΒ
    ઐ༻ͷιϑτ΢ΣΞ΍αʔϏε͕ศརɻ
    53

    View full-size slide

  47. AWS ͷؔ࿈αʔϏε܈

    View full-size slide

  48. σʔλલॲཧʹศརͳαʔϏε
    • Amazon Mechanical Turk
    • Amazon Athena
    • AWS Lambda / Step Functions
    • AWS CloudWatch Events
    • Amazon EMR / Batch / EC2
    55

    View full-size slide

  49. Amazon Mechanical Turk
    56
    ΞϝϦΧͰ͸ͦͷར༻͕
    ͱͯ΋ྲྀߦ͍ͬͯΔ
    ͱͷ͜ͱɾɾ

    View full-size slide

  50. ࢼߦࡨޡ / POC

    View full-size slide

  51. ࢼߦࡨޡʹศརͳ΋ͷͨͪ

    View full-size slide

  52. ओʹՊֶٕज़ܭࢉ΍ػցֶशͷۀքͰ
    ͋Ε͜Εࢼߦࡨޡͨ͠ΓɺͦΕΛ୭͔ͱڞ༗͢ΔͨΊͷ 

    πʔϧɻଟ͘ͷݚڀऀ΍ΤϯδχΞʹѪ༻͞Ε͍ͯΔɻ
    git ͳͲͰόʔδϣϯ؅ཧ͢Δͷ΋༰қʂ
    Jupyter notebook
    59

    View full-size slide

  53. ֶशʹ͸ͱͯ΋͕͔͔࣌ؒΔ΋ͷɻ
    ߦྻܭࢉ͕ಘҙͳ GPU Λ࢖͑͹͕࣌ؒઅ໿Ͱ͖·͢ʂ
    ࣗ୐ͷ PC ʹ͍ࢗͬͯ͞Δ GPU ͕࢖͑Δ͔΋ɾɾʁ
    (NVIDIA) GPU
    60
    ʢ͜Ε͕ࢗͬͯ͞Δਓ͸͍ͳ͍ͱࢥ͏͚Ͳ..ʣ

    View full-size slide

  54. (NVIDIA) GPU
    61
    ݱࡏ AWS Ͱ GPU Λ࢖͏ͱ͖ͷ Tips Λ·ͱΊ·ͨ͠
    https://speakerdeck.com/pottava/tesorflow-v1-dot-0-on-ec2

    View full-size slide

  55. ࢼߦࡨޡ͢Δʹ͸͜Ε΋ͱͯ΋ศརͰ͢ɻ
    ϥΠϒϥϦ͕ͲΜͲΜόʔδϣϯߋ৽ͯ͠΋େৎ෉ʂ
    Ϋϥ΢υ্ʹֶशɾਪ࿦Λ࣋ͬͯߦ͘ͱ͖ʹ΋༗༻ʂ
    docker run -it --rm -p 8888:8888 jupyter/tensorflow-notebook
    Docker
    62

    View full-size slide

  56. Docker
    63
    ݱࡏ AWS Ͱ Docker Λ࢖͏ͱ͖ͷ·ͱΊ
    https://speakerdeck.com/pottava/containers-on-aws

    View full-size slide

  57. NVIDIA ͷ Docker Πϝʔδ
    64
    ҎԼͷΑ͏ͳܧঝؔ܎ͷΠϝʔδ͕ެ։͞Ε͍ͯ·͢ɻ
    ػցֶशͷಈ࡞ཁ݅ʹదͨ͠ΠϝʔδΛϕʔεʹɻ
    ಠࣗ Docker ΠϝʔδͷϏϧυ΋Ͱ͖·͢ɻ
    cuda:7.x-runtime
    ubuntu:14.04
    cuda:7.x-devel
    cuda:7.x-cudax-runtime
    cuda:7.x-cudax-devel caffe (v0.14) digits (v4.0)

    View full-size slide

  58. AWS Ϣʔβ Retty ͞Μ͕ GPUʢ෺ཧʣΛങͬͨ࿩ɻ
    ͱͯ΋ڵຯਂ͍ɻ
    Ϋϥ΢υ͸ඞཁͳͷʁ
    65
    http://qiita.com/taru0216/items/dda1f9f11397f811e98a

    View full-size slide

  59. ࣮ࡍɺνʔϜͰݚڀɾ։ൃΛ͢ΔͱͳΔͱ
    ؀ڥͷ෼཭ / ෳ੡ / ڞ༗ / ݖݶ؅ཧͳͲ՝୊͸ͨ͘͞Μɻ
    ޙड़ͷ EMR or ECS + IAM ͳͲͷ૊Έ߹ΘͤΕ͹
    ࠷৽ͷ GPU ؀ڥΛࣗಈ഑෍͢Δͱ͍ͬͨ͜ͱ΋ʂ
    AWS Ͱͷ෼ੳ؀ڥ
    66

    View full-size slide

  60. AWS ͷؔ࿈αʔϏε܈

    View full-size slide

  61. ࢼߦࡨޡϑΣʔζʹศརͳαʔϏε
    • Amazon Machine Learning
    • Amazon EMR / EC2
    ‣ p2 / g2 (GPU) instances
    ‣ Deep Learning AMI
    • Amazon EBS / S3 / ECR
    68

    View full-size slide

  62. ೋ߲෼ྨɺෳ਺Ϋϥε෼ྨɺઢܗճؼͷϚωʔδυαʔ
    ϏεɻσʔλͷऔΓࠐΈ͔Βɺֶशɾਪ࿦͕ߦ͑·͢ɻ
    αʔόͷ؅ཧ͕ෆཁͳͨΊɺεέʔϥϏϦςΟ΍ਪ࿦αʔ
    ϏεͷՄ༻ੑ͸ؾʹͤͣ OKʂ
    Amazon Machine Learning
    69

    View full-size slide

  63. GPU Πϯελϯε
    70
    AWS ʹ͸ 2 छྨ͋Γ·͢ʢݱߦੈ୅ʣ
    g2 ܥ: NVIDIA GRID K520
    ɹɹɹɹ1,536 CUDA cores / GPU ͕ 2 ͭͰ 1 ͭͷ K520
    ɹɹɹɹg2 Ͱ࢖͑Δ GPU ͸ຊདྷάϥϑΟοΫɾήʔϛϯά༻్
    p2 ܥ: NVIDIA Tesla K80
    ɹɹɹɹഒਫ਼౓ԋࢉ࠷େ 2.91 TFLOPSɺ୯ਫ਼౓ԋࢉ࠷େ 8.74 TFLOPS
    ɹɹɹɹ2,496 CUDA cores / GPU ͕ 2 ͭͰ 1 ͭͷ K80
    ɹɹɹɹp2 ͷ GPU ͸൚༻ίϯϐϡʔςΟϯά༻్

    View full-size slide

  64. Amazon DeepLearning AMI
    71
    શ෦ೖΓ AMIɺ͋Γ·͢ʂʂ
    TensorFlow 1.0, MXNet, Caffe, CNTK, Theano, Torchɻ
    CUDA 7.5, cuDNN 5.0, Anaconda ΋ɻ

    View full-size slide

  65. 3ɹֶश
    ΋ͬͱ΋ॏཁɺ͔ͭ΋ͷ͕͔͔࣌ؒ͘͢͝Δͱ͜Ζɻ
    ࣗࣾͷϞσϧΛ࡞Δͷ͸ͱͯ΋େม͕ͩ
    ΦϦδφϧͷ΋ͷ͕Ͱ͖Ε͹وॏͳ஌ࡒʹɻ
    Ϋϥ΢υͷ༷ʑͳαʔϏε͕αϙʔτͯ͘͠Ε·͢ɻ
    73

    View full-size slide

  66. AWS ͷؔ࿈αʔϏε܈

    View full-size slide

  67. ֶशϑΣʔζʹศརͳαʔϏε
    • Amazon EMR / Batch / EC2
    ‣ p2 / g2 (GPU) instances
    ‣ Deep Learning AMI
    ‣ Spot Fleet / AutoScaling Group
    • Amazon Machine Learning
    • Amazon EFS / EBS / S3 / ECR
    • Amazon SQS
    75

    View full-size slide

  68. AWS Batch
    76
    https://www.youtube.com/watch?v=UR8BI2Exkbc
    Պֶٕज़ܭࢉɾϋΠύϑΥʔϚϯείϯϐϡʔςΟϯά
    ༻్ͰਅՁΛൃش͢Δɺେن໛ͳεέʔϧɺδϣϒͷґ
    ଘఆ͕ٛՄೳͳϚωʔδυฒྻ෼ࢄόονॲཧج൫ɻ

    View full-size slide

  69. ͢Ͱʹ Black Belt ͷࢿྉ͕ެ։͞Ε͍ͯ·͢ɻ
    AWS Batch
    http://aws.typepad.com/sajp/2017/02/aws-black-belt-online-seminar-aws-batch.html
    77

    View full-size slide

  70. ࢲ΋Ϣʔβࢹ఺Ͱݱঢ়Λ·ͱΊ·ͨ͠ɻ
    AWS Batch
    http://qiita.com/pottava/items/d9886b2e8835c5c0d30f
    78

    View full-size slide

  71. 4ɹਪ࿦
    ֶशࡁΈͷϞσϧΛ࢖͍ɺਪ࿦͢Δɻ
    Ϗδωεͱ௚݁͢Δ͜ͱ͕ଟ͘ɺՔಇ͸ 24 / 365ɻ
    Մ༻ੑͱϨΠςϯγ͕ॏཁͳͷ͸ҰൠαʔϏεಉ༷ɻ
    ΋͔ͯ͠͠αʔόϨεͰ΋ɾɾ͍͚Δɾɾɾʁ
    80

    View full-size slide

  72. AWS ͷؔ࿈αʔϏε܈

    View full-size slide

  73. ਪ࿦ϑΣʔζʹศརͳαʔϏε
    • Amazon ECS / EC2
    ‣ p2 / g2 (GPU) instances
    ‣ Deep Learning AMI
    ‣ Spot Fleet / AutoScaling Group
    • AWS Lambda / Amazon API Gateway
    • AWS ElasticBeanstalk
    • Amazon EFS / EBS / S3 / ECR
    82

    View full-size slide

  74. ϑϧϚωʔδυͳ Docker ίϯςφΫϥελ؀ڥɻ
    GPU ϕʔεͷਪ࿦ΞϓϦέʔγϣϯͩͬͯಈ͖·͢ʂ
    Amazon ECS
    83
    https://speakerdeck.com/ayemos/build-image-classification-service-with-amazon-ecs-and-gpu-instances
    ΫοΫύουגࣜձࣾ છ୩ ༔Ұ࿠͞Μ

    View full-size slide

  75. ͪ͜Β΋͢Ͱʹ Black Belt ͷࢿྉ͕ެ։͞Ε͍ͯ·͢ɻ
    Amazon ECS
    84
    http://aws.typepad.com/sajp/2017/02/aws-black-belt-online-seminar-aws-batch.html

    View full-size slide

  76. AWS Lambda
    85
    αʔόϨεͰ MXNet ʹΑΔਪ࿦Λ͢Δ࣮૷ྫ
    http://aws.typepad.com/sajp/2017/01/
    seamlessly-scale-predictions-with-aws-lambda-
    and-mxnet.html

    View full-size slide

  77. AWS ར༻ Tips

    View full-size slide

  78. ػցֶशΛ AWS Ͱ΍ΔͳΒɺ஌ͬͯಘ͢Δػೳ No. 1ʂ
    Ծ૝αʔόΛ҆͘࢖͑Δىಈํ๏ɻ
    AWS ͷσʔληϯλͷʮ༨৒෼ʯΛ
    ͜ͷֹۚͳΒ࢖͍·͢ʂͱʮೖࡳʯͯ͠ىಈɻ
    Spot Fleet / Spot Πϯελϯε
    87

    View full-size slide

  79. ͜Ε·Ͱ঺հ͖ͯͨ͠ AWS ͷ֤αʔϏεΛ
    Ͳ͏࢖͍͍͔ͨΛ yaml / json Ͱએݴతʹهड़͓͖ͯ͠
    Ұؾʹੜ੒ɾഁغ͢Δ͜ͱ͕Ͱ͖Δɻ
    ؆୯ਝ଎ʹɺ҆৺ͯ͠؀ڥ͕ߏஙͰ͖Δɻ
    ӡ༻ෛՙԼ͕Γ·͢ɻΠϯϑϥΛόʔδϣϯ؅ཧՄೳʹɻ
    CloudFormation
    88

    View full-size slide

  80. Let’s try, anyway!

    View full-size slide

  81. ؼͬͨΒࣗ෼ͰҰ࿈ͷྲྀΕΛܦݧʂʂ࣮ફେࣄɻ
    ʮ਺ࣈը૾൑ఆ with TensorFlow on AWSʯ
    ࠓ೔ͷ॓୊
    http://qiita.com/pottava/items/2fb2572f7099d432ebd9
    90

    View full-size slide

  82. ػցֶशʹͲͷΫϥ΢υΛ࢖͏͔ʁͱߟ͑ΔΑΓ
    ৄ͍͠ਓΛั·͑ͯɺͬ͞ͱ৘ใΛूΊͯ
    ͍͍ͱ͜ͲΓͰ࢖͏ͷ͕Α͍ͱࢥ͍·͢ɻ 

    ͱ͍͏͔ɺࢼ͚ͩ͢ͳΒ
    ϩʔΧϧʹ؀ڥΛ੔͑Ε͹े෼Ͱ͢ɾɾ
    ·ͱΊ͡Όͳ͍ɺ·ͱΊ
    91

    View full-size slide

  83. JAWS-UG AI ࢧ෦

    View full-size slide

  84. ίϯςϯπ
    • AWS Ͱ AI αʔϏεΛ࣮૷ɾӡ༻͢ΔͨΊͷ
    ɹҰൠతͳٕज़৘ใɺ஌ݟɺࣄྫڞ༗ͷ৔
    • ͢Ͱʹ׆༻͍ͯ͠Δํ
    • ಋೖΛݕ౼͍ͯ͠Δํ
    • ԿͦΕ͓͍͍͠ͷʁͳํʢ։࠵͝ͱʹ೉қ౓͕ଟগҧ͍·͢ʣ

    View full-size slide

  85. ͋Γ͕ͱ͏͍͟͝·ͨ͠
    ࢀߟจݙ:
    • AWS Batch – ؆୯ʹ࢖͑ͯޮ཰తͳόονίϯϐϡʔςΟϯάػೳ – AWS
    https://aws.amazon.com/jp/batch/
    • AWS Black Belt Online SeminarʮAWS Batchʯͷࢿྉ͓ΑͼQAެ։
    http://aws.typepad.com/sajp/2017/02/aws-black-belt-online-seminar-aws-
    batch.html#QCPzBdn.twitter_tweet_count_m
    • re:Invent 2016: AWS Big Data & Machine Learning Sessionsɻ
    https://aws.amazon.com/blogs/big-data/reinvent-2016-aws-big-data-
    machine-learning-sessions/

    View full-size slide