scieee AI-readable full text Open interactive document viewer

Learning probabilistic action models from interpretation transitions

Martínez Martínez, David,Ribeiro, Tony,Inoue, Katsumi,Alenyà Ribas, Guillem,Torras, Carme

Abstract

Probabilistic planners are very flexible tools that provide good solutions for difficult tasks. However, they rely on a model of the domain and actions, which they have difficulties to learn for complex tasks. We propose a new learning approach that (a) requires only a set of state transitions to learn the model; (b) can cope with uncertainty in the effects; (c) uses a relational representation to generalize over different objects; and (d) in addition to action effects, it can also learn

Full text

Technical Communications of ICLP 2015. Copyright with the Authors. 1 Learning Probabilistic Action Models from Interpretation Transitions David Mart´ ınez Institut de Robotica i Informatica Industrial (CSIC-UPC) (e-mail: [email protected]), Tony Ribeiro The Graduate University for Advanced Studies (Sokendai), (e-mail: tony [email protected]), Katsumi Inoue National Institute of Informatics, (e-mail: [email protected]) Guillem Aleny` a, Carme Torras Institut de Robotica i Informatica Industrial (CSIC-UPC) (e-mail: {galenya,torras}@iri.upc.edu) submitted 29 April 2015; accepted 5 June 2015 Abstract There have been great advances in the probabilistic planning community during recent years, and planners can now provide solutions for very complex probabilistic tasks. However, planners require to have a model that represents the dynamics of the system, and in general these models are built by hand. In this paper, we present a framework to automatically infer probabilistic models from observations of the state transitions of a dynamic system. We propose an extension of previous works that perform learning from interpretation transitions. These works consider as input a set of state transitions and build a logic program that realizes the given transition relations. Here we extend this method to learn a compact set of probabilistic planning operators that capture probabilistic dynamics. Finally, we provide experimental validation of the quality of the learned models. KEYWORDS:inductive logic programming, learning from interpretation transitions, probabilistic planning operators, action model learning, probabilistic planning 1 Introduction Lately the performance of probabilistic task planners has improved to the point where they can find solutions in many complex scenarios (Kolobov et al. 2012; Keller and Eyerich 2012). Planners have been applied successfully in several fields, such as robotics (Chanel et al. 2014; Mart´ ınez et al. 2015) and aerospace (Surovik and Scheeres 2015). However, in most cases an expert is required to define the action model to be used by the planner. Creating a model is an error-prone task that requires in-depth knowledge about the problem and the planner, as well as extensive testing to assure the correctness of the model. We propose a new method to automatically learn action models based on a set of given state transitions. 2D. Mart´ ınez et al. Most previous approaches have only tackled the problem of learning deterministic action models (Zhuo et al. 2010), including uncertainty in the perceptions (Mourao et al. 2012). Regarding logic programming, abductive action learning has been studied based on abductive event calculus (Eshghi 1988), an abductive extension of event calculus, and has been extended for applications to planning, e.g., (Shanahan 2000). (Moyle 2003) uses an ILP technique to learn a causal theory based on event calculus (Kowalski and Sergot 1989), given examples of input-output relations. Probabilistic logic programs to maximize the probabilities of observations are learned by (Corapi et al. 2011; Sykes et al. 2013). They use parameter estimation to find the probabilities associated with each atom and rule, but it requires to code manually the restrictions for the initial set of rule candidates. Action models with uncertain effects have also been learned by (Rodrigues et al. 2012; Pasula et al. 2007) in STRIPS-like languages. Their optimization looks for planning operators that define as many effects as possible at once, which makes it a better choice for preconditionseffects based PPDDL domains (Younes and Littman 2004), such as the domains in past planning competitions (IPPC 2004-2008). In contrast our approach finds planning operators for each single action effect (i.e. rule head), which makes it a better choice to learn variable-based RDDL domains (Sanner 2010) used in newer planning competitions (IPPC 2011-2014). Our approach learns an action model encoded as a set of planning operators. Each operator describes how the value of a predicate changes based on a set of preconditions given that an action is executed. We present a novel method to learn in two levels as shown in Fig. 1. On the right, the Learning From Interpretation Transitions (LFIT) framework (Inoue et al. 2014; Ribeiro and Inoue 2014) is used to generate rules. Given a set of state transitions of a system, it can learn a normal logic program that captures the system dynamics. The resulting rules are all candidates that have to be considered to select the best planning operators. On the left, the data is generalized between different objects by using a relational representation, and an optimization method is used to select the best subsets of planning operators that explain input transitions while maintaining generality. The dependency relations between the planning operators are used to efficiently select the best candidates. Our method is designed to learn RDDL-like (Younes and Littman 2004) operators, where each variable is updated separately based on a set of preconditions. To that end, in this paper we present the following novel improvements: •The LUST algorithm: an extension of the LFIT framework to learn probabilistic dynamics from uncertain state transitions. The new algorithm that we propose can construct a model of a non-deterministic system by learning probabilistic rules. •LUST also integrates multi-valued variables, which allows us to represent actions more efficiently since every transition has only one action of the many possible actions. •The integration of logic programming to efficiently limit the number of rule candidates with a relational representation that provides better generalization, and an optimization method to select the best subsets of planning operators. The paper is organized as follows. First we will introduce some background required to understand the logic rule learning, and the algorithms proposed to that end. Afterwards, the action model and the translations needed between logic programs and planning domains Learning Probabilistic Action Models from Interpretation Transitions 3 Input observations Symbolic interpretation Interpretation transitions LFIT Grounded transitions Symbolic transitions Interpretation transitions Probabilistic propositional rules Symbolic planning operators Probabilistic propositional rules Operator optimization Best RDDL operators Fig. 1. Overview of the learning framework. The modules that interact with planning data and operators are in the blue rectangle on the left, while the modules related to logic programming are included inside the red rectangle on the right. The input of the method are grounded transitions, which are then converted to symbolic transitions to generalize between different objects. To obtain rule candidates, LFIT requires that the symbolic transitions are represented with propositional atoms. Finally, after rule candidates are obtained, they are transformed to planning operators to select the best set of operators. are explained. Finally we show experimental results and conclusions of the presented approach. 2 Preliminaries In this section we recall some preliminaries of logic programming. We also explain the basis of learning from interpretation transitions in order to make easier the understanding of its extension to multi-valued variable and probabilistic rule learning. 2.1 Logic Programming We consider a first-order language and denote the Herbrand base (the set of all ground atoms) as B.A(normal)logic program (NLP) is a set of rules of the form A←A1∧ · · · ∧ Am∧ ¬Am+1 ∧ · · · ∧ ¬An(1) where Aand Aiare atoms (n≥m≥0). For any rule Rof the form (1), the atom Ais called the head of Rand is denoted as h(R), and the conjunction to the right of ←is called the body of R. An (Herbrand)interpretation Iis a subset of B. For a logic program Pand an Herbrand interpretation I, the immediate consequence operator (or TPoperator) (Apt et al. 1988) is the mapping TP: 2B→2B: TP(I) = {h(R)|R∈ground(P), b+(R)⊆I, b−(R)∩I=∅}.(2) 2.2 Learning from Interpretation Transitions LF1T (Inoue et al. 2014) is an any time algorithm that takes a set of one-step state transitions Eas input. These one-step state transitions can be considered as positive examples. 4D. Mart´ ınez et al. From these transitions, the algorithm learns a logic program Pthat represents the dynamics of E. To perform this learning process, we can iteratively consider one-step transitions. In LF1T, the set of all atoms Bis assumed to be finite. In the input E, a state transition is represented by a pair of interpretations. The output of LF1T is a logic program that realizes all state transitions of E. Learning from 1-Step Transitions (LF1T) Input: Ea set of state transitions (I, J)of a system Sand Bthe set of all possible atoms that can appear in Iand J. Output: A logic program Psuch that J=next(I)holds for any (I, J)∈E. To build a logic program with LF1T, in (Ribeiro and Inoue 2014) we used a bottom-up method that generates hypotheses by specialization from the most general rules, that are fact rules, until the logic program is consistent with all input state transitions. Learning by specialization ensures to output the most general valid hypothesis. 2.3 Learning Multi-valued logic programs Research in multi-valued logic programming has proceed along three different directions (Kifer and Subrahmanian 1992): bilattice-based logics (Fitting 1991; Ginsberg 1988), quantitative rule sets (Van Emden 1986) and annotated logics (Blair and Subrahmanian 1989; Blair and Subrahmanian 1988). The multi-valued logic representation used in our new algorithm is based on annotated logics. Here, to each atom corresponds a given set of values. In a rule, a literal is an atom annotated with one of these values. It allows us to represent annotated atoms simply as classical atoms and thus to remain in the normal logic program semantics. In order to represent multi-valued variables, we now restrict all atoms of a logic program to the form varval. The intuition behind this form is that var represents some variable of the system and val represents the value of this variable. In annotated logics, the atom var is said to be annotated by the constant val. We consider a multi-valued logic program as a set of rules of the form varval ←varval1 1∧ · · · ∧ varvaln n(3) where varval and varvali i’s are atoms (n≥1). Like before, for any rule Rof the form (3), left part of ←is called the head of Rand is denoted as h(R), and the conjunction to the right of ←is called the body of R. We represent the set of literals in the body of Rof the form (3) as b(R) = {varval1 1, . . . , varvaln n}. A rule Rof the form (3) is interpreted as follows: the variable var takes the value val in the next state if all variables varihave the value valiin the current state. An interpretation of a multi-valued program provides the value of each variable of the system and is defined as follows. Definition 1 (Multi-valued Interpretation) Let Bbe a set of atoms where each element has the form varval. An interpretation Iof a set of atoms Bis a subset of Bwhere ∀varval ∈ B,∃varval0∈Iand ∀varval0∈ I, @varval00 ∈I, val06=val00. For a system Srepresented by a multi-valued logic program Pand a state s1represented Learning Probabilistic Action Models from Interpretation Transitions 5 by an interpretation I, the successor of s1is represented by the interpretation: next(I) = {h(R)|R∈P, b(R)⊆I} The state transitions of a logic program Pare represented by a set of pairs of interpretations (I, next(I)). Definition 2 (Multi-valued Consistency) Let Rbe a rule and (I, J)be a state transition. Ris consistent with (I, J)iff b(R)⊆I implies h(R)∈J. Let Ebe a set of state transitions, Ris consistent with Eif Ris consistent with all state transitions of E. A logic program Pis consistent with Eif all rules of Pare consistent with E. Definition 3 (Subsumption) Let R1and R2be two rules. If h(R1) = h(R2)and b(R1)⊆b(R2)then R1subsumes R2. Let Pbe a logic program and Rbe a rule. Psubsumes Rif there exists a rule R0∈Pthat subsumes R. We say that a rule R1is more general than another rule R2if R1subsumes R2. In particular, a rule Ris most general if there is no rule R0(6=R)that subsumes R(b(r) = ∅). Example 1 Let R1and R2be the two following rules: R1= (a1←b1),R2= (a1←a0∧b1),R1 subsumes R2because (b(R1) = {b1})⊂(b(R2) = {a0, b1}).When R1appears in a logic program P,R2is useless for P, because whenever R2can be applied, R1can be applied. To learn multi-valued logic programs with LF1T we need to adapt the ground resolution of (Inoue et al. 2014) and the least specialization of (Ribeiro and Inoue 2014) to handle non-boolean variables. Definition 4 (complement) Let R1and R2be two rules, R2is a complement of R1on varval if varval ∈b(R1), varval0∈b(R2), val 6=val0and (b(R2)\ {varval0})⊆(b(R1)\ {varval}). Definition 5 (multi-valued ground resolution) Let Rbe a rule, Pbe a logic program and Bbe a set of atoms, Rcan be generalized on varval if ∀varval0∈ B, val 6=val0,∃R0∈Psuch that R0is a complement of Ron varval: generalise(R, P ) = h(R)←b(R)\varval Definition 6 (Multi-valued least specialization) Let R1and R2be two rules such that h(R1) = h(R2)and R1subsumes R2. Let Bbe a set of atoms. The least specialization ls(R1, R2,B)of R1over R2w.r.t Bis ls(R1, R2,B) = {h(R1)←b(R1)∧varval0|varval ∈b(R2)\b(R1), varval0∈ B, val06=val} Least specialization can be used on a rule Rto avoid the subsumption of another rule with a minimal reduction of the generality of R. By extension, least specialization can be used on the rules of a logic program Pto avoid the subsumption of a rule with a minimal reduction of the generality of P. Let Pbe a logic program, Bbe a set of atoms, Rbe a rule 6D. Mart´ ınez et al. and Sbe the set of all rules of Pthat subsume R. The least specialization ls(P, R, B)of Pby Rw.r.t Bis as follows: ls(P, R, B)=(P\S)∪([ RP∈S ls(RP, R, B)) LF1T starts with an initial logic program P={varval ← | varval ∈ B}. Then LF1T iteratively analyzes each transition (I, J)∈E. For each labeled atom Athat does not appear in J,LF1T infers an anti-rule RI A: RI A=A←^ Bi∈I Bi A rule of Pthat subsumes such an anti-rule is not consistent with the transitions of Eand must be revised. The idea is to use least specialization to make Pconsistent with the new transitions (I, J)by avoiding the subsumption of all anti-rules RI Ainferred from (I, J). After least specialization, Pbecomes consistent with the new transition while remaining consistent with all previously analyzed transitions (theorem 3 of (Ribeiro and Inoue 2014)). When all transitions of Ehave been analyzed, LF1T outputs the rules of the system that realize E. 3 Learning from Uncertain State Transitions In this section we extend the LFIT framework to learn probabilistic dynamics by proposing an extension of LFIT for learning from uncertain state transitions. Where other work like (Gutmann et al. 2011) perform inferences from a probabilistic logic program, what we do is inferring the rules of such logic program. The programs infered by our new algorithm are similar to paraconsistent logic program of (Blair and Subrahmanian 1988). The use of annotated atoms allows the learned programs to induce multiple values for the same represented variable. It allows us to represent multi-valued models and capture nondeterministic state transitions. Our semantics differs from previous work like (Fierens et al. 2013). There, the authors consider probabilistic logic programs as logic programs in which some of the facts are annotated with probabilities. But in our method, its the rules that have probabilities and they are independent. 3.1 Formalization An non-deterministic system can be represented by a set of logic programs where the rules have the following form: R=value(var, val, i, j)←varval1 1∧ · · · ∧ varvaln n where varval and varvali iare atoms (n≥1),value(var, val, i, j)is the head of Ragain denoted h(R)and i, j are natural numbers, i≤j. Let Ibe a multi-valued interpretation. Rmeans that itimes over j,var takes the value val in the successor of Iif b(R)⊂I. Definition 7 (Non-deterministic successors) Let Ibe the multi-valued interpretation of a state of a non-deterministic system Srepresented by a set of logic programs P. Let P0be a logic program, one of the successors of I Learning Probabilistic Action Models from Interpretation Transitions 7 according to P0is next(I, P 0) = {varval|R∈P0, b(R)⊆I, h(R) = value(var, val, i, j),0< i ≤j} The set of successors of Iin Saccording to Pis successor(I, P) = {J|J∈next(I, Pi), Pi∈P} Example 2 Let R1and R2be two rules such that R1= (value(a, 1,10,100) ←a1)and R2= (value(a, 2,90,100) ←a1). Let Sbe a probabilistic system represented by a set of logic programs Psuch that P={{R1},{R2}}. The possible next states of Iin Sare successor(I, P) = {{a1},{a2}}. The likelihood of having a1in the next state of Iis 10% and the one of having a2is 90%. 3.2 Algorithm We now present LUST, an extension of LFIT for Learning from Uncertain State Transition. LUST learns a set of deterministic logic programs. The main idea is that when two transitions are not consistent we need two different programs to realize them. The first program will realize the first transition and the second one will realize the second transition. The algorithm will output a set of logic programs such that every transition given as input is realized by at least one of those programs. The rules learned also provide the probability of the variable values in the next state. The probability of each rule R=value(var, val, i, j)←b(R)is simply obtained by counting how many transitions (I, J)it realizes (when b(R)⊆Iand varval ∈J), represented by i, over how many transitions it matches (when b(R)⊆I), represented by j. LUST algorithm: •Input: a set of pairs of interpretations Eand a set of atoms B. •Step 1: Initialize a set of logic programs Pwith one program P1with fact rules for each atom of B. •Step 2: Pick (I, J)in E, check consistency of (I, J)with all programs of P: •if there is no logic program in Pthat realizes (I, J)then —copy one of the logic programs Piinto a P0 iand add rules in P0 ito realize (I, J). —Use full ground resolution to generalize P0 i. •Step 3: Revise all logic programs that realize (I, J)by using least specialization. •Step 4: If there is a remaining transition in E, go to step 2. •Step 5: Compute the probability of each rule of all programs Piaccording to E. •Output:Pa set of multi-valued logic programs that realizes E. 4 Integration of Logic Programming and Planning Domains In this section we describe the formalization used to represent planning operators, as well as the data conversions needed to learn symbolic operators from grounded transitions while using propositional logic programming. 8D. Mart´ ınez et al. 4.1 Planning Model Although LUST uses a propositional representation, the planning model uses a relational representation to provide a better generalization between different states. Relational domains represent the state structure and objects explicitly. These domains are described by using a vocabulary of predicates Pand actions A, and a set of objects Cπ. Predicates and actions take objects as arguments to define their ground counterparts. Example 3 Let on(X,Y) be a symbolic predicate, and {box1,box2,box3}be a set of objects. Three possible groundings of the symbolic predicate on(X,Y) with the given atoms are on(box1, box2),on(box1, box3 ) and on(box3, box1). A ground predicate or action is equivalent to an atom. In a planning domain, a planning state sis a set of ground predicates s={p1, p2, ..., pn}that is equivalent to an Herbrand interpretation. Our planner operators represent a subset of RDDL domains (Sanner 2010). For each variable, we define the probability that it will become true in the next state based on a set of preconditions. In contrast to the full RDDL specification, these preconditions can only consist of an action and a set of predicates. Thus we define a planning operator as a tuple o=hopval , oact, oprec, oprobiwhere: •opval is a predicate pwhose value can change to val by applying the operator. It is equivalent to the head of a logic rule. •oact is the action that has to be executed for the operator to be applicable. •oprec is a set of predicates that have to be satisfied in the current state so that the planning operator is applicable. It is equivalent to the body of a logic rule. •oprob is the probability that pval will be true. 4.2 Data Representation To have a more general and compact model, we are using a relational representation at the planning level. The input of our method consists of state transitions that are tuples t=hs, act, s0iwhere sand s0are the states before and after executing the action act. The states consist of sets of ground predicates, and act is a grounded action. On the other hand, the output is a set of symbolic (i.e. non-grounded) planning operators. Therefore, our method transforms initial grounded data to symbolic planning operators. Moreover, LUST works with propositional atoms, so a transformation from symbolic predicates to atoms and back to symbolic predicates is also needed. Figure 1 shows the needed data conversions, which are explained in more detail below. Transform grounded transitions to symbolic transitions: •Input: a set of grounded transitions T= [t1, t2, ..., tn]. •For each transition t=hs, act, s0i: —Take every argument χof the action act. —Substitute χfor a default symbolic parameter in s,act, and s0. —Create a new transition t0with the symbolic predicates in sand s0and the symbolic action act. Learning Probabilistic Action Models from Interpretation Transitions 9 —Add the new transition t0to T0. •Output: set of symbolic transitions T0. Transform a symbolic transition to an interpretation transition: •Input: a symbolic transition t=hs, act, s0i. •Assign an atom to each predicate in s,act and s0. •I=atoms that correspond to s. •Add act as an atom in Ithat represents the action. •J=atoms that correspond to s0. •Output: interpretation transition (I, J). To transform a planning symbolic transition to an interpretation transition, a labeled atom that encodes the action is added to the body of the interpretation transition. As each transition has exactly one action, a multi-valued variable represents it more efficiently than boolean, otherwise every action would have to be represented as different variables with only one being true. Moreover, each symbolic predicate value is represented by one labeled atom. After the logic programs are generated, the labeled atoms are translated back to symbolic predicates by using the same conversion. Transform a logic program to a set of planning operators: •Input: a logic program P. •For every rule R∈Psuch that h(R) = value(var, val, i, j), a planning operator o is created so that: —opval =varval. —oact =the action in the atoms of b(R). —oprec =the set of atoms in b(R)that represent predicates. —oprob =i/j. —Add oto O •Output: set of planning operators O. 5 Selecting the Set of Planning Operators In this section we present the method to select the best subset of probabilistic planning operators by using the set of logic programs generated by LF1T. First, the requirements that the planning operators have to satisfy are presented. Afterwards, we explain the preferences to decide which are the best planning operators. Finally, the method to obtain the desired planning operators is described. 5.1 Planning Operators Requirements Probabilistic planners require that only one planning operator can be applied in each stateaction pair. Therefore the model has to be defined with a set of non-conflicting operators, so the planner can always decide which operator to apply for each state-action pair.