Po-Chuan Chen
    • 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
    • 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
    • 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
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
Subscribed
  • Any changes
    Be notified of any changes
  • Mention me
    Be notified of mention me
  • Unsubscribe
Subscribe
# 機器學習 - 簡仁宗 (2022 Fall) ###### tags: `NYCU-2022-Fall` ## Class info. [課程資訊](https://timetable.nycu.edu.tw/?r=main/crsoutline&Acy=111&Sem=1&CrsNo=535373&lang=zh-tw) ![](https://i.imgur.com/3UtMqSb.png) Temporary Grading Policy: Midterm Exam (28%), Final Exam (37%), Homework (35%) [Homework-01 (2022-Fall-ML)](/Ee84tiKUQ5mlrB3v7-gqHw) ## Date ### 9/16 [Chapter 1 ppt](https://lear.inrialpes.fr/~jegou/bishopreadinggroup/chap1.pdf) [Chapter 3 ppt](https://lear.inrialpes.fr/~jegou/bishopreadinggroup/chap3.pdf) ![](https://i.imgur.com/4Z4wjH7.png) ![](https://i.imgur.com/aiCH2MA.png) :::info From chapter 3 ![](https://i.imgur.com/dRJrd1A.png) ::: ![](https://i.imgur.com/DzF7cKd.png) Root Mean Square $E_{RMS}=\sqrt{2E(\rm{w}^{*})/N}$ * Regularization It refers to the act of modifying a learning algorithm to favor “simpler” prediction rules to avoid overfitting. Most commonly, regularization refers to modifying the loss function to penalize certain values of the weights you are learning. ![](https://i.imgur.com/fw8LzsR.png) * Minimize error: $E(w)=\frac{1}{2}\sum^{N}_{i=1}\{y(x_n,w)-t_n\}^{2}$ * Model selection: choosing $M$ * Regularization: $\widetilde{E}(w)=\frac{1}{2}\sum^{N}_{i=1}\{ y(x_n,w)-t_n \}^{2}+\frac{\lambda}{2}\|w\|^{2}$ This can be expressed in the Bayesian framework using maximum likelihood. #### Probability theory (discrete random variables) * Sum rule: $p(X)=\sum_Y p(X,Y)$ * Product rule: $p(X,Y)=p(X|Y)p(Y)=p(Y|X)p(X)$ * Exception: $\mathop{\mathbb{E}}[f]=\sum_x p(x)f(x)$ * Conditional exception: $\mathop{\mathbb{E}}_x[f|y] = \sum_x p(x|y)f(x)$ * Covariance for example $x$ and $y$: $\rm{cov}[x,y]=\mathop{\mathbb{E}_{x,y}}[xy]-\mathop{\mathbb{E}}[x]\mathop{\mathbb{E}}[y]$ * Variance: $\rm{var}[f]=\mathop{\mathbb{E}}[(f(x)-\mathop{\mathbb{E}}[f(x)])^2]$ * Bayes: $P(W|D)=\frac{P(D|W)P(W)}{P(D)}$ * 事後機率: 是在考慮和給出相關證據或數據後所得到的條件機率。 $posterior = \frac{likekihood × prior}{normalization}$ :::info $P(D)$: evidence $P(W|D)$: posterior $P(D|W)$: likeihood function 它表达了在不同的参数向量w下,观测数据出现的可能性的⼤⼩ $P(W)$: prior ::: #### Probability densities (continuous random variables) * cumulative distribution function: $P(z)=p(x \in (-\infty, z))$ 频率学家⼴泛使⽤的⼀个估计是最⼤似然(maximum likelihood)估计,其中w的值是使似 然函数p(D | w)达到最⼤值的w值。这对应于选择使观察到的数据集出现概率最⼤的w的值。 在机器学习的⽂献中,似然函数的负对数被叫做误差函数(error function)。由于负对数是单调递减的函数,最⼤化似然函数等价于最⼩化误差函数。 ![](https://i.imgur.com/RM7yZAx.jpg) ![](https://i.imgur.com/lGsFeFL.jpg) ![](https://i.imgur.com/YTGYALA.jpg) ### 9/23 ![](https://i.imgur.com/9ucapK4.png) * [Fully Bayesian approach](https://stats.stackexchange.com/questions/31849/fully-bayesian-vs-bayesian) ![](https://i.imgur.com/MpjAi4t.png) :::info $α$ is the precision of the distribution (分布⽅差的倒数) $β$ is the Gaussian conditional distribution (分布的精度) Regularization parameter given by $λ = α/β$ ::: * [K-folder cross-vailation](https://ithelp.ithome.com.tw/articles/10197461) > Not all the intuitions developed in spaces of low dimensionality will generalize to spaces of many dimensions * Minimizing the misclassification rate $p(C_k | x)$ ![](https://i.imgur.com/xC435pK.png) ![](https://i.imgur.com/fTJf43j.png) ![](https://i.imgur.com/QcMwyZw.png) * Minimizing the expected loss ($L$ means loss function) ![](https://i.imgur.com/eyqUbCM.png) * Loss functions for regression ![](https://i.imgur.com/Ik9lo3q.png) ![](https://i.imgur.com/XQNWOuW.png) ![](https://i.imgur.com/WLMvZZ3.png) * Relative entropy and mutual information * Lagrange multipliers ### 9/30 $KL(p \| q) = - \int p(x)ln \ q(x)dx - (\int p(x)ln \ p(x) dx) = - \int p(x) ln \{ \frac{q(x)}{p(x)}\}dx$ $KL(q \| p) = - \int q(x)ln \ p(x)dx - (\int q(x)ln \ q(x) dx) = - \int q(x) ln \{ \frac{p(x)}{q(x)}\}dx$ $KL(p\|q) \neq KL(q\|p)$ * [Why KL divergence is non-negative?](https://stats.stackexchange.com/questions/335197/why-kl-divergence-is-non-negative) * [Proof of nonnegativity of KL divergence using Jensen's inequality](https://math.stackexchange.com/questions/2031062/proof-of-nonnegativity-of-kl-divergence-using-jensens-inequality) :::info [**Forward and Reverse KL**](https://dibyaghosh.com/blog/probability/kldivergence.html) ![](https://i.imgur.com/nJ399Cp.png) ![](https://i.imgur.com/4l4dkjM.png) ::: * mutual information --- ||Discrete|Continuous| |---|---|---| |Observation (likelihood) $P(D\|W)$|Binomial / Multinomial|Gaussian| |parameter|$p \ ,(1-p)$ / $\{P_i\}^M_{i=1}$|$\mu \ , \sigma^{2}$| |prior $P(W)$|beta / Dirichlet|Gaussian / gamma| |posterior $P(W\|D)$|beta / Dirichlet|Gaussian / gamma| * Binomial distribution $$ \rm{Bin}(m | N, \mu) = \begin{pmatrix}N\\m\end{pmatrix} \mu^{m}(1-\mu)^{N-m} $$ * Gamma $$ \Gamma(x) \equiv \int_0^{\infty} u^{x-1} e^{-u} \mathrm{~d} u $$ * Beta ![](https://i.imgur.com/GnpJzbt.png) ![](https://i.imgur.com/6yEkUkN.png) ![](https://i.imgur.com/x7yx4kl.png) ![](https://i.imgur.com/hQ98DrN.png) ### 10/7 ![](https://i.imgur.com/Ibx5dYs.png) ![](https://i.imgur.com/PqxZnag.png) ![](https://i.imgur.com/ZPBL3SV.png) --- :::info 2.3.1 条件⾼斯分布 ::: * 多元⾼斯分布的⼀个重要性质是,如果两组变量是联合⾼斯分布,那么以⼀组变量为条件,另⼀组变量同样是⾼斯分布。类似地,任何⼀个变量的边缘分布也是⾼斯分布。 ![](https://i.imgur.com/kZ348x6.png) ![](https://i.imgur.com/sZ3AdyL.png) ![](https://i.imgur.com/pBfNoMA.png) :::info 2.3.2 边缘⾼斯分布 ::: ![](https://i.imgur.com/lAfrIWh.png) ![](https://i.imgur.com/JurJL2B.png) ![](https://i.imgur.com/H1MhAt6.png) * 边缘概率分布 $$ p(\textbf{x}_a) = \cal{N}(\textbf{x}_a | \mu_a, \sum {}_{aa}) $$ :::info 2.3.4 ⾼斯分布的最⼤似然估计 ::: ![](https://i.imgur.com/Pd4EYWO.png) :::info 2.3.5 顺序估计 ::: ![](https://i.imgur.com/IjSc0IS.png) ![](https://i.imgur.com/ta2HU44.png) * Robbins-Monro ![](https://i.imgur.com/rz6RrOB.png) ### 10/14 :::info 2.3.6 ⾼斯分布的贝叶斯推断 ::: :::info 2.3.7 学⽣t分布 ::: :::info 2.3.9 混合⾼斯模型 ::: ![](https://i.imgur.com/qVgOTka.png) ![](https://i.imgur.com/XO6vKO5.png) :::info 2.4 指数族分布 ::: 本章中研究的概率分布(⾼斯混合分布除外)都是⼀⼤类被称为指数族(exponential family)分布的概率分布的具体例⼦。 ![](https://i.imgur.com/fqzD7RT.png) ![](https://i.imgur.com/srTuOCM.png) ![](https://i.imgur.com/EzlfLDg.png) ![](https://i.imgur.com/rSRs16d.png) :::info 2.4.2 共轭先验 ::: ![](https://i.imgur.com/YhSVwYS.png) :::info 2.4.3 ⽆信息先验 ::: * 平移不变性(translation invariance) * 缩放不变性(scale invariance) :::info 2.5 ⾮参数化⽅法 ::: * 密度估计的直⽅图⽅法: 具有下⾯的性质:⼀旦直⽅图被计算出来,数据本⾝就被丢弃了,这当数据量很⼤的时候会很有优势。并且,直⽅图⽅法也很容易应⽤到数据顺序到达的情形。 ![](https://i.imgur.com/kEjn2J0.png) :::info 2.5.1 核密度估计 ::: ![](https://i.imgur.com/N7zWqav.png) :::info 2.5.2 近邻⽅法 ::: ![](https://i.imgur.com/8eZHRCN.png) ![](https://i.imgur.com/kJFbhHi.png) ![](https://i.imgur.com/qDSv2iV.png) --- :::info 3.1 线性基函数模型 ::: ![](https://i.imgur.com/hGG8Vd8.png) ![](https://i.imgur.com/7ecZAgy.png) ![](https://i.imgur.com/kFxyUDP.png) ![](https://i.imgur.com/5NUpBSw.png) :::info Feel free to update course content Suggest to read textbook with chinese version for preparing midterm The note for the course just copy and paste from the textbook, so I won't update anymore, but maybe future :P ::: ## Cheat sheet for midterm (but only include 3 chapters, which from chapter 1 ~ chapter 3) {%pdf https://docdro.id/snPwyw4%} ## Reference [原文書電子檔](https://www.microsoft.com/en-us/research/uploads/prod/2006/01/Bishop-Pattern-Recognition-and-Machine-Learning-2006.pdf) [Reading Group Slide](https://lear.inrialpes.fr/~jegou/bishopreadinggroup/) [PRML中文版_模式识别与机器学习.pdf](https://github.com/wwkenwong/book/blob/master/PRML%E4%B8%AD%E6%96%87%E7%89%88_%E6%A8%A1%E5%BC%8F%E8%AF%86%E5%88%AB%E4%B8%8E%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0.pdf)

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