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
Aizu.go
Search
Yamashou
July 22, 2017
0
63
Aizu.go
ELM&serverless
Yamashou
July 22, 2017
Tweet
Share
More Decks by Yamashou
See All by Yamashou
Go Tensorflow 思ってたこと
yamashou
0
190
Spring LT in Aizu
yamashou
0
76
学生版GoConを開催したい
yamashou
0
2.3k
会津でGo
yamashou
0
2.6k
Aizu.go second
yamashou
0
340
Go ELM
yamashou
0
140
open app lab kick off meeting 2017
yamashou
0
130
manifes2017
yamashou
1
75
Featured
See All Featured
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
Optimizing for Happiness
mojombo
376
70k
Typedesign – Prime Four
hannesfritz
40
2.4k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
Become a Pro
speakerdeck
PRO
26
5k
VelocityConf: Rendering Performance Case Studies
addyosmani
326
24k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
Product Roadmaps are Hard
iamctodd
PRO
49
11k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
520
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
Bash Introduction
62gerente
608
210k
Transcript
Aizu.go ࢁຊଠ
ࣗݾհ ࢁຊଠ Yamashou ֶ෦3 σβΠχϜ ৭ʑͬͯ·͢
ࠓ·ͰGoͰ CLI api ࡞ʢझຯʣ εΫϨΠϐϯά Bot
͏ͪΐͬͱผͷ ͜ͱͬͯΈΑ
Go ݴޠʹΑΔELM • ػցֶश (ELM = Extreme Learning Machine) •
ಈػɿݚڀͰઌഐํ͕͍ͬͯΔ
ELMͱʁ • Extreme Learning Machine • ߴͳػցֶशΞϧΰϦζϜ (DeeplearningͷਅٯͱݴΘΕ͍ͯΔ) • ؆୯ͳ࣮
https:/ /tech.d-itlab.co.jp/ml/229/
͕ͩ…
ೋिؒલ Ұिؒલ ࡾલ ࠓ MLΖʙ &-.
ཁҼ ٖࣅٯߦྻੜ ͦͦͷߦྻԋࢉ͕͠ΜͲ͍ (github.com/gonum/matrix) ͋ͱ͏গ͠ʂͩͱࢥͬͯ͠·ͬͨ
͓ئ͍ ٖࣅٯߦྻΛٻΊΔϥΠϒϥϦ͋ͬͨΒ ڭ͍͑ͯͩ͘͞ʂʂʂ
͋ͱ͏গ͠ʂ
ͳͷͰͳΜͱ͔͢Δ
όΠτͰGo
ͳͥʁ
ࣗ ࣾһ͞Μ XX࡞ͬͯ ͳΒpython͕͍ ͍͔Ͱ͢Ͷ JSͰ͓ئ͍ Ұճ࡞ͬͨ͜ͱ͋ ΔGo͕͍͍Ͱ͢ OO࡞ͬͯʂ ૣٸʹ
ྃղͰ͢ʂ JSͰ͓ئ͍ ྃղͰ͢ʂ ZZ͓ئ͍Ͱ͖ Δʁ ྃղͰ͢ʂ JSͰ͢Ͷʂ
ཧ༝ AWS LambdaΛओʹ༻ ͕ࣗఏࣔ͢Δݴޠ͕ࣾһ͞ΜಡΊ ͳ͍͔Β ͲΜͳ࣌ͰΘΓͱແཧཧjs͕ଟ͍
AWS Lambda&API GatewayͰαʔόʔϨ εΞϓϦέʔγϣϯΛߏங͢Δπʔϧ ˞αʔόʔϨεΞʔΩςΫνϟ ϝϯςφϯεΛؾʹ͠ͳ͍ʰඇৗறܕϓϩηεʱΛΠϕϯτΛτϦΨʔ ʹ͢ΔΠϯϑϥετϥΫνϟͩͱࢥͬͯ·͢ https:/ /github.com/serverless
ͱ͍͏͜ͱͰ
ແཧཧʹ߅ ͍ͨ͠ʂ
ࢼͨ͠ͷ Apex eawsy serverless-go
Apex lambdaϏϧυ&σϓϩΠΛ؆୯ʹͰ͖Δʂ Node.js Go Python Java Rust Clojure ެࣜʹରԠ͍ͯ͠ͳ͍ͷରԠʂ http:/
/apex.run/
όΠφϦ
eawsy GoΛlambda্Ͱ࣮ߦͰ͖ΔΑ͏ʹ͢Δ جຊతʹΕΔ͜ͱApexมΘΒͳ͍ make࣮ߦ https:/ /github.com/eawsy
cgoڥ shared library zip http:/ /tdoc.info/blog/2016/11/02/eawsy_lambda.html GO C֦ு
͍͍ͱ͜Ζ ApexɿCLI͔ͩΒ࡞ɾσϓϩΠɾ࣮ߦ؆୯ eawsyɿlog͕ग़ͤΔʂɾॻ͚ͩ͘ʂɾϑϨʔϜϫʔΫରԠ
ඍົͳͱ͜Ζ Apexɿapigateway͕खಈʁ eawsyɿzipͷޙखಈʁ
eawsyਐԽ͢Δʂ
serverless-go eawasy ͷ֦ு serverless͛Δʂ
cgoڥ shared library http:/ /tdoc.info/blog/2016/11/02/eawsy_lambda.html ➕
͍͍ͱ͜Ζ makeͰserverlessͰdeploy·Ͱ ॻ͖ํී௨ͷgoͬΆ͍ʂ
eawasy Apex python ̍ճ 0.02s 0.11s 0.02s ̎ճ 0.02s 0.12s
0.02s ̏ճ 0.02s 0.09s 0.02s αΠζ 3.3MB 799.3kB 354bytes
ൺֱ Apexͷ͕Bbild͕ૣ͍ eawsyͷ͕Ϩεϙϯεૣ͍ αΠζͬͺΓຊՈ͕͍͍ײ͡
͜Ε͔Β ELMΛࢦ͢ʂʂʂʂ lambdaͰgoҰԠόΠτઌͰใࠂ͠ ͯΈΑ͏͔ͳ