Black-Box Policy Search with Probabilistic Programsjwvdm/assets/pdf/vandemeent... · Black-Box...

14
Black-Box Policy Search with Probabilistic Programs Jan-Willem van de Meent Brooks Paige David Tolpin Frank Wood Department of Engineering Science, University of Oxford Abstract In this work we show how to represent policies as programs: that is, as stochastic simulators with tunable parameters. To learn the param- eters of such policies we develop connections between black box variational inference and existing policy search approaches. We then explain how such learning can be implemented in a probabilistic programming system. Us- ing our own novel implementation of such a system we demonstrate both conciseness of policy representation and automatic policy parameter learning for a set of canonical rein- forcement learning problems. 1 Introduction In planning under uncertainty the objective is to find a policy that selects actions, given currently available information, in a way that maximizes expected re- ward. In many cases an optimal policy can neither be represented compactly nor learned exactly. On- line approaches to planning, such as Monte Carlo Tree Search [Kocsis and Szepesv´ ari, 2006], are nonparamet- ric policies that select actions based on simulations of future outcomes and rewards, also known as roll- outs. While policies like this are often able to achieve near optimal performance, they are computationally intensive and do not have compact parameterizations. Policy search methods (see Deisenroth et al. [2011] for a review) learn parameterized policies offline, which then can be used without performing rollouts at test time, trading off improved test-time computation against having to choose a policy parameterization that may be insufficient to represent the optimal policy. In this work we show how probabilistic programs can represent parametric policies in a both more general Appearing in Proceedings of the 19 th International Con- ference on Artificial Intelligence and Statistics (AISTATS) 2016, Cadiz, Spain. JMLR: W&CP volume 41. Copyright 2016 by the authors. and compact manner. We also develop automatic infer- ence techniques for probabilistic programming systems to do model-agnostic policy search. Our proposed ap- proach, which we call black box policy learning (BBPL), is a variant of Bayesian policy search [Wingate et al., 2011, 2013] in which policy learning is cast as stochastic gradient ascent on the marginal likelihood. In contrast to languages that target a single domain- specific algorithm [Andre and Russell, 2002, Srivastava et al., 2014, Nitti et al., 2015], our formulation empha- sizes the use of general-purpose techniques for Bayesian inference, in which learning is used for inference amor- tization. To this end, we adapt black-box variational inference (BBVI), a technique for approximation of the Bayesian posterior [Ranganath et al., 2014, Wingate and Weber, 2013] to perform (marginal) likelihood maximization in arbitrary programs. The resulting technique is general enough to allow implementation in a variety of probabilistic programming systems. We show that this same technique can be used to per- form policy search under an appropriate planning as inference interpretation, in which a Bayesian model is weighted by the exponent of the reward. The resulting technique, BBPL is closely related to classic policy gra- dient methods such as REINFORCE [Williams, 1992]. We present case studies in the Canadian traveler prob- lem, the RockSample domain, and introduce a setting inspired by Guess Who [Coster and Coster, 1979] as a benchmark for optimal diagnosis problems. 2 Policies as Programs Probabilistic programming systems [Milch et al., 2007, Goodman et al., 2008, Minka et al., 2014, Pfeffer, 2009, Mansinghka et al., 2014, Wood et al., 2014, Gordon et al., 2014] represent generative models as programs in a language that provides specialized syntax to in- stantiate random variables, as well as syntax to impose conditions on these random variables. The goal of in- ference in a probabilistic program is to characterize the distribution on its random variables subject to the imposed conditions, which is done using one or more generic methods provided by an inference backend. arXiv:1507.04635v4 [stat.ML] 4 Aug 2016

Transcript of Black-Box Policy Search with Probabilistic Programsjwvdm/assets/pdf/vandemeent... · Black-Box...

Page 1: Black-Box Policy Search with Probabilistic Programsjwvdm/assets/pdf/vandemeent... · Black-Box Policy Search with Probabilistic Programs Jan-Willem van de Meent Brooks Paige David

Black-Box Policy Search with Probabilistic Programs

Jan-Willem van de Meent Brooks Paige David Tolpin Frank WoodDepartment of Engineering Science, University of Oxford

Abstract

In this work we show how to represent policiesas programs: that is, as stochastic simulatorswith tunable parameters. To learn the param-eters of such policies we develop connectionsbetween black box variational inference andexisting policy search approaches. We thenexplain how such learning can be implementedin a probabilistic programming system. Us-ing our own novel implementation of such asystem we demonstrate both conciseness ofpolicy representation and automatic policyparameter learning for a set of canonical rein-forcement learning problems.

1 Introduction

In planning under uncertainty the objective is to finda policy that selects actions, given currently availableinformation, in a way that maximizes expected re-ward. In many cases an optimal policy can neitherbe represented compactly nor learned exactly. On-line approaches to planning, such as Monte Carlo TreeSearch [Kocsis and Szepesvari, 2006], are nonparamet-ric policies that select actions based on simulationsof future outcomes and rewards, also known as roll-outs. While policies like this are often able to achievenear optimal performance, they are computationallyintensive and do not have compact parameterizations.Policy search methods (see Deisenroth et al. [2011] for areview) learn parameterized policies offline, which thencan be used without performing rollouts at test time,trading off improved test-time computation againsthaving to choose a policy parameterization that maybe insufficient to represent the optimal policy.

In this work we show how probabilistic programs canrepresent parametric policies in a both more general

Appearing in Proceedings of the 19th International Con-ference on Artificial Intelligence and Statistics (AISTATS)2016, Cadiz, Spain. JMLR: W&CP volume 41. Copyright2016 by the authors.

and compact manner. We also develop automatic infer-ence techniques for probabilistic programming systemsto do model-agnostic policy search. Our proposed ap-proach, which we call black box policy learning (BBPL),is a variant of Bayesian policy search [Wingate et al.,2011, 2013] in which policy learning is cast as stochasticgradient ascent on the marginal likelihood.

In contrast to languages that target a single domain-specific algorithm [Andre and Russell, 2002, Srivastavaet al., 2014, Nitti et al., 2015], our formulation empha-sizes the use of general-purpose techniques for Bayesianinference, in which learning is used for inference amor-tization. To this end, we adapt black-box variationalinference (BBVI), a technique for approximation of theBayesian posterior [Ranganath et al., 2014, Wingateand Weber, 2013] to perform (marginal) likelihoodmaximization in arbitrary programs. The resultingtechnique is general enough to allow implementationin a variety of probabilistic programming systems. Weshow that this same technique can be used to per-form policy search under an appropriate planning asinference interpretation, in which a Bayesian model isweighted by the exponent of the reward. The resultingtechnique, BBPL is closely related to classic policy gra-dient methods such as REINFORCE [Williams, 1992].

We present case studies in the Canadian traveler prob-lem, the RockSample domain, and introduce a settinginspired by Guess Who [Coster and Coster, 1979] as abenchmark for optimal diagnosis problems.

2 Policies as Programs

Probabilistic programming systems [Milch et al., 2007,Goodman et al., 2008, Minka et al., 2014, Pfeffer, 2009,Mansinghka et al., 2014, Wood et al., 2014, Gordonet al., 2014] represent generative models as programsin a language that provides specialized syntax to in-stantiate random variables, as well as syntax to imposeconditions on these random variables. The goal of in-ference in a probabilistic program is to characterizethe distribution on its random variables subject to theimposed conditions, which is done using one or moregeneric methods provided by an inference backend.

arX

iv:1

507.

0463

5v4

[st

at.M

L]

4 A

ug 2

016

Page 2: Black-Box Policy Search with Probabilistic Programsjwvdm/assets/pdf/vandemeent... · Black-Box Policy Search with Probabilistic Programs Jan-Willem van de Meent Brooks Paige David

Black-Box Policy Search with Probabilistic Programs

(defquery ctp"Probabilistic program representing an agentsolving the Canadian Traveler Problem"

[graph src tgt base-prob make-policy](let [sub-graph

(sample-weather graph base-prob src tgt)[path dist counts](dfs-agent sub-graph src tgt (make-policy ))]

(factor (- dist))(predict :path path)(predict :distance dist)(predict :counts counts )))

(defm dfs-agent"Run depth-first-search from start to target,prioritizing edges according to policy"

[graph start target policy]... )

(defm make-random-policy"Policy: Select edge at random"[](fn policy [u vs](sample(categorical(zipmap vs (repeat (count vs) 1.))))))

(defm make-edge-policy"Policy: learn priorities for each edge"[](let [Q (mem (fn [u v]

(sample [u v](tag :policy(gamma 1. 1.)))))]

(fn policy [u vs](argmax(zipmap vs (map (fn [v] (Q u v)) vs ))))))

Figure 1: A Canadian traveler problem (CTP) implementation in Anglican. In the CTP, an agent must travelalong a graph, which represents a network of roads, to get from the start node (green) to the target node (red).Due to bad weather some roads are blocked, but the agent does not know which in advance. Upon arrival at eachnode the agent observes the set of open edges. The function dfs-agent walks the graph by performing depth-firstsearch, calling a function policy to choose the next destination based on the current and unvisited locations.The function make-random-policy returns a policy function that selects destinations uniformly at random, whereasmake-edge-policy constructs a policy that selects according to sampled edge preferences (Q u v). By learning adistribution on each value (Q u v) through gradient ascent on the marginal likelihood, we obtain a heuristic offlinepolicy that follows the shortest path when all edges are open, and explores more alternate routes as more edgesare closed.

In sequential decision problems we must define astochastic simulator of an agent, which chooses ac-tions based on current contextual information, and astochastic simulator of the world, which may have someinternal variables that are opaque to the agent, butprovides new contextual information after each action.For sufficiently simple problems, both the agent andthe world simulator can be adequately described asgraphical models. Here we are interested in using prob-abilistic programs as simulators of both the world andthe agent. The trade-off made in this approach is thatwe can incorporate more detailed assumptions aboutthe structure of the problem into our simulator of theagent, which decreases the size of the search space, atthe expense of having to treat these simulators as blackboxes from the perspective of the learning algorithm.

In Figure 1 we show an example of a program, written

in the language Anglican [Wood et al., 2014], whichsimulates an agent in the Canadian traveler problem(CTP) domain. This agent traverses a graph usingdepth first search (DFS) as a base strategy, choosingedges either at random, or according to sampled prefer-ences. Probabilistic programs can describe a family ofalgorithmic policies, which may make use of program-ming constructs such as recursion, and higher-orderfunctions and arbitrary deterministic operations. Thisallows us to define structured policies that enforce ba-sic constraints, such as the rule that you should nevertravel the same edge twice.

Given a base policy program, we can define differentparametrizations that encode additional structure, suchas the typical travel distance starting from each edge.We can then formulate a Bayesian approach to pol-icy learning, in which we place a prior on the policy

Page 3: Black-Box Policy Search with Probabilistic Programsjwvdm/assets/pdf/vandemeent... · Black-Box Policy Search with Probabilistic Programs Jan-Willem van de Meent Brooks Paige David

Jan-Willem van de Meent, Brooks Paige, David Tolpin, Frank Wood

parameters and optimize its hyperparameters to max-imize the reward. To do so we employ a planning asinference interpretation [Toussaint et al., 2006, Rawliket al., 2012, Neumann, 2011, Hoffman et al., 2009a,b,Levine and Koltun, 2013] that casts policy search asstochastic gradient ascent on the marginal likelihood.

A challenge in devising methods for approximate in-ference in probabilistic programs is that such methodsmust deal gracefully with programs that may not in-stantiate the same set of random variables in eachexecution. For example, the random policy in Figure 1will generate a different set of categorical variables ineach execution, depending on the path followed throughthe graph. Similarly, the edge based policy samplesvalues (Q u v) lazily, depending on the visited nodes.

In this paper we develop an approach to policy learn-ing based on black box variational inference (BBVI)[Ranganath et al., 2014, Wingate and Weber, 2013], atechnique for variational approximation of the posteriorin Bayesian models. We begin by reviewing planning asinference formulations of policy search. We then showhow BBVI can be adapted to perform hyperparameteroptimization. In a planning as inference interpretationthis method, which we call black box policy learning(BBPL), is equivalent to classic policy gradient meth-ods. We then describe how BBPL may be implementedin the context of probabilistic programs with varyingnumbers of random variables, and provide a language-agnostic definition of the interface between the programand the inference back end.

3 Policy Search as Bayesian Inference

In sequential decision problems, an agent drawsan action ut from a policy distribution π(ut |xt),which may be deterministic, conditioned on a con-text xt. The agent then observes a new contextxt+1 drawn from a distribution p(xt+1 |ut, xt). Inthe finite horizon case, where an agent performs afixed number of actions T , resulting in a sequenceτ = (x0, u0, x1, u1, x2, . . . , uT−1, xT ), which is knownas a trajectory, or roll-out. Each trajectory gets areward R(τ). Policy search methods maximize the ex-pected reward Jθ = Epθ [R(τ)] for a family of stochasticpolicies πθ with parameters θ

Jθ =

∫R(τ)pθ(τ) dτ, (1)

pθ(τ) := p(x0)

T−1∏t=0

π(ut |xt, θ)p(xt+1 |ut, xt). (2)

We are interested in performing upper-level policysearch, a variant of the problem defined in terms ofthe hyperparameters λ of a distribution pλ(τ, θ) that

places a prior pλ(θ) on the policy parameters

Jλ =

∫R(τ)pλ(τ, θ) dτ dθ, (3)

pλ(τ, θ) := pλ(θ)p(τ | θ). (4)

Upper-level policy search can be interpreted as maxi-mization of the normalizing constant Zλ of an unnor-malized density

γλ(τ, θ) = pλ(τ, θ) exp(βR(τ)), (5)

Zλ =

∫γλ(τ, θ) dτ dθ (6)

= Epλ [exp(βR(τ))]. (7)

The constant β > 0 has the interpretation of an ‘inversetemperature’ that controls how strongly the densitypenalizes sub-optimal actions. The normalization con-stant Zλ is the expected value of the exponentiatedreward exp(βR(τ)), which is known as the desirabil-ity in the context of optimal control [Kappen, 2005,Todorov, 2009]. It is not a priori obvious that max-imization of the expected reward Jλ yields the samepolicy hyperparameters as maximization of the desire-ability Zλ, but it turns out that the two are in factequivalent, as we will explain in section 5.

In planning as inference formulations, γλ(τ, θ)/Zλ is of-ten interpreted as a posterior pλ(τ, θ | r) conditioned ona pseudo observable r = 1 that is Bernoulli distributedwith probability p(r = 1 | τ) ∝ exp(βR(τ)), resultingin a joint distribution that is proportional to γλ(τ, θ),

p(r = 1, τ, θ) ∝ pλ(τ, θ) exp(βR(τ)) = γλ(τ, θ). (8)

Maximization of Zλ is then equivalent to the maximiza-tion of the marginal likelihood pλ(r = 1) with respectto the hyperparameters λ. In a Bayesian context thisis known as empirical Bayes (EB) [Maritz and Lwin,1989], or type II maximum likelihood estimation.

4 Black-box Variational Inference

Variational Bayesian methods [Wainwright and Jordan,2008] approximate an intractable posterior with a moretractable family of distributions. For purposes of ex-position we consider the case of a posterior p(z, θ | y),in which y is a set of observations, θ is a set of modelparameters, and z is a set of latent variables. We writep(z, θ | y) = γ(z, θ)/Z with

γ(z, θ) = p(y | z, θ)p(z | θ)p(θ), (9)

Z =

∫γ(z, θ) dz dθ. (10)

Variational methods approximate the posterior using aparametric family of distributions qλ by maximizing a

Page 4: Black-Box Policy Search with Probabilistic Programsjwvdm/assets/pdf/vandemeent... · Black-Box Policy Search with Probabilistic Programs Jan-Willem van de Meent Brooks Paige David

Black-Box Policy Search with Probabilistic Programs

lower bound on logZ with respect to λ

Lλ = Eqλ [log γ(z, θ)− log qλ(z, θ)] (11)

= logZ −DKL(qλ(z) || γ(z)/Z) ≤ logZ. (12)

This objective may be optimized with stochastic gradi-ent ascent [Hoffman et al., 2013]

λk+1 = λk + ρk∇λLλ∣∣λ=λk

, (13)

∇λLλ = Eqλ(z)[∇λ log qλ(z) log

γ(z, θ)

qλ(z, θ))

]. (14)

Here ρk is a sequence of step sizes that satisfies theconditions

∑∞k=1 ρk = ∞ and

∑∞k=1 ρ

2k < ∞. The

calculation of the gradient ∇λLλ requires an integralover qλ. For certain models, specifically those wherethe likelihood and prior are in the conjugate exponen-tial family [Hoffman et al., 2013], this integral can beperformed analytically.

Black box variational inference targets a much broaderclass of models by sampling z[n], θ[n] ∼ qλ and replacingthe gradient for each component i with a sample-basedestimate [Ranganath et al., 2014]

∇λiLλ =

N∑n=1

∇λi log qλ(z[n], θ[n])(logw[n] − bi), (15)

w[n] = γ(z[n], θ[n])/qλ(z[n], θ[n]), (16)

in which bi is a control variate that reduces the varianceof the estimator

bi =

∑Nn=1(∇λi log qλ(z[n], θ[n]))2w[n]∑Nn=1(∇λi log qλ(z[n], θ[n]))2

. (17)

5 Black-box Policy Search

The sample-based gradient estimator in BBVI resem-bles the one used in classic likelihood-ratio policy gra-dient methods [Deisenroth et al., 2011], such as RE-INFORCE [Williams, 1992], G(PO)MDP [Baxter andBartlett, 1999, Baxter et al., 1999], and PGT [Suttonet al., 1999]. There is in fact a close connection be-tween BBVI and these methods, as has been noted bye.g. Dayan et al. [1995], Mnih and Gregor [2014] andBa et al. [2014].

To make this connection precise, let us consider what itwould mean to perform variational inference in a plan-ning as inference setting. In this case, we can definea lower bound Lλ,λ0

on logZλ0in terms of a varia-

tional distribution qλ(τ, θ) with parameters λ and anunnormalized density γλ0

(τ, θ) of the form in equation5, with parameters λ0

Lλ,λ0 = Eqλ [log γλ0(z, θ)− log qλ(z, θ)] (18)

= Eqλ

[βR(τ) + log

pλ0(τ, θ)

qλ(τ, θ)

](19)

If we now choose a variational distribution with thesame form as the prior, then qλ(τ, θ) = pλ0(τ, θ) when-ever λ = λ0. Under this assumption, the lower boundat λ = λ0 simplifies to

Lλ,λ0

∣∣∣λ=λ0

= Eqλ [βR(τ)]∣∣∣λ=λ0

= βJλ

∣∣∣λ=λ0

. (20)

In other words, the lower bound Lλ,λ0is proportional to

the expected reward Jλ when the variational posterioris equal to the prior.

The gradient of the lower bound similarly simplifies to

∇λLλ,λ0

∣∣∣λ=λ0

= Eqλ

[∇λ log qλ(τ, θ) log

γλ0(τ, θ)

qλ(τ, θ)

] ∣∣∣λ=λ0

= Eqλ0

[∇λ log qλ(τ, θ)

∣∣∣λ=λ0

βR(τ)

]=

∫dτdθ ∇λqλ(τ, θ)

∣∣∣λ=λ0

βR(τ)

= ∇λJλ∣∣∣λ=λ0

.

The implication of this identity is that we can performgradient ascent on Jλ by making a slight modificationto the update equation

λk+1 = λk + ρk∇λLλ,λk∣∣λ=λk

. (21)

The difference in these updates is that instead of cal-culating the gradient ∇λLλ,λ0

estimate relative to afixed set of prior parameters λ0, we update the pa-rameters of the prior pλk(τ, θ) after each gradient step,and calculate the gradient ∇λLλ,λk . We note that theconstant β is simply a scaling factor on the step sizesρk, and will from here on assume that β = 1.

When BBVI is performed using the update step inequation 21, and the variational family qλ is chosento have the same form as the prior pλ, we obtain aprocedure for EB estimation, which maximizes thenormalizing constant Zλ with respect to the parametersλ of the prior. The difference between the EB andmaximum likelihood (ML) methods is that the firstcalculates the gradient relative to hyperparameters λ,whereas the other calculates the gradient relative to theparameters θ. Because this difference relates only to theassumed model structure, EB estimation is sometimesreferred to as Type II maximum likelihood.

As is evident from equation 20, EB estimation in thecontext of planning as inference formulations maxi-mizes the expected reward Jλ. In the context of aprobabilistic programming system this means that wecan effectively get three algorithms for the price of one:If we can provide an implementation of BBVI, thenthis implementation can be adapted to perform EBestimation, which in turn allows us to perform pol-icy search by simply defining models where exponent

Page 5: Black-Box Policy Search with Probabilistic Programsjwvdm/assets/pdf/vandemeent... · Black-Box Policy Search with Probabilistic Programs Jan-Willem van de Meent Brooks Paige David

Jan-Willem van de Meent, Brooks Paige, David Tolpin, Frank Wood

of the reward takes the place of the likelihood terms.This results in a method that we call black box policylearning (BBPL), which is equivalent to variants ofREINFORCE applied to upper-level policy search.

6 Learning Probabilistic Programs

An implementation of BBVI and BBPL for probabilisticprogram inference needs to address two domain-specificissues. The first is that probabilistic programs need notalways instantiate the same set of random variables,the second is that we need to distinguish between dis-tributions that define model parameters θ and thosethat define latent variables z, or variables that are partof the context x in the case of decision problems.

Let us refer back to the program in Figure 1. Thefunction dfs-agent performs a recursive loop until astopping criterion is met: either the target node isreached, or there are no more paths left to try. At eachstep dfs-agent makes a call to policy, which is createdby either calling make-random-policy or make-edge-policy.A random policy samples uniformly from unexploreddirections. When depth first search is performed withthis policy, we are defining a model in which the numberof context variables is random, since the number ofsteps required to reach the goal state will vary. In thecase of the edge policy, we use a memoized function tosample edge preference values as needed, choosing theunexplored edge with the highest preference at eachstep. In this case the number of parameter variablesis random, since we only instantiate preferences foredges that are (a) open, and (b) connect to the currentlocation of the agent.

As has been noted by Wingate and Weber [2013], BBVIcan deal with varying sets of random variables quitenaturally. Since the gradient is computed from a sam-ple estimate, we can compute gradients for a eachrandom variable by simply averaging over those execu-tions in which the variable exists. Sampling variablesas needed can in fact be more statistically efficient,since irrelevant variables that never affect the trajec-tory of the agent will not contribute to the gradientestimate. BBVI has the additional advantage of havingrelatively light-weight implementation requirements; itonly requires differentiation of the log proposal den-sity, which is a product over primitive distributionsof a limited number of types, for which derivativescan be computed analytically. This is in contrast toimplementations based on (reverse-mode) automaticdifferentiation [Pearlmutter and Siskind, 2008], as isused in Stan [Kucukelbir et al., 2015], which storederivative terms for the entire computation graph.

To provide a language-agnostic definition of BBVI andBBPL, we formalize learning in probabilistic programs

as the interaction between a program P and an in-ference back end B. The program P represents alldeterministic steps in the computation and has inter-nal state (e.g. its environment variables). The backend B performs all inference-related tasks.

A program P executes as normal, but delegates to theinference back end whenever it needs to instantiate arandom variable, or evaluate a conditioning statement.The back end B then supplies a value for the randomvariable, or makes note of the probability associatedwith the conditioning statement, and then delegatesback to P to continue execution. We will assumethat the programming language provides some wayto differentiate between latent variables z, which aresimply to be sampled, and parameters θ for which adistribution is to be learned. In Anglican the syntax(sample (tag :policy d)), as used in Fig. 1, is used as ageneral-purpose mechanism to label distributions onrandom variables. An inference back end can simplyignore these labels, or implement algorithm-specificactions for labeled subsets.

In order for the learning algorithm to be well-defined inprograms that instantiate varying numbers of randomvariables, we require that the each random variable zais uniquely identified by an address a, which may eitherbe generated automatically by the language runtime,or specified by the programmer. Each model parameterθb is similarly identified by an address b.

In BBVI, the interface between a program P and theback end B can be formalized with the following rules:

• Initially B calls P with no arguments P().

• A call to P returns one of four responses to B:

1. (sample, a, f, φ): Identifies a latent randomvariable (not a policy parameter) za withunique address a, distributed according tofa(· |φa). The back end generates a valueza ∼ fa(· |φa) and calls P(za).

2. (learn, b, f, η): For policy parameters, the ad-dress b identifies a random variable θb in themodel, distributed according to a distributionfb with parameters ηb. The back end gener-ates θb ∼ fb(· |λb) conditioned on a learnedvariational parameter λb and registers an im-portance weight wb = fb(θb | ηb)/fb(θb |λb).Execution continues by calling P(θb).

3. (factor, c, l): Here c is a unique address for afactor with log probability lc and importanceweight wc = exp(lc). Execution continues bycalling P().

4. (return, v): Execution completes, returninga value v.

Page 6: Black-Box Policy Search with Probabilistic Programsjwvdm/assets/pdf/vandemeent... · Black-Box Policy Search with Probabilistic Programs Jan-Willem van de Meent Brooks Paige David

Black-Box Policy Search with Probabilistic Programs

Because each call to P is deterministic, an executionhistory is fully characterized by the values for eachrandom variable that are generated by B. However theset of random variables that is instantiated may varyfrom execution to execution. We write A,B,C for theset of addresses of each type visited in a given execution.The program P now defines an unnormalized densityγP of the form

γP(z, θ) := pP(z, θ)∏c∈C

exp(lc), (22)

pP(z, θ) :=∏a∈A

fa(za |φa)∏b∈B

fb(θb | ηb) . (23)

Implicit in this notation is the fact that the distributiontypes fa(· |φa) and fb(· | ηb) are return values from callsto P, which implies that both the parameter valuesand the distribution type may vary from executionto execution. While fa(· |φa) and fb(· | ηb) are fullydetermined by preceding values for z and θ, we assumethey are opaque to the inference algorithm, in thesense that no analysis is performed to characterizethe conditional dependence of each φa or ηb on otherrandom variables in the program.

Given the above definition of a target density γP(z, θ),we are now in a position to define the density of avariational approximation Qλ to the program. In thisdensity, the runtime values ηb are replaced by varia-tional parameters λb

pQλ(z, θ) :=∏a∈A

fa(za |φa)∏b∈B

fb(θb |λb) . (24)

This density corresponds to that of a mean-field proba-bilistic program, where the dependency of each θb onother random variables is ignored.

Repeated execution of P given the interface describedabove results in a sequence of weighted samples(w[n], θ[n], z[n]), whose importance weight w[n] is de-fined as

w[n] := γP(z[n], θ[n]) / pQλ(z[n], θ[n])

=∏b∈B

f(θ[n]b | ηb)

f(θ[n]b |λb)

∏c∈C

exp l[n]c . (25)

With this notation in place, it is clear that we candefine a lower bound LQλ,Qλk analogous to that ofEquation 19, and a gradient estimator analogous tothat of Equation 15, in which the latent variables ztake the role of the trajectory variables τ . In summary,we can describe a sequential decision problem as aprobabilistic program P in which the log probabilitieslc are interpreted as rewards, parameters θb define thepolicy and all other latent variables za are trajectoryvariables. EB inference can then be used to learn the

Algorithm 1 Black-box Policy Learning

initialize parameters λ0,b ← ηb, iteration k = 0repeat

Set initial λk+1 = {λk,b}b∈BRun N executions of program Qλk , generating

(w[n], θ[n], z[n]) according to Eqns. 24, 25for each address b do

Let Nb ≤ N be the # of runs containing b

Let g[n]b := ∇λk,b log f(θ

[n]b |λk,b)

Compute baseline bλk,b from Eq. 17

∇λk,bJλk ← Nb−1∑ g

[n]b (logw[n] − bλk,b)

Update λk+1,b ← λk,b + ρk∇λk,bJλkend fork ← k + 1

until parameters λb converge

hyperparameters λ that maximize the expected reward,as described in Algorithm 1.

An assumption that we made when deriving BBPL isthat the variational distribution qλ(τ, θ) must have thesame analytical form as the prior pλ0(τ, θ). Practicallythis requirement means that a program P must bewritten in such a way that the values of the hyperpa-rameters ηb have the same constant values in everyexecution, since their values may not depend on thoseof random variables. One way to enforce this is to passη as a parameter in the initial call P(η) by B, thoughwe do not formalize such a requirement here.

7 Case Studies

We demonstrate the use of programs for policy searchin three problem domains: (1) the Canadian TravelerProblem, (2) a modified version of the RockSamplePOMDP, and (3) an optimal diagnosis benchmark in-spired by the classic children’s game Guess Who.

These three domains are examples of deterministicPOMDPs, in which the initial state of the world is notknown, and observations may be noisy, but the statetransitions are deterministic. Even for discrete variantsof such problems, the number of possible informationstates xt = (u0, o1, . . . , ut−1, ot) grows exponentiallywith the horizon T , meaning that it is not possible tofully parameterize a distribution π(u |x, θ) in terms of aconditional probability table θx,u. In our probabilisticprogram formulations for these problems, the agent ismodeled as an algorithm with a number of randomparameters, and we use BBPL to learn the distributionon parameters that maximizes the reward.

We implement our case studies using the probabilisticprogramming system Anglican [Wood et al., 2014]. Weuse the same experimental setup in each of the three

Page 7: Black-Box Policy Search with Probabilistic Programsjwvdm/assets/pdf/vandemeent... · Black-Box Policy Search with Probabilistic Programs Jan-Willem van de Meent Brooks Paige David

Jan-Willem van de Meent, Brooks Paige, David Tolpin, Frank Wood

110 210 310

Gradient Steps

1.0

1.5

2.0

2.5

3.0M

ean

Dis

tanc

e20 Nodes

110 210 310

Gradient Steps

50 Nodes

Figure 2: Convergence for CTP domains of 20 and50 nodes. Blue lines show the mean traveled distanceusing the learned policy, averaged over 5 domains. Redlines show the mean traveled distance for the optimisticheuristic policy. Dash length indicates the fraction ofopen edges, which ranges from 1.0 to 0.6.

domains. A trial begins with a learning phase, in whichBBPL is used to learn the policy hyperparameters,followed by a number of testing episodes in which theagent chooses actions according to a fixed learned policy.At each gradient update step, we use 1000 samplesto calculate a gradient estimate. Each testing phaseconsists of 1000 episodes. All shown results are basedon test-phase simulations.

Stochastic gradient methods can be sensitive to thelearning rate parameters. Results reported here use aRMSProp style rescaling of the gradient [Hinton et al.],which normalizes the gradient by a discounted rollingdecaying average of its magnitude with decay factor0.9. We use a step size schedule ρk = ρ0/(τ + k)κ asreported in Hoffman et al. [2013], with τ = 1, κ = 0.5in all experiments. We use a relatively conservativebase learning rate ρ0 = 0.1 in all reported experi-ments. For independent trials performed across a range1, 2, 5, 10, . . . , 1000 of total gradient steps, consistentconvergence was observed in all runs using over 100gradient steps.

The source code for the case studies, as well as theBBPL implementation, is available online.1

7.1 Canadian Traveler Problem

In the Canadian Traveler Problem (CTP) [Papadim-itriou and Yannakakis, 1991], an agent must traverse agraph G = (V,E), in which edges may be missing atrandom. It is assumed the agent knows the distanced : E → R+ associated with each edge, as well asthe probability p : E → (0, 1] that the edge is open,but has no advance knowledge of the edges that areblocked. The problem is NP-hard [Fried et al., 2013],

1https://bitbucket.org/probprog/black-box-policy-search

Figure 3: Learned policies for the Rock Sample domain.Edge weights indicate the frequency at which the agentmoves between each pair of rocks. Starting points arein green, exit paths in red.

and heuristic online and offline approaches [Eyerichet al., 2010] are used to solve problem instances.

The results in Figure 1 show that the learned policybehaves in a reasonable manner. When edges are openwith high probability, the policy takes the shortestpath from the start node, marked in green, to thetarget node, marked in red. As the fraction of closededges increases, the policy makes more frequent useof alternate routes. Note that each edge has a fixedprobability of being open in our set-up, resulting in apreference for routes that traverse fewer edges.

Figure 2 shows convergence as a function of the numberof gradient steps. Results are averaged over 5 domainsof 20 and 50 nodes respectively. Convergence plotsfor each individual domain can be found in the sup-plementary material. We compare the learned policiesagainst the optimistic policy, a heuristic that selectsedges according to the shortest path, assuming thatall unobserved edges are open. We observe that meantraveled distance for the learned policy converges tothat of the optimistic policy, which is close to optimal.

7.2 RockSample POMDP

In the RockSample POMDP [Smith and Simmons,2004], an N ×N square field with M rocks is given. Arover is initially located in the middle of the left edge ofthe square. Each of the rocks can be either good or bad;the rover must traverse the field and collect samplesof good rocks while minimizing the traveled distance.The rover can sense the quality of a rock remotely with

Page 8: Black-Box Policy Search with Probabilistic Programsjwvdm/assets/pdf/vandemeent... · Black-Box Policy Search with Probabilistic Programs Jan-Willem van de Meent Brooks Paige David

Black-Box Policy Search with Probabilistic Programs

0 2 4 6 8 10 12

Questions

0.0

0.2

0.4

0.6

0.8

1.0Re

ward

learned myopic random

Figure 4: (left) Average reward in Guess Who as afunction of number of questions. (right) Convergenceof rewards as function number of gradient steps. Eachdot marks an independent restart.

an accuracy decreasing with the distance to the rock.We consider a finite-horizon variant of the RockSampledomain, described in the supplementary material, witha structured policy in which a robot travels along rocksin a left-to-right order.

The policy plots in Figure 3 show that this simple policyresults in sensible movement preferences. In particularwe point out that in the 5×5 instance, the agent alwaysvisits the top-left rock when traveling to the top-middlerock, since doing so incurs no additional cost. Similarly,the agent follows an almost deterministic trajectoryalong the left-most 5 rocks in the 10× 10 instance, butdoes not always make the detour towards the lowerrocks afterwards.

7.3 Guess Who

Guess Who is a classic game in which players pick acard depicting a face, belonging to a set that is knownto both players. The players then take turns askingquestions until they identify the card of the other player[Coster and Coster, 1979]. We here consider a single-player setting where an agent asks a pre-determinednumber of questions, but the responses are inaccuratewith some probability. This is sometimes known as ameasurement selection, or optimal diagnosis problem.We make use of a feature set based on the originalgame, consisting of 24 individuals, characterized by11 binary attributes and two multi-class attributes,resulting in a total of 19 possible questions. We assumea response accuracy of 0.9. By design, the structureof the domain is such that there is no clear winningopening question. However the best question at anypoint is highly contextual.

We assume that the agent knows the reliability of theresponse and has an accurate representation of theposterior belief bt(s) = p(s |xt) for each candidate s

in given questions and responses. The agent selectsrandomly among the highest ranked candidates afterthe final question. We consider 3 policy variants, twoof which are parameter-free baselines. In the first base-line, questions are asked uniformly at random. Inthe second, questions are asked according to a my-opic estimate of the value of information [Hay et al.,2012], i.e. the change in expected reward relative tothe current best candidates, which is myopically op-timal in this setting. Finally, we consider a policythat empirically samples questions q according to aweight vq = γnq (Ab)q, based on the current belief b, aweight matrix A, and a discount factor γnq based on thenumber of times nq a question was previously asked. In-tuitively, this algorithm can be understood as learninga small set of α-vectors, one for each question, similarto those learned in point-based value iteration [Pineauet al., 2003]. The discounting effectively “shrinks” thebelief-space volume associated with the α-vector of thecurrent best question, allowing the agent to select thenext-best question.

The results in Figure 4 show that the learned policyclearly outperforms both baselines, which is a surpris-ing result given the complexity of the problem and therelatively simplistic form of this heuristic policy. Whilethese results should not be expected to be in any wayoptimal, they are encouraging in that they illustratehow probabilistic programming can be used to imple-ment and test policies that rely on transformationsof the belief or information state in a straightforwardmanner.

8 Discussion

In this paper we put forward the idea that probabilisticprograms can be a productive medium for describingboth a problem domain and the agent in sequentialdecision problems. Programs can often incorporateassumptions about the structure of a problem domainto represent the space of policies in a more targetedmanner, using a much smaller number of variables thanwould be needed in a more general formulation. Bycombining probabilistic programming with black-boxvariational inference we obtain a generalized variant ofwell-established policy gradient techniques that allow usto define and learn policies with arbitrary levels of algo-rithmic sophistication in moderately high-dimensionalparameter spaces. Fundamentally, policy programs rep-resent some form of assumptions about what contextualinformation is most relevant to a decision, whereas thepolicy parameters represent domain knowledge thatgeneralizes across episodes. This suggests future workto explore how latent variable models may be used torepresent past experiences in a manner that can berelated to the current information state.

Page 9: Black-Box Policy Search with Probabilistic Programsjwvdm/assets/pdf/vandemeent... · Black-Box Policy Search with Probabilistic Programs Jan-Willem van de Meent Brooks Paige David

Jan-Willem van de Meent, Brooks Paige, David Tolpin, Frank Wood

Acknowledgements

We would like to thank Thomas Keller for his assis-tance with Canadian traveler problem, and RajeshRanganath for helpful feedback on configuring RM-SProp for black-box variational inference. Frank Woodis supported under DARPA PPAML through the U.S.AFRL under Cooperative Agreement number FA8750-14-2-0006, Sub Award number 61160290-111668.

References

D. Andre and S. J. Russell. State Abstraction for Pro-grammable Reinforcement Learning Agents. In AAAI,2002.

J. Ba, V. Mnih, and K. Kavukcuoglu. Multiple objectrecognition with visual attention. In Proceedings of theInternational Conference on Learning Representations,2014. arXiv:1412.7755.

J. Baxter and P. Bartlett. Direct gradient-based reinforce-ment learning: I. Gradient estimation algorithms. Tech-nical report, Computer Sciences Laboratory, AustralianNational University, 1999.

J. Baxter, L. Weaver, and P. Bartlett. Direct gradient-basedreinforcement learning: II. Gradient ascent algorithmsand experiments. Technical report, Computer SciencesLaboratory, Australian National University, 1999.

T. Coster and O. Coster. Guess Who? http://theoradesign.com, 1979.

P. Dayan, G. E. Hinton, R. M. Neal, and R. S. Zemel. TheHelmholtz machine. Neural Computation, 7(5):889–904,1995.

M. P. Deisenroth, G. Neumann, and J. Peters. A Surveyon Policy Search for Robotics. Foundations and Trendsin Robotics, 2(2011):1–142, 2011.

P. Eyerich, T. Keller, and M. Helmert. High-quality policiesfor the Canadian traveler’s problem. In AAAI, 2010.

D. Fried, S. E. Shimony, A. Benbassat, and C. Wenner.Complexity of Canadian traveler problem variants. Theor.Comput. Sci., 487:1–16, 2013.

N. Goodman, V. Mansinghka, D. M. Roy, K. Bonawitz,and J. B. Tenenbaum. Church: a language for generativemodels. In Uncertainty in Artificial Intelligence, pages220–229, 2008.

A. D. Gordon, T. A. Henzinger, A. V. Nori, and S. K.Rajamani. Probabilistic programming. In InternationalConference on Software Engineering (ICSE, FOSE track),2014.

N. Hay, S. Russell, D. Tolpin, and S. Shimony. SelectingComputations: Theory and Applications. In Uncertaintyin Artificial Intelligence, 2012.

G. Hinton, N. Srivastava, and K. Swersky.http://www.cs.toronto.edu/˜tijmen/csc321/slides/lecture_slides_lec6.pdf.

M. D. Hoffman, D. M. Blei, C. Wang, and J. Paisley.Stochastic variational inference. Journal of MachineLearning Research, 14:1303–1347, 2013.

M. W. Hoffman, N. d. Freitas, A. Doucet, and J. R. Peters.An expectation maximization algorithm for continuous

Markov Decision Processes with arbitrary reward. InInternational Conference on Artificial Intelligence andStatistics, pages 232–239, 2009a.

M. W. Hoffman, H. Kueck, N. de Freitas, and A. Doucet.New inference strategies for solving Markov decisionprocesses using reversible jump MCMC. In Uncertaintyin Artificial Intelligence, pages 223–231. AUAI Press,2009b.

H. J. Kappen. Path integrals and symmetry breaking foroptimal control theory. Journal of Statistical Mechanics:Theory and Experiment, 2005(11), 2005. P11011.

L. Kocsis and C. Szepesvari. Bandit based Monte-Carloplanning. In European Conference on Machine Learning,pages 282–293, 2006.

A. Kucukelbir, R. Ranganath, A. Gelman, and D. M. Blei.Automatic Variational Inference in Stan. Neural Infor-mation Processing Systems, 2015.

S. Levine and V. Koltun. Guided Policy Search. In Inter-national Conference on Machine Learning, volume 28,pages 1–9, 2013.

V. Mansinghka, D. Selsam, and Y. Perov. Venture: ahigher-order probabilistic programming platform withprogrammable inference. arXiv preprint arXiv:1404.0099,2014.

J. S. Maritz and T. Lwin. Empirical Bayes methods, vol-ume 35. Chapman and Hall, London, 1989. ISBN0412277603.

B. Milch, B. Marthi, S. Russell, D. Sontag, D. L. Ong, andA. Kolobov. Blog: Probabilistic models with unknownobjects. Statistical relational learning, page 373, 2007.

T. Minka, J. Winn, J. Guiver, S. Webster, Y. Za-ykov, B. Yangel, A. Spengler, and J. Bronskill. In-fer.NET 2.6, 2014. Microsoft Research Cambridge.http://research.microsoft.com/infernet.

A. Mnih and K. Gregor. Neural variational inference andlearning in belief networks. In Proceedings of The 31stInternational Conference on Machine Learning, pages1791–1799, 2014.

G. Neumann. Variational Inference for Policy Search inChanging Situations. In International Conference onMachine Learning, 2011.

D. Nitti, V. Belle, and L. De Raedt. Planning in Discreteand Continuous Markov Decision Processes by Proba-bilistic Programming. In ECML PKDD, Lecture Notes inComputer Science, pages 327–342, Cham, 2015. SpringerInternational Publishing.

C. H. Papadimitriou and M. Yannakakis. Shortest pathswithout a map. Theor. Comput. Sci., 84(1):127–150, July1991.

B. A. Pearlmutter and J. M. Siskind. Using programminglanguage theory to make automatic differentiation soundand efficient. Advances in Automatic Differentiation,pages 79–90, 2008.

A. Pfeffer. Figaro: An object-oriented probabilistic pro-gramming language. Technical report, 2009.

J. Pineau, G. Gordon, and S. Thrun. Point-based valueiteration: An anytime algorithm for POMDPs. In In-ternational Joint Conference on Artificial Intelligence,pages 1025–1030, 2003.

Page 10: Black-Box Policy Search with Probabilistic Programsjwvdm/assets/pdf/vandemeent... · Black-Box Policy Search with Probabilistic Programs Jan-Willem van de Meent Brooks Paige David

Black-Box Policy Search with Probabilistic Programs

R. Ranganath, S. Gerrish, and D. M. Blei. Black Box Vari-ational Inference. In Artificial Intelligence and Statistics,2014.

K. Rawlik, M. Toussaint, and S. Vijayakumar. On Stochas-tic Optimal Control and Reinforcement Learning by Ap-proximate Inference. On Stochastic Optimal Control andReinforcement Learning by Approximate Inference, (2),2012.

T. Smith and R. Simmons. Heuristic Search Value Iterationfor POMDPs. In Uncertainty in Artificial Intelligence,pages 520–527, Arlington, Virginia, United States, 2004.AUAI Press.

S. Srivastava, S. Russell, P. Ruan, and X. Cheng. First-Order Open-Universe POMDPs. In Uncertainty in Arti-ficial Intelligence, 2014.

R. S. Sutton, D. McAllester, S. Singh, and Y. Mansour. Pol-icy Gradient Methods for Reinforcement Learning withFunction Approximation. Neural Information ProcessingSystems, pages 1057–1063, 1999.

E. Todorov. Efficient computation of optimal actions. Proc.Nat. Acad. Sci. of America, 106(28):11478–11483, 2009.

M. Toussaint, S. Harmeling, and A. Storkey. Probabilisticinference for solving (PO)MDPs. Neural Computation,31(December):357–373, 2006.

M. J. Wainwright and M. I. Jordan. Graphical Models,Exponential Families, and Variational Inference. Foun-dations and Trends in Machine Learning, 1(12):1–305,2008.

R. J. Williams. Simple statistical gradient-following algo-rithms for connectionist reinforcement learning. MachineLearning, 8(3-4):229–256, 1992.

D. Wingate and T. Weber. Automated variational in-ference in probabilistic programming. arXiv preprintarXiv:1301.1299, 2013.

D. Wingate, N. D. Goodman, D. M. Roy, L. P. Kaelbling,and J. B. Tenenbaum. Bayesian policy search with policypriors. In International Joint Conference on ArtificialIntelligence, pages 1565–1570, 2011.

D. Wingate, C. Diuk, T. O. Donnell, J. Tenenbaum, S. Ger-shman, L. Labs, and J. B. Tenenbaum. CompositionalPolicy Priors. Technical report, Computer Science andArtificial Intelligence Laboratory, Cambridge, MA, 2013.

F. Wood, J. van de Meent, and V. Mansinghka. A newapproach to probabilistic programming inference. InArtificial Intelligence and Statistics, pages 1024–1032,2014.

Page 11: Black-Box Policy Search with Probabilistic Programsjwvdm/assets/pdf/vandemeent... · Black-Box Policy Search with Probabilistic Programs Jan-Willem van de Meent Brooks Paige David

Jan-Willem van de Meent, Brooks Paige, David Tolpin, Frank Wood

A Anglican

All case studies are implemented in Anglican, a probabilistic programming language that is closely integrated into theClojure language. In Anglican, the macro defquery is used to define a probabilistic model. Programs may make use ofuser-written Clojure functions (defined with defn) as well as user-written Anglican functions (defined with defm). Thedifference between the two is that in Anglican functions may make use of the model special forms sample, observe, andpredict, which interrupt execution and require action by the inference back end. In Clojure functions, sample is a primitiveprocedure that generates a random value, observe returns a log probability, and predict is not available.

Full documentation for Anglican can be found at

http://www.robots.ox.ac.uk/˜fwood/anglican

The complete source code for the case studies can be found at

https://bitbucket.org/probprog/black-box-policy-search

B Canadian Traveler Problem

The complete results for the Canadian traveler problem, showing the performance and convergence for the learned policiesfor multiple graphs of different sizes and topologies, are presented in Figures 5 and 6.

C RockSample

The RockSample problem was formulated as a benchmark for value iteration algorithms and is normally evaluated inan infinite horizon setting where the discount factor penalizes sensing and movement. In the original formulation of theproblem, movement and sensing incur no cost. The agent gets a reward of 10 for each good rock, as well as for reachingthe right edge, but incurs a penalty of -10 when sampling a bad rock.

Here we consider an adaptation of RockSample to a finite horizon setting. We assume sensing is free, and movementincurs a cost of -1. We structure the policy by moving along rocks in a left-to-right order. At each rock the agent sense theclosest next rock and chooses to move to it, or discard it and consider the next closest rock. When the agent gets to arock, it only samples the rock if the rock is good. The parameters describe the prior over the probability of moving to arock conditioned on the current location and the sensor reading.

D Guess Who

In Table 1 we provide as reference the complete ontology for the Guess Who domain. At each turn, the player asks whetherthe unknown individual has a particular value of a single attribute.

Page 12: Black-Box Policy Search with Probabilistic Programsjwvdm/assets/pdf/vandemeent... · Black-Box Policy Search with Probabilistic Programs Jan-Willem van de Meent Brooks Paige David

Black-Box Policy Search with Probabilistic Programs

101 102 103

Gradient Steps

1.0

1.5

2.0

2.5

3.0

Mea

n D

ista

nce

Instance 20a

101 102 103

Gradient Steps

Instance 20b

101 102 103

Gradient Steps

Instance 20c

101 102 103

Gradient Steps

Instance 20d

101 102 103

Gradient Steps

Instance 20e

Figure 5: Canadian traveler problem: edge weights, indicating average travel frequency under the learned policy,and convergence for individual instances with 20 nodes.

Page 13: Black-Box Policy Search with Probabilistic Programsjwvdm/assets/pdf/vandemeent... · Black-Box Policy Search with Probabilistic Programs Jan-Willem van de Meent Brooks Paige David

Jan-Willem van de Meent, Brooks Paige, David Tolpin, Frank Wood

101 102 103

Gradient Steps

1.0

1.5

2.0

2.5

3.0

Mea

n D

ista

nce

Instance 50a

101 102 103

Gradient Steps

Instance 50b

101 102 103

Gradient Steps

Instance 50c

101 102 103

Gradient Steps

Instance 50d

101 102 103

Gradient Steps

Instance 50e

Figure 6: Canadian traveler problem: edge weights, indicating average travel frequency under the learned policy,and convergence for individual instances with 50 nodes.

Page 14: Black-Box Policy Search with Probabilistic Programsjwvdm/assets/pdf/vandemeent... · Black-Box Policy Search with Probabilistic Programs Jan-Willem van de Meent Brooks Paige David

Black-Box Policy Search with Probabilistic Programs

idb

eard

ear-rings

eye-colorgen

der

gla

ssesh

air-co

lor

hair-len

gth

hair-ty

pe

hat

mou

stache

mou

th-size

nose-size

red-ch

eeks

alex

falsefalse

brow

nm

ale

false

bla

cksh

ort

straig

ht

false

true

largesm

allfalse

alfred

falsefalse

blu

em

ale

false

gin

ger

lon

gstra

ight

false

true

small

small

falsean

itafalse

falseb

lue

female

false

blo

nd

elo

ng

straig

ht

false

falsesm

allsm

alltru

ean

ne

falsetru

eb

rown

female

false

bla

cksh

ort

curly

false

falsesm

alllarge

falseb

ernard

falsefalse

brow

nm

ale

false

brow

nsh

ort

straig

ht

true

falsesm

alllarge

falseb

illtru

efalse

brow

nm

ale

false

gin

ger

bald

straig

ht

false

falsesm

allsm

alltru

ech

arles

falsefalse

brow

nm

ale

false

blo

nd

esh

ort

straig

ht

false

true

largesm

allfalse

claire

falsefalse

brow

nfem

ale

true

gin

ger

short

straig

ht

true

falsesm

allsm

allfalse

dav

idtru

efalse

brow

nm

ale

false

blo

nd

esh

ort

straig

ht

false

falselarge

small

falseeric

falsefalse

brow

nm

ale

false

blo

nd

esh

ort

straig

ht

true

falselarge

small

falsefra

ns

falsefalse

brow

nm

ale

false

gin

ger

short

curly

false

falsesm

allsm

allfalse

george

falsefalse

brow

nm

ale

false

wh

itesh

ort

straig

ht

true

falselarge

small

falseh

erman

falsefalse

brow

nm

ale

false

gin

ger

bald

curly

false

falsesm

alllarge

falsejo

efalse

falseb

rown

male

true

blo

nd

esh

ort

curly

false

falsesm

allsm

allfalse

maria

falsetru

eb

rown

female

false

brow

nlo

ng

straig

ht

true

falsesm

allsm

allfalse

max

falsefalse

brow

nm

ale

false

bla

cksh

ort

curly

false

true

largelarge

falsep

aul

falsefalse

brow

nm

ale

true

wh

itesh

ort

straig

ht

false

falsesm

allsm

allfalse

peter

falsefalse

blu

em

ale

false

wh

itesh

ort

straig

ht

false

falselarge

largefalse

ph

iliptru

efalse

brow

nm

ale

false

bla

cksh

ort

curly

false

falselarge

small

true

richard

true

falseb

rown

male

false

brow

nb

ald

straig

ht

false

true

small

small

falsero

bert

falsefalse

blu

em

ale

false

brow

nsh

ort

straig

ht

false

falsesm

alllarge

true

samfalse

falseb

rown

male

true

wh

iteb

ald

straig

ht

false

falsesm

allsm

allfalse

susan

falsefalse

brow

nfem

ale

false

wh

itelo

ng

straig

ht

false

falselarge

small

true

tomfalse

falseb

lue

male

true

bla

ckb

ald

straig

ht

false

falsesm

allsm

allfalse

Tab

le1:

Onto

logy

forth

eG

uess

Wh

od

om

ain

,co

nsistin

gof

24

ind

ivid

uals,

chara

cterizedby

11

bin

aryattrib

utes

and

two

mu

lti-classattrib

utes.