Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Amazon Machine Learning を使ってみた
Search
Kenta Murata
April 21, 2015
Technology
17
5k
Amazon Machine Learning を使ってみた
画面を指さしながら説明するために作った背景画像の上に、簡単な説明テキストを追加したやつです。
Kenta Murata
April 21, 2015
Tweet
Share
More Decks by Kenta Murata
See All by Kenta Murata
waitany と waitall を作った話
mrkn
0
170
HolidayJp.jl を作りました
mrkn
0
180
Calling Julia functions from Streamlit applications
mrkn
1
400
Red Data Tools で切り開く Ruby の未来
mrkn
3
1.1k
Method-based JIT compilation by transpiling to Julia
mrkn
0
7k
Apache Arrow C++ Datasets
mrkn
4
1.5k
Reducing ActiveRecord memory consumption using Apache Arrow
mrkn
0
1.7k
RubyData and Rails
mrkn
0
3k
Tensor and Arrow
mrkn
0
920
Other Decks in Technology
See All in Technology
CDKのコードレビューを楽にするパッケージcdk-mentorを作ってみた/cdk-mentor
tomoki10
0
210
My small contributions - Fujiwara Tech Conference 2025
ijin
0
1.5k
メールヘッダーを見てみよう
hinono
0
110
Alignment and Autonomy in Cybozu - 300人の開発組織でアラインメントと自律性を両立させるアジャイルな組織運営 / RSGT2025
ama_ch
1
2.4k
2025年のARグラスの潮流
kotauchisunsun
0
800
EMConf JP の楽しみ方 / How to enjoy EMConf JP
pauli
2
150
Visual StudioとかIDE関連小ネタ話
kosmosebi
1
380
Unsafe.BitCast のすゝめ。
nenonaninu
0
200
JuliaTokaiとJuliaLangJaの紹介 for NGK2025S
antimon2
1
120
AWSサービスアップデート 2024/12 Part3
nrinetcom
PRO
0
140
AIアプリケーション開発でAzure AI Searchを使いこなすためには
isidaitc
1
120
カップ麺の待ち時間(3分)でわかるPartyRockアップデート
ryutakondo
0
140
Featured
See All Featured
Intergalactic Javascript Robots from Outer Space
tanoku
270
27k
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.3k
Practical Orchestrator
shlominoach
186
10k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
232
17k
Optimising Largest Contentful Paint
csswizardry
33
3k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
113
50k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
2k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
33
2.7k
The Language of Interfaces
destraynor
155
24k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Thoughts on Productivity
jonyablonski
68
4.4k
Transcript
Amazon ML Λ ͬͯΈͨ Kenta Murata 2015.04.21
ػցֶश
ػցֶशͰͰ͖Δ͜ͱ 1. ճؼ 2. ྨ 3. ΫϥελϦϯά
ػցֶशͰͰ͖Δ͜ͱ 1. ճؼ 2. ྨ 3. ΫϥελϦϯά → ࣮ͷ༧ଌ http://commons.wikimedia.org/wiki/File:Linear_regression.svg
http://commons.wikimedia.org/wiki/File:Polyreg_scheffe.svg
ػցֶशͰͰ͖Δ͜ͱ 1. ճؼ 2. ྨ 3. ΫϥελϦϯά → ࣮ͷ༧ଌ →
͔̋×͔Λ༧ଌ http://en.wikipedia.org/wiki/File:SVM_with_soft_margin.pdf
ػցֶशͰͰ͖Δ͜ͱ 1. ճؼ 2. ྨ 3. ΫϥελϦϯά → ࣮ͷ༧ଌ →
͔̋×͔Λ༧ଌ → ࣗಈάϧʔϓ͚ http://commons.wikimedia.org/wiki/File:KMeans-density-data.svg
Amazon Machine Learning
Amazon Machine Learning ͰͰ͖Δ͜ͱ 1. ճؼ 2. ೋྨ 3. ଟྨ
Amazon Machine Learning ͰͰ͖Δ͜ͱ 1. ճؼ 2. ೋྨ 3. ଟྨ
ͬͯΈͨ
Amazon Machine Learning Ͱ ଟྨثΛ࡞Δ
σʔλͷ४උ ↓ σʔλιʔε࡞ ↓ Ϟσϧ࡞ ↓ (σʔλιʔεͷࣗಈׂ) ↓ Ϟσϧͷֶश ↓
ϞσϧͷධՁ ଟྨثͷ࡞खॱ
σʔλͷ४උ
None
70,000ݸͷखॻ͖ࣈ http://myselph.de/neuralNet.html 28px 28px
60,000ݸ → ֶश༻ 10,000ݸ → ධՁ༻ ֶश༻ͱධՁ༻ʹ༧Ί͚ͯ͞Ε͍ͯΔ
όΠφϦσʔλͳͷͰ CSV ม͢Δ
28px 28px y, x1, x2,ɾɾɾ, x_k,ɾɾɾ, x784 8, 0, 0,ɾɾɾ,
221,ɾɾɾ, 0 256֊ௐάϨΠεέʔϧ ਖ਼ղϥϕϧ ϐΫηϧ
μϯϩʔυ͢Δ
https://rubygems.org/gems/mnist
$ gem install mnist $ mnist2csv train-images-idx3-ubyte.gz train-labels-idx1-ubyte.gz > mnist_train.csv
$ mnist2csv t10k-images-idx3-ubyte.gz t10k-labels-idx1-ubyte.gz > mnist_test.csv
CSV ϑΝΠϧΛ S3 ʹΞοϓϩʔυ͢Δ
σʔλιʔεΛ࡞Δ
None
Ξοϓϩʔυͨ͠ CSV ϑΝΠϧ
None
None
None
None
ྨରͷΧϥϜΛબͯ͠Ͷὑ
σʔλΛݟͯࣗಈఆ
༧ଌ݁Ռ͕σʔλιʔεͷͲͷߦʹରԠ͢Δ͔Λ ࣝผ͢ΔͨΊͷ ID ͕͋Εࢦఆ͢Δ ࠓճແ͍ͷͰࢦఆ͠ͳ͍
None
None
None
None
ϞσϧΛ࡞Δ
None
ೖྗσʔλΛબ
બͿ
None
None
σʔλΛ 7:3 ʹׂͯ͠ 7 ͷํΛ܇࿅ʹɺ3 ͷํ ΛϞσϧͷධՁʹ͏
͍Ζ͍ΖࣗͰࢦఆ͢Δ ࠓճͬͪ͜
None
σʔλͷલॲཧํ๏ͳͲ Λ JSON Ͱࢦఆ͢Δ ϑΟʔϧυɻ ࠓճ CSV ʹมͨ͠ ͚ͩͰલॲཧ͕ྃͯ͠ ΔͷͰσϑΥϧτͷ··
Ͱ͓̺
None
Regularization (ਖ਼ଇԽ) ɺϞσϧͷաֶश (܇࿅σʔ λʹద߹͗ͯ͢͠͠·͏ࣄ) Λ͙ͨΊʹߦ͏ɻ L1 (Lasso ճؼ) ɺෆཁͳύϥϝʔλΛͬͯϞσϧΛ
γϯϓϧʹ͍ͨ͠ͱ͖ʹ͏ɻ L2 (Ridge ճؼ) Β͔ͳϞσϧ͕ཉ͍͠ͱ͖ʹ͏ɻ (ײ: L1 ͱ L2 ΛࠞͥΒΕΕͬͱྑ͍ͷʹ)
None
Ϟσϧͷ࡞ޙʹࣗಈతʹධՁ࣮ࢪ͢Δ͔Ͳ͏͔ɻ ࠓճผʹධՁΛΔͷͰ No ΛબͿɻ
None
None
ϞσϧΛ࡞Δ
ֶशδϣϒࣗಈతʹ։࢝͢Δ
None
60,000 ڭࢣσʔλ → 20
ϞσϧΛධՁ͢Δ
None
None
None
None
None
None
None
10,000 ςετσʔλ → 1ʙ2
None
ҎԼͷࣜͰܭࢉ͞ΕΔϞσϧͷ༏ल͞ΛଌΔྔ 2 × ద߹ × ࠶ݱ ద߹ + ࠶ݱ
ਅͷྨ 1 ͦͷଞ ༧ ଌ ݁ Ռ 1 True Positive
False Positive ͦ ͷ ଞ False Negative True Negative ద߹ ʹ ࠶ݱ ʹ True Positive True Positive + False Positive True Positive True Positive + False Negative TP FP FN TN TP FP FN TN
None
1,000 ڭࢣσʔλͰ࡞ͬͨϞσϧͷ߹
None
ڭࢣσʔλ͕ଟ͍΄ͲϞσϧͷੑೳ͕ྑ͘ͳΔ
ϞσϧΛ͏
Ϟσϧͷ͍ํ 1. όον༧ଌ 2. ϦΞϧλΠϜ༧ଌ
Ϟσϧͷ͍ํ 1. όον༧ଌ 2. ϦΞϧλΠϜ༧ଌ → ·ͱ·ͬͨσʔλΛ·ͱΊͯ༧ଌ
Ϟσϧͷ͍ํ 1. όον༧ଌ 2. ϦΞϧλΠϜ༧ଌ → ·ͱ·ͬͨσʔλΛ·ͱΊͯ༧ଌ → API Λͬͯ1ͭͣͭ༧ଌ
Amazon Machine Learning ͷྉۚମܥ
Amazon Machine Learning ͷྉۚମܥ
1,000 σʔλͰϞσϧΛ࡞ͬͨͱ͖
70,000 σʔλͰϞσϧΛ࡞ͬͨͱ͖
S3 price
Amazon Machine Learning ΛͬͯΈͨײ 1. Α͘Ͱ͖ͯΔ 2. ͬ͘͞ͱϓϩτλΠϓ͍ͨ࣌͠ʹศརͦ͏ 3. ֶशࡁΈͷϞσϧΛΤΫεϙʔτͰ͖ͳ͍
Amazon Machine Learning ΛͬͯΈͨײ 1. Α͘Ͱ͖ͯΔ 2. ͬ͘͞ͱϓϩτλΠϓ͍ͨ࣌͠ʹศརͦ͏ → ΞϧΰϦζϜΛදʹग़ͣ͞ʹ্ख͘؆ུԽͯ͠Δ
3. ֶशࡁΈͷϞσϧΛΤΫεϙʔτͰ͖ͳ͍
Amazon Machine Learning ΛͬͯΈͨײ 1. Α͘Ͱ͖ͯΔ 2. ͬ͘͞ͱϓϩτλΠϓ͍ͨ࣌͠ʹศརͦ͏ → ΞϧΰϦζϜΛදʹग़ͣ͞ʹ্ख͘؆ུԽͯ͠Δ
→ ࣮ӡ༻લʹ༷ʑͳಛϕΫτϧΛ؆୯ʹࢼͤΔ 3. ֶशࡁΈͷϞσϧΛΤΫεϙʔτͰ͖ͳ͍
Amazon Machine Learning ΛͬͯΈͨײ 1. Α͘Ͱ͖ͯΔ 2. ͬ͘͞ͱϓϩτλΠϓ͍ͨ࣌͠ʹศརͦ͏ → ΞϧΰϦζϜΛදʹग़ͣ͞ʹ্ख͘؆ུԽͯ͠Δ
→ ࣮ӡ༻લʹ༷ʑͳಛϕΫτϧΛ؆୯ʹࢼͤΔ 3. ֶशࡁΈͷϞσϧΛΤΫεϙʔτͰ͖ͳ͍ → ࣮ӡ༻࣌ࣗͰ࣮ͨ͠ϞσϧΛ͏ ɹ ϓϩτλΠϓͰ্ख͘ߦ͖ͦ͏ͳ͜ͱ͕ ɹ ͔ͬͯΔͷͰ࣮ίετؾʹͳΒͳ͍!?