<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="https://wangren09.github.io/feed.xml" rel="self" type="application/atom+xml" /><link href="https://wangren09.github.io/" rel="alternate" type="text/html" /><updated>2026-11-22T08:31:43-08:00</updated><id>https://wangren09.github.io/feed.xml</id><title type="html">Ren Wang</title><subtitle>Assistant Professor</subtitle><author><name>Ren Wang</name></author><entry><title type="html">Systems for ML</title><link href="https://wangren09.github.io/posts/2019/04/blog-post-2/" rel="alternate" type="text/html" title="Systems for ML" /><published>2019-04-13T00:00:00-07:00</published><updated>2019-04-13T00:00:00-07:00</updated><id>https://wangren09.github.io/posts/2019/04/blog-post-2</id><content type="html" xml:base="https://wangren09.github.io/posts/2019/04/blog-post-2/"><![CDATA[<p><a href="http://dlsys.cs.washington.edu/">CSE 599W: Systems for ML</a> by Tianqi Chen, Haichen Shen, and Arvind Krishnamurthy at University of Washington.</p>

<p><a href="http://dlsys.cs.washington.edu/pdf/lecture1.pdf">Lecture 1: Introduction to Deep Learning</a></p>

<p>Not about Learning aspect of Deep Learning (except for the first two); System aspect of deep learning: faster training, efficient serving, lower memory consumption.</p>

<p><a href="http://dlsys.cs.washington.edu/pdf/lecture3.pdf">Lecture 3: Components Overview of Deep Learning System</a></p>

<p>Typical Deep Learning System Stack</p>

<p>User API: Programming API; Gradient Calculation (Differentiation API)</p>

<p>System Components: Computational Graph Optimization and Execution; Runtime Parallel Scheduling</p>

<p>Architecture: GPU Kernels, Optimizing Device Code; Accelerators and Hardwares</p>

<p><a href="http://dlsys.cs.washington.edu/pdf/lecture4.pdf">Lecture 4: Backprop and Automatic Differentiation</a></p>

<p>Numerical differentiation</p>

<ul>
  <li>Tool to check the correctness of implementation</li>
</ul>

<p>Backpropagation</p>

<ul>
  <li>Easy to understand and implement</li>
  <li>Bad for memory use and schedule optimization</li>
</ul>

<p>Automatic differentiation</p>

<ul>
  <li>Generate gradient computation to entire computation graph</li>
  <li>Better for system optimization</li>
</ul>

<p><a href="http://dlsys.cs.washington.edu/pdf/lecture5.pdf">Lecture 5: Hardware backends: GPU</a></p>

<p>Tips for high performance</p>

<ul>
  <li>Use existing libraries, which are highly optimized, e.g. cublas, cudnn.</li>
  <li>Use nvprof or nvvp (visual profiler) to debug the performance.</li>
  <li>Use high level language to write GPU kernels.</li>
</ul>

<p><a href="http://dlsys.cs.washington.edu/pdf/lecture6.pdf">Lecture 6: Optimize for hardware backends</a></p>

<p>Optimizations = Too Many Variant of Operators</p>

<ul>
  <li>Different tiling patterns</li>
  <li>Different fuse patterns</li>
  <li>Different data layout</li>
  <li>Different hardware backends</li>
</ul>]]></content><author><name>Ren Wang</name></author><category term="Machine Learning" /><category term="Deep Learning" /><summary type="html"><![CDATA[CSE 599W: Systems for ML by Tianqi Chen, Haichen Shen, and Arvind Krishnamurthy at University of Washington.]]></summary></entry><entry><title type="html">Deep Learning Specialization</title><link href="https://wangren09.github.io/posts/2019/04/blog-post-1/" rel="alternate" type="text/html" title="Deep Learning Specialization" /><published>2019-04-01T00:00:00-07:00</published><updated>2019-04-01T00:00:00-07:00</updated><id>https://wangren09.github.io/posts/2019/04/blog-post-1</id><content type="html" xml:base="https://wangren09.github.io/posts/2019/04/blog-post-1/"><![CDATA[<p><a href="https://www.deeplearning.ai/deep-learning-specialization/">Deep Learning Specialization</a> by deeplearning.ai on Coursera.</p>

<div align="center">
<img src="/images/DL_0.png" />
</div>

<p><br /></p>

<p><a href="https://www.coursera.org/learn/neural-networks-deep-learning">Neural Networks and Deep Learning</a> by deeplearning.ai on Coursera.</p>

<div align="center">
<img src="/images/DL_1.png" />
</div>

<p><br /></p>

<p><a href="https://www.coursera.org/learn/deep-neural-network">Improving Deep Neural Networks: Hyperparameter tuning, Regularization and Optimization</a> by deeplearning.ai on Coursera.</p>

<div align="center">
<img src="/images/DL_2.png" />
</div>

<p><br /></p>

<p><a href="https://www.coursera.org/learn/machine-learning-projects">Structuring Machine Learning Projects</a> by deeplearning.ai on Coursera.</p>

<div align="center">
<img src="/images/DL_3.png" />
</div>

<p><br /></p>

<p><a href="https://www.coursera.org/learn/convolutional-neural-networks">Convolutional Neural Networks</a> by deeplearning.ai on Coursera.</p>

<div align="center">
<img src="/images/DL_4.png" />
</div>

<p><br /></p>

<p><a href="https://www.coursera.org/learn/nlp-sequence-models">Sequence Models</a> by deeplearning.ai on Coursera.</p>

<div align="center">
<img src="/images/DL_5.png" />
</div>]]></content><author><name>Ren Wang</name></author><category term="Machine Learning" /><category term="Deep Learning" /><category term="CNN" /><category term="RNN" /><summary type="html"><![CDATA[Deep Learning Specialization by deeplearning.ai on Coursera.]]></summary></entry><entry><title type="html">AI For Everyone</title><link href="https://wangren09.github.io/posts/2019/03/blog-post-2/" rel="alternate" type="text/html" title="AI For Everyone" /><published>2019-03-29T00:00:00-07:00</published><updated>2019-03-29T00:00:00-07:00</updated><id>https://wangren09.github.io/posts/2019/03/blog-post-2</id><content type="html" xml:base="https://wangren09.github.io/posts/2019/03/blog-post-2/"><![CDATA[<p><a href="https://www.coursera.org/learn/ai-for-everyone">AI For Everyone</a> by deeplearning.ai on Coursera.</p>

<p>It provides a big picture of AI, and it is interesting to learn AI from a different perspective.</p>]]></content><author><name>Ren Wang</name></author><category term="AI" /><category term="Machine Learning" /><category term="Deep Learning" /><summary type="html"><![CDATA[AI For Everyone by deeplearning.ai on Coursera.]]></summary></entry><entry><title type="html">Deep Unsupervised Learning</title><link href="https://wangren09.github.io/posts/2019/03/blog-post-1/" rel="alternate" type="text/html" title="Deep Unsupervised Learning" /><published>2019-03-07T00:00:00-08:00</published><updated>2019-03-07T00:00:00-08:00</updated><id>https://wangren09.github.io/posts/2019/03/blog-post-1</id><content type="html" xml:base="https://wangren09.github.io/posts/2019/03/blog-post-1/"><![CDATA[<p><a href="https://sites.google.com/view/berkeley-cs294-158-sp19/home">CS294-158 Deep Unsupervised Learning</a> by Pieter Abbeel at University of California, Berkeley.</p>

<p>Week 1 (1/30):</p>

<ol>
  <li>Lecture 1a: Logistics</li>
  <li>Lecture 1b: Motivation</li>
  <li>Lecture 1c: Likelihood-based Models Part I: Autoregressive Models</li>
</ol>

<iframe width="560" height="315" src="https://www.youtube.com/embed/zNmvH6OXDpk" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe>

<p><br /></p>

<p><br /></p>

<p>Week 2 (2/6):</p>

<ol>
  <li>Lecture 2a: Likelihood-based Models Part I: Autoregressive Models (ctd) (same slides as week 1)</li>
  <li>Lecture 2b: Lossless Compression</li>
  <li>Lecture 2c: Likelihood-based Models Part II: Flow Models</li>
</ol>

<iframe width="560" height="315" src="https://www.youtube.com/embed/mYCLVPRy2nc" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe>

<p><br /></p>

<p><br /></p>

<p>Week 3 (2/13):</p>

<ol>
  <li>Lecture 3a: Likelihood-based Models Part II: Flow Models (ctd) (same slides as week 2)</li>
  <li>Lecture 3b: Latent Variable Models - part 1</li>
</ol>

<iframe width="560" height="315" src="https://www.youtube.com/embed/NCRzGmM1ywE" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe>

<p><br /></p>

<p><br /></p>]]></content><author><name>Ren Wang</name></author><category term="Machine Learning" /><category term="Deep Learning" /><category term="Unsupervised Learning" /><summary type="html"><![CDATA[CS294-158 Deep Unsupervised Learning by Pieter Abbeel at University of California, Berkeley.]]></summary></entry><entry><title type="html">Applied Machine Learning</title><link href="https://wangren09.github.io/posts/2019/02/blog-post-5/" rel="alternate" type="text/html" title="Applied Machine Learning" /><published>2019-02-20T00:00:00-08:00</published><updated>2019-02-20T00:00:00-08:00</updated><id>https://wangren09.github.io/posts/2019/02/blog-post-1</id><content type="html" xml:base="https://wangren09.github.io/posts/2019/02/blog-post-5/"><![CDATA[<p><a href="https://www.cs.columbia.edu/~amueller/comsw4995s19/">COMS W4995 Applied Machine Learning</a> by Andreas C. Müller at Columbia University.</p>

<p>01/23/19	Introduction</p>

<iframe width="560" height="315" src="https://www.youtube.com/embed/Qd68h4UGlNY" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe>

<p><br /></p>

<p>Conda is a packaging tool and installer that aims to do more than what pip does; handle library dependencies outside of the Python packages as well as the Python packages themselves. Conda also creates a virtual environment, like virtualenv does.</p>

<p><br /></p>

<p>01/28/19	git, GitHub and testing</p>

<iframe width="560" height="315" src="https://www.youtube.com/embed/EPVwnG-n4B0" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe>

<p><br /></p>

<table>
  <thead>
    <tr>
      <th>Usage</th>
      <th>Git command</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Changes between working directory and what was last staged</td>
      <td>git diff</td>
    </tr>
    <tr>
      <td>Changes between staging area and last commit</td>
      <td>git diff –staged</td>
    </tr>
    <tr>
      <td>Current Version (most recent commit)</td>
      <td>HEAD</td>
    </tr>
    <tr>
      <td>Version before current</td>
      <td>HEAD~1</td>
    </tr>
    <tr>
      <td>Changes made in the last commit</td>
      <td>git diff HEAD~1</td>
    </tr>
    <tr>
      <td>Changes made in the last 2 commits</td>
      <td>git diff HEAD~2</td>
    </tr>
    <tr>
      <td> </td>
      <td>git log –online –decorate –all –graph</td>
    </tr>
    <tr>
      <td>moves HEAD to <commit> (takes the current branch with it)</commit></td>
      <td>git reset –soft <commit></commit></td>
    </tr>
    <tr>
      <td>moves HEAD to <commit>, changes index to be at <commit> (but not working directory)</commit></commit></td>
      <td>git reset –mixed <commit></commit></td>
    </tr>
    <tr>
      <td>moved HEAD to <commit>, changes index and working tree to <commit></commit></commit></td>
      <td>git reset –hard <commit></commit></td>
    </tr>
  </tbody>
</table>

<p>Unit tests – function does the right thing.</p>

<p>Integration tests – system / process does the right thing.</p>

<p>Non-regression tests – bug got removed (and will not be reintroduced).</p>

<p><br /></p>

<p>01/30/19	matplotlib and visualization</p>

<iframe width="560" height="315" src="https://www.youtube.com/embed/O2zXpQmij_c" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe>

<p><br /></p>

<p><code class="language-plaintext highlighter-rouge">import matplotlib.pyplot as plt</code></p>

<p><code class="language-plaintext highlighter-rouge">ax = plt.gca() # get current axes</code></p>

<p><code class="language-plaintext highlighter-rouge">fig = plt.gcf() # get current figure</code></p>

<p><br /></p>

<p>02/04/19	Introduction to supervised learning</p>

<iframe width="560" height="315" src="https://www.youtube.com/embed/MEEWqrJEtTg" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe>

<p><br /></p>

<table>
  <thead>
    <tr>
      <th>Naive Nearest Neighbor</th>
      <th>Kd-tree Nearest Neighbor</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>fit: no time</td>
      <td>fit: O(p * n log n)</td>
    </tr>
    <tr>
      <td>memory: O(n * p)</td>
      <td>memory: O(n * p)</td>
    </tr>
    <tr>
      <td>predict: O(n * p)</td>
      <td>predict: O(k * log(n)) FOR FIXED p!</td>
    </tr>
    <tr>
      <td>n=n_samples</td>
      <td>p=n_features</td>
    </tr>
  </tbody>
</table>

<p>Parametric model: Number of “parameters” (degrees of freedom) independent of data.</p>

<p>Non-parametric model: Degrees of freedom increase with more data.</p>

<p><br /></p>

<p>02/06/19	Preprocessing</p>

<iframe width="560" height="315" src="https://www.youtube.com/embed/9rBc3rTsJsY" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe>

<p><br /></p>

<p><code class="language-plaintext highlighter-rouge">est.fit_transform(X) == est.fit(X).transform(X) # mostly</code></p>

<p><code class="language-plaintext highlighter-rouge">est.fit_predict(X) == est.fit(X).predict(X) # mostly</code></p>

<p>For high cardinality categorical features, we can use target-based encoding.</p>

<p>Power Transformation:</p>

<p>\begin{equation}
bc_{\lambda}(x) =
\begin{cases} 
\frac{x^{\lambda}-1}{\lambda},  &amp; \mbox{if }\lambda \neq 0 \newline
\log(x), &amp; \mbox{if }\lambda = 0
\end{cases}
\end{equation}</p>

<p>Only applicable for positive x!</p>

<p><br /></p>

<p>02/11/19	Linear models for Regression</p>

<iframe width="560" height="315" src="https://www.youtube.com/embed/3cZ_ScHonsI" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe>

<p><br /></p>

<p>Imputation Methods:</p>

<ol>
  <li>Mean/Median</li>
  <li>kNN</li>
  <li>Regression models</li>
  <li>Matrix factorization</li>
</ol>

<p>Coefficient of determination $R^2$:</p>

<p>$R^2 (y, y’) = 1 - \sum_{i=0}^{n-1}(y_i-y’<em>i)^2 / \sum</em>{i=0}^{n-1}(y_i-\bar{y})^2$</p>

<p>$\bar{y} = \frac{1}{n}\sum_{i=0}^{n-1}y_i$</p>

<p>Can be negative for biased estimators - or the test set!</p>

<p>Ridge Regression:</p>

<p>$\min_{w \in \mathbb{R}^p, b \in \mathbb{R}} \sum_{i=1}^n |w^Tx_{i} + b - y_i|^2 + \alpha_2|w|_2^2$</p>

<p>Lasso Regression:</p>

<p>$\min_{w \in \mathbb{R}^p, b \in \mathbb{R}} \sum_{i=1}^n |w^Tx_{i} + b - y_i|^2 + \alpha_1|w|_1$</p>

<p>Elastic Net:</p>

<p>$\min_{w \in \mathbb{R}^p, b \in \mathbb{R}} \sum_{i=1}^n |w^Tx_{i} + b - y_i|^2 + \alpha_1|w|_1 + \alpha_2|w|_2^2$</p>

<p><br /></p>

<p>02/13/19	Linear models for Classification, SVMs</p>

<iframe width="560" height="315" src="https://www.youtube.com/embed/MRfLSgJyfpQ" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe>

<p><br /></p>

<p>Logistic Regression:</p>

<p>$\min_{w \in \mathbb{R}^p, b \in \mathbb{R}} -\sum_{i=1}^n \log(\exp(-y_i(w^Tx_i+b))+1)$</p>

<p>Penalized Logistic Regression:</p>

<p>$\min_{w \in \mathbb{R}^p, b \in \mathbb{R}} -C\sum_{i=1}^n \log(\exp(-y_i(w^Tx_i+b))+1) + |w|_2^2$</p>

<p>$\min_{w \in \mathbb{R}^p, b \in \mathbb{R}} -C\sum_{i=1}^n \log(\exp(-y_i(w^Tx_i+b))+1) + |w|_1$</p>

<p>(Soft Margin) Linear SVM</p>

<p>$\min_{w \in \mathbb{R}^p, b \in \mathbb{R}} C\sum_{i=1}^n \max(0, 1-y_i(w^Tx_i+b)) + |w|_2^2$</p>

<p>$\min_{w \in \mathbb{R}^p, b \in \mathbb{R}} C\sum_{i=1}^n \max(0, 1-y_i(w^Tx_i+b)) + |w|_1$</p>

<table>
  <thead>
    <tr>
      <th>One vs Rest</th>
      <th>One vs One</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>nclasses classifiers</td>
      <td>nclasses*(nclasses-1)/2 classifiers</td>
    </tr>
    <tr>
      <td>trained on imbalanced datasets of original size</td>
      <td>trained on balanced subsets</td>
    </tr>
    <tr>
      <td>retains some uncertainty</td>
      <td>No uncertainty propagated</td>
    </tr>
  </tbody>
</table>

<p>Multinomial Logistic Regression</p>

<p>$\min_{w \in \mathbb{R}^p, b \in \mathbb{R}} -\sum_{i=1}^n \log(p(y=y_i \mid x_i, w, b))$</p>

<p>$p(y=i \mid x) = \frac{e^{w^T_ix+b_i}}{\sum_{j=1}^ne^{w^T_jx+b_j}}$</p>

<p>Kernel SVM: Read the book!</p>

<p><br /></p>

<p>02/18/19	Trees, Forests &amp; Ensembles</p>

<iframe width="560" height="315" src="https://www.youtube.com/embed/_FBgcCbAvig" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe>

<p><br /></p>

<p>Trees are similar to Nearest Neighbors.</p>

<p>Trees and Nearest Neighbors can not extrapolate.</p>

<p>Trees are not stable.</p>

<p>Bagging (Bootstrap AGGregation): Generic way to build “slightly different” models.</p>

<p>Generalization in Ensembles depend on strength of the individual classifiers and (inversely) on their correlation; Uncorrelating them might help, even at the expense of strength.</p>

<p>Randomize in two ways in Random Forest:</p>

<ol>
  <li>
    <p>For each tree: pick bootstrap sample of data</p>
  </li>
  <li>
    <p>For each split: pick random sample of features</p>
  </li>
</ol>

<p><br /></p>

<p>02/20/19	Gradient Boosting, Calibration</p>

<iframe width="560" height="315" src="https://www.youtube.com/embed/OC3qmxGh2gc" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe>

<p><br /></p>

<p>Gradient Boosting Algorithm:</p>

<p>$f_1(x) \approx y$</p>

<p>$f_2(x) \approx y - \gamma f_1(x)$</p>

<p>$f_3(x) \approx y - \gamma f_1(x) - \gamma f_2(x)$</p>

<p>Learning rate: $\gamma$</p>

<p>Gradient Boosting Advantages:</p>

<ol>
  <li>
    <p>slower to train than RF, but much faster to predict</p>
  </li>
  <li>
    <p>very fast using XGBoost, LightGBM, pygbm ……</p>
  </li>
  <li>
    <p>small model size</p>
  </li>
  <li>
    <p>usually more accurate than Random Forests</p>
  </li>
</ol>

<p>When to use tree-based models:</p>

<ol>
  <li>
    <p>Model non-linear relationships</p>
  </li>
  <li>
    <p>Doesn’t care about scaling, no need for feature engineering</p>
  </li>
  <li>
    <p>Single tree: very interpretable (if small)</p>
  </li>
  <li>
    <p>Random forests very robust, good benchmark</p>
  </li>
  <li>
    <p>Gradeint boosting often best performance with careful tuning</p>
  </li>
</ol>

<p>Calibration curve</p>

<p>Brier Score (for binary classification): “mean squared error of probability estimate”</p>

<p>$BS = \sum_{i=1}^n (p(y_i)-y_i)^2 / n$ (measure both calibration and accuracy)</p>

<p>Calibrating a classifier:</p>

<ol>
  <li>
    <p>Platt Scaling: $f_{platt} = \frac{1}{1+\exp(-ws(x)-b)}$</p>
  </li>
  <li>
    <p>Isotonic Regression: Learn monotonically increasing step function in 1d.</p>
  </li>
</ol>

<p><br /></p>

<p>02/25/19	Model Evaluation</p>

<iframe width="560" height="315" src="https://www.youtube.com/embed/EUiIydNBIbE" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe>

<p><br /></p>

<p>confusion matrix:</p>

<table>
  <thead>
    <tr>
      <th> </th>
      <th> </th>
      <th> </th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>negative class</td>
      <td>TN</td>
      <td>FP</td>
    </tr>
    <tr>
      <td>positive class</td>
      <td>FN</td>
      <td>TP</td>
    </tr>
    <tr>
      <td> </td>
      <td>predicted negative</td>
      <td>predicted positive</td>
    </tr>
  </tbody>
</table>

<p>$Accuracy = \frac{TP+TN}{TP+TN+FP+FN}$</p>

<p>$Precision = \frac{TP}{TP+FP}$</p>

<p>$Recall = \frac{TP}{TP+FN}$</p>

<p>$F = 2\frac{precision \times recall}{precision+recall}$</p>

<p>Precision-Recall curve: (x-axis Recall; y-axis Precision)</p>

<p>Average Precision:</p>

<p>$AveP = \sum_{k=1}^n P(k)\triangle r(k)$</p>

<p>$FPR = \frac{FP}{FP+TN}$</p>

<p>$TPR = \frac{TP}{TP+FN}$</p>

<p>ROC curve: (x-axis FPR; y-axis TPR)</p>

<p>ROC AUC: Area under ROC Curve (Always 0.5 for random/constant prediction)</p>

<p><br /></p>

<p>03/04/19	Learning with Imbalanced Data</p>

<iframe width="560" height="315" src="https://www.youtube.com/embed/Eix70D-H5ag" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe>

<p><br /></p>

<p><br /></p>

<p>03/06/19	Model Interpretration and Feature Selection</p>

<iframe width="560" height="315" src="https://www.youtube.com/embed/EQQ5YQibXOI" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe>

<p><br /></p>

<p><br /></p>]]></content><author><name>Ren Wang</name></author><category term="Machine Learning" /><summary type="html"><![CDATA[COMS W4995 Applied Machine Learning by Andreas C. Müller at Columbia University.]]></summary></entry><entry><title type="html">程序设计与算法 Specialization</title><link href="https://wangren09.github.io/posts/2019/01/blog-post-5/" rel="alternate" type="text/html" title="程序设计与算法 Specialization" /><published>2019-01-24T00:00:00-08:00</published><updated>2019-01-24T00:00:00-08:00</updated><id>https://wangren09.github.io/posts/2019/01/blog-post-5</id><content type="html" xml:base="https://wangren09.github.io/posts/2019/01/blog-post-5/"><![CDATA[<p><a href="https://www.coursera.org/learn/jisuanji-biancheng">计算导论与C语言基础</a> by Peking University on Coursera.</p>

<div align="center">
<img src="/images/C_1.png" />
</div>

<p><br /></p>

<p><a href="https://www.coursera.org/learn/c-chengxu-sheji">C程序设计进阶</a> by Peking University on Coursera.</p>

<div align="center">
<img src="/images/C_2.png" />
</div>]]></content><author><name>Ren Wang</name></author><category term="程序设计" /><category term="算法" /><summary type="html"><![CDATA[计算导论与C语言基础 by Peking University on Coursera.]]></summary></entry><entry><title type="html">Natural Language Processing with Deep Learning</title><link href="https://wangren09.github.io/posts/2019/01/blog-post-4/" rel="alternate" type="text/html" title="Natural Language Processing with Deep Learning" /><published>2019-01-21T00:00:00-08:00</published><updated>2019-01-21T00:00:00-08:00</updated><id>https://wangren09.github.io/posts/2019/01/blog-post-4</id><content type="html" xml:base="https://wangren09.github.io/posts/2019/01/blog-post-4/"><![CDATA[<p><a href="https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1174/index.html">CS224n: Natural Language Processing with Deep Learning</a> by Christopher Manning at Stanford University.</p>

<iframe width="560" height="315" src="https://www.youtube.com/embed/OQQ-W_63UgQ" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe>

<p><br /></p>

<p>Why is NLP hard?</p>

<ul>
  <li>
    <p>Complexity in representing, learning and using linguistic/situational/word/visual knowledge</p>
  </li>
  <li>
    <p>Human languages are ambiguous (unlike programming and other formal languages)</p>
  </li>
  <li>
    <p>Human language interpretation depends on real world, common sense, and contextual knowledge</p>
  </li>
</ul>

<p><br /></p>

<iframe width="560" height="315" src="https://www.youtube.com/embed/ERibwqs9p38" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe>

<p><br /></p>

<p>Main idea of word2vec</p>

<p>Two algorithms</p>

<ul>
  <li>
    <p>skip-grams (SG): predict context words given target (position independent)</p>
  </li>
  <li>
    <p>Continuous Bag of Words (CBOW): predict target word from bag-of-words context</p>
  </li>
</ul>

<p>Two (moderately efficient training methods)</p>

<ul>
  <li>
    <p>Hierarchical softmax</p>
  </li>
  <li>
    <p>Negative sampling</p>
  </li>
</ul>

<p>$J(\theta) = -\frac{1}{T}\sum_{t=1}^T \sum_{-m \le j \le m, j \neq 0} \log p(w_{t+j} \mid w_{t})$</p>

<p>$p(o \mid c) = \frac{\exp (u_o^T v_c)}{\sum_{w=1}^V \exp (u_w^T v_c)}$</p>

<p><br /></p>

<iframe width="560" height="315" src="https://www.youtube.com/embed/ASn7ExxLZws" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe>

<p><br /></p>

<p>Negative sampling: train binary logistic regressions for a true pair (center word and word in its context window) versus a couple of noise pairs (the center word paired with a random word)</p>

<p>The skip-gram model with negative sampling</p>

<p>$J(\theta) = \frac{1}{T} \sum_{t=1}^T J_t(\theta)$</p>

<p>$J_t(\theta) = \log \sigma(u_o^Tv_c) + \sum_{j \sim P(\omega)} [\log \sigma(-u_j^Tv_c)]$ : maximize probability that real outside word appears, minimize probability that random words appear around center word</p>

<p>GloVe: $J(\theta) = \frac{1}{2} \sum_{i,j=1}^W f(P_{ij})(u_i^Tv_j - \log P_{ij})^2$ Count-based + Direct prediction method</p>

<p><br /></p>

<iframe width="560" height="315" src="https://www.youtube.com/embed/uc2_iwVqrRI" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe>

<p><br /></p>

<p>If you only have a small training dataset, don’t train the word vectors.</p>

<p>If you have a very large dataset, it may work better to train word vectors to the task.</p>

<p>The max-margin loss: $J = \max (0, 1-s+s_c)$</p>

<p>Idea for training objective: make score of true window larger and corrupt window’s score lower (until they’re good enough)</p>

<p><br /></p>

<iframe width="560" height="315" src="https://www.youtube.com/embed/isPiE-DBagM" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe>

<p><br /></p>

<p>Chain rule, Nothing fancy!</p>

<p><br /></p>

<iframe width="560" height="315" src="https://www.youtube.com/embed/PVShkZgXznc" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe>

<p><br /></p>

<p><br /></p>

<iframe width="560" height="315" src="https://www.youtube.com/embed/PicxU81owCs" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe>

<p><br /></p>

<p>TensorFlow = Tensor + Flow</p>

<p><br /></p>

<iframe width="560" height="315" src="https://www.youtube.com/embed/Keqep_PKrY8" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe>

<p><br /></p>

<p><br /></p>

<iframe width="560" height="315" src="https://www.youtube.com/embed/QuELiw8tbx8" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe>

<p><br /></p>

<iframe width="560" height="315" src="https://www.youtube.com/embed/IxQtK2SjWWM" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe>

<p><br /></p>

<iframe width="560" height="315" src="https://www.youtube.com/embed/6_MO12fPC-0" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe>

<p><br /></p>

<iframe width="560" height="315" src="https://www.youtube.com/embed/3MjIkWxXigM" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe>

<p><br /></p>

<iframe width="560" height="315" src="https://www.youtube.com/embed/Lg6MZw_OOLI" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe>

<p><br /></p>

<iframe width="560" height="315" src="https://www.youtube.com/embed/RfwgqPkWZ1w" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe>

<p><br /></p>

<iframe width="560" height="315" src="https://www.youtube.com/embed/rpwEWLaueRk" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe>

<p><br /></p>

<iframe width="560" height="315" src="https://www.youtube.com/embed/T3octNTE7Is" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe>

<p><br /></p>

<iframe width="560" height="315" src="https://www.youtube.com/embed/B4v545V3Dq0" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe>

<p><br /></p>

<iframe width="560" height="315" src="https://www.youtube.com/embed/JYwNmSe4HqE" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe>]]></content><author><name>Ren Wang</name></author><category term="Natural Language Processing" /><category term="Deep Learning" /><summary type="html"><![CDATA[CS224n: Natural Language Processing with Deep Learning by Christopher Manning at Stanford University.]]></summary></entry><entry><title type="html">Launching into Machine Learning</title><link href="https://wangren09.github.io/posts/2019/01/blog-post-3/" rel="alternate" type="text/html" title="Launching into Machine Learning" /><published>2019-01-14T00:00:00-08:00</published><updated>2019-01-14T00:00:00-08:00</updated><id>https://wangren09.github.io/posts/2019/01/blog-post-3</id><content type="html" xml:base="https://wangren09.github.io/posts/2019/01/blog-post-3/"><![CDATA[<p><a href="https://www.coursera.org/learn/launching-machine-learning">Launching into Machine Learning</a> by Google Cloud on Coursera.</p>

<div align="center">
<img src="/images/Launching_into_Machine_Learning.png" />
</div>]]></content><author><name>Ren Wang</name></author><category term="Machine Learning" /><summary type="html"><![CDATA[Launching into Machine Learning by Google Cloud on Coursera.]]></summary></entry><entry><title type="html">How Google does Machine Learning</title><link href="https://wangren09.github.io/posts/2019/01/blog-post-2/" rel="alternate" type="text/html" title="How Google does Machine Learning" /><published>2019-01-13T00:00:00-08:00</published><updated>2019-01-13T00:00:00-08:00</updated><id>https://wangren09.github.io/posts/2019/01/blog-post-2</id><content type="html" xml:base="https://wangren09.github.io/posts/2019/01/blog-post-2/"><![CDATA[<p><a href="https://www.coursera.org/learn/google-machine-learning">How Google does Machine Learning</a> by Google Cloud on Coursera.</p>

<div align="center">
<img src="/images/How_Google_does_Machine_Learning.png" />
</div>]]></content><author><name>Ren Wang</name></author><category term="Machine Learning" /><summary type="html"><![CDATA[How Google does Machine Learning by Google Cloud on Coursera.]]></summary></entry><entry><title type="html">Intro to TensorFlow</title><link href="https://wangren09.github.io/posts/2019/01/blog-post-1/" rel="alternate" type="text/html" title="Intro to TensorFlow" /><published>2019-01-11T00:00:00-08:00</published><updated>2019-01-11T00:00:00-08:00</updated><id>https://wangren09.github.io/posts/2019/01/blog-post-1</id><content type="html" xml:base="https://wangren09.github.io/posts/2019/01/blog-post-1/"><![CDATA[<p><a href="https://www.coursera.org/learn/intro-tensorflow">Intro to TensorFlow</a> by Google Cloud on Coursera.</p>

<div align="center">
<img src="/images/Intro_TensorFlow.png" />
</div>]]></content><author><name>Ren Wang</name></author><category term="TensorFlow" /><summary type="html"><![CDATA[Intro to TensorFlow by Google Cloud on Coursera.]]></summary></entry></feed>