nbswords
    • 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
      • Invitee
      • No invitee
    • Publish Note

      Publish Note

      Everyone on the web can find and read all notes of this public team.
      Once published, notes can be searched and viewed by anyone online.
      See published notes
      Please check the box to agree to the Community Guidelines.
    • 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
    • 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 Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Versions and GitHub Sync 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
Invitee
No invitee
Publish Note

Publish Note

Everyone on the web can find and read all notes of this public team.
Once published, notes can be searched and viewed by anyone online.
See published notes
Please check the box to agree to the Community Guidelines.
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
Subscribed
  • Any changes
    Be notified of any changes
  • Mention me
    Be notified of mention me
  • Unsubscribe
Subscribe
--- tags: AI Summer school --- # 大規模機器學習的隨機優化 - 王奕翔教授 台大電機系 ## ML:from data to intelligence Problems: - * Amount of data * feature selection * Model selection ### Abstraction of ML * input > **BLACK BOX** > output (Supervised) * 如何知道Black box如何運作? * Training data > Model > Predict * Estimated Black box ($\hat{y}$) <-> Black box ($y$) * 前者是一個learning model (透過loss...等等) ### Quantifying the Effectiveness * loss function ($y$和$\hat{y}$實際上的距離) * 用一個函數來測量兩者之間有多遠 Example: * 0-1 loss (Classification) * hinge loss (SVM的loss function) * Cross entropy loss (One-hot encoding) ### Learning Model 1. 通常先將Raw data map到一個high dimension的feature 再抽取features * 如何抽取?... 2. 把features 丟進 learning model後產出output $\hat{y}$ 3. Parameter $w$ 通常很高維 * 如何找到好的$w$? * 從learning data中學習 * 什麼是好? (未必loss很低就是好 -> **Overfitting**) ### Expected loss * 用testing input來測試$y$和$\hat{y}$之間相差多遠 (Prediction vs Ground Truth) 算出loss * 取loss的期望值 並透過調整$w$來嘗試minimize這個期望值 * 所謂的Random(Stochastic)就是隨機抽一個點來比較 ### Risk Minimization is Challenging * statisical vs empirical * 前者的分布unknown 後者的知道 * 因為gradient很難算 所以其實很難 ### 最佳化gradient, Hessian很難 如何估計? ### First-Order Approimation * 每一次iteration只需算一個gradient * 無法算Hessian * 大規模的ml不考慮First-Order (Costly) ## Stochastic Gradient Method by Robbins and Monro,1951 1. 從 $w$開始 2. 在每一個iteration中都產生一個亂數 並利用目前的gradient來算出一個stochatic vector $g$ 3. 選擇 step size 4. 利用 $g$ update $w$ 在n個iteration後output出最後的$w$ (Unbiased estimated) ### SGD for Risk minimization * 若有足夠的homogeneous data 可直接從data算出 $P$ * 但若沒有 也可以用 Empirical Risk中算出 ### Stochastic vs Full-Batch * 與其把所有gradient算出來 平均出大gradient (costly) 不如用SGD更有效率 * Example... LBFGS vs SGD * SGD一開始掉比較快 * 其實在ML裡面, Train比較久沒有比較好, 可能會overfitting ### Intuitive Explanation: 為何SGD一開始很快 最後變很慢? * $w^*$是最佳點 因此一開始都是往右邊跑 直到跑到右邊後會開始左右不斷移動 (自己confuse自己) * 這個左右震盪的現象就是最後收斂很慢的原因 (最後還是會找到 只是要很久) * 可降低Stepsize來繼續Train Emerging Questions 1. Convergence guarantess of SGD? 2. SGD如何取決於問題的結構 3. .... * Begin with Convex problems (Non-Convex比較有趣 但不夠成熟) ### Why Convexity * 因為若沒有結構化的條件很難得到全局最佳點 但Convex problem有一些好用、成熟的function、演算法可以使用 * Convexity 能肯定global convergence 在optimum上 (也就是在convex problem中 local covergence = global convergence ### Strong Convexity * **something stronger than convexity** * EX: First-Order 、 second-order condition ### smoothness 可微分 -> smooth (Strongly-Convex gradient變化速度很快) 不可微分 -> Non-smooth * 在convex problem下 可能有些點無法微分 只要將gradient用subsgradient替代即可 (但要有smothness) * 有smoothness會快很多 ### SGD 的 Variance Reduction * SGD已經無法再更快了 只能透過修改參數來加速 * 辣張圖 * Key: SGD的Variance * 可用mini-batch 降低Variance (一次Sample愈多 variance愈小) * 一開始的時候不需要很小的Variance 但接近最佳點的時候就需要小一點的Variance (**Dynamic smapling**) ### Reduce Variance 的其中一個方法 - SVRG algorithm [SVRG Paper](https://papers.nips.cc/paper/4937-accelerating-stochastic-gradient-descent-using-predictive-variance-reduction.pdf) ## [Main Reference](https://arxiv.org/abs/1606.04838)

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 lose 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?
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

How to use Slide mode

API Docs

Edit in VSCode

Install browser extension

Get in Touch

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
Upgrade to Prime Plan

  • Edit version name
  • Delete

revision author avatar     named on  

More Less

No updates to save
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

      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