Probabilistic programs with dynamic computation graphs can define measures over sample spaces with unbounded dimensionality, which constitute programmatic analogues to Bayesian nonparametrics. Owing to the generality of this model class, inference relies on `black-box' Monte Carlo methods that are often not able to take advantage of conditional independence and exchangeability, which have historically been the cornerstones of efficient inference. We here seek to develop a `middle ground' between probabilistic models with fully dynamic and fully static computation graphs. To this end, we introduce a combinator library for the Probabilistic Torch framework. Combinators are functions that accept models and return transformed models. We assume that models are dynamic, but that model composition is static, in the sense that combinator application takes place prior to evaluating the model on data. Combinators provide primitives for both model and inference composition. Model combinators take the form of classic functional programming constructs such as map and reduce. These constructs define a computation graph at a coarsened level of representation, in which nodes correspond to models, rather than individual variables. Inference combinators implement operations such as importance resampling and application of a transition kernel, which alter the evaluation strategy for a model whilst preserving proper weighting. Owing to this property, models defined using combinators can be trained using stochastic methods that optimize either variational or wake-sleep style objectives. As a validation of this principle, we use combinators to implement black box inference for hidden Markov models.
翻译:具有动态计算图的概率性程序可以界定具有无限制的维度的抽样空间的测量尺度,这是Bayesian非参数性的程序类比。由于模型类的笼统性,推断依赖“黑盒子”蒙特卡洛方法,而这些方法往往无法利用有条件的独立和互换性,而后者历来是有效推断的基石。我们在这里寻求在具有完全动态和完全静态计算图的概率性模型之间开发一个“中点 ” 。为此,我们为概率 Toch 框架引入了一个调色器库。组合器是接受模型和返回变型模型的功能。我们假设模型是动态的,但模型的构成是静态的,在评估数据模型之前,组合器为模型和推导价构成最原始的。模型采用典型的功能性能编程结构,例如地图和完全静态的计算图。我们为图表绘制了一个分层结构的计算图,在其中,节点的风格是接受模型和返回的模型。我们假定模型是动态的模型,而模型是动态的,但模型的构成是静态的,而模型的构成是静态的,这种结构结构结构的调整的变式应用是用来的。 将评估方法用来进行排序的排序的排序的变式,使用这种变式的计算方法,使用这种变式的计算方法,使用这种变式的变式的变式的变式的变式的变式,使用。 将的计算方法,使用这种变式的计算方法,使用这种变式的变式的计算方法,使用这种变式的计算方法,使用这种变式,使用这种变式的变式的变式,使用这种变式的计算方法作为的变式的变式的变式的变式的变式的变式的变的变式,使用这种变式的变式的变式的变式的变的变式,用的变式的变式,使用一种的变式的变式的变式的变式,用的变式的变式的变式的变式的变式的变式的变的变的变式的变的变的变的变的变的变的变的变的变的变的变的变的变的变的变的变的变的变的变的变的变的变的变的变的变