Leetcode 216: Combination Sum III

216. Combination Sum III https://leetcode.com/problems/combination-sum-iii/ Total Accepted: 45842 Total Submissions: 115036 Difficulty: Medium Find all possible combinations of k numbers that add up to a number n, given that only numbers from 1 to 9 can be used and each combination should be a unique set of numbers.   Example 1: Input: k = 3, …

“file pdftex.def” not found on Mac OS

After installing MacTex, I still encountered “File pdftex.def not found” error when compiling a tex file in TexMaker/TexShop. Here is the way to solve it: Download from pdfetx-def package from https://www.ctan.org/pkg/pdftex-def Unzip Copy the unzipped folder to the texlive installation directory. Below is what I used:  sudo cp -R graphics-def /usr/local/texlive/2016/texmf-dist/  

Restricted Boltzmann Machine

In this post, I am going to share with you my understanding in Restricted Boltzmann Machine (RBM). Restricted Boltzmann Machine is a stochastic artificial neural network that learns the probability distribution of input. A stochastic artificial neural network means a structure contains a series of units with values between 0 to 1 that depend on …

Understand “Markov Chain Sampling Methods for Dirichlet Process Mixture Models”

In this post I am going to share my understanding of the paper: Markov Chain Sampling Methods for Dirichlet Process Mixture Models. In chapter 2, it introduces the basic concept of Dirichlet Process Mixture Models. In (2.1), we have: $latex y_i | \theta_i \sim F(\theta_i) \newline \theta_i | G \sim G \newline G \sim DP(G_0, \alpha)$ …

Difference between SARSA and Q-learning

State-Action-Reward-State-Action (SARSA) and Q-learning are two forms of reinforcement learning. The difference of the two methods are discussed in: https://studywolf.wordpress.com/2013/07/01/reinforcement-learning-sarsa-vs-q-learning/ http://stackoverflow.com/questions/6848828/reinforcement-learning-differences-between-qlearning-and-sarsatd http://stats.stackexchange.com/questions/184657/difference-between-off-policy-and-on-policy-learning Let’s explain why Q-learning is called off-policy learning and SARSA is called on-policy learning. Suppose at state $latex s_t$, a method takes action $latex a_t$ which results to land in a new state …

Why the greedy algorithm of maximum weighted matching is a 2-approximation?

This post explains my understanding in a proposed greedy algorithm for the maximum weighted matching problem. The greedy algorithm goes as follows (listed by this paper in Introduction section): It is claimed that the greedy algorithm is a 2 approximation, i.e., greedy result >= 1/2 optimal result. The document where the greedy algorithm is proposed is …

Theano LSTM Code Walk Through

In this post, I am going to explain the code (as much as I can) from theano LSTM tutorial: http://deeplearning.net/tutorial/lstm.html You need to first understand LSTM. Here is an online recommended material: http://colah.github.io/posts/2015-08-Understanding-LSTMs/, in which many beautiful figures are provided to illustrate LSTM step by step. The tutorial aims to predict positive/negative sentiment based on movie reviews …

NLP datasets

Twitter Sentiment Analysis: http://thinknook.com/twitter-sentiment-analysis-training-corpus-dataset-2012-09-22/ Topic classification for news (including Reuters, NewsGroup): http://disi.unitn.it/moschitti/corpora.htm Movie reviews: http://www.cs.cornell.edu/People/pabo/movie-review-data/ Other reviews: http://www.text-analytics101.com/2011/07/user-review-datasets_20.html Twitter Evaluation dataset: http://tweenator.com/index.php?page_id=13 Amazon review: https://snap.stanford.edu/data/web-Amazon.html Amazon review (upon request): https://www.cs.uic.edu/~liub/FBS/sentiment-analysis.html opinmind: https://inclass.kaggle.com/c/si650winter11/data Large movie reviews: http://ai.stanford.edu/~amaas/data/sentiment/