HackMD
  • Prime
    Prime  Full-text search on all paid plans
    Search anywhere and reach everything in a Workspace with Prime plan.
    Got it
      • Create new note
      • Create a note from template
    • Prime  Full-text search on all paid plans
      Prime  Full-text search on all paid plans
      Search anywhere and reach everything in a Workspace with Prime plan.
      Got it
      • Options
      • Versions and GitHub Sync
      • Transfer ownership
      • Delete this note
      • Template
      • Save as template
      • Insert from template
      • Export
      • Dropbox
      • Google Drive
      • Gist
      • Import
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
      • Download
      • Markdown
      • HTML
      • Raw HTML
      • Sharing Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • More (Comment, Invitee)
      • Publishing
        Everyone on the web can find and read all notes of this public team.
        After the note is published, everyone on the web can find and read this note.
        See all published notes on profile page.
      • Commenting Enable
        Disabled Forbidden Owners Signed-in users Everyone
      • Permission
        • Forbidden
        • Owners
        • Signed-in users
        • Everyone
      • Invitee
      • No invitee
    Menu Sharing Create Help
    Create Create new note Create a note from template
    Menu
    Options
    Versions and GitHub Sync Transfer ownership Delete this note
    Export
    Dropbox Google Drive Gist
    Import
    Dropbox Google Drive Gist Clipboard
    Download
    Markdown HTML Raw HTML
    Back
    Sharing
    Sharing Link copied
    /edit
    View mode
    • Edit mode
    • View mode
    • Book mode
    • Slide mode
    Edit mode View mode Book mode Slide mode
    Note Permission
    Read
    Owners
    • Owners
    • Signed-in users
    • Everyone
    Owners Signed-in users Everyone
    Write
    Owners
    • Owners
    • Signed-in users
    • Everyone
    Owners Signed-in users Everyone
    More (Comment, Invitee)
    Publishing
    Everyone on the web can find and read all notes of this public team.
    After the note is published, everyone on the web can find and read this note.
    See all published notes on profile page.
    More (Comment, Invitee)
    Commenting Enable
    Disabled Forbidden Owners Signed-in users Everyone
    Permission
    Owners
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Invitee
    No invitee
       owned this note    owned this note      
    Published Linked with GitHub
    Like BookmarkBookmarked
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # #8 Self-Attention Generative Adversarial Networks ###### tags: `GAN` `論文まとめ` 理解力がなく,つらい https://arxiv.org/abs/1805.08318 # 要旨 SAGANは注視駆動のGANである.従来の畳み込み層を用いたGANは低解像度の潜在因子空間の局所点から,高解像度の画像を生成しているがSAGANは,全潜在因子空間からのキューを用いて画像を生成する. さらに良い特徴として,ディスクリミネータが,画像の離れた部分の特徴が互いに一致しているかどうかを確認することが可能になる. また,ジェネレータに条件付けを設けるとGANのパフォーマンスに影響を与えることが最近の研究で判明している. この結果を利用して,GANのジェネレータにスペクトル正規化を適用し,訓練の改善を行った. # 導入 DCGANは多クラスを含むデータセットの訓練において,まともな画像を生成することは難しい. 例えば,ImageNet GANのモデルでは,テクスチャで区別されるような,空や海などといった画像の生成には優れているが,ジオメトリによって区別されるような複雑な構造パターンを含むような画像生成には向いていない. これは,畳み込み演算は局所的な受容野を擁しているため,長距離依存はいくつかの畳み込み層を超えた後にのみ処理を行うことが可能になる. カーネルサイズを大きくすることで,この問題はある程度解決することが可能であるが,局所的畳み込みを利用することで得られるような計算効率や統計効率といった恩恵を失ってしまう. SAGANでは,Self-Attentionのメカニズムを畳み込みGANに導入することで,長距離性と計算効率をともに解決した. # 関連論文 ## GAN ### Spectral Normalization https://arxiv.org/abs/1802.05957 ## Attention Models 大域的な依存性を抽出するうえで,Attentionモデルは非常に重要である. # Self-Attention Genarative Adversarial Networks 従来のGANで最もよく使われている畳み込み層は局所近傍の情報を処理している.そのため,長距離依存性をモデル化する上で,計算機の性能などの面からでも不向きであるモデルといえる. https://arxiv.org/abs/1711.07971 そのため,上記論文の非局所的モデルを適用し,ジェネレータ,ディスクリミネータともに空間的に離れた構造関係に対して効率的に対処する. ![image alt](https://i.gyazo.com/aa8281a6c6e113ba18b836a6f2e0eb67.png) ある層に対して,そのひとつ前からの隠れ層の出力(つまり自身の入力)を$x\in \mathbb R^{C\times N}$とする.この行列に対してattentionを算出するために写像$f,g$を定める. ただし,$f(x)=W_f x,g(x)=W_g x$とする.また,$\beta_{j,i}$を以下のように定義する. これは,$j$番目の領域を合成する際にモデルが$i$番目の位置にどの程度関与するかを示す量といえる. $$ \beta_{j,i}=\frac{\exp(s_{ij})}{\sum_{i=1}^{N}\exp(s_{ij})},\text{where}~~ s_{ij}=f(x_i)^Tg(x_j) $$ 次にattention層の出力$o=\{o_1,o_2, ...,o_j,...o_N\}\in \mathbb R^N$を, $$ \displaystyle o_j=\sum^N_{i=1}\beta_{j,i}h(x_i),\text{where}~~~ h(x_i)=W_h x_i $$ と定義する. SAGANは上記パラメータのうち,$W_g\in\mathbb R^{\bar{C}\times C},W_f\in\mathbb R^{\bar{C}\times C},W_h\in\mathbb R^{C\times C}$を$1\times 1$畳み込み層を用いて実装を行い,学習させる この論文では$\bar{C}=C/8$として実験を行った. 最後に,アウトプットをスケーリングし,入力をつけ足したものを最終的な出力とした.すなわち,最終的な出力$y_i$は $$ y_i=\gamma o_i+x_i $$ と表せる.ただし,$\gamma$ははじめ,0で初期化を行う.すなわち,これによって学習の初めの段階は局所近傍を主に学習し,学習を重ねていくうちに漸次的に大域性を増して学習を行うことが可能になる. 損失関数は以下のものを使用する.(https://arxiv.org/abs/1705.02894) $$ \begin{eqnarray*} L_D&=&-\mathbb E_{(x,y)\sim p_{data}}[\min(0,-1+D(x,y))]- \mathbb E_{z\sim p_z,y\sim p_{data}}[\min(0,-1-D(G(z),y))]\\ L_G&=&-\mathbb E_{z\sim p_z,y\sim p_{data}}D(G(z),y) \end{eqnarray*} $$ # GAN学習安定化を支える技術 ## スペクトル正規化を両モデルに適用 https://arxiv.org/abs/1802.05957 の論文で提案されたスペクトル正規化はディスクリミネータにのみ適用されていたが,これをジェネレータにも同様に適用させる.スペクトル正規化は他の正規化処理と比較してハイパーパラメータチューニングを行うことがないことが大きな特徴である. ジェネレータにスペクトル正規化を適用させることでパラメータの大きさが爆発的に増加することを抑えることが可能になり,勾配爆発の問題を避けることができるようになる. ## 両モデル間の学習率を不均衡にさせる ディスクリミネータに正規化を課すと,GANの学習過程が遅れてしまうということが従来の研究により分かっている.実際,ジェネレータの1回の更新の間にディスクリミネータは数回(5回あたりが多い)の更新を行うという実装をしているものが多く見受けられる. https://arxiv.org/abs/1706.08500 この方法とは別に,上記論文にて,ジェネレータとディスクリミネータにそれぞれ別の学習率を使用することを提案している. 数度のディスクリミネータの更新がいらなくなるため,同一時間に行える学習回数の向上が見受けれられる.

    Import from clipboard

    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 lost their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template is not available.


    Upgrade

    All
    • All
    • Team
    No template found.

    Create custom template


    Upgrade

    Delete template

    Do you really want to delete this template?

    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

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in via Google

    New to HackMD? Sign up

    Help

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

    Documents

    Tutorials

    Book Mode Tutorial

    Slide Mode Tutorial

    YAML Metadata

    Contacts

    Facebook

    Twitter

    Feedback

    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

    Versions and GitHub Sync

    Sign in to link this note to GitHub Learn more
    This note is not linked with GitHub Learn more
     
    Add badge Pull Push GitHub Link Settings
    Upgrade now

    Version named by    

    More Less
    • Edit
    • Delete

    Note content is identical to the latest version.
    Compare with
      Choose a version
      No search result
      Version not found

    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. Learn more

         Sign in to GitHub

        HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.

        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
        Available push count

        Upgrade

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Upgrade

        Danger Zone

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

        Syncing

        Push failed

        Push successfully