陳亮宇
    • 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
    # 大呼過癮ㄉ智慧製造比賽紀錄 ## Pytorch訓練環境建置 參考:https://mc.ai/%E3%80%90pytorch%E6%95%99%E7%A8%8B%E3%80%91p1-pytorch%E7%92%B0%E5%A2%83%E7%9A%84%E9%85%8D%E7%BD%AE%E5%8F%8A%E5%AE%89%E8%A3%9D/ 1. 先建置Anaconda環境python=3.7 2. 按照參考網站安裝pytorch,版本選擇如下 pytorch載點:https://pytorch.org/get-started/locally/ ![](https://i.imgur.com/N7aE22d.png) https://medium.com/pyladies-taiwan/%E6%B7%B1%E5%BA%A6%E5%AD%B8%E7%BF%92%E6%96%B0%E6%89%8B%E6%9D%91-pytorch%E5%85%A5%E9%96%80-511df3c1c025 補資料方式:https://towardsdatascience.com/6-different-ways-to-compensate-for-missing-values-data-imputation-with-examples-6022d9ca0779 ## 初賽過程 目標:加工機台參數預測 以加工機台完整的「加工參數」和「加工品質」作為訓練資料,於測試階段預 測 20項重點參數 ### 1.訓練數據 官方說明內容: 本數據提供學習建模使用,提供1個excel檔案作為訓練數據,內含總共348筆資料。 每筆資料包含281項加工機台參數設定與6個鑽孔機加工品質的輸出結果,其中每筆 輸入資料包含137項6個鑽孔機(A1~A6)的共同參數以及144項單一鑽孔機的各別參數, 詳細資訊如下: | 欄位名稱 | 參數意義 | | ------------------ |:------------------------------- | | Input_C_001 ~ 137 | 與Output_A1 ~ A6 相關的共同參數 | | Input_A1_001 ~ 024 | 與Output_A1 相關的參數 | | Input_A2_001 ~ 024 | 與Output_A2 相關的參數 | | Input_A3_001 ~ 024 | 與Output_A3 相關的參數 | | Input_A4_001 ~ 024 | 與Output_A4 相關的參數 | | Input_A5_001 ~ 024 | 與Output_A5 相關的參數 | | Input_A6_001 ~ 024 | 與Output_A6 相關的參數 | | Output_A1 ~ A6 | 六個鑽頭加工品質的輸出結果 | 在Input_C_015 ~ 038 與 Input_C_063 ~ 082包含測量偏移量的文字參數,其說明如下: | 資料內容 | 資料意義 | | -------- | ------------------- | | N;0 | 無偏移 | | R;1 | 向x+方向偏移1個單位 | | L;1 | 向x-方向偏移1個單位 | | U;1 | 向y+方向偏移1個單位 | | D;1 | 向y-方向偏移1個單位 | ### 2. 資列缺失補齊 初賽所給予的訓練數據有部份遺失,須透過一些統計方法進行填補 填資料使用的包 * Impyute 安裝方式 `pip3 install impyute` 介紹網站: https://impyute.readthedocs.io/en/latest/?fbclid=IwAR2r9eIaZs49_VTZpQWGM3lZTL1TQPm5s7RKK5JFKj-2lo9BSLQCMrxEJ1I * fancyimpute 安裝方式 `pip install fancyimpute` github連結: https://github.com/iskandr/fancyimpute?fbclid=IwAR0pb9Ng5TMGhrlclaai1Is53trpzrPwLdbeNAdYyoHw-jKEhTm0JHLsx6k 使用的填補方式: 1. KNN 呼叫Facncyimpute的函式,k值填1的目的是避免經過平均後產生無意義的資料 ```=python data=np.array(df) fill_knn=KNN(k=1).fit_transform(data) df2=pd.DataFrame(fill_knn) df2.columns=df.columns ``` 3. MICE 呼叫Impute的函式 ```=python mice_impute=IterativeImputer() df2=mice_impute.fit_transform(df) ``` ### 3. UDRL切割 數據資料中有下列情況(參考官方說明),包括Input_C_015 ~ Input_C_038以及Input_C_063 ~ Input_C_082 ![](https://i.imgur.com/McWskYF.png) 為了使這些data能夠train,並且也能填入缺失的資料,必須將其切成有意義的數字 嘗試過下述兩種方式 : 1. 切成U、D、R、L四項,分別代表上下右左四個方向,其值即為方向的移動量 2. 切成U、D、R、L、v1、v2六項,其中U、D、R、L分別代表上下右左四個方向,並由0或1代表是否是該方向,v1則代表上下的移動量,v2則代表左右的移動量 ### 4. 刪除對訓練無效的資料 有部份資料過多相同數據,會降低訓練的效率 其中包括:Input_A1_08、Input_A1_10 ~ Input_A6_08、Input_A6_10 Input_C_002、Input_C_0023Input_C_004、Input_C_006、Input_C_132 ### Code ### 5. Neural Network Regression 範本 : https://docs.microsoft.com/zh-tw/archive/msdn-magazine/2019/march/test-run-neural-regression-using-pytorch?fbclid=IwAR0ZgLW2KIrfCBEp0VxQtPGr2Tv4_3xHrT0uVk1Qr5pRKiGj_OfqPsd5E8c ## 比賽資料 1. 比賽資訊與原始資料:https://drive.google.com/drive/u/2/folders/1_ZwX0Yq1tsslcn1_8MFF8EUN1x8zfYOU?fbclid=IwAR0TJK8a_fsd2oMHCVqQI4XyTcvigtwBZqVDEByucs-aSeNlpVSsNc7v9fY 2. 程式碼及處理後資料雲端:https://drive.google.com/drive/u/2/folders/1EyoA69p_Cw98ixUsmYvgoetuDqcb7avJ?fbclid=IwAR0TJK8a_fsd2oMHCVqQI4XyTcvigtwBZqVDEByucs-aSeNlpVSsNc7v9fY ## 原始資料分析 ### 各預測目標數據出現頻率: 1. Input_A1_020 |數據|出現頻率| |---|---| |0.1000| 106 |0.2000| 68 |1.0000| 59 |0.0000| 57 |0.3000| 10 |2.0000| 7 |1.1000| 5 |1.2000| 4 |3.2000| 3 |0.9000| 2 |3.0000| 2 |3.5000| 2 |1.5000| 2 |0.5000| 2 |2.1000| 2 |2.2000| 2 |3.1000| 2 |3.6000| 1 |1.8000| 1 |0.6000| 1 |1.4000| 1 |1.9000| 1 |5.0000| 1 |2.8000| 1 |5.3000| 1 |0.4000| 1 |2.6000| 1 |1.3000| 1 2. Input_A2_016 |數據|出現頻率| |---|---| |-0.0200| 90 |-0.0400| 73 |-0.0300| 72 |-0.0500| 56 |-0.0100| 55 3. Input_A2_017 |數據|出現頻率| |---|---| |-0.0200| 99 |-0.0100| 72 |-0.0300| 62 |-0.0500| 58 |-0.0400| 55 4. Input_A2_024 |數據|出現頻率| |---|---| |0.0100| 141 |0.0200| 93 |-0.0100| 70 |-0.0200| 23 |0.0000| 9 |0.0300| 6 |-0.0400| 3 |-0.0300| 2 |-0.0010| 1 5. Input_A3_013 |數據|出現頻率| |---|---| |0.0060| 152 |0.0040| 121 |0.0020| 40 |0.0080| 34 |0.0050| 1 6. Input_A3_015 |數據|出現頻率| |---|---| |0.0200| 57 |0.0500| 55 |0.0100| 42 |-0.0300| 40 |-0.0200| 40 |-0.0100| 27 |0.0300| 23 |-0.0500| 22 |0.0000| 15 |0.0400| 11 |-0.0400| 10 |0.0490| 2 |0.0470| 1 |0.0240| 1 7. Input_A3_016 |數據|出現頻率| |---|---| |-0.0200| 81 |-0.0300| 76 |-0.0500| 66 |-0.0400| 65 |-0.0100| 58 8. Input_A3_017 |數據|出現頻率| |---|---| |-0.0200| 100 |-0.0400| 69 |-0.0100| 65 |-0.0300| 64 |-0.0500| 48 9. Input_A3_018 |數據|出現頻率| |---|---| |-0.0200| 106 |-0.0400| 70 |-0.0100| 65 |-0.0300| 64 |-0.0500| 41 10. Input_A6_001 |數據|出現頻率| |---|---| |0.0000| 304 |0.1000| 8 |0.0900| 8 |0.0800| 6 |0.0700| 6 |0.1600| 5 |0.1200| 4 |0.1400| 2 |0.0200| 1 |0.2000| 1 |0.0150| 1 |0.1500| 1 |0.0600| 1 11. Input_A6_011 |數據|出現頻率| |---|---| |0.0040| 121 |0.0020| 72 |0.0030| 47 |0.0080| 40 |0.0100| 26 |0.0050| 25 |0.0060| 15 |0.0070| 1 |0.0010| 1 12. Input_A6_019 |數據|出現頻率| |---|---| |-0.0200| 96 |-0.0400| 74 |-0.0300| 68 |-0.0500| 55 |-0.0100| 53 13. Input_A6_024 |數據|出現頻率| |---|---| |0.0100| 126 |0.0000| 71 |0.0200| 55 |-0.0100| 54 |-0.0200| 17 |0.0300| 15 |0.0400| 6 |-0.0300| 3 |-0.0400| 1 14. Input_C_013 |數據|出現頻率| |---|---| |0.0050| 208 |0.0040| 122 |0.0060| 8 |0.0070| 3 |0.0020| 2 |0.0080| 2 15. Input_C_046 |數據|出現頻率| |---|---| |0.0010| 51 |0.0011| 43 |0.0009| 41 |0.0008| 37 |0.0007| 30 |0.0005| 27 |0.0004| 23 |0.0012| 21 |0.0006| 17 |0.0015| 12 |0.0013| 12 |0.0003| 11 |0.0016| 6 |0.0014| 4 |0.0017| 3 |0.0002| 2 |0.0019| 1 |0.0018| 1 |0.0022| 1 16. Input_C_049 |數據|出現頻率| |---|---| |0.0006| 59 |0.0005| 54 |0.0004| 46 |0.0007| 39 |0.0008| 35 |0.0003| 31 |0.0009| 21 |0.0002| 16 |0.0010| 13 |0.0012| 10 |0.0011| 9 |0.0013| 3 |0.0016| 2 |0.0014| 2 |0.0015| 1 |0.0019| 1 |0.0018| 1 17. Input_C_050 |數據|出現頻率| |---|---| |0.0050| 60 |0.0070| 56 |0.0060| 54 |0.0080| 30 |0.0040| 26 |0.0011| 16 |0.0090| 14 |0.0009| 13 |0.0010| 13 |0.0100| 10 |0.0012| 10 |0.0014| 7 |0.0008| 7 |0.0110| 4 |0.0007| 4 |0.0120| 4 |0.0015| 3 |0.0140| 2 |0.0017| 2 |0.0013| 2 |0.0018| 2 |0.0030| 2 |0.0150| 1 |0.0005| 1 18. Input_C_057 |數據|出現頻率| |---|---| |0.0160| 23 |0.0150| 22 |0.0180| 19 |0.0120| 19 |0.0130| 18 |0.0100| 16 |0.0110| 15 |0.0090| 14 |0.0080| 13 |0.0190| 13 |0.0220| 13 |0.0070| 11 |0.0009| 11 |0.0140| 10 |0.0007| 10 |0.0170| 10 |0.0011| 9 |0.0010| 8 |0.0004| 7 |0.0008| 7 |0.0240| 7 |0.0210| 7 |0.0200| 6 |0.0040| 5 |0.0060| 5 |0.0230| 4 |0.0003| 4 |0.0250| 4 |0.0006| 4 |0.0013| 4 |0.0015| 3 |0.0005| 3 |0.0012| 3 |0.0016| 2 |0.0280| 2 |0.0270| 2 |0.0002| 2 |0.0350| 1 |0.0050| 1 |0.0260| 1 |0.0014| 1 |0.0017| 1 |0.0320| 1 |0.0019| 1 |0.0290| 1 19. Input_C_058 |數據|出現頻率| |---|---| |0.0080| 29 |0.0070| 26 |0.0100| 26 |0.0090| 23 |0.0110| 21 |0.0130| 17 |0.0060| 17 |0.0140| 16 |0.0050| 13 |0.0120| 13 |0.0160| 12 |0.0150| 12 |0.0170| 11 |0.0180| 10 |0.0005| 9 |0.0007| 8 |0.0010| 8 |0.0008| 8 |0.0006| 8 |0.0012| 7 |0.0013| 7 |0.0190| 7 |0.0014| 5 |0.0011| 5 |0.0040| 4 |0.0015| 4 |0.0017| 2 |0.0016| 2 |0.0009| 2 |0.0004| 2 |0.0220| 2 |0.0018| 2 |0.0200| 2 |0.0019| 1 |0.0270| 1 |0.0210| 1 20. Input_C_096 |數據|出現頻率| |---|---| |0.0100| 160 |0.0200| 117 |0.0000| 68

    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