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
ニューラルネットの1bit化 / 1bit-neural-network
Search
shun74
July 13, 2022
Programming
0
870
ニューラルネットの1bit化 / 1bit-neural-network
Explanation of what is 1bit neural network .
shun74
July 13, 2022
Tweet
Share
More Decks by shun74
See All by shun74
深度推定モデルの自己教師あり学習/self-supervised-depth
shun74
0
400
GPUでステレオマッチング / Stereo-matching with GPU
shun74
0
870
卒業研究の進め方 / How to preceed with the research
shun74
1
500
Barcode Recognition / pharmacode-decoder
shun74
0
910
Vision Transformer講座 / Vision Transformer Presentation
shun74
1
640
Defocus Map Estimation From a Single Image Based on Two-Parameter Defocus Model / two-parameter-defocus-model
shun74
0
340
理解してほしいVision Transformer / plz-understand-ViT
shun74
0
700
Other Decks in Programming
See All in Programming
私の後悔をAWS DMSで解決した話
hiramax
4
210
AIと私たちの学習の変化を考える - Claude Codeの学習モードを例に
azukiazusa1
10
4.3k
Swift Updates - Learn Languages 2025
koher
2
490
Flutter with Dart MCP: All You Need - 박제창 2025 I/O Extended Busan
itsmedreamwalker
0
150
パッケージ設計の黒魔術/Kyoto.go#63
lufia
3
440
Namespace and Its Future
tagomoris
6
700
AI時代のUIはどこへ行く?
yusukebe
18
8.9k
「待たせ上手」なスケルトンスクリーン、 そのUXの裏側
teamlab
PRO
0
530
AIコーディングAgentとの向き合い方
eycjur
0
270
JSONataを使ってみよう Step Functionsが楽しくなる実践テクニック #devio2025
dafujii
1
530
Reading Rails 1.0 Source Code
okuramasafumi
0
240
プロポーザル駆動学習 / Proposal-Driven Learning
mackey0225
2
1.3k
Featured
See All Featured
Stop Working from a Prison Cell
hatefulcrawdad
271
21k
Java REST API Framework Comparison - PWX 2021
mraible
33
8.8k
Building Flexible Design Systems
yeseniaperezcruz
329
39k
What’s in a name? Adding method to the madness
productmarketing
PRO
23
3.7k
Facilitating Awesome Meetings
lara
55
6.5k
What's in a price? How to price your products and services
michaelherold
246
12k
Making Projects Easy
brettharned
117
6.4k
Six Lessons from altMBA
skipperchong
28
4k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
RailsConf 2023
tenderlove
30
1.2k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
23
1.4k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.1k
Transcript
ニューラルネットの1bit化 B4 shun sato
本日のお話 • ニューラルネットとは • ニューラルネットの1bit化 • 1bit化のメリット • FPGAによる爆速化
ニューラルネットとは • 人間のシナプス結合を模倣 • 掛け算足し算をたくさんやる • 出力と答えの誤差を微分して学習 ニューラルネット内の数値表現 • 入力
:float32, int32, uint8… • 重み :float32 • バイアス :float32 • 出力・答え :float32, int32, uint8… シナプス結合 ニューラルネット(多層パーセプトロン)
ニューラルネットの1bit化 内部の表現をいろいろと1bit化する 式: ⇢⇢⇢ 1bit化 重み・活性化関数・正則化などが1bit化可能 ※ここでいう1bitとは{-1, 1}のことです
1bit化のメリット • メモリ大幅削減! float32 ⇢ 1bitでメモリ消費が1/32になる • 計算の単純化 ⇢ 高速化・省電力
• FPGAによる爆速化 (次のスライド) 1bitの掛け算はXNORと同じ ⇢ ALUを使わなくても計算可能 足し算もbit countで高速に処理
FPGAによる爆速化 FPGA = Field Programmable Gate Array (その場で書き換え可能な集積論理回路) ⇠こういうやつ 高位合成でプログラムするのが一般的
HDLでもプログラム可能 LUT(Look up table)を使った高速な計算が可能 浮動小数点演算 :速くて40クロックぐらい LUT+FFによる演算 :数クロック LUTで数値を取り出してFFに入力
FPGAの実験 ⇠ FPGAのみの実験結果 ネットワークの大きさはSFC<LFC<CNVの順番 手元でSFCをGPUで動かしたら9500FPSぐらいだった 1bit+FPGAにすれば約1000倍速(1200万FPS)になる? LUTは回路の面積も小さいので省電力
デメリットもあるよね? • 普通に1bit化すると大幅な精度低下 • ニューラルネットの1bit化について様々な研究が存在 • Binary Connect:BC (CVPR 2015)
https://arxiv.org/abs/1511.00363 NNの重みを1bit化した初のモデル • Binarized Neural Network:BNN (NIPS 2016) https://arxiv.org/abs/1602.02830 BCの活性化関数を1bit化 計算のボトルネックになるBatchNormalizationをシフト演算化 • XNOR-Net (CVPR 2016) https://arxiv.org/abs/1603.05279 BNNの演算に係数をつけて大規模データセットにも対応 畳み込みブロックの順序を変えて精度を向上
参考文献 • ニューラルネット https://sinhrks.hatenablog.com/entry/2014/11/30/192940 • 1bit化とハードウェア https://www.slideshare.net/kentotajiri/ss-77136469 • 演算のクロック数 http://rakasaka.fc2web.com/delphi/numop.html
• FPGAの大手企業 Xilinx https://xilinx.com/