wxyz86103
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.

      Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Explore these features while you wait
      Complete general settings
      Bookmark and like published notes
      Write a few more notes
      Complete general settings
      Write a few more notes
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.

    Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Explore these features while you wait
    Complete general settings
    Bookmark and like published notes
    Write a few more notes
    Complete general settings
    Write a few more notes
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # FBNet representation #### [CVPR](https://openaccess.thecvf.com/content_CVPR_2019/html/Wu_FBNet_Hardware-Aware_Efficient_ConvNet_Design_via_Differentiable_Neural_Architecture_Search_CVPR_2019_paper.html) #### [好懂的中文講解影片](https://www.youtube.com/watch?v=D9m9-CXw_HY&ab_channel=ShusenWang) ![](https://i.imgur.com/qXKO2JC.png) ![](https://i.imgur.com/WXh8OiK.png) 30秒來說這篇論文的話 就是構建多層網路, 叫做supernet 每層都有多個分支, 每個分支都有一個分數 透過softmax計算這層每個分支的機率 選取最大機率的分支為最終結果, 得到最終的網路 (將離散的search space透過softmax變成連續的, 因此可微) 60秒 和DARTS相比, 增加了latency的評估 透過實驗得知特定層特定分支在目標硬體上的runtime 並儲存為lookup table 在評估latnecy的時候就透過查表計算latency --- ## 1. Introduction 1. Intractable design space 2. Nontransferable optimality 3. Inconsistent efficiency metrics ## 2. Related work ### Efficient ConvNet models ### NAS ## 3. Method ![](https://i.imgur.com/LVcGY2O.png) 3.1. The Search Space 以往研究用cell, 一旦找好cell就重複用在每層 許多找到的cell很複雜且碎片化, 所以在移動裝置表現的不好 而且cell在不同層會有不同性能(準度, 延遲) 所以在這篇論文中可以讓不同層選擇不同的block以便得到更好的準度與性能 這篇論文建構了一個固定的macro-architecture(宏觀架構)搭配layer-wise search space. 每一層都能選擇不同的block (我猜宏觀架構的用意是讓search space以layer-wise呈現) 宏觀架構的定義在table1 ![](https://i.imgur.com/XEWrXVr.png) 那它定義了層數和 每層in/output的channel數 那第一層和最後三層的運算操作是定義好的 其他層的block則是需要經過搜尋後才能確認 需要注意的是filter number是經過實驗後手動選取的. (補充說明filter number就是定義output channel數) 前面層使用相對小的channel sizes, 因為一開始圖片的解析度比較大, 也就是面積會比較大, kernel數量少一點會使運算成本顯著的降低. 前面說到每層都能選擇不同的block, 那block的結構是被MobileNetV2和ShiftNet所啟發, 這張圖就是block結構(圖3) ![](https://i.imgur.com/5B4hJ1p.png) block需要藉由搜尋才能定義的有expansion rate, kernel size和group convolution的group數. :::info 1x1 (group)(expansion rate) GConv kxk (kernel size) DWConv 1x1 (group) GConv ::: expansion rate指將input channel放大幾倍, 但不會影響到output channel(bottle neck的概念) 上面兩個conv會接ReLU, 最後一個conv後不會接ReLU 論文中也提到如果output channel和input channel相同, 則會加一個skip connection, 把input加到output 但我看表格, 只有一個是相同的input/output. A:他的block會重複幾次, 取決n, 所以會有相同的in/out DWConv的kernel size有3和5可選 第一和第三的group conv用意是降低運算複雜度 且GVonv會使用channel shuffle來混合不同group的資訊 這篇論文的實驗中, layer-wise search space有9個候選blocks, 他們的設定在table2 ![](https://i.imgur.com/uT8ltQB.png) skip是用來降低網路的深度用, 直接將input當成output search space總共有22層, 每層有9個block可選 所以search spacec大小為9^22次方, 約為10^21種不同的架構 從這麼多架構中找到最好的不是一件容易的任務 3.2. Latency-Aware Loss Function ![](https://i.imgur.com/LVcGY2O.png) 式1 為了呈現給定架構的準確度和在特定硬體的延遲, 而使用式2 ![](https://i.imgur.com/lInVoLt.png) First term: alpha是指當前架構, Wa是指filter的權重 cross-entropy loss Second term: LAT是在特定硬體上的時間, 單位為ms α是用來控制對latency的注重程度 β modulates the magnitude of the latency term. CE好算, 但是latency不好算, 因為要測量在特定硬體上跑特定架構的run time, 可是架構共有10^21個, 根本是不可能的任務 為了解決這個問題, 作者團隊使用了latency lookup table model來估計網路的總延遲, 這個table是透過計算各個operator的實際在目標硬體上測量runtime得來. ![](https://i.imgur.com/0LsKXKm.png) layer-**l** from architecture **a**. 這裡假設在目標的處理器, operator的run time為互相獨立, 不會互相影響. 這個假設在許多mobile CPUs和DSPs都是成立的, 因為operators都是一個接一個. 藉由測量9*21=189個operator, 就可以簡單的估計共10^21個架構的runtime了 更重要的是, 使用lookup table model可以讓式2的latency term變得可微(repect to layer-wise block), 所以就可以用梯度下降來優化式1 :a: 為何變得可微 3.3. The Search Algo 使用暴力搜尋解空間來優化式子1會很難解 其中一個問題是要訓練神經網路 The inner problem of optimizing wa involves training a neural network. ImageNet分類任務, 要訓練好幾天甚至幾周 The outer problem of optimizing a ∈ A has a combinatorially large search space. 圖是? Most of the early works on NAS follow the paradigm above. 為了減少計算成本, 第一個問題透過訓練簡易的代理資料集來解決(在比較簡單的dataset訓練好, 或是大dataset只訓練幾個epoch) 舉例來說, 以往論文有的在CIFAR10 dataset訓練好, 或在ImageNet訓練5個epoch. 為了避免窮盡search space, 他們使用強化學習來主導exploration. 盡管有這些優化, 解決式1依舊是很耗成本, 因為訓練代理資料及也很花時間, 在找到最佳架構前可能會訓練幾千個架構 作者團隊採取不同的方法來解決 首先以隨機的super net來呈現search space super net 有著相同的宏觀架構 每個層有9個平行的block 在inference的時候, 只有一個候選block會被選中並執行 選擇分數為: ![](https://i.imgur.com/8tvkXIs.png) layer-l的output如下 ![](https://i.imgur.com/Xv090FU.png) m is a random variable in {0, 1} and is evaluated to 1 if block bl,i is sampled 他們讓每個層選取block的機率是獨立的, 因此每個架構的機率可以由下面的式子所描述 ![](https://i.imgur.com/31N146B.png) 取代優化離散的架構選擇, 他們將問題relax成優化機率Pθ問題來達到最小的loss. 重寫式1如下 ![](https://i.imgur.com/VkO8soB.png) 可以看到式7, Wa是可微的, 可以直接用SGD算, 選擇block的θ不是直接可微, 因為random variable m作為遮罩是離散的. 為了避免這個問題, 他們使用Gumbel Softmax function來relax這個遮罩變數 ![](https://i.imgur.com/kPlG7yn.png) gl,i 是一個random noise, 值是根據Gumbel distribution產生 temperature parameter τ As τ approaches 0, 會很接近式6的離散分類抽樣 As τ becomes larger, m會變成連續隨機變數 無論τ的值如何, 結論是m會變得可微(respect to the θ) 式2的cross-entropy term對m和θ是可微的 latency term的話, 因為是使用lookup table, 式3可被改寫成 ![](https://i.imgur.com/Xoww5WE.png) LAT(bl,i)是個常數係數, 所以m可微, LAT(a)可微 總結來說, 式2對Wa和θ會變得都可微, 所以就可以用SGD來解式1了 operators訓練完後, 各個operators對accuaracy都有不同的貢獻程度 接著計算∂L/∂θ來更新probability Pθ, 讓好的operator值更大 其他則變小. As will be shown in the experiment section, the proposed DNAS algorithm is orders of magnitude faster than previous RL based NAS while generating better architectures. ## 4. Experiments 4.1. ImageNet Classification 訓練資料集: ImageNet 2012 classification dataset 希望模型在特定硬體上能表現出高準確與低延遲 實驗中, 目標硬體為Samsung Galaxy S8 with a Qualcomm Snapdragon 835 platform. 使用Caffe2部屬在mobile devices(使用int8 inference engine). 輸入圖片的解析度為224x224 為了減少訓練時間, 從原本1000個class中隨機選出100個class來訓練90個epoch. 每個epoch, 會先訓練operator權重, 在訓練架構機率參數θ 權重先用80%的training set訓練(SGD with momentum). 架構參數θ則會用剩餘20%training set訓練(Adam optimizer) temperature of the Gumbel Softmax: exponentially decaying temperature 在搜尋結束後, 會Pθ根據選出幾個架構, 並且從頭訓練 搜尋架構使用pytorch實做, 模型訓練則是用Caff2完成 結果在Table 3 ![](https://i.imgur.com/TdoiXOY.png) Directly cite the parameter size, FLOP count, and top-1 accuracy from the original paper. 因為他們是使用caffe2和 int8 implementation, 在latency上有很大的優勢, 為了公平比較, 有在他們的環境實做其他方法來測量latency table3 - mnasnet MnasNet does not disclose the exact search cost. 8,000 models each model is trained for five epochs. According to our experiments, one epoch takes 17 minutes using 8 GPUs. 8,000 models for 5 epochs = 17/60 × 5 × 8 × 8, 000 ≈ 91 × 103 GPU hours. visualize some of our searched FBNets, MobileNetV2, and MnasNet in Figure 4. ![](https://i.imgur.com/VgN4CHV.png) 4.2. Different Resolution and Channel Size Scaling 減少計算成本的方法: reduce the input resolution or channel size 他們假設使用這些方法的話 找出來的架構也會是不同 為了測試假設, 實驗以不同的解析度和通道數測試, 結果在table4 Especially the FBNet-96-0.35-1 model achieves 50.2% (+4.7%) accuracy and 2.9 ms latency(345 frames per second) on a Samsung Galaxy S8. ![](https://i.imgur.com/yvTyPFW.png) ![](https://i.imgur.com/d25Oxm0.png) ![](https://i.imgur.com/pCvezj8.png) ![](https://i.imgur.com/uDR6xCY.png) ![](https://i.imgur.com/0LHCb3q.png) 4.3. Different Target Devices ## 5. Conclusion --- code ###### tags: `paper`

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password
    or
    Sign in via Google Sign in via Facebook Sign in via X(Twitter) Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    By signing in, you agree to our terms of service.

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully