<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.9.3">Jekyll</generator><link href="https://unsuthee.github.io/feed.xml" rel="self" type="application/atom+xml" /><link href="https://unsuthee.github.io/" rel="alternate" type="text/html" /><updated>2023-04-01T00:15:40+00:00</updated><id>https://unsuthee.github.io/feed.xml</id><title type="html">Un (Suthee)’s Official Site</title><subtitle></subtitle><entry><title type="html">Ladder VAE (NIPS’2016)</title><link href="https://unsuthee.github.io/Ladder-VAE/" rel="alternate" type="text/html" title="Ladder VAE (NIPS’2016)" /><published>2018-06-20T00:00:00+00:00</published><updated>2018-06-20T00:00:00+00:00</updated><id>https://unsuthee.github.io/Ladder-VAE</id><content type="html" xml:base="https://unsuthee.github.io/Ladder-VAE/">&lt;p&gt;Ladder VAE is a VAE architecture that can effectively several stochastic layers. The trick is to couple the distribution parameters from the inference and generative networks to better estimate the model’s parameters.&lt;/p&gt;

&lt;h2 id=&quot;the-generative-network-is&quot;&gt;The generative network is:&lt;/h2&gt;

\[P(\textbf{z}) = P(\textbf{z}_L)\prod_{i=1}^{L-1}P(\textbf{z}_i|\textbf{z}_{i+1})\]

&lt;p&gt;Where:&lt;/p&gt;

\[P(\textbf{z}_i|\textbf{z}_{i+1}) = Normal(\textbf{z}_i|\mu_{p,i}(\textbf{z}_{i+1}), \sigma^2_{p,i}(z_{i+1}))\]

&lt;p&gt;and&lt;/p&gt;

\[P(\textbf{z}_L) = Normal(\textbf{z}_L|0, I)\]

&lt;p&gt;The prior \( P(\textbf{z}_L) \) is a standard gaussian.&lt;/p&gt;

&lt;h2 id=&quot;the-inference-network&quot;&gt;The inference network:&lt;/h2&gt;

&lt;p&gt;The key difference is that each stochastic layer calculates the distribution parameters (mean and variance) but does not sample the latent vector from this distribution. The standard VAE will simply draw a sample from the distribution parameters computed by the inference network. However, the Ladder VAE draw the latent vector from:&lt;/p&gt;

\[\sigma_{q,i} = \frac{1}{\hat \sigma^2_{q,i} + \sigma^2_{p,i}}\]

\[\mu_{q,i} = \frac{\hat \mu_{q,i} \hat \sigma^{-2}_{q,i} + \mu_{p,i}\sigma^{-2}_{p,i}}{\hat \sigma^{-2}_{q,i} + \sigma^{-2}_{p,i}}\]

&lt;p&gt;The approximate distribution at layer i is:&lt;/p&gt;

\[q(\textbf{z}_i|\cdot) = Normal(\textbf{z}_i|\mu_{q,i},\sigma^2_{q,i})\]

&lt;p&gt;By coupling the distribution parameters from both inference and generative networks, the Ladder VAE utilizes information from both network for parameter learning.&lt;/p&gt;

&lt;h2 id=&quot;reference&quot;&gt;Reference&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;Sønderby, Casper Kaae, et al. “Ladder variational autoencoders.” Advances in neural information processing systems. 2016.&lt;/li&gt;
&lt;/ul&gt;</content><author><name></name></author><category term="VAE" /><summary type="html">A summery of Ladder VAE.</summary></entry><entry><title type="html">Towards a Neural Statistician (ICLR’17)</title><link href="https://unsuthee.github.io/NeuralStats/" rel="alternate" type="text/html" title="Towards a Neural Statistician (ICLR’17)" /><published>2017-09-28T00:00:00+00:00</published><updated>2017-09-28T00:00:00+00:00</updated><id>https://unsuthee.github.io/NeuralStats</id><content type="html" xml:base="https://unsuthee.github.io/NeuralStats/">&lt;p&gt;One extension of VAE is to add a hierarchy structure. In contrast to the classical VAE which its prior is drawn from a standard Gaussian distribution, Hierarchical VAE (HVAE) learns the prior distribution from the dataset.&lt;/p&gt;

&lt;p&gt;The generative process is:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Draw a dataset prior \( \boldsymbol{c} \sim N(\boldsymbol{0}, \boldsymbol{I}) \)&lt;/li&gt;
  &lt;li&gt;For each data point in the dataset
    &lt;ul&gt;
      &lt;li&gt;Draw a latent vector \( \boldsymbol{z} \sim P(\cdot \mid \boldsymbol{c}) \)&lt;/li&gt;
      &lt;li&gt;Draw a sample \( \boldsymbol{x} \sim P(\cdot \mid \boldsymbol{z}) \)&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The likelihood of the dataset is:&lt;/p&gt;

\[p(D) = \int p(c) ( \prod_{x \in D} \int p(x \mid z;\theta)p(z \mid c;\theta)dz ) dc\]

&lt;p&gt;The paper define the approximate inference network, \( q(z \mid x,c;\phi) \) and \( q(c \mid D; \phi) \) to optimize a variational lowerbound. The single dataset log likelihood lowerboud is:&lt;/p&gt;

\[\mathcal{L}_D = E_{q(c \mid D;\phi)}\big( \sum_{x \in d} E_{q(z \mid c, x; \phi)}( \log p(x \mid z;\theta)) - D_{KL}(q(z \mid c,x;\phi)||p(z \mid c;\theta)) \big) - D_{KL}(q(c \mid D;\phi)||p(c))\]

&lt;p&gt;The statistic network \( q(c \mid D; \phi) \) that approximates the posterior distribution over the context c given the dataset D. Basically, this inference network has an encoder to take each datapoint into a vector \( e_i = E(x_i) \). Then, add a pool layer to aggregate \( e_i \) into a single vector, an element-wise mean is used. The final vector is used to generate parameters of a diagonal Gaussian.&lt;/p&gt;

&lt;p&gt;This model surprisingly works well for many tasks such as topic models, transfer learning, one-shot learning, etc.&lt;/p&gt;

&lt;h2 id=&quot;reference&quot;&gt;Reference&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://arxiv.org/abs/1606.02185&quot;&gt;Towards a Neural Statistician&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content><author><name></name></author><category term="VAE" /><category term="ICLR" /><summary type="html">A summery of Hierarchical VAE model.</summary></entry><entry><title type="html">IRGAN (SIGIR’17)</title><link href="https://unsuthee.github.io/IRGAN/" rel="alternate" type="text/html" title="IRGAN (SIGIR’17)" /><published>2017-06-28T00:00:00+00:00</published><updated>2017-06-28T00:00:00+00:00</updated><id>https://unsuthee.github.io/IRGAN</id><content type="html" xml:base="https://unsuthee.github.io/IRGAN/">&lt;p&gt;This paper uses GANs framework to combine generative and discriminative information retrieval model. It shows a promising result on web search, item recommendations, and Q/A tasks.&lt;/p&gt;

&lt;p&gt;Typically, many relevant models are classified into 2 types:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Generative retrieval model&lt;/strong&gt;: It generates a document given query and relevant score. The model is \( p(d \mid q,r) \).&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Discriminative retrieval model&lt;/strong&gt;: It computes a relevant score for the given query and document pair. The model is \( p(r \mid d, q) \).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The generative model tried to find a connection between document and query. On the other hand, the discriminative model attempts to model the interaction between query and document based on relevance scores.&lt;/p&gt;

&lt;p&gt;Both models have their shortcoming. Many generative models require a predefined data generating story. The wrong assumption will lead to the poor performance. The generative model is usually trying to fit the data to its model without external guidance. Meanwhile, the discriminative model requires a lot of labeled data to be effective, especially for a deep neural network model.&lt;/p&gt;

&lt;p&gt;By train both models using GANs framework, it is now possible to solve their shortcoming. The generative model is now adaptive because the discriminator will reward the generative model when it can create or select good samples. This adaptive guidance from the discriminator is unique in GANs framework and will help the generator learns to pick good samples from the data distribution. At the same time, the discriminator can receive even more training data from the generative model. This is similar to semi-supervised learning where unlabeled data are utilized. Adversarial training allows us to improve both generative and discriminative models via jointly learning through the Adversarial training allows us to improve both generative and discriminative models via jointly learning through the minimax training. The traditional training based on maximum likelihood does not have principle way to allow both models to give each other feedbacks.&lt;/p&gt;

&lt;p&gt;The proposed framework seems to be promising and the results on 3 information retrieval tasks are really good. But I notice that their training procedure requires pretraining. This made me wonder if pre-training is part of the performance boost during testing. I don’t find the part in the paper that explains the benefit of pretraining in their settings.&lt;/p&gt;

&lt;p&gt;The discriminative model is straight forward. It is a sigmoid function. The discriminator basically gives a high probability when the given document-query pair is relevant. The generative model is more interesting. In the standard GANs, the generator will create a sample from a simple distribution, but IRGAN does not generate a new document-query pair. Instead, the author chose to let the generator select the sample from the document pool. In my opinion, this approach is simpler than creating a new data because the sample is realistic. Also, IRGAN cares about finding a function to compute a relevance score so it is unnecessary to generate a completely new data.&lt;/p&gt;

&lt;p&gt;However, the cost function for the generator is an expectation over all documents in the corpus. The Monte Carlo approximation will have a high variance. Thus, they use policy gradient to reduce the variance so that the model can learn a useful representation. Although \( p(d \mid q,r) \) is a discrete distribution, the backprop is applicable because we pre-sample all documents from \( p(d \mid q,r) \) beforehand. Thus, eq.5 is differentiable. The extra care may need in order to reduce variance further. They use an advantage function. (Please look at the reference on Reinforcement Learning [2]).&lt;/p&gt;

&lt;p&gt;Generating positive and negative samples are still confusing in this paper. It seems to be application specific. The author mentioned about using softmax with temperature hyper-parameter to put more or less focus on top documents. My guess is when we put less focus on top documents, the generator has more chance to pick up more negative samples. After I read the paper again, it seems that all samples selected by the generator model are negative samples. This part remains unclear and I need to ask the author for more details.&lt;/p&gt;

&lt;p&gt;In conclusion, I like this paper because it tried to combine generative and discriminative retrieval models via GANs framework. The paper has a good motivation and discussed the advantage of jointly train both models. It seems adversarial training is useful for IR tasks as well.&lt;/p&gt;

&lt;h2 id=&quot;references&quot;&gt;References:&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;Jun Wang, Lantao Yu, Weinan Zhang, Yu Gong, Yinghui Xu, Benyou Wang, Peng Zhang, and Dell Zhang. 2017. IRGAN: A Minimax Game for Unifying Generative and Discriminative Information Retrieval Models. In Proceedings of SIGIR’17, Shinjuku, Tokyo, Japan, August 7-11, 2017, 10 pages.&lt;/li&gt;
  &lt;li&gt;Richard S Sutton, David A McAllester, Satinder P Singh, Yishay Mansour, and others. 1999. Policy Gradient Methods for Reinforcement Learning with Function Approximation. In NIPS.&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://lantaoyu.com/publications/IRGAN&quot;&gt;IRGAN code&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content><author><name></name></author><category term="GANs" /><category term="IR" /><category term="SIGIR" /><summary type="html">A summery of IRGAN framework.</summary></entry><entry><title type="html">LDA2Vec</title><link href="https://unsuthee.github.io/LDA2vec/" rel="alternate" type="text/html" title="LDA2Vec" /><published>2017-06-28T00:00:00+00:00</published><updated>2017-06-28T00:00:00+00:00</updated><id>https://unsuthee.github.io/LDA2vec</id><content type="html" xml:base="https://unsuthee.github.io/LDA2vec/">&lt;p&gt;The topic is interpretable by collecting all nearby word vectors to the selected topic vector. This work boosts word2vec with topic modeling via training in the similar fashion to word2vec.&lt;/p&gt;

&lt;p&gt;The key difference of LDA2Vec is its loss function. There are 2 loss functions: the first one is Skipgram Negative Sampling Loss which is similar to Word2Vec. It wants to maximize the probability of predicting a target word \( \vec w_j \) and non-target word (negative samples) given a context vector \( \vec c_j \). This loss wants the model to distinguish a positive word (which related to the given context) from negative sampled words.&lt;/p&gt;

&lt;p&gt;The innovation is the context vector \( \vec c_j \). The intuition is that predict a nearby word given a pivot word also depends on the theme of the context. For example, if the document is about an airline when we want to predict nearby words given a word “Germany”, we will likely want to see word related to airlines but not country names. Thus, a context vector is a sum of a word vector and document vector. \( \vec c_j = \vec w_j + \vec d_j \). Thus, LDA2vec attempts to capture both document-wide relationship and local interaction between words within its context window.&lt;/p&gt;

&lt;p&gt;In order to learn a topic vector, the document is further decomposed as a linear combination of topic vectors. \( \vec d_j = \sum_{k} p_{jk} \cdot \vec t_k \) where \( p_{jk} \) is a probability of document j will be a topic k. Finally, the interpretability comes from a sparsity of topic assignment vector, \( p_j \). One way to enforce sparsity is to design the loss function as:&lt;/p&gt;

\[L^{d} = \lambda \sum_{jk} (\alpha - 1)\log p_{jk}\]

&lt;p&gt;When \( \alpha &amp;lt; 1 \), we encourage a topic assignment probability to put more mass on a small set of topics.&lt;/p&gt;

&lt;p&gt;The results look interesting. This paper shows a simple way to combine topic modeling with word embedding. By embedding document vectors and topic vectors into the same semantic space as word vectors, we can learn a global semantic structure as well as word-level local interaction.&lt;/p&gt;

&lt;h2 id=&quot;references&quot;&gt;References:&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://arxiv.org/pdf/1605.02019.pdf&quot;&gt;Original LDA2Vec paper&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://multithreaded.stitchfix.com/blog/2016/05/27/lda2vec/&quot;&gt;LDA2Ve post&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://mccormickml.com/2016/04/19/word2vec-tutorial-the-skip-gram-model/&quot;&gt;Skip-gram tutorial part1&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://mccormickml.com/2017/01/11/word2vec-tutorial-part-2-negative-sampling/&quot;&gt;Skip-gram tutorial part2&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content><author><name></name></author><category term="LDA" /><category term="Word2Vec" /><summary type="html">A summery of LDA2Vec.</summary></entry><entry><title type="html">RBMs for Collaborative Filtering (ICML’2007)</title><link href="https://unsuthee.github.io/RBMS-for-CF/" rel="alternate" type="text/html" title="RBMs for Collaborative Filtering (ICML’2007)" /><published>2017-04-06T00:00:00+00:00</published><updated>2017-04-06T00:00:00+00:00</updated><id>https://unsuthee.github.io/RBMS-for-CF</id><content type="html" xml:base="https://unsuthee.github.io/RBMS-for-CF/">&lt;p&gt;If we are going to write a paper on deep learning for Collaborative Filtering problem, then RBM-CF [1] must be cited! Although it was not the best algorithm that yielded the lowest RMSE during the Netflix contest (SVD++ was the best algorithm at that time), RBM-CF was used as one of many algorithms for ensemble learning. One the main reason is that of its unique approach at that time. Thus, its predictions were slightly different from matrix factorization approaches.&lt;/p&gt;

&lt;p&gt;It turns out that one of the state-of-the-art for collaborative filtering right now (as of  April 2017) that I am aware of is NADE-CF [2] which is based on a similar idea as RBM-CF. This post will summarize the RBM-CF model, its architecture, and extensions.&lt;/p&gt;

&lt;p&gt;The RBM-CF models the joint probability between visible and hidden units. In this case of CF problem, visible units are observed ratings which are represented as a binary value. Each rating is one-hot encoded as a binary vector of length K where K is the maximum rating. The goal is to infer hidden units from these observed ratings. This means we need to learn a non-linear function that maps visible units to a probability of distribution of hidden units. In RBF, this non-linear function is a sigmoid function.&lt;/p&gt;

&lt;p&gt;RBM-CF uses a softmax function to model the visible units and the hidden units are modeled by Bernoulli distribution. To infer all hidden units, this model is trained by using a contrastive divergence to approximate the gradient of the log-likelihood. In order to make a prediction, the author suggested to first compute all \( p(v_q = k \mid V) \) and normalize them using softmax. Then, compute the expectation of rating.&lt;/p&gt;

&lt;p&gt;One possible variant is to model the hidden units as Gaussian latent variables. This variant increases the capacity of the model. Another variant to utilize the missing ratings as an extra information. The author observed that all rating in the test sets can be treated as all items that are viewed by a user without the rating. The viewing information is represented as a binary random variable and influences the hidden units. The conditional RBM model significantly improves performance. Imputing the missing values is a heuristic used to slightly improve the model performance.&lt;/p&gt;

&lt;p&gt;The most interesting contribution is how the author proposed an architecture to reduce the number of free parameters. This can be done by factoring the weight matrix into a product of two lower-rank matrices. The less number of parameters means that we can avoid an overfitting and the convergence will be faster.&lt;/p&gt;

&lt;p&gt;CF-RBM has a slightly lower RMSE than a standard SVD. The modern approaches such as Autoencoder or PMF are much more scalable than CF-RBM. This model can be extended to a deeper model and RBM used for parameter pretraining.&lt;/p&gt;

&lt;h2 id=&quot;references&quot;&gt;References:&lt;/h2&gt;

&lt;p&gt;[1] Salakhutdinov, Ruslan, Andriy Mnih, and Geoffrey Hinton. “Restricted Boltzmann machines for collaborative filtering.” Proceedings of the 24th international conference on Machine learning. ACM, 2007.&lt;/p&gt;

&lt;p&gt;[2] Zheng, Yin, et al. “A neural autoregressive approach to collaborative filtering.” Proceedings of the 33nd International Conference on Machine Learning. 2016.&lt;/p&gt;</content><author><name></name></author><category term="CF" /><category term="ICML" /><summary type="html">A summary of using RBMS for Collaborative Filtering.</summary></entry></feed>