李柏翰アヤセ
    • 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
    • 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

    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
    >在模型訓練時,判斷模型問題出在哪很重要,本章節整理了碰到下列情況該如何調整 ### 訓練模型三步驟 step1:function with unknow(尋找合適函數) input為feature值, step2:define loss from training data(計算損失值) step3:optimization(找到恰當的優化器(演算法)) ![image](https://hackmd.io/_uploads/H1r1sSv6T.png =80%x) **上圖來自李弘毅教授之教學影片** ### 判斷模型訓練失敗的可能原因 >紀錄training data的loss值這很重要!!! >[name=澤] 下圖為判斷圖 ![image](https://hackmd.io/_uploads/HJuIsSDTp.png =80%x) 1.先判斷你的training data的loss值是大還小 2.在判斷你的模型在 testing data上的學習狀況 若是在訓練資料上loss太大有可能是model bias 或是optimization的問題 **那該如何判斷是哪種可能呢?** ## model bias VS optimization **model bias** 在你的模型太過簡單時可能會發生,EX:今天帶入未知的parameter(參數)到function,但function set當中卻沒一個function可以令我們的loss值降低,簡單來說就是白做,解決方法就是想辦法讓你的model更複雜,你可以透過輸入更多特徵值,或是增加更多的layer ,nerual,來解決這類狀況。 **optimization** 舉個例子,我們在訓練模型時大多都會用到gradient descent(梯度下降法),他確實有找到一個function,但他找到的卻不是最好的,loss不夠小,EX:你在養魚場釣魚,釣上來確只有蝦子。 好那我們介紹完上列兩種可能的問題,那到底該怎麼判斷是哪種呢? >哈阿,答對摟,就是多試幾次拉。 >[name=澤] > 請你先觀察這兩張圖 ![](https://hackmd.io/_uploads/r1bc1QAhn.png =40%x)![](https://hackmd.io/_uploads/BJ-CxXR3n.png =50%x) 56層 v.s. 20層 的測試資料,20層的loss< 56層的loss 56層 v.s. 20層 的訓練資料,20層的loss< 56層的loss 因為在訓練的時候,越深/複雜的model應該要越契合訓練資料,甚至會overfitting,但訓練資料的loss,深<淺,你就算後36層什麼都不做,loss也不會比只做20層多啊,所以可以判斷,是optimization的問題。 如果還是不懂 ![](https://hackmd.io/_uploads/BJKufQ033.png) 這張圖上在layer到第五層時loss卻比第四層還大,這就是optimization的問題。 若是遇到這類狀況,建議先用比較淺的神經網路訓練模型(待補)。 ## 過擬合問題 好那如果今天training data的loss夠小,但testing卻大的哭出來,那就有可能是overfitting or mismatch 好,那甚麼是overfitting呢? 首先我們來解釋一下過度擬合吧・ω・ 簡單來說就是,機器太過依賴訓練資料,導致他過度依賴某項特徵(不一定是一個啦)舉例來說,我們今天來做貓的辨識,但是我的訓練資料裡都是有毛的貓貓,那如果我今天辨識的圖片是無毛貓呢!? 機器:欸這個圖片裡沒有毛,應該就不是貓了吧(誤 以上只是舉例,不要當真 就會有過度擬合的狀況 如果你的function真的太太太太廢,一個random猜準確度還比較高, 那通常我們會傾向往兩個方向去改,第一個是增加你的資料量第二個是做data augmentation(資料增強)自己去創造資料,舉例,如果我們將一張圖片上下左右顛倒🙃️,或是用不同手段處理,以此來增加資料量。 ## train loss 和 test loss 判斷 | train_loss | test_loss | problem | |:-------------:|:------------:|:----------------------------------------:| | $\downarrow$ | $\downarrow$ | 網路仍在學習 | | $\downarrow$ | ---- | 過擬合 | | ---- | $\downarrow$ | 數據集問題 | | ---- | ---- | 學習遇到瓶頸,減少batch_size或調整學習率 | | $$\uparrow $$ | $$\uparrow$$ | 訓練超參數、網路設計不當等問題 | ### 參考資料 [-機器學習攻略](https://www.youtube.com/watch?v=WeHM2xpYQpw&list=LL&index=1) [-分析訓練過程loss異常](https://cloud.tencent.com/developer/article/1851524)

    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