Title: LEARNING NEURAL RANDOM FIELDS WITH INCLU-SIVE AUXILIARY GENERATORS

Abstract: Neural random fields (NRFs), which are defined by using neural networks to implement potential functions in undirected models, provide an interesting family of model spaces for machine learning. In this paper we develop a new approach to learning NRFs with inclusive-divergence minimized auxiliary generator -the inclusive-NRF approach, for continuous data (e.g. images), with solid theoretical examination on exploiting gradient information in model sampling. We show that inclusive-NRFs can be flexibly used in unsupervised/supervised image generation and semi-supervised classification, and empirically to the best of our knowledge, represent the best-performed random fields in these tasks. Particularly, inclusive-NRFs achieve state-of-the-art sample generation quality on CIFAR-10 in both unsupervised and supervised settings. Semi-supervised inclusive-NRFs show strong classification results on par with state-of-the-art generative model based semi-supervised learning methods, and simultaneously achieve superior generation, on the widely benchmarked datasets -MNIST, SVHN and CIFAR-10.

1. INTRODUCTION:

One of the core research problems in machine learning is learning with probabilistic models, which can be broadly classified into two classes -directed and undirected1 (Koller & Friedman, 2009) . Significant progress has been made recently on learning with deep generative models (DGMs), which generally refer to models with multiple layers of stochastic or deterministic variables. There have emerged a bundle of deep directed generative models, such as variational AutoEncoders (VAEs) (Kingma & Welling, 2014) , generative adversarial networks (GANs) (Goodfellow et al., 2014) and so on. In contrast, undirected generative models (also known as random fields (Koller & Friedman, 2009) , energy-based models (LeCun et al., 2006) ) received less attention with slow progress. This is presumably because fitting undirected models is more challenging than fitting directed models. In general, calculating the log-likelihood and its gradient is analytically intractable, because it involves the expectation with respect to (w.r.t.) the model distribution.

In this paper, we aims to advance the learning of neural random fields (RFs) which use neural networks with multiple (deterministic) layers to define the potential function2 u θ (x) over observation x with parameter θ. The probability distribution p θ (x) ∝ exp(u θ (x)) is then defined by normalizing the exponentiated potential function. This type of RFs has been studied several times in different contexts, once called deep energy models (DEMs) (Ngiam et al., 2012; Kim & Bengio, 2016) , descriptive models (Xie et al., 2016) , generative ConvNet (Dai et al., 2014) , neural random field language models (Wang & Ou, 2017) . For convenience, we refer to such models as neural random fields (NRFs) in general.

An important method of maximum likelihood (ML) learning of random fields is called stochastic maximum likelihood (SML) (Younes, 1989) , which approximates the model expectations by Monte Carlo sampling for calculating the gradient. A recent progress in learning NRFs as studied in Kim & Bengio (2016) ; Xie et al. (2016) ; Wang & Ou (2017) ; Kuleshov & Ermon (2017) is to pair the target random field p θ with an auxiliary directed generative model (often called generator) q φ (x) parameterized by φ, which approximates sampling from the target random field. Learning is performed by maximizing the log-likelihood of training data under p θ or some bound of the log-likelihood, and simultaneously minimizing some divergence between the target random field p θ and the auxiliary generator q φ . Different learning algorithms differ in the objective functions used in the joint training of p θ and q φ , and thus have different computational and statistical properties (partly illustrated in Figure 1 ). For example, minimizing the exclusive-divergence KL[q φ ||p θ ] q φ log (q φ /p θ ) w.r.t. φ, as employed in Kim & Bengio (2016) , involves the intractable entropy term and tends to enforce the generator to seek modes, yielding missing modes. There are also other factors, e.g. modeling discrete or continuous data, different choices of the target RF and the generator, which lead to different algorithms. We leave detailed comparison and connection of our approach with existing studies to section 3 (related work).

In this paper, we propose to use inclusive-divergence minimized auxiliary generators (section 2.1). And particularly for continuous data (e.g. images), we propose to use SGLD (stochastic gradient Langevin dynamics (Welling & Teh, 2011) ) and SGHMC (stochastic gradient Hamiltonian Monte Carlo (Chen et al., 2014) ) to exploit gradient information in model sampling with solid theoretical examination (section 2.2). The new approach, abbreviated as the inclusive-NRF approach, offers some advantages over previous methods. First, minimizing the inclusive-divergence KL[p θ ||q φ ] p θ log (p θ /q φ ) w.r.t. φ avoids the annoying entropy term and tends to drive the generator to cover modes of the target density p θ . The SGLD/SGHMC sampling further pushes the samples towards the modes of p θ . Presumably, this helps to produce Markov chains that mix fast between modes and facilitate model learning. Second, the new approach enables us to flexibly use NRFs in unsupervised/supervised image generation and semi-supervised classification (section 2.3), and empirically to the best of our knowledge, represents the best-performed random fields in these tasks.

The main contributions of this paper can be summarized as follows:

• We develop the inclusive-NRF approach, which learns NRFs with inclusive auxiliary generators and particularly for continuous data, exploits gradient information in model sampling with solid theoretical examination. • Inclusive-NRFs achieve state-of-the-art sample generation quality, measured by both Inception Score (IS) and Frechet Inception Distance (FID). On CIFAR-10, we obtain unsupervised IS 8.28 (FID 20.9) and supervised IS 9.06 (FID 18.1), both using unconditional generation. • Semi-supervised inclusive-NRFs show strong classification results on par with state-ofthe-art DGM-based semi-supervised learning (SSL) methods, and simultaneously achieve superior generation, on the widely benchmarked datasets -MNIST, SVHN and CIFAR-10.

2. THE INCLUSIVE-NRF APPROACH:

Consider a random field for modeling observation x with parameter θ:

EQUATION

where Z(θ) = exp(u θ (x))dx is the normalizing constant, u θ (x) is the potential function3 which assigns a scalar value to each configuration of random variable x. The general idea of neural random fields (NRFs) is to implement u θ (x) : R dx → R, by a neural network, taking the multi-dimensional x ∈ R dx as input and outputting the scalar u θ (x) ∈ R. In this manner, we can take advantage of the representation power of neural networks for RF modeling. It is usually intractable to maximize the data log-likelihood logp θ (x) for observed x, since the gradient involves expectation w.r.t. the model distribution, as shown below:

EQUATION

2.1. INTRODUCING INCLUSIVE-DIVERGENCE MINIMIZED AUXILIARY GENERATORS:

In this paper, we further develop NRF learning with auxiliary generators. We are mainly concerned with modeling fixed-dimensional continuous observations x ∈ R dx (e.g. images), and choose a Algorithm 1 Learning NRFs with inclusive auxiliary generators

repeat Sampling: Draw a minibatch M = (x i , x i , h i ), i = 1, • • • |M| from p(x)p θ (x)q φ (h|x) (see Algorithm 2); Updating: Update θ by ascending: 1 |M| (x,x,h)∼M [∇ θ u θ (x) -∇ θ u θ (x)]; Update φ by ascending: 1 |M| (x,x,h)∼M ∇ φ log q φ (x, h);

until convergence directed generative model, q φ (x, h) q(h)q φ (x|h), for the auxiliary generator, which specifically is defined as follows4 :

h ∼ N (0, I h ),

EQUATION

where g φ (h) : R d h → R dx is implemented as a neural network with parameter φ, which maps the latent code h to the observation space. I h and I denote the identity matrices, with dimensionality implied by h and respectively. Drawing samples from the generator q φ (x, h) is simple as it is just ancestral sampling from a 2-variable directed graphical model.

Suppose that data D = {x 1 , • • • , xn }, consisting of n observations, are drawn from the true but unknown data distribution p 0 (•). p(x)

1 n n k=1 δ(x -xk ) denotes the empirical data distribution. Then we formulate the maximum likelihood learning of p θ (x) with the inclusive-divergence minimized generator q φ (x) as optimizing5 

EQUATION

The first line of Eq. ( 4) is equivalent to maximum likelihood training of the target RF p θ under the empirical data p, which requires sampling from p θ . Simultaneously, the second line optimizes the generator q φ to be close to p θ so that q φ becomes a good proposal for sampling from p θ . It can be easily seen that the gradients w.r.t. θ and φ (to be ascended) are defined as follows:

EQUATION

Both lines of Eq. ( 5) hold, as proved in Proposition 1 in the Supplement. In practice, we calculate noisy gradient estimators, and apply minibatch based stochastic gradient descent (SGD) to solve the optimization problem Eq. ( 4), as shown in Algorithm 1.

2.2. APPLYING SGLD/SGHMC FOR MODEL SAMPLING:

In Algorithm 1, we need to draw samples from p θ (x)q φ (h|x) given current θ and φ. For continuous observations, SGLD (stochastic gradient Langevin dynamics) (Welling & Teh, 2011) and SGHMC (Stochastic Gradient Hamiltonian Monte Carlo) (Chen et al., 2014) sampling provide mechanisms for exploiting (stochastic) gradients of the target density p θ (x)q φ (h|x), enabling efficient exploration of the state space. We take the theoretical results about SGLD from Teh et al. (2016) and SGHMC from Chen et al. (2014) , which are briefly summarized in Theorem 1 in the Supplement, and apply them in the sampling step in Algorithm 1. Denoting the target density as p(z; λ) with given λ, Theorem 1 shows that SGLD/SGHMC, by utilizing ∂ ∂z log p(z; λ), yields a non-homogeneous Markov chain z (l) , l ≥ 1 , which converges to the equilibrium distribution p(z; λ).

By letting z:

(x, h), p(z; λ) p θ (x)q φ (h|x), λ (θ, φ) T in Theorem 1, we can perform the sampling step in Algorithm 1 by running |M| parallel chains, each chain being executed as shown Algorithm 2 Sampling from p θ (x)q φ (h|x)

1. Do ancestral sampling by the generator, namely first drawing h ∼ p(h ), and then drawing x ∼ q φ (x |h ); 2. Starting from (x , h ) = z (0) , run finite steps of SGLD/SGHMC (l = 1, • • • , L) to obtain (x, h) = z (L) , which we call sample revision, according to Eq. ( 11)/(12). Return (x, h).

in Algorithm 2. In sample revision, the calculation of the gradient w.r.t. h, ∂ ∂h log p(z; λ) = ∂ ∂h log q φ (h|x) = ∂ ∂h log q φ (h, x), is straightforward. For the gradient w.r.t. x, we have

EQUATION

)

The reason is that ∂ ∂x log q φ (x) can be approximated by an unbiased estimate, as proved in Proposition 2 in the Supplement:

∂ ∂x log q φ (x) ≈ ∂ ∂x log q φ (h, x).

Therefore, we can use ∂ ∂x log p θ (x)6 as an unbiased estimate of the gradient ∂ ∂x log p(z; λ), and we can apply Theorem 1 in the Supplement with tractable gradients w.r.t. both x and h.

Remarks. Intuitively, the generator gives a proposal (x , h ), and then the system follows the gradients of p θ (x) and q φ (h, x) (w.r.t. x and h respectively) to revise (x , h ) to (x, h). The gradient terms pull samples moving to low energy region of the random field and adjust the latent code of the generator, while the noise term brings randomness. In this manner, we obtain Markov chain samples from p θ (x)q φ (h|x). Note that finite steps in sample revision will produce biased estimates of the gradients ∇ θ and ∇ φ in Eq. ( 5). We did not find this to pose problems to the SGD optimization in practice, as similarly found in Bornschein & Bengio (2015) and Kuleshov & Ermon (2017) , which work with biased gradient estimators.

2.3. SEMI-SUPERVISED LEARNING WITH INCLUSIVE NRFS:

In the following, we apply our inclusive-NRF approach in the SSL setting to show its flexibility. Note that different models are needed in unsupervised and semi-supervised learning, because SSL needs to additionally consider labels apart from observations. Model definition. In semi-supervised tasks, we consider the following RF for joint modeling of observation x ∈ R dx and class label y ∈ {1, • • • , K}:

EQUATION

which is different from Eq.1 for unsupervised learning without labels. To implement the potential function u θ (x, y), we consider a neural network Φ θ (x) : R dx → R K , with x as the input and the output size being equal to the number of class labels, K. Then we define u θ (x, y) = onehot(y) T Φ θ (x), where onehot(y) represents the one-hot encoding vector for the label y. In this manner, the conditional density p θ (y|x) is the classifier, defined as follows:

EQUATION

which acts like multi-class logistic regression using K logits calculated from x by the neural network Φ θ (x). And we do not need to calculate Z(θ) for classification. The auxiliary generator is implemented the same as in Eq. 3, i.e. an unconditional generator.

With the definition the joint density in Eq. 7, it can be shown that, with abuse of notation, the marginal density

p θ (x) = 1 Z(θ) exp [u θ (x)] where u θ (x) log y exp [u θ (x, y)].

Model learning. Suppose that among the data D = {x 1 , • • • , xn }, only a small subset of the observations, for example the first m observations, have class labels, m n. Denote these labeled data as L = {(x 1 , ỹ1 ), • • • , (x m , ỹm )}. Then we can formulate the semi-supervised learning as jointly optimizing

EQUATION

which are defined by hybrids of generative and discriminative criteria, similar to Zhu (2006) ; Larochelle et al. (2012) ; Kingma et al. (2014) . The hyper-parameter α d controls the relative weight between generative and discriminative criteria. Similar to deriving Eq. ( 5), it can be easily seen that the gradients w.r.t. θ and φ (to be ascended) are defined as follows:

EQUATION

In practice, we calculate noisy gradient estimators, and apply minibatch based stochastic gradient descent (SGD) to solve the optimization problem Eq. ( 9), as shown in Algorithm 3 in the Supplement.

Apart from the basic losses as shown in Eq. ( 9), there are some regularization losses that are found to be helpful to guide SSL learning and are presented in the Supplement. To conclude, we show that the inclusive-NRF can be easily applied to SSL. To the best of our knowledge, there are no priori studies in applying random fields to SSL. The semi-supervised inclusive-NRF model defined above is novel itself for SSL.

3. RELATED WORK:

Comparison and connection of our inclusive-NRF approach with existing studies are provided in the following from three perspectives.

Learning NRFs with auxiliary generators. These studies are most relevant to this work, which aims to learn NRFs. The classic method for learning RFs is the SML method (Younes, 1989) 2017) is to jointly train the target random field p θ (x) and an auxiliary generator q φ (x). Different studies differ in the objective functions used in the joint training, and thus have different computational and statistical properties.

• It is shown in Proposition 3 in the Supplement that learning in Kim & Bengio (2016) minimizes the exclusive-divergence KL[q φ ||p θ ] w.r.t. φ, which involves the intractable entropy term and tends to enforce the generator to seek modes, yielding missing modes. We refer to this approach as exclusive-NRF. • Learning in Wang & Ou (2017) Wang & Ou (2017) mainly studies random field language models, using LSTM generators (autoregressive with no latent variables) and employing Metropolis independence sampler (MIS) -applicable for discrete data (natural sentences). In this paper, we mainly develop random field models for continuous data (images), using latent-variable generators and utilizing SGLD/SGHMC (with solid theoretical examination) to exploit gradient information in the continuous space. • In Xie et al. (2016) , motivated by interweaving maximum likelihood training of the random field p θ and the latent-variable generator q φ , a joint training method is introduced.

Operationally, in learning θ and φ, this method also uses Langevin sampling to generate samples. Two Langevin sampling steps are intuitively interleaved according to ∂ ∂x log p θ (x) and ∂ ∂h log q φ (h, x) separately. This is different from our sampling step, which moves (h, x) jointly, as theoretically justified in section 2.2. Let r(h, x) denote the distribution obtained by running the interleaved Langevin transitions starting from (h, x) ∼ q φ (h, x). Interpretation presented in Xie et al. (2016) relates their method to the following joint optimization problem:

   min θ {KL [p(x)||p θ (x)] -KL [r(h, x)||p θ (x)]} min φ KL [r(h, x)||q φ (h, x)]

which is also different from ours as shown in Eq. ( 4). Thus, learning in Xie et al. (2016) does not aim to minimize the inclusive-divergence KL[p θ ||q φ ] w.r.t. φ.

• Learning in Kuleshov & Ermon (2017) 

minimizes the χ 2 -divergence χ 2 [q φ ||p θ ] (p θ -q φ ) 2 q φ

w.r.t. φ, which also tends to drive the generator to cover modes. But this approach is severely limited by the high variance of the gradient estimator w.r.t. φ, and is only tested on the simpler MNIST and Omniglot.

Additionally, different NRF studies also differ in models used in the joint training. For example, the target NRF used in this work is different from those in previous studies Kim & Bengio (2016) ; Wang & Ou (2017) ; Xie et al. (2016) . The differences are: Kim & Bengio (2016) includes linear and squared terms in u θ (x), Wang & Ou (2017) defines over sequences, and Xie et al. (2016) defines in the form of exponential tilting of a reference distribution (Gaussian white noise). There exist different choices for the generator, such as GAN models in Kim & Bengio (2016) , LSTMs in Wang & Ou (2017) , or latent-variable models in both Xie et al. (2016) and this work. All are easy to do sampling.

Moreover, all the previous NRF studies examine unsupervised learning, and none shows application or extension of their methods or models for semi-supervised learning.

Monte Carlo sampling. One step in our inclusive-NRF approach is to apply SGLD/SGHMC to draw samples from the target density p θ , starting from the proposal sample from the generator. Theoretically, improvements in NRF sampling methods could be potentially integrated into NRF learning algorithms. For example, it is recently studied in Levy et al. (2018) to learn MCMC transition kernels, also parameterized by neural networks, to improve the HMC sampling from the given target distribution. Integration into learning NRFs is interesting but outside the scope of this paper.

Comparison and connection with GANs. On the one hand, there are some efforts that aim to address the inability of GANs to provide sensible energy estimates for samples. The energy-based GANs (Zhao et al., 2017) proposes to view the discriminator as an energy function by designing an auto-encoder discriminator. The recent work in Dai et al. (2017a) connects Zhao et al. (2017) and Kim & Bengio (2016) , and show another two approximations for the entropy term. However, it is known that as the generator converges to the true data distribution, the GAN discriminator converges to a degenerate uniform solution. This basically afflicts the GAN discriminator to provide density information, though there are some modifications. In contrast, our inclusive-NRFs, unlike GANs, naturally provide (unnormalized) density estimate. Moreover, none of the above energy-related GAN studies examine their methods or models for SSL, except in EBGAN which performs moderately.

On the other hand, there are interesting connections between inclusive-NRFs and GANs, as elaborated in section 11 in the Supplement. When interpreting the potential function u θ (x) as the critic in Wasserstein GANs, inclusive-NRFs seem to be similar to Wasserstein GANs. A difference is that in optimizing θ in inclusive-NRFs, the generated samples are further revised by taking finite-stepgradient of u θ (x) w.r.t. x. However, the critic in Wasserstein GANs can hardly be interpreted as an unnormalized log-density. Thus strictly speaking, inclusive-NRFs are not GAN-like.

4. EXPERIMENTS:

We conduct a series of experiments to evaluate the performances of our approach (inclusive-NRFs) and various existing methods on synthetic and real-world datasets for both unsupervised and semisupervised learning tasks, with both visual and numerical evaluation. We refer to the Supplement for experimental details and additional results. 

4.1. GMM SYNTHETIC EXPERIMENT:

The synthetic data consist of 1,600 training examples generated from a 2D Gaussian mixture model (GMM) with 32 equally-weighted, low-variance (σ = 0.1) Gaussian components, uniformly laid out on four concentric circles as in Figure 1 (a). The data distribution exhibits many modes separated by large low-probability regions, which makes it suitable to examine how well different learning methods can deal with multiple modes. For comparison, we experiment with GAN with logD trick (Goodfellow et al., 2014) and WGAN-GP (Gulrajani et al., 2017) for directed generative model, exclusive-NRF (Kim & Bengio, 2016) and inclusive-NRF for undirected generative model.

Figure 1 visually shows the generated samples from the trained models using different methods. Table 1 reports the "covered modes" and "realistic ratio" as numerical measures of how the multi-modal data are fitted, similarly as in Dumoulin et al. (2017) . The main observations are as follows.

(1) GAN suffers from mode missing, generating realistic but not diverse samples. WGAN-GP increases "covered modes" but decreases "realistic ratio". Inclusive-NRF performs much better than both GAN and WGAN-GP in sample generation.

(2) Inclusive-NRF outperforms exclusive-NRF in both sample generation and density estimation.

(3) After revision, samples from inclusive-NRF become more like real samples, achieving the best in both "covered modes" and "realistic ratio" metrics.

4.2. IMAGE GENERATION ON CIFAR-10:

We examine both unsupervised and supervised learning over the widely used real-world dataset CIFAR-10 Krizhevsky (2009) for image generation. To evaluate generation quality quantitatively, we use inception score (IS) Salimans et al. (2016) , and Frechet inception distance (FID) Heusel et al. (2017) . Table 2 reports the inception score and FID for state of the art methods, for both unsupervised and supervised settings. The supervised learning of inclusive-NRF is conducted as a special case of semi-supervised learning over all labeled images (m = n), which uses unconditional generation. We use ResNet in this experiment, see section 12.2 in the Supplement for experimental details.

Table 1 : Numerical evaluations over the GMM (32 components) synthetic data. The "covered modes" metric is defined as the number of covered modes by a set of generated samples. The "realistic ratio" metric is defined as the proportion of generated samples which are close to a mode. The measurement details are presented in section 12.1 in the Supplement. Mean and SD are from 10 independent runs.

Methods covered modes realistic ratio:

GAN with logD trick 22.25 ± 1.54 0.90 ± 0.01 WGAN-GP (Gulrajani et al., 2017) 27.81 ± 1.40 0.74 ± 0.04 Exclusive-NRF (Kim & Bengio, 2016) (Salimans et al., 2016) 8.09 ± 0.07 WGAN-GP (Gulrajani et al., 2017) 7.86 ± 0.07 8.42 ± 0.10 SGAN (Huang et al., 2017) 8.59 ± 0.12 DFM (Warde-Farley & Bengio, 2017) 7.72 ± 0.13 CT-GAN (Wei et al., 2018) 8.12 ± 0.12 8.81 ± 0.13 Fisher-GAN (Mroueh & Sercu, 2017) 7.90 ± 0.05 8.16 ± 0.12 BWGAN (Adler & Lunz, 2018) 8.26 ± 0.07 SNGAN (Miyato et al., 2018) 8.22 ± 0.05 21.7 ± 0.21

Inclusive-NRF generation 8.28 ± 0.09 20.9 ± 0.25 9.06 ± 0.10 18.1 ± 0.23

From the comparison results in Table 2 , it can be seen that the proposed inclusive-NRF model achieves the best inception score over CIFAR-10, to the best of our knowledge, in both unsupervised and supervised settings. Some generated samples are shown in Figure 5 (c)(d) for unsupervised and supervised settings respectively. We also show in the Supplement the capability of inclusive-NRFs in latent space interpolation (section 14) and conditional generation (section 15).

4.3. SEMI-SUPERVISED LEARNING RESULTS:

For semi-supervised learning, we consider the three widely used benchmark datasets, namely MNIST (LeCun et al., 1998) , SVHN (Netzer et al., 2011), and CIFAR-10 (Krizhevsky, 2009) . As in previous work, we randomly sample 100, 1,000, and 4,000 labeled samples from MNIST, SVHN, and CIFAR-10 respectively during training, and use the standard data split for testing. See section 12.3 in the Supplement for experimental details. We also provide a SSL toy experiment in section 13 in the Supplement to help understanding how semi-supervised inclusive-NRF works.

It can be seen from Table 3 that semi-supervised inclusive-NRFs produce strong classification results on par with state-of-art DGM-based SSL methods. See Figure 5 (a)(b) in the Supplement for generated samples. Bad-GANs achieve better classification results, but as indicated by the low inception score, their generation is much worse than semi-NRF-IAGs. In fact, among DGM-based SSL methods, inclusive-NRFs achieve the best performance in sample generation. This is in contrast to the conflict of good classification and good generation, as observed in GAN-based SSL (Salimans et al., 2016; Dai et al., 2017b) . It is analyzed in Dai et al. (2017b) that good GAN-based SSL requires a bad generator7 . This is embarrassing and in fact obviates the original idea of generative SSLsuccessful generative training, which indicates good generation, provides regularization for finding good classifiers (Zhu, 2006; Larochelle et al., 2012) . In this sense, Bad-GANs could hardly be classified as a generative SSL method. (Maaloe et al., 2016) 1.32 ± 0.07 16.61 ± 0.24 --Ladder network (Rasmus et al., 2015) 1.06 ± 0.37 -20.40 ± 0.47 / ADGM (Maaloe et al., 2016) 0.96 ± 0.02 22.86 --Improved-GAN (Salimans et al., 2016) 0.93 ± 0.07 8.11 ± 1.3 18.63 ± 2.32 3.87 ± 0.03 EBGAN (Zhao et al., 2017) 1.04 ± 0. Finally, note that some discriminative SSL methods, as listed in the lower block in Table 3 also produce superior performances, by utilizing data augmentation and consistency regularization. However, these methods are unable to generate (realistic) samples. It can be seen that discriminative SSL methods utilize different regularization from generative SSL methods and cannot be directly compared to generative SSL methods. Their combination, as an interesting future work, could yield further performance improvement.

4.4. ABLATION STUDY:

We report the results of ablation study of our inclusive-NRF method on CIFAR-10 in Table 4 . In this experiment, we use the standard CNN (Miyato et al., 2018) for unsupervised learning and the same networks as those used in Table 3 for semi-supervised learning. See section 12.4 in the Supplement for experimental details. We analyze the effects of different settings in model training, such as using SGLD or SGHMC and the revision step L = 1/5/10 used. For each training setting, we also compare the two manners to generate samples -whether applying sample revision or not in inference (generating samples) given a trained NRF, as previously illustrated in Figure 1 over synthetic GMM data. The main observations are as follows.

First, given a trained NRF, after revision (i.e. following the gradient of the RF's potential u θ (x) w.r.t. x), the quality (IS) of samples is always improved, as shown by the consistent IS improvement from the second column (generation) to the third (revision). This is in accordance with the results in the GMM synthetic experiments. Moreover, noting that in revision, it is the the estimated density p θ that guides the samples towards low energy region of the random field. This demonstrates one benefit of random field modeling, which, unlike GANs, can learn density estimate about the data manifold.

Second, a row-wise reading of Table 4 reveals that with more revision steps and using SGHMC in training, the SSL classification performance is improved. Utilizing SGHMC in inclusive-NRFs to Table 4 : Ablation study of our inclusive-NRF method on CIFAR-10, regarding the effects of using SGLD or SGHMC in training and of applying sample revision in inference (generating samples). Mean and SD are from 5 independent runs for each training setting. In each training setting, for unsupervised learning, two manners to generate samples given a trained NRF are compared, as previously illustrated in Figure 1 over synthetic GMM data. We examine generated samples (i.e. directly from the generator) and revised samples (i.e. after sample revision) respectively, in term of inception scores (IS). For semi-supervised learning, we examine the classification error rates. 7.46 ± 0.12 7.57 ± 0.10 15.12 ± 0.36 exploit gradient information with momentum yields better performance than simple SGLD as used in Xie et al. (2016) . It is also found that more revision steps in model training do not significantly improve unsupervised IS. So we can use L = 1 in unsupervised learning for generation, which can reduce the computational cost.

5. DISCUSSION AND CONCLUSION:

In this paper we develop the inclusive-NRF approach, which learns NRFs with inclusive auxiliary generators and particularly for continuous data, exploits gradient information in model sampling with solid theoretical examination. Extensive empirical evaluations show that inclusive-NRFs obtain state-of-the-art sample generation quality and achieve strong semi-supervised learning results on par with state-of-the-art DGMs. The superior performances presumably are attributed to the two distinctive features in inclusive-NRFs -introducing the inclusive-divergence minimized auxiliary generator and utilizing sample revision by SGLD/SGHMC. Intuitively, the revised samples from the RF will guide the training of the generator, and subsequently the generator will propose samples for the RF to sense the data manifold. This forms positive interactions between the random field and the generator, which enables successful joint training of both models.

The new approach enables us to flexibly use NRFs in unsupervised, supervised and semi-supervised settings and successfully train them in a black-box manner. Interesting future work will consider inclusive-NRFs in more challenging tasks, e.g. unsupervised and semi-supervised learning with sequential data (e.g. speech, language, video, etc.).

Supplement for "Learning Neural Random Fields with Inclusive:

Auxiliary Generators"

6. PROOF OF PROPOSITION 1:

Proposition 1. Both lines of Eq.( 5) for gradient calculations hold.

Proof. The first line of Eq.( 5) can be obtained by directly taking derivative of KL [p(x)||p θ (x)] w.r.t. θ, as shown below,

∂ ∂θ KL [p(x)||p θ (x)] = ∂ ∂θ p(x) log p(x) p θ (x) dx = -p(x) ∂ ∂θ log p θ (x)dx,

and then applying the basic formula of Eq. ( 2).

For the second line, by direct calculation, we first have

E q φ (h|x) [∇ φ log q φ (h|x)] = q φ (h|x)q φ (h|x) -1 ∇ φ q φ (h|x)dh = ∇ φ q φ (h|x)dh = ∇ φ q φ (h|x)dh = ∇ φ 1 = 0.

Then combining ∂ ∂φ KL [p θ (x)||q φ (x)] = -E p θ (x) [∇ φ log q φ (x)] and ∇ φ log q φ (x) = E q φ (h|x) [∇ φ log q φ (x)] = E q φ (h|x) [∇ φ log q φ (x, h) -∇ φ log q φ (h|x)] = E q φ (h|x) [∇ φ log q φ (x, h)] .

will give the second line of Eq.(5).

7. SGLD/SGHMC:

Theorem 1. Denote the target density as p(z; λ) with given λ. Assume that one can compute a noisy, unbiased estimate ∆(z, ξ; λ) to the gradient ∂ ∂z log p(z; λ), where ξ is an auxiliary random variable which contains all the randomness involved in constructing the estimate, namely E [∆(z, ξ; λ)] = ∂ ∂z log p(z; λ). Assume the stability Assumptions 4 in Teh et al. (2016) holds. For a sequence of asymptotically vanishing time-steps {δ l , l ≥ 1} (satisfying l) , and an independent and i.i.d. sequence ξ l of auxiliary random variables, l ≥ 1, the SGLD iterates as follows, starting from z (0) :

∞ l=1 δ l = ∞ and ∞ l=1 δ 2 l < ∞), an i.i.d. sequence η (

z (l) = z (l-1) + δ l 2 ∆(z (l-1) , ξ l ; λ) + δ l η (l) , η (l) ∼ N (0, I), l = 1, • • • (11)

Starting from z (0) and v (0) = 0, the SGHMC iterates as follows:

   v (l) = βv (l-1) + δ l 2 ∆(z (l-1) , ξ l ; λ) + δ l η (l) , η (l) ∼ N (0, I) z (l) = z (l-1) + v (l) , l = 1, • • • (12)

Then in both cases, the non-homogeneous Markov chain z (l) , l ≥ 1 converges to the equilibrium distribution p(z; λ).

Proposition 2. Let z (x, h), p(z; λ) p θ (x)q φ (h|x), λ (θ, φ) T in Theorem 1. The initial value (x (0) , h (0) ) is obtained from ancestral sampling by the generator. The SGLD/SGHMC as shown in Eq.( 11)/(12) iteratively generates (x (m) , h (m) ), m = 1, • • • . Then, ∂ ∂x (m) log q φ (h (m) , x (m) ) is an unbiased estimate of the gradient ∂ ∂x (m) log q φ (x (m) ), m = 0, 1, • • • .

Proof. Note that Langevin dynamics and Hamiltonian dynamics are reversible Neal (2011). Thus the SGLD/SGHMC transitions Eq.( 11)/(12) satisfy the detailed balance condition:

π(h (m-1) , x (m-1) )K(h (m) , x (m) |h (m-1) , x (m-1) ) = π(h (m) , x (m) )K(h (m-1) , x (m-1) |h (m) , x (m) ),

where π(•) denotes the target density, and K(•|•) denotes the transition kernel. Also note that E h∼q φ (h|x) ∂ ∂x log q φ (h, x) = ∂ ∂x log q φ (x). Thus if we show that h (m) is indeed drawn from q φ (h (m) |x (m) ) during sample revision, m = 0, 1, • • • , then the unbiasedness will hold.

Denote by π (m) (h (m) , x (m) ) the state-occupation density at step m. Then we need to show that

π (m) (h (m) |x (m) ) actually follows π(h (m) |x (m) ), i.e. q φ (h (m) |x (m) ), m = 0, 1, • • • .

First, it is obvious that this holds for (h (0) , x (0) ). Then, we proceed by mathematical induction. Suppose π (m-1) (h (m-1) |x (m-1) ) = π(h (m-1) |x (m-1) ). Then we have

EQUATION

Integrating out (h (m-1) , x (m-1) ) from both sides of Eq.13, we obtain m) , x (m) )

π (m) (h (m) , x (m) ) = π(h (

x (m-1)

π (m-1) (x (m-1) ) π(x (m-1) ) K(x (m-1) |h (m) , x (m) )

= π(h (m) , x (m) )

x (m-1)

π (m-1) (x (m-1) ) π(x (m-1) ) K(x (m-1) |x (m) )

where the second equality, i.e. K(x|h , x ) = K(x|x ), holds because in the SGLD/SGHMC transitions Eq.( 11)/(12), generating next step x only depends on current x and is independent of current h . Then we have

π (m) (h (m) |x (m) ) = π(h (m) |x (m) ) π(x (m) ) π (m) (x (m) ) x (m-1) π (m-1) (x (m-1) ) π(x (m-1) ) K(x (m-1) |x (m) ) = π(h (m) |x (m) )

where the second equality holds because we have m) ). This concludes the inductive step.

EQUATION

9. SEMI-SUPERVISED LEARNING WITH INCLUSIVE-NRFS:

Apart from the basic losses, as shown in Eq.10, in applying inclusive-NRFs in SSL, there are some regularization losses that are helpful to guide the semi-supervised learning.

11. CONNECTION BETWEEN INCLUSIVE-NRFS AND GANS:

Note that for the generator as defined in Eq. 3, we have the following joint density

logq φ (x, h) = - 1 2σ 2 ||x -g φ (h)|| 2 + constant.

The generator parameter φ is updated according to Eq. 5, which is rewritten as follows:

E p θ (x)q φ (h|x) [∇ φ logq φ (x, h)] = 0

Specifically, we draw (h , x ) ∼ q φ and then perform one-step SGLD to obtain (h, x). To simply the analysis of the connection, suppose h ≈ h , x ≈ g φ (h ) ≈ g φ (h). Then we have

EQUATION

The gradient in the updating step in Algorithm 1 becomes:

∇ φ logq φ (x, h) = 1 σ 2 ∂ ∂φ g φ (h) [x -g φ (h)] ≈ 1 σ 2 ∂ ∂φ g φ (h) δ 1 2 ∂ ∂x u θ (x) x=g φ (h) = 1 σ 2 δ 1 2 ∂ ∂φ u θ (g φ (h))

where ∂ ∂φ g φ (h) is a matrix of size dim(φ) × dim(x). Therefore, the inclusive-NRF Algorithm 1 can be viewed to perform the following steps:

1. Draw an empirical example x ∼ p 0 .

2. Draw h ∼ p(h), x = g φ (h), and generate x by one-step-gradient according to Eq. 14.

3. Update θ by ascending: ∇ θ u θ (x) -∇ θ u θ (x).

4.. Update φ by descending: -:

∂ ∂φ u θ (g φ (h)).

Now suppose that we interpret the potential function u θ (x) as the discriminator in GANs (or the critic in Wasserstein GANs), which assign high scalar scores to empirical samples x ∼ p 0 and low scalar scores to generated samples x. Then, the inclusive-NRF training could be viewed as playing a two-player minimax game:

EQUATION

except that in optimizing θ, the generated sample are further revised by taking one-step-gradient of u θ (x) w.r.t. x (as shown in the above Step 2). The discriminator u θ is trained to discriminate between empirical samples and generated samples, while the generator q φ is trained to fool the discriminator by assigning higher scores to generated samples. From the above analysis, we find some interesting connections between inclusive-NRFs and existing studies in GANs.

• The optimization shown in Eq. 15 is in fact the same as that in Wasserstein GANs (Theorem 3 in Arjovsky et al. ( 2017)), except that in Wasserstein GANs, the critic u θ (x) is constrained to be 1-Lipschitz continuous. So hopefully we can improve the inclusive-NRF training by constraining the discriminator u θ (x) to be 1-Lipschitz continuous, e.g. by utilizing the recently developed technique of spectral normalization of weight matrices in the discriminator as in Miyato et al. (2018) .

12.3 SEMI-SUPERVISED EXPERIMENT ON MNIST, SVHN AND CIFAR-10

The network architectures (taken from the released code from Salimans et al. (2016) and widely used in Li et al. (2017) ; Dai et al. (2017b) ) and hyperparameters for semi-supervised inclusive-NRFs on MNIST, SVHN and CIFAR-10 are listed in Table 6 , Table 7 and Table 8 respectively. We use SGHMC for semi-supervised inclusive-NRFs for all three datasets, with empirical revision hyperparameters (β = 0.5, δ l = 0.003) for MNIST and CIFAR-10, and (β = 0.5, δ l = 0.01) for SVHN. The confidence loss is employed for semi-supervised inclusive-NRFs on MNIST and SVHN, and the potential control loss is employed on CIFAR-10. For unsupervised learning, we use the same networks as in Table 3 in Miyato et al. (2018) (standard CNN using spectral normalization). We use Adam optimizer with the hyperparameter (α = 0.0002, β 1 = 0, β 2 = 0.9). For semi-supervised learning, the experimental setting is the same as in section 12.3 including the networks, number of labels, etc. For different revision steps, we use (δ l = 0.003) for SGLD, and (β = 0.5, δ l = 0.003) for SGHMC. The potential control loss is employed in both unsupervised (α p = 0.1) and semi-supervised (α d = 100, α p = 0.1) learning.

13. SSL TOY EXPERIMENT:

In Figure 2 , we present the performance of semi-supervised inclusive-NRFs for SSL on a synthetic dataset, which emphasizes that inclusive-NRFs can provide (unnormalized) density estimates for p θ (x), p θ (x, y = 1) and p θ (x, y = 2). In contrast, the use of GANs as general purpose probabilistic generative models has been limited by the difficulty in using them to provide density estimates or even unnormalized potential values for sample evaluation.

The dataset is a 2D GMM with 16 Gaussian components, uniformly laid out on two concentric circles.

The two circles represent two different classes, each class with 4 labeled data and 400 unlabeled data. The network architectures are the same as in Table 5 , except that the neural network which implement the potential function u θ (x, y) for SSL now has two units in the output. 

14. LATENT SPACE INTERPOLATION:

Figure 3 shows that the auxiliary generator smoothly outputs transitional samples as the latent code h moves linearly in the latent space. The interpolated generation demonstrates that the model has indeed learned an abstract representation of the data. Notice that the generator does not explicitly include class labels, thus it is unable to perform classconditional generation directly. However, the random field has modeling of p θ (x, y), based on which we can perform class-conditional generation as follows:

1. Generate a sample x unconditionally, by ancestral sampling with the generator.

2. Predict the label y for the sample x by the random field;

3. Starting from x, running SGLD/SGHMC revision with p θ (x|y) as the target density by fixing y. The resulting samples could be viewed as conditional generations, according to Theorem 1. 

:

An easy way to tell an undirected model from a directed model is that an undirected model involves the normalizing constant (also called the partition function in physics), while the directed model is self-normalized.

Note that compared to modeling with multiple deterministic layers, modeling with multiple stochastic layers, e.g. deep Boltzmann machines (DBMs)(Salakhutdinov & Hinton, 2009), presents much greater challenge for model learning and thus yields inferior performance. This is observed in both directed and undirected models.

Negating the potential function defines the energy function.

Note that during training, σ 2 is absorbed into the learning rates and does not need to be estimated.

Such optimization using two objectives is employed in a number of familiar learning methods, such as GAN with logD trick(Goodfellow et al., 2014), wake-sleep algorithm(Hinton et al., 1995).

Note that ∂ ∂x log p θ (x) = ∂ ∂x u θ (x)does not require the calculation of the normalizing constant.

This analysis is based on using the (K + 1)-class GAN-like discriminator objective for SSL. To the best of our knowledge, the conflict does not seem to be reported in previous generative SSL methodsZhu (2006);Larochelle et al. (2012) which use the K-class classifier like in semi-supervised inclusive-NRFs.

Figures and Tables:

Figure 1: Comparison of different methods over GMM synthetic data. Stochastic generations from GAN with logD trick, WGAN-GP, Exclusive-NRF, Inclusive-NRF generation (i.e. sampling from the auxiliary generator) and Inclusive-NRF revision (i.e. after performing sample revision over samples from the auxiliary generator), are shown in (b)-(f) respectively. Inclusive-NRF generation and inclusive-NRF revision are two manners to generate samples, given a trained NRF. For both manners, the NRF model is trained with the sample revision step. Each generation contains 1,000 samples. The learned potentials u θ (x) from exclusive and inclusive NRFs are shown in (g) and (h) respectively, where the red dots indicate the mean of each Gaussian component. Inclusive NRFs are clearly superior in learning data density and sample generation.

Figure 5(a)(b) show the generated samples from semi-supervised inclusive-NRFs trained over SVHN and CIFAR-10 respectively.

Figure 2: SSL toy experiment based on semi-supervised inclusive-NRFs. Each class has 4 labeled points, red dots for class 1 and blue for class 2. The learned potentials for u θ (x), u θ (x, y = 1) and u θ (x, y = 2) are shown in (b)(c)(d) respectively.

Figure3: Latent space interpolation with inclusive-NRFs on MNIST. The leftmost and rightmost columns are from stochastic generations x 1 with latent code h 1 and x 2 with h 2 . The columns in between correspond to the generations from the latent codes interpolated linearly from h 1 to h 2 .

Figure 4: Conditional generated samples from semi-supervised inclusive-NRFs trained on MNIST. Due to sample revision, the background pixels are not purely black.

Figure 5: Generated samples from semi-supervised inclusive-NRFs (i.e. trained for SSL) on SVHN and CIFAR-10 are shown in (a) and (b) respectively. Generated samples from unsupervised and supervised training of inclusive-NRFs on CIFAR-10 are shown in (c) and (d) respectively.

and in this paper minimizes the inclusive-divergence KL[p θ ||q φ ] w.r.t. φ. But noticeably, this paper presents our innovation in development of NRFs for continuous data, which is fundamentally different fromWang & Ou (2017) for discrete data. The target NRF model, the generator and the sampler are all different.

Table content: <table/>

Inception score (IS) and FID on CIFAR-10 for unsupervised and supervised learning.

Table content: <table><tr><td/><td colspan="2">28.14 ± 0.68 0.73 ± 0.03</td><td/></tr><tr><td>Inclusive-NRF generation</td><td colspan="2">29.52 ± 0.54 0.84 ± 0.01</td><td/></tr><tr><td>Inclusive-NRF revision</td><td colspan="2">30.75 ± 0.43 0.97 ± 0.01</td><td/></tr><tr><td>Methods</td><td>Unsupervised IS FID</td><td>IS</td><td>Supervised FID</td></tr><tr><td>DCGAN (Radford et al., 2015)</td><td>6.16 ± 0.07</td><td colspan="2">6.58</td></tr><tr><td>Improved-GAN</td><td/><td/><td/></tr></table>

Comparison with state-of-the-art methods on three benchmark datasets. "CIFAR-10 IS" means the inception score for samples generated by SSL models trained on CIFAR-10. " †" is obtained by running the released code accompanied by the corresponding papers. "-" means the results are not reported in the original work and without released code. "/" means not applicable, e.g. the models cannot generate samples stochastically. " ‡" uses image data augmentation which significantly helps classification performance. The upper/lower blocks show generative/discriminative SSL methods respectively.

Table content: <table><tr><td>Methods</td><td>error (%) MNIST</td><td>error (%) SVHN</td><td>error (%) CIFAR-10</td><td>IS CIFAR-10</td></tr><tr><td>CatGAN (Springenberg, 2016)</td><td>1.91 ± 0.10</td><td>-</td><td colspan="2">19.58 ± 0.46 3.57 ± 0.13  †</td></tr><tr><td>SDGM</td><td/><td/><td/><td/></tr></table>

Peer review (iclr2019):
 This paper addresses an important problem of learning the random field using neural networks by using a inclusive auxiliary generator. Comparing to existing state-of-the-art methods for learning neural random fields, this paper used a the inclusive-divergence (KL divergence of the density approximate and the auxiliary generator) which avoids the intractable entropy term. SGLD/SGHMC are used to revise samples drawn from the auxiliary generator and these two sampling methods are examined theoretically. In generally, the paper is well motivated and well written. Experiments are sufficient and convincing, especially the synthetic data experiments with GMM distributions. However, I am a little bit concerned that the theoretical contribution seems weak. As discussed in the related work, the idea of using neural network to learn the random field is not new. Using inclusive-divergence is also not new, e.g. Xie et al (2016) and Wang & Ou (2017) already proposed to use the inclusive-divergence. If I understand it correctly, the only contribution here is to apply the SGLD/SGHMC to revise the samples and authors provided some theoretical analysis of SGLD/SGHMC. The overall technical quality of the paper is sound but I am not 100% sure about the equations, e.g. the second line in Eq. 4. In summary, this paper is well written and authors have done a good job. But I will appreciate if authors can elaborate more on the novelty and innovation of the paper.