Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
ChainerとAnnoyを使った 類似画像検索
Search
takaaki shimbo
August 29, 2018
Technology
930
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
ChainerとAnnoyを使った 類似画像検索
Qiita:
https://qiita.com/ta7uwtaka/items/9301eef7dd74a249d5ea
takaaki shimbo
August 29, 2018
Other Decks in Technology
See All in Technology
HRC_Frontend_Conference_Fukuoka_2026.pdf
ts020
0
730
Reactの設計論
uhyo
24
13k
Issue 駆動でスペシャリストの意図を届ける、AI 実装のアクセシビリティ向上
thkt
0
110
Deployment の 先にある AI Agent 基盤 - kagent vNext、Agent Substrate、Hermes から読み解く Agent Runtime の現在地 / k8s-matsuri-2-ai-agent-platform-amsy810
masayaaoyama
3
560
20260912_スクラムにジェネラリストは必要か
ryugen04
0
420
すぐできる衛星通信対応 あとは山奥に行くだけ
tatetate55
0
130
白金鉱業Meetup Vol.25 アウトカムが二値のデータに対するCausal Impact
brainpadpr
0
200
AI de Idea
kawaguti
PRO
2
110
バイブコーディング時代のWebアプリ開発入門~Cloud Runで学ぶセキュアなビルドとデプロイ
waiwai2111
1
130
aws-iot-platform-architecture-use-cases.pdf
ma2shita
0
150
負債のメタファと2026年 / Debt Metaphor in Agentic Engineering Age 202609 Edition
twada
PRO
5
2.6k
新機種発売前に見直そう!端末移行で再ログインが要るアプリ・要らないアプリは何が違うのか 〜シームレスに再開できる設計と実装〜
zozotech
PRO
0
190
Featured
See All Featured
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
56
3.5k
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
740
Side Projects
sachag
456
43k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
590
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
6
1.2k
Context Engineering - Making Every Token Count
addyosmani
9
1.1k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
460
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.4k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
410
Mind Mapping
helmedeiros
1
360
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
360
Transcript
Chainer ͱAnnoyΛͬͨ ྨࣅը૾ݕࡧ ʙɹ͘͘Ռൃද + هɹʙ Shimbo Takaaki 2018 /
08 / 25 @Chainer mokumoku #2
ࣗݾհ • ໊લɿɹ৽อɹᠳཅ • 4݄͔Βࣾձਓ (ERPͷձࣾ ) • Twitter: @ta7uw
• GitHub: @takaaki82 • Qiita: https://qiita.com/ta7uwtaka
ྨࣅը૾ݕࡧͱ • ಛϕΫτϧ Ͱදݱ͞Εͨը૾ʹ͍ۙը૾Λ σʔλϕʔεͷத͔Β୳͢͜ͱ • σʔλϕʔεͷͯ͢ͷը૾ͱྨࣅΛൺֱ͠ ͍ͯΔͱେͳܭࢉྔʹͳΓ͕͔͔࣌ؒΔͷ ͰɺޮΑ͘ࣅ͍ͯΔը૾Λ୳ͩ͢͜͠ͱ͕ ٻΊΒΕΔɻ
Pinterest
Approach • ը૾ಛྔͷྨࣅܭࢉ ը૾͔ΒCNNͳͲͰಛྔΛநग़͠ɺίαΠϯྨࣅͳͲͷؔʹΑͬ ͯྨࣅܭࢉΛߦ͏͜ͱͰը૾ͷྨࣅΛٻΊΔ → ࠓճͪ͜ΒΛ࣮͢Δ • Deep LearningΛͬͨྨࣅֶश
ࣅ͍ͯΔը૾Ͱ͋Εɺྨࣅ͕େ͖ͳΔΑ͏ʹଛࣦΛઃఆֶͯ͠शΛ ߦ͏
ߏ ɾը૾ಛྔநग़ ֶशࡁΈը૾ೝࣝϞσϧͷதؒΛ͏ → Chainer ɾಛྔͷྨࣅܭࢉ ۙࣅ࠷ۙ୳ࡧ(ANN)Λ͏ → Annoy
ۙࣅ࠷ۙ୳ࡧϥΠϒϥϦ Annoy
Annoy • ࠷ۙ୳ࡧ(ANN)Λ࣮ͨ͠ϥΠϒϥϦ • Spotify͕։ൃ͢ΔOSS • ԻָͷϨίϝϯυػೳʹΘΕ͍ͯΔ • C++࣮ɹ-> PythonόΠϯσΟϯά
• PythonͰ؆୯ʹ͑Δ
MNISTͰྨࣅը૾Λ୳ͯ͠ΈΔ ݕࡧʹ ͬͨը૾
CIFAR-10ͷֶश • ࠓճσʔληοτʹCIFAR-10Λ༻͍Δ • ௨ৗͷը૾ྨͱಉ༷ʹChainerͰֶशΛߦ͏ • ֶशΛߦͬͨϞσϧΛಛྔநग़ʹ͏
ಛྔΛAnnoyʹՃ from annoy import AnnoyIndex train, test = chainer.datasets.get_cifar10() dim
= 1024 #தؒͷग़ྗͷཁૉ annoy_model = AnnoyIndex(dim) with chainer.using_config('train', False), chainer.using_config('enable_backprop', False): for i in range(len(train)): img, _ = train[i] # numpy -> cupy x = model.xp.asarray(img[None, ...]) # ֶशσʔλͷਪ݁Ռͷ͏ͪը૾ྨϞσϧͷ̍̌ͷग़ྗΛಘΔ x = get_hidden(model ,9 ,x=x).data x = x.reshape(-1) #cupy -> numpy x = chainer.cuda.to_cpu(x) annoy_model.add_item(i, x) # AnnoyϞσϧͷϏϧυ(ҎޙσʔλͷՃߦ͑ͳ͍) annoy_model.build(1000) annoy_model.save("cifar-10-1000tree.ann")
ۙࣅ࠷ۙ୳ࡧͷ࣮ߦ x = model.xp.asarray(x[None, …]) x = get_hidden(model ,9 ,x=
x).data x = x.reshape(-1) x = chainer.cuda.to_cpu(x) # ಛϕΫτϧxΛΘͨ͢ͱɺྨࣅܭࢉΛߦ͍ɺྨࣅͷେ͖͍ͷΛฦ͢ɹɹɹɹɹɹɹɹɹɹɹ predict_indexes = annoy_model.get_nns_by_vector(x, 5, search_k=-1)
݁Ռ ը૾ΫΤϦ
ը૾ΫΤϦ
·ͱΊ • Chainerͱۙࣅ࠷ۙ୳ࡧϥΠϒϥϦAnnoyΛ ͏ͱྨࣅը૾ݕࡧͰ͖Δ • ࣍Deep LearningͷྨࣅֶशΛͬͨྨ ࣅը૾ݕࡧΛ࣮ͯ͠ΈΔ
ࢀߟ • Start Today Technologies TECH BLOG (https://tech.starttoday-tech.com/entry/detection_and_retrieval) • ݪాୡ
(2017) , ը૾ೝࣝɹػցֶशϓϩϑΣογϣφϧ γϦʔζ • Deep metric learning using Triplet network (https://arxiv.org/pdf/1412.6622.pdf)
ৄࡉQiitaʹॻ͖·ͨ͠ɻ Α͔ͬͨΒͲ͏ͧ Qiita
͝ਗ਼ௌ ͋Γ͕ͱ͏͍͟͝·ͨ͠