JMLR: Workshop and Conference Proceedings 1:1–14, 2017

ICML 2017 AutoML Workshop

Neural Block Sampling Tongzhou Wang Yi Wu David Moore Stuart Russell

SIMON . L @ BERKELEY. EDU JXWUYI @ GMAIL . COM DAVMRE @ GMAIL . COM RUSSELL @ BERKELEY. EDU

EECS, UC Berkeley

Abstract Efficient Monte Carlo inference often requires manual construction of model-specific proposals. We propose an approach to automated proposal construction by training neural networks to provide fast approximations to block Gibbs conditionals. The learned proposals generalize to occurrences of common structural motifs both within a given model and across models, allowing for the construction of a library of learned inference primitives that can accelerate inference on unseen models with no model-specific training required.

1. Introduction Model-based probabilistic inference is a highly successful paradigm for machine learning, with applications to a variety of tasks. People learn and plan using mental models, and indeed the entire enterprise of modern science can be viewed as constructing a sophisticated hierarchy of models of physical, mental, and social phenomena. Probabilistic programming provides a formal representation of models as sample-generating programs, promising the ability to explore a rich range of models, including those non-differentiable models with discrete variables, context-specific dependencies or open-universe semantics. This requires us to perform efficient inference in novel models, motivating the development of black-box inference techniques. Unfortunately, generic inference methods such as single-site Gibbs sampling often perform poorly, suffering from slow mixing and bad local optima. Effective real-world inference often requires block proposals that update multiple variables together to overcome near-deterministic and long-range dependence structures. However, computing exact Gibbs proposals for large blocks quickly becomes intractable (approaching the difficulty of posterior inference), and in practice it is common to invest significant effort in hand-engineering proposals specific to a particular model. In this work, we propose to learn tractable block samplers, in the form of approximate Gibbs proposals, that can then be reused both within a given model and across models containing similar structural motifs. Recent work has recognized that a wide range of models can be represented as compositions of simple components (Grosse et al., 2012), and that domain-specific models may still reuse general structural motifs such as chains, grids, or trees (Kemp and Tenenbaum, 2008). By learning flexible samplers, we can improve inference not only within a specific model but also on previously unseen models containing similar structures, with no additional training required — even if the new model has completely different parameterizations of conditional distributions. We explore different applications including discrete models from UAI inference competition, open-universe Gaussian mixture models and a real-world named entity recognition (NER) task. We show that a simple learned block proposal yields performance comparable (or better) to a modelspecific hand-tuned sampler, and generalizes to models more than those it was trained on.

© 2017 T. Wang, Y. Wu, D. Moore & S. Russell.

N EURAL B LOCK S AMPLING

2. Neural Block MCMC We train neural networks to approximate the Gibbs proposal for a block of variables. Each learned proposal is specific to a particular block structure and a conditioning set corresponding to an approximate Markov blanket. Together we refer to these components as a structural motif. Crucially our proposals do not fix the model parameters, which are instead provided as input to the network, so that the same trained network may be reused to perform inference on novel models with parameterizations not previously observed. Our inference networks are parameterized as mixture density networks (Bishop, 1994), and trained to minimize the Kullback-Leibler divergence between the true posterior conditional and the approximate proposal, given prior samples generated from the model. The approximate proposals are then accepted or rejected following the Metropolis-Hastings (MH) rule (Andrieu et al., 2003), so that we maintain the correct stationary distribution even though the proposals are approximate. 2.1. Background Although our approach generalizes to arbitrary probabilistic programs, for simplicity we focus on models represented as factor graphs. A model consists of a set of variables V represented as the nodes of a graph G = (V, E), along with a set of factors specifying a joint probability distribution pΨ (V ), generically described by parameters Ψ. In particular, this paper focuses primarily on discrete directed models, in which the factors Ψ are the conditional probability tables (CPTs) describing the distribution of each variable given its parents. In undirected models, such as the CRFs in Section 3.2, the factors are arbitrary functions associated with cliques in the graph. Given observations of a set of evidence variables, inference attempts to compute (by way of drawing samples) the conditional distribution on the remaining variables. A standard approach is Gibbs sampling, in which each variable vi is successively resampled from its conditional distribution p(vi |V¬i ) given all other variables V¬i in the graph. In most cases this conditional in fact depends only on a subset of V¬i , known as the Markov blanket, MB(vi ) ⊆ V¬i . Each Gibbs update can be viewed as a MH proposal that is accepted by construction, thus inheriting the MH guarantee that the limiting distribution of the sampling process is the desired posterior conditional distribution. 2.2. Structural Motifs in Graphical Models We identify each learned proposal with a structural motif that determines the shape of the network inputs and outputs. Structural motifs can be arbitrary subgraphs, but we are more interested in motifs that represent interesting conditional structure between two sets of variables, the block proposed variables B and the conditioning variables C. A given motif can have multiple instantiations with a model, or across models. As a concrete example, Figure 1 shows two instantiations of a structural motif of 6 consecutive variables in

Figure 1: Two instantiations of a structural motif in a directed chain. The motif consists of two consecutive variables and their Markov blanket of four neighboring variables. Each instantiation is separated into block proposing variables Bi (white) and conditioning variables Ci (shaded).

2

N EURAL B LOCK S AMPLING

a chain model. In each instantiation, we approximate the conditional distribution of two middle variables given neighboring four. Definition 1 A structural motif (or motif in short) is an (abstract) graph with nodes partitioned into two components, B and C, and a parameterized joint distribution p(B, C) whose factorization is consistent with the graph structure. This specifies the functional form of the conditional p(B|C), but not the specific parameters. Definition 2 Within a graphical model (G, Ψ), G = (V, E), an instantiation of a structural motif is a subset of the model variables (Bi , Ci ) ⊆ V such that the induced subgraph on (Bi , Ci ) is isomorphic to the motif (B, C), with the partition preserved by the isomorphism (so nodes in B are mapped to Bi , and C to Ci ). An instantiation also includes the subset of model parameters Ψi ⊆ Ψ required to specify the joint distribution pΨi (B, C) on the motif variables. We would typically define a structural motif by first picking out a block of variables B to jointly sample, and then selecting a conditioning set C. Intuitively, the natural choice for a conditioning set is the Markov blanket, C = MB(B). However, this is not a fixed requirement, and C could be either a subset or superset of the Markov blanket (or neither). We might deliberately choose to use some alternate conditioning set C, e.g., a subset of the Markov blanket to gain a faster proposal, or a superset with the idea of learning longer-range structure. More fundamentally, however, Markov blankets depend on the larger graph structure and might not be consistent across instantiations of a given motif (e.g., if one instantiation has additional edges connecting Bi to other model variables not in Ci ). Allowing C to represent a generic conditioning set therefore leaves us with greater flexibility in instantiating a motif. Formally, our goal is to learn a Gibbs-like block proposal q(Bi |Ci ; Ψi ) for all instantiations of a structural motif {(Bi , Ci , Ψi )}i that is close to the true conditional in the sense that ∀i, ∀ci ∈ supp(Ci ), q(Bi ; ci , Ψi ) ≈ pΨ (Bi |Ci = ci )

(1)

This provides another view of this approximation problem. If we choose the motif to have complex structures in each instantiation, the conditionals pΨ (Bi |Ci = ci ) can often be quite different for different i, and thus difficult to approximate. Therefore, choosing what is a structural motif represents a trade-off between generality of the proposal and easiness to approximate. While our approach works for any structural motif complying with the above definition, we suggest using common structures as motifs, such as chain of certain length as in Figure 1. In principle, one could automatically detect recurring motifs, but in this work, we focus on hand-identified commons structures. 2.3. Parameterizing and Training Neural Block Proposals We choose mixture density networks (MDN) (Bishop, 1994) as our proposal parametrization. An MDN is a form of neural network whose outputs parametrize a mixture distribution, where in each mixture component the variables are uncorrelated. In our case, a neural block proposal is a function qθ parametrized by a MDN with weights θ. The function qθ represents proposals for a structural motif {(Bi , Ci , Ψi )}i by taking in current values of Ci and local parameters Ψi and outputting a distribution over Bi . Then, the goal becomes to optimize θ so qθ is close to the true conditional.

3

N EURAL B LOCK S AMPLING

We use the Kullback-Leibler (KL) divergence D(pΨ (Bi |Ci ) k qθ (Bi ; Ci , Ψi )) as the measure of closeness to the true conditional in Equation (1). We would like to minimize this divergence across all settings of Ci . For simplicity, we first focus on one particular instantiation of the motif (Bi , Ci , Ψi ). To account for all Ci values, we choose to minimize the expected divergence over prior of Ci : ECi [D(pΨ (Bi |Ci ) k qθ (Bi ; Ci , Ψi ))] = −EBi ,Ci [log qθ (Bi ; Ci , Ψi )] + constant.

(2)

Taking into account multiple instantiations of the motif, we train using average expected KL divergence among different instantiations. Given a motif with N instantiations, we define the overall loss as: N 1 X L(θ) = − EBi ,Ci [log qθ (Bi ; Ci , Ψi )]. (3) N i=1

We further optimize L(θ) using minibatch SGD with batch size K, which utilizes Monte Carlo estimation of the gradient of the loss L(θ) by randomly selecting K instantiations and sampling Bi and Ci from the model prior: (j)

(j)

i(j) ∼ Unif{1, . . . , N }, Bi(j) , Ci(j) ∼ pΨ (Bi(j) , Ci(j) ), ∇θ L(θ) ≈ −

j = 1, . . . , K

K 1 X (j) (j) ∇θ log qθ (Bi(j) ; Ci(j) ; Ψi(j) ) K

(4) (5)

j=1

2.4. Neural Block MCMC

Algorithm 1 Neural Block MCMC Algorithm

The neural block MCMC procedure is outlined in Algorithm 1. It is worth pointing our framework allows a great amount of flexibility. One may be only interested in a good proposal for a particular part of a particular model. Then a neural block proposal can be trained with the underlying motif occurring in that specific part. In other cases, one may want to learn a general proposal, say for all grid models. Then we can work with a grid-shaped motif that have instantiations in every possible grid model, and extend the training procedure described in Section 2.3 by modifying Equation (4) to match arbitrary distribution over all instantiations, as experimented in Section 3.1. Therefore, it is potentially possible to store a library of neural block proposals trained on common motifs to speed up inference on previously unseen models.

3. Experiments We evaluate our method of learning neural block proposals against single-site Gibbs sampler as well as a model-specific MCMC method. Due to space limit, we only demonstrate preliminary results of discrete grid models and NER models in this section. More experiment details as well as the experiments of open-universe Gaussian mixture models are deferred to appendix. 4

N EURAL B LOCK S AMPLING

3.1. Grid Models We start with a common structural motif in graphical models, grids. Here, we focus on binary-valued grid models of all sorts for their relative easiness to directly compute posteriors. Specifically, to test the performance of MCMC algorithms, we compare the estimated posterior marginals Pˆ against true posterior marginals P computed using IJGP (Mateescu et al., 2010). Then, for each inference task the er with N variables, we calculated 1 PN ˆ ror N i=1 P (Xi = 1) − P (Xi = 1) as the mean abFigure 2: Motif in general grid models solute deviation of marginal probabilities. contains 9 proposing variables (white), We consider the motif shown in Figure 2, which oc- and 14 conditioning variables (shaded) curs in arbitrary binary-valued grid Bayesian networks that form the Markov blanket. Dashed (BN). The neural block proposal takes in CPTs of all the gray arrows represent dependencies that 23 = 9 + 14 variables as well as the current assignments may exist but are irrelevant to the conof 14 conditioning variables in Markov blanket, and out- ditional we are interested in. put the proposal distribution for the 9 proposal variables. In order for the proposal to be general, we randomly generate grid BNs by sampling each CPT entry in the model and train the MDN on all these random grids. After training, the proposal is completely fixed. We evaluate the performance of the trained neural block proposal on all 180 grid BNs up to 500 nodes from UAI 20081 inference competition. In each epoch of MCMC, for each latent variable, we identify and propose the block as in Figure 2 when possible. Otherwise, e.g., when the variable is at boundary or close to evidence, we do single-site Gibbs resampling instead. Figure 3 shows the performance of both neural block Figure 3: Performance difference be- MCMC and singles-site Gibbs in terms of error integrated tween single-site Gibbs and our method over time for all 180 models. The models are divided on 180 grid models from UAI 2008 in- into three classes, grid-50, grid-75 and grid-90, according ference competition. Each mark repre- to the percentage of deterministic relations. Our neural sents integrated errors for both methods block MCMC significantly outperforms single-site Gibbs sampler in almost every model. in a single run over 1200s inference. To further investigate the performance of neural block MCMC, we focus on 3 grid models with different percentage of deterministic relations and compare it with single-site Gibbs, and exact block Gibbs with the same proposal block. Figure 4 illustrates the performance of three algorithms w.r.t. both time and epochs. Single-site Gibbs performs worst on all three models since it gets stuck very quickly in local modes. Between the two block proposal MCMC methods, neural block MCMC is more performing in terms of error w.r.t. time due to shorter computational time. However, because the neural block proposal is only an approximate of the true block Gibbs proposal, it is worse in terms of error w.r.t. epochs, as expected. 1. http://graphmod.ics.uci.edu/uai08

5

N EURAL B LOCK S AMPLING

Figure 4: Sample runs on three models (left: grid-50; middle: grid-75; right: grid-90) using singlesite Gibbs (blue), neural block MCMC (red), and block Gibbs with true conditional (green). We measure the average error w.r.t. to running time and epochs respectively.

Figure 5: Averaged F1 score and log likelihood of the MCMC algorithms over entire test dataset. 3.2. NER Tagging Named entity recognition (NER) is a task of inferring named entity tags for words in natural language sentences. Here we utilize the approach proposed in (Liang et al., 2008), which trains a conditional random field (CRF) representing the joint distribution of tags and word features. In particular, this undirected model contains weights between word features and tags and high order factors between/among consecutive tags. For each test sentence, it builds a chain Markov random field (MRF) containing only the tag variables using extracted word features and learned CRF model, and then applies MCMC methods like single-site Gibbs to sample the NER tags. The training dataset consists of 17494 sentences taken from CoNLL-2003 Shared Task2 . Our goal is to train good neural block proposals for the chain MRFs built for test sentences. In order to experiment with different block sizes, we train three proposals, each for a motif of 2 (similar to Figure 1), 3, or 4 consecutive proposed tag variables and their Markov blankets. With each proposal, the MDN takes in both the local MRF parameters and assignments of Markov blanket variables, then outputs the block proposal.. Due to the difficulty in generating natural language sentences, we reuse the training dataset for CRF model to train neural block proposals. We then evaluate the learned neural block proposals on the previously unseen test dataset of 3453 sentences. Figure 5 plots the performance of neural block MCMC and single-site Gibbs w.r.t. both time and epochs on the entire test dataset. As block size grows larger, learned proposal takes more time to mix. But eventually, block proposals generally achieve better performance than singlesite Gibbs in terms of both F1 scores and log likelihoods. Therefore, as shown in the figure, a mixed proposal of single-site Gibbs and neural block proposals can achieve better mixing without slowing down much. As an interesting observation, neural block MCMC sometimes achieves higher F1 scores even before passing single-site Gibbs in log likelihood, implying that log likelihood is at best an imperfect proxy for performance on this task. 2. http://www.cnts.ua.ac.be/conll2003/ner/

6

N EURAL B LOCK S AMPLING

References Christophe Andrieu, Nando De Freitas, Arnaud Doucet, and Michael I Jordan. An introduction to MCMC for machine learning. Machine learning, 50(1):5–43, 2003. Marcin Andrychowicz, Misha Denil, Sergio G´omez, Matthew W Hoffman, David Pfau, Tom Schaul, and Nando de Freitas. Learning to learn by gradient descent by gradient descent. In D. D. Lee, M. Sugiyama, U. V. Luxburg, I. Guyon, and R. Garnett, editors, Advances in Neural Information Processing Systems 29, pages 3981–3989. Curran Associates, Inc., 2016. Christopher M Bishop. Mixture density networks. 1994. Yuri Burda, Roger Grosse, and Ruslan Salakhutdinov. Importance weighted autoencoders. arXiv preprint arXiv:1509.00519, 2015. Roger Grosse, Ruslan R Salakhutdinov, William T Freeman, and Joshua B Tenenbaum. Exploiting compositionality to explore a large space of model structures. In 28th Conference on Uncertainly in Artificial Intelligence, pages 15–17. AUAI Press, 2012. Shixiang Gu, Zoubin Ghahramani, and Richard E Turner. Neural adaptive sequential Monte Carlo. In Advances in Neural Information Processing Systems, pages 2629–2637, 2015. Nicolas Heess, Daniel Tarlow, and John Winn. Learning to pass expectation propagation messages. In Advances in Neural Information Processing Systems, pages 3219–3227, 2013. Sonia Jain and Radford M Neal. A split-merge Markov chain Monte Carlo procedure for the Dirichlet process mixture model. Journal of Computational and Graphical Statistics, 13(1):158–182, 2004. Charles Kemp and Joshua B Tenenbaum. The discovery of structural form. Proceedings of the National Academy of Sciences, 105(31):10687–10692, 2008. Diederik P Kingma and Max Welling. Auto-encoding variational Bayes. arXiv preprint arXiv:1312.6114, 2013. Tuan Anh Le, Atlm Gne Baydin, and Frank Wood. Inference Compilation and Universal Probabilistic Programming. In 20th International Conference on Artificial Intelligence and Statistics, Fort Lauderdale, FL, USA, 2017. Ke Li and Jitendra Malik. Learning to optimize neural nets. arXiv preprint arXiv:1703.00441, 2017. Percy Liang, Hal Daum´e III, and Dan Klein. Structure compilation: trading structure for features. In Proceedings of the 25th international conference on Machine learning, pages 592–599. ACM, 2008. Robert Mateescu, Kalev Kask, Vibhav Gogate, and Rina Dechter. Join-graph propagation algorithms. Journal of Artificial Intelligence Research, 37(1):279–328, 2010. Robert Nishihara, Thomas Minka, and Daniel Tarlow. Detecting parameter symmetries in probabilistic models. arXiv preprint arXiv:1312.5386, 2013. B. Paige and F. Wood. Inference networks for sequential Monte Carlo in graphical models. In Proceedings of the 33rd International Conference on Machine Learning, volume 48 of JMLR, 2016. Daniel Ritchie, Anna Thomas, Pat Hanrahan, and Noah Goodman. Neurally-guided procedural models: Amortized inference for procedural graphics programs using neural networks. In D. D. Lee, M. Sugiyama, U. V. Luxburg, I. Guyon, and R. Garnett, editors, Advances in Neural Information Processing Systems 29, pages 622–630. Curran Associates, Inc., 2016. 7

N EURAL B LOCK S AMPLING

Stephane Ross, Daniel Munoz, Martial Hebert, and J Andrew Bagnell. Learning message-passing inference machines for structured prediction. In Computer Vision and Pattern Recognition (CVPR), 2011 IEEE Conference on, pages 2737–2744. IEEE, 2011. Andreas Stuhlm¨uller, Jacob Taylor, and Noah Goodman. Learning stochastic inverses. In Neural Information Processing Systems, 2013. Daniel Turek, Perry de Valpine, Christopher J Paciorek, Clifford Anderson-Bergman, et al. Automated parameter blocking for efficient Markov chain Monte Carlo sampling. Bayesian Analysis, 2016. Deepak Venugopal and Vibhav Gogate. Dynamic blocking and collapsing for Gibbs sampling. In Uncertainty in Artificial Intelligence, page 664. Citeseer, 2013. Wei Wang and Stuart J Russell. A smart-dumb/dumb-smart algorithm for efficient split-merge MCMC. In UAI, pages 902–911, 2015.

8

N EURAL B LOCK S AMPLING

Appendix A. Related Work There has been a great deal of interest in using learned, feedforward inference networks to generate approximate posteriors. Variational autoencoders (Kingma and Welling, 2013) train an inference network jointly with the parameters of the forward model to maximize a variational lower bound. Within the VAE framework, Burda et al. (2015) and Gu et al. (2015) utilize another neural network as an adaptive proposal distribution to improve the convergence of variational inference. However, the uses of a parametric variational distribution mean they typically have limited capacity to represent complex, potentially multimodal posteriors, such as those incorporating discrete variables or structural uncertainty. A related line of work has developed data-driven proposals for importance samplers (Paige and Wood, 2016; Le et al., 2017; Ritchie et al., 2016), training an inference network from prior samples which is then used as a proposal given observed evidence. In particular, Le et al. (2017) generalizes the framework to probabilistic programming, and is able to automatically generate and train a neural proposal network given an arbitrary model described in a probabilistic program. Our approach differs in that we focus on MCMC inference, allowing modular proposals for subsets of model variables that may depend on latent quantities, and exploit recurring substructure, and that generalize to new models containing analogous structures with no additional training. Several approaches have been proposed for adaptive block sampling, in which sets of variables exhibiting strong correlations are identified dynamically during inference, so that costly joint sampling is used only for blocks where it is likely to be beneficial (Venugopal and Gogate, 2013; Turek et al., 2016). This is largely complementary to our current approach, which assumes the set of blocks (structural motifs) is given and attempts to learn fast approximate proposals. Perhaps most closely related to our current work is the idea of learning Gibbs-like proposals from stochastic inverses of graphical models (Stuhlm¨uller et al., 2013). Because these proposals are trained online during inference, they will in principle converge to the true Gibbs conditional, whereas our proposals are always approximate. However, our approach is simpler, requiring no model-specific training, and generates proposals that may be reused both within and across different models. Section B.2 explores this comparison empirically. Taking a much broader view, the approach in this work of learning an approximate local update scheme can be seen as related to approximate message passing (Ross et al., 2011; Heess et al., 2013), and to recent advances in learning gradient-based optimizers for continuous objectives (Andrychowicz et al., 2016; Li and Malik, 2017).

Appendix B. Experiment Details In the mixture density network output, mixture weights are represented explicitly. Within each mixture component, distributions of bounded discrete variables are directly represented as probability tables, and distributions of continuous variables are represented as isotropic Gaussians with mean and variance. To avoid degenerate proposals, we threshold the variance of each Gaussian component to be at least 0.00001. B.1. Grid Models In our experiment, the MDN is parametrized as a 3-layer perception with 106-480-480-120 structure. The output of the proposal distribution is a mixture of 12 components.

9

N EURAL B LOCK S AMPLING

Figure 6: Small version of the triangle grid model used in experiment B.2, with evidence represented as shaded nodes at bottom layer. The actual network has 15 layers and 120 nodes.

Figure 7: Motif for the triangle grid model in Figure 6. Proposed variables are white, and conditioning variables are shaded, which form the Markov blanket. Dashed gray arrows show possible but irrelevant dependencies.

In order for the proposal to be general, we need to consider motif instantiations in all possible binary-valued grid models. We randomly generated grid BNs by sampling each CPT entry i.i.d. from the following mixed distribution:  1  w.p. 40 [0, 1] 1 (6) [1, 0] w.p. 40   19 Dirichlet([0.5, 0.5]) w.p. 20 B.2. Compare with Stochastic Inverse MCMC Neural block proposals can also be used model-specifically by training only a particular model. In this subsection, we demonstrate that our method can achieve comparable performance with a more complex task-specific MCMC method, the stochastic inverse MCMC (Stuhlm¨uller et al., 2013). Figure 6 illustrates the triangle grid model we use in this experiment, which is the same model used in Stuhlm¨uller et al. (2013). For our method, we chose the motif shown in Figure 7. The underlying MDN, with 161-1120-1120-224 network structure, takes in assignments of conditioning variables and all relevant CPTs, then outputs a block proposal represented as a mixture of 16 components. The proposal is trained on all instantiations in this triangle model using prior samples. Stochastic inverse MCMC is an algorithm that builds auxiliary data structures offline to speed up inference. Given an inference task, it computes and trains an inverse graph for each latent variable where the latent variable is at the bottom and evidence variables are at top. These inverse graphs are then used in MCMC procedures. In this experiment, we run stochastic inverse MCMC with frequency density estimator trained with posterior samples, proposal block size up to 20 and Gibbs proposals precomputed, following the original approach in (Stuhlm¨uller et al., 2013). It is difficult to compare these two methods w.r.t. time. While both methods require offline training, stochastic inverse MCMC needs to train inverse graphs from scratch if the set of evidence nodes changes, yet neural block MCMC only needs one-time training for different inference tasks on this model. In this experiment setting, for each inference epoch, both methods propose about 10

N EURAL B LOCK S AMPLING

Figure 8: Performance of MCMC algorithms on the triangle grid model w.r.t. epochs. Each semitransparent line represents a single MCMC run. Opaque lines show averages over 10 MCMC runs for each algorithm. Numbers in parentheses denote the amount of training data. 10.5 values on average per latent variable. Figure 8 shows a more meaningful comparison of error w.r.t. epochs among single-site Gibbs, neural block MCMC, and stochastic inverse MCMC with different amount of training data. The learned neural block proposal, trained using 104 samples, is able to achieve comparable performance with stochastic inverse MCMC, which is trained using 105 samples and builds model-specific data structure (inverse graphs). B.3. Gaussian Mixture Model with Unknown Number of Components We next consider open-universe Gaussian mixture models (GMMs), in which the number of mixture components is unknown, subject to a prior. Similarly to Dirichlet process GMMs, these are typically treated with hand-designed, model-specific split-merge MCMC algorithms. Specifically, we study the performance of neural block MCMC and split-merge Gibbs on a Gaussian mixture model shown in Figure 9. In this setting, n points x = {xi }i=1,...,n are observed from the GMM with unknown number of active mixtures M ∼ Unif{1, 2, . . . , m}. Each point comes uniformly randomly from one of the M active mixtures. Our task is to infer the posterior of mixture means µ = {µj }j=1,...,M , the indicators showing their activeness v = {vj }j=1,...,M , and the labels z = {zi }i=1,...,n , where zi is the mixture index xi comes from. Formally, the model can be written as: M ∼ Unif{1, 2, . . . , m} µj ∼ N (0, σµ2 I) v|M ∼ Unif{a ∈ {0, 1}m :

j = 1, . . . , m X

aj = M }

j

zi |v ∼ Unif{j : vj = 1}

i = 1, . . . , n

xi |zi , µ ∼ N (µzi , σ 2 I)

i = 1, . . . , n,

where m, n, σµ2 and σ 2 are model parameters. P Notice that M is completely dependent of v, so in this experiment, we always calculate M = j aj instead of sampling M . The GMM has many nearly-deterministic relations. For example, relations like p(vj = 0, zi = j) = 0 cause vanilla single-site Gibbs often stuck in local optima and unable to jump across 11

N EURAL B LOCK S AMPLING

M µj

v

... j = 1, . . . , m

zi ... xi i = 1, . . . , n

Figure 9: A Gaussian mixture model with unknown number of components M , component means µ, and N observed points xi with cluster labels zi . We represent the open-universe modelP in truncated form, where each vj determines whether the jth cluster is active in the model, so that j vj = M deterministically. different M values and to efficiently explore the state space. To solve such issues, split-merge MCMC algorithms, such as Restricted Gibbs split-merge (RGSM) (Jain and Neal, 2004) and SmartDumb/Dumb-Smart (SDDS) (Wang and Russell, 2015), use hand-designed model-specific MCMC moves that split and merge mixture components. For neural block MCMC framework, it is possible to deal with such nearly-deterministic relations with a proposal block including all of z, µ and v. However, doing so would require a large MDN and a long training time. Instead, we train a proposal qθ for two arbitrary mixtures (µi , vi ) and (µj , vj ) conditioned on all other variables except z. With z taken out of the input, the proposal is able propose values outside local modes. However, we still need account for z to be accepted by MH rule. We first experiment with the intuitive approach which adds a resampling step for z in the proposal. At each proposal, qθ is first used to propose new mixtures µ0 and v0 , and then z is proposed from p(z|µ0 , v0 , x). While this approach gives good performance, it suffers greatly from low acceptance ratio as size of z, i.e., number of observed points n, grows large. Our second attempt considers the model with z variables collapsed. By ignoring z, the proposal is essentially working with this collapsed model. Moreover, we can think of the inference task as first sampling µ, v from the collapsed model p(µ, v|x) and then sampling z from p(z|µ, v, x). Because the likelihood of this particular collapsed model is fairly simple to calculate, we modify the algorithm such that the proposal from qθ is accepted or rejected by the MH rule on the collapsed model. Afterwards, z is then resampled from p(z|µ, v, x). We adopt this approach because that it generally leads to better performance, especial with large n. In training, we notice that such mixture models have symmetries that must be broken before used as input to the neural network (Nishihara et al., 2013). In particular, the mixtures {(vj , µj )}j can be permuted in m! ways and the points {(zi , xi )}i in n! ways. Following a similar procedure as in Le et al. (2017), we sort these values according the first principal component of x, and also feed the first principal component vector into the MDN. Using prior samples, we train a neural block proposal for the mentioned structural motif with a MDN of 156-624-624-36 structure and 4 mixture components in output distribution. In inference, we randomly choose two clusters to propose at each time.

12

N EURAL B LOCK S AMPLING

Figure 10: Average log likelihoods of algorithms run on 200 inference tasks for a total of 600s in various GMMs.

Figure 11: Trace plots of M over 12 runs from initiations with different M values on a GMM with m = 12, n = 90. Neural block MCMC explores the sample space significantly faster than Gibbs with SDDS. 13

N EURAL B LOCK S AMPLING

Although our proposal is trained on a GMM with a specific number of mixtures m = 8 and number of points n = 60, we also experiment applying on GMMs with larger m and n by randomly selecting 8 mixtures and 60 points for each proposal. Figure 10 shows how the neural block MCMC performs on GMM of various sizes, comparing against split-merge Gibbs with SDDS. In particular, we notice that as model gets larger, Gibbs with SDDS mixes more slowly, while neural block MCMC still mixes fairly fast and outperforms Gibbs with SDDS. Figure 11 shows a trace plot of M for both algorithms over multiple runs on the same observation. Gibbs with SDDS takes a long time to find a high likelihood explanation and fails to explore other possible ones efficiently. Neural block MCMC, on the other hand, mixes quickly among the possible explanations. B.4. NER Tagging In Figure 5, all variables in every test MRF is proposed roughly once for all algorithms per epoch. F1 scores are measured using states with highest likelihood seen over Markov chain traces. To better show comparison, epoch plots are cut off at 500 epochs and time plots at 12850s. Log likelihoods shown don’t include normalization constant. In this experiment, the trained MDN outputs a mixture of 4 components.

Appendix C. Discussion and Future Work This paper proposes and explores the (to our knowledge) novel idea of training neural nets to approximate block Gibbs proposals. Our proposals are trained offline and can be applied directly to novel models given only a common set of structural motifs. Experiments show that the neural block sampling approach can help overcome bad local modes comparing with single-site Gibbs sampling and achieve comparable performance against model-specialized methods. In the current stage, our framework requires the user to manually detect common structural motifs and choose where and how to apply the pretrained block sampler. It will be a very interesting direction to investigate, when given a library of trained block proposals, how an inference system can automatically detect the common structural motifs and (adaptively) apply appropriate samplers to help convergence for real-world applications.

14

Neural Block Sampling

enterprise of modern science can be viewed as constructing a sophisticated hierarchy of models of physical, mental, and ... However, computing exact Gibbs proposals for large blocks ..... generate grid BNs by sampling each CPT entry in the.

1MB Sizes 3 Downloads 300 Views

Recommend Documents

Block
What does Elie's father learn at the special meeting of the Council? 11. Who were their first oppressors and how did Wiesel say he felt about them? 12. Who was ...

Block
10. What does Elie's father learn at the special meeting of the Council? 11. Who were their ... 5. What did the Jews in the train car discover when they looked out the window? 6. When did ... How did Elie describe the men after the air raid? 8.

Adaptive Sampling based Sampling Strategies for the ...
List of Figures. 1.1 Surrogate modeling philosophy. 1. 3.1 The function ( ). ( ) sin. y x x x. = and DACE. 3.1a The function ( ). ( ) sin. y x x x. = , Kriging predictor and .... ACRONYMS argmax. Argument that maximizes. CFD. Computational Fluid Dyna

Sampling Instructions Navigating to a Sampling Site ...
Jul 1, 2010 - Use the steps below to navigate to a sampling site on Lake Attitash using the Garmin GPSMap 76CSx hand-held GPS. The unit used by the association has been pre-programmed with the coordinates of the sampling sites. To use a different Gar

Portable contaminant sampling system
Dec 12, 2007 - 8/1976 BrouWer. 4,092,845 A. 6/1978 Prodi et a1. .... an apple, or the surface of a machine or tool. At present, gas is sampled through the use ...

SAMPLING PRODUCTS.pdf
Sign in. Loading… Page 1. Whoops! There was a problem loading more pages. Retrying... SAMPLING PRODUCTS.pdf. SAMPLING PRODUCTS.pdf. Open. Extract. Open with. Sign In. Main menu. Displaying SAMPLING PRODUCTS.pdf.

Sampling Methods
Solution 1: approximate integral by. ˆG = T. ∑ t=1 g(xt)p(xt)∆x, ... t=1 E[g(Xt)] = G. convergence: ... Solution 1: Probability integral transformation: If X ∼ F, then U ...

The LED Block Cipher
AddConstants: xor round-dependent constants to the two first columns ..... cube testers: the best we could find within practical time complexity is ... 57 cycles/byte.

1st Block
Dec 10, 2009 - 50 20 10 20 70. **Grading Completed: 10 Assmnts. 10928. 5. 5. 13. 10. 13. 28 16 10 20 29. 67.42. 11332. 5. 5. 15. 10. 15. 46 18. 5 19 61. 90.04.

block panchayat.pdf
Which Arab traveller visited Security Act (MISA) was party of? (c) HimachalPradesh (c) Indian Iron & Steel Co. ... (b) RajendraSingh (d) MN GovindanNair for a file with a high degree (d) expert. www.keralapsctips.blogspot.in ... (a) 120 (b) 150 was I

AV​ ​BLOCK MarkTuttleMD.com
Mobitz​​II​​block​​is​​usually​​located​​in​​the​​infra-His​​conduction​​system​​(wide​​QRS​​in​​80%​​of​​cases)​​but​​can.

Block Watcher -
Internet Protocol)? If so, you may want to check to make sure you have enhanced 911 service. Without ... internet company when she moved. If you have Voice ...

sampling theory pdf
Page 1 of 1. File: Sampling theory pdf. Download now. Click here if your download doesn't start automatically. Page 1 of 1. sampling theory pdf. sampling theory pdf. Open. Extract. Open with. Sign In. Main menu. Displaying sampling theory pdf. Page 1

BLOCK SECRETARY thozhilvartha.pdf
The first medical college in (d) wherever. Dipersion b) Tamil Nadu 32. Which is the river that flows ... INSATC-21 d) SwathiThirunal I c) Manju Varior I a) Geneva b)Vienna 1 76. Hardly had the train moved - .75th Amendment 123) The ..... BLOCK SECRET

Block 2 Trim.pdf
connection oriented protocols are reliable network services that provide guarantees that data will. arrive in the proper sequence, however, they place a greater ...

BLOCK 3.pdf
computer systems to ensure the availability, integrity, and confidentiality of. information. ... a committee in Oasis-Open. The protocol .... BLOCK 3.pdf. BLOCK 3.

Block 1.pdf
There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. Block 1.pdf.Missing:

APA Block Quotes.pdf
models, research questions, hypothesis, and specification of information needed. The. research ... APA Block Quotes.pdf. APA Block Quotes.pdf. Open. Extract.

Block 1.pdf
There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. Block 1.pdf.

BLOCK SECRETARY thozhilvartha.pdf
Page 1 of 2. 2015 2eJ3O4 1wiimm 19: 2, The flst girls school in Soul of the Constitution' by d) Benzyl chloride outputs? which have rural broadband 68) First ...

command block minecraft.pdf
command block minecraft.pdf. command block minecraft.pdf. Open. Extract. Open with. Sign In. Main menu. Displaying command block minecraft.pdf. Page 1 of ...

block – 4
string in a particular font, and method getLeading() to get the appropriate line spacing for the font. There are many more methods in ..... ->Gives choices for multiple options. JButton -> Accepts command and does the action .... The common analogy i

Coal Block - Jindal.pdf
Mr Devashish Bharuka, Ms Rita Jha, Mr Jatin Sehgal. and Mr Ravi Baruka. For the Respondent/UoI : Mr Sanjay Jain, ASG, Mr Akshay Makhija, CGSC,. Mr Amit ...