楊尚峰
    • 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

      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.
      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
    • 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 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

    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.
    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
    --- title: '深度學習學習心得-5' disqus: hackmd --- 深度學習學習心得 第五篇 === ![grade](https://img.shields.io/badge/Grade-新手-brightgreen) ![build](https://img.shields.io/badge/Build-keras-important) --- ## CNN 1. 我們希望每個NUERAL都可以成為最小單位的分類器 2. 使用DNN的時候,通常會需要太多的參數 3. 所以使用CNN來減少參數 :::info DNN:假設一張100x100的彩色照片 = 30000維 若每層nueral 有1000個,那參數就是30000x1000個 ::: ---- 基本想法 --- 1. 一張圖不是全部的地方都有特徵 2. 將一些不太重要的權重去掉來減少參數 3. 減少參數:用一些我們已經知道的規則 4. CNN模型結構比DNN結構還要簡單 --- 重點1.Nueral --- 1. 要找到輸入影像中的某些規則 往往不需要看整張影像 就可以找到規則(pattern) 2. Ex. Find 鳥嘴不需要看整張圖 3. 故得知每個nueral只要連接到部分網路 而非全部都要連接 ![](https://i.imgur.com/kSkmGY4.png) ---- 重點2.減少分類器 -- 1. 某些pattern在不同訓練資料中 處在不同位置,不需要訓練2個 重複性的detector 2. 一樣是舉鳥嘴的例子 ![](https://i.imgur.com/zM3I4iC.png) ---- 重點3.Subsampling --- 1. 子採樣可以有效降低參數數量 2. 子採樣的方式通常採用maxpooling 3. 當然不只maxpooling,還有其他的pooling ---- CNN進行流程與重點的關係 --- :::info CNN流程: input -> convolution -> maxpooling ->convolution -> maxpooling..... ->flatten-> fully-connected ->output ::: 1. convolution -> maxpooling流程可以循環多次 2. 重點1 & 重點2: convolution 3. 重點3: maxpooling --- Convolution(捲積) --- 1. 現在輸入影像6x6,捲基層有多組filter 2. 先將filter(大小3x3)放到左上角進行內積(值= 3) ![](https://i.imgur.com/e3WvNEN.png) 3. 接著根據stride決定往右挪動距離,再往下內積 ---- 捲積意義1 --- ![](https://i.imgur.com/uMkGoTW.png) 1. 內積結果將原本6x6 -> 4x4 的矩陣 2. Filter 1偵測到左上角與左下角的值最大 ->有filter1想找的pattern 3. 重點2:不同位置pattern可用同一filter找到 ---- 捲積意義2 --- ![](https://i.imgur.com/ET0HPMP.png) 1. 接著換filter2去跑,跑出來一樣也是4x4矩陣 2. 所有filter都跑完之後就得到 feature map 3. 固定filter大小的做法有一些隱憂: 鳥嘴大小差太多可能就沒辦法用同個filter找到 ---- 捲積意義3 --- 1. 彩色image=input,filter會變成立體的nxnx3 同一個filter會同時考慮3個不同顏色channel 2. Convolution可以視為DNN中的部分輸出值 3. 不是所有nueral都連接到3 =>減少參數 ![](https://i.imgur.com/mlEtzod.png) ---- 捲積意義4 --- ![](https://i.imgur.com/R6woLfz.png) 1. 不同的nueral ouput間會共用同一個weight 2. 每個input給不同output 的weight都是一樣的 3. 編號2給輸出3與輸出-1的weight都是一樣的 -> 減少更多參數 --- Maxpooling(最大池化) --- ![](https://i.imgur.com/cVukCLQ.png) 1. 根據filter算出的feature map 我們可以再將它縮小成n個一組 2. 這邊舉例用4個一組,然後4個裡面 選擇最大值代表(見下頁) ---- **最大值代表** ![](https://i.imgur.com/K019dFv.png) ---- 輸入大小變化 --- ![](https://i.imgur.com/c3KXuuS.png) 1. input:6x6 2. conv -> maxpooling 3. output:2x2 4. 參數真的有變少 :+1: ---- Flatten --- 1. feature map拉直 = DNN的input ![](https://i.imgur.com/SFxB5cb.png) :::warning 做CNN時要注意input不再是一般向量 而是高維的向量 ::: --- ## Next Lesson ... 1. CNN code review ###### tags: `Deep learning` `beginner` `python` `keras` `tutorial`

    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

    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 with Wallet
    Wallet ( )
    Connect another wallet

    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

    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