Discriminative Bias for Learning Probabilistic Sentential Decision Diagrams

. Methods that learn the structure of Probabilistic Senten-tial Decision Diagrams (PSDD) from data have achieved state-of-the-art performance in tractable learning tasks. These methods learn PSDDs incrementally by optimizing the likelihood of the induced probability distribution given available data and are thus robust against missing values, a relevant trait to address the challenges of embedded applications, such as failing sensors and resource constraints. However PSDDs are outper-formed by discriminatively trained models in classiﬁcation tasks. In this work, we introduce D-LearnPSDD , a learner that improves the clas-siﬁcation performance of the LearnPSDD algorithm by introducing a discriminative bias that encodes the conditional relation between the class and feature variables.


Introduction
Probabilistic machine learning models have shown to be a well suited approach to address the challenges inherent to embedded applications, such as the need to handle uncertainty and missing data [11].Moreover, current efforts in the field of Tractable Probabilistic Modeling have been making great strides towards successfully balancing the trade-offs between model performance and inference efficiency: probabilistic circuits, such as Probabilistic Sentential Decision Diagrams (PSDDs), Sum-Product Networks (SPNs), Arithmetic Circuits (ACs) and Cutset Networks, posses myriad desirable properties [4] that make them amenable to application scenarios where strict resource budget constraints must be met [12].But these models robustness against missing data-from learning them generatively-is often at odds with their discriminative capabilities.We address such a conflict by proposing a discriminative-generative probabilistic circuit learning strategy, which aims to improve the models' discriminative capabilities, while maintaining their robustness against missing features.
We focus in particular on the PSDD [17], a state-of-the-art tractable representation that encodes a joint probability distribution over a set of random variables.Previous work [12] has shown how to learn hardware-efficient PSDDs that remain robust to missing data and noise.This approach relies largely on the LearnPSDD algorithm [20], a generative algorithm that incrementally learns the structure of a PSDD from data.Moreover, it has been shown how to exploit such robustness to trade off resource usage with accuracy.And while the achieved accuracy is competitive when compared to Bayesian Network classifiers, discriminatively learned models perform consistently better than purely generative models [21] since the latter remain agnostic to the discriminative task they ought to perform.This begs the question of whether the discriminative performance of the PSDD could be improved while remaining robust and tractable.
In this work, we propose a hybrid discriminative-generative PSDD learning strategy, D-LearnPSDD, that enforces the discriminative relationship between class and feature variables by capitalizing on the model's ability to encode domain knowledge as a logic formula.We show that this approach consistently outperforms the purely generative PSDD and is competitive compared to other classifiers, while remaining robust to missing values at test time.

Background
Notation.Variables are denoted by upper case letters X and their instantiations by lower case letters x.Sets of variables are denoted in bold upper case X and their joint instantiations in bold lower case x.For the classification task, the feature set is denoted by F while the class variable is denoted by C. PSDD.Probabilistic Sentential Decision Diagrams (PSDDs) are circuit representations of joint probability distributions over binary random variables [17].They were introduced as probabilistic extensions to Sentential Decision Diagrams (SDDs) [7], which represent Boolean functions as logical circuits.The inner nodes of a PSDD alternate between AND gates with two inputs and OR gates with arbitrary number of inputs; the root must be an OR node; and each Fig. 1.A Bayesian network and its equivalent PSDD (taken from [20]).
leaf node encodes a distribution over a variable X (see Fig. 1.c).The combination of an OR gate with its AND gate inputs is referred to as decision node, where the left input of the AND gate is called prime (p), and the right is called sub (s).Each of the n edges of a decision node are annotated with a normalized probability distribution θ 1 , ..., θ n .
PSDDs possess two important syntactic restrictions: 1) Each AND node must be decomposable, meaning that its input variables must be disjoint.This property is enforced by a vtree, a binary tree whose leaves are the random variables and which determines how will variables be arranged in primes and subs in the PSDD (see Fig. 1.d): each internal vtree node is associated with the PSDD nodes at the same level, variables appearing in the left subtree X are the primes and the ones appearing in the right subtree Y are the subs.2) Each decision node must be deterministic, thus only one of its inputs can be true.
Each PSDD node q represents a probability distribution.Terminal nodes encode a univariate distributions.Decision nodes, when normalized for a vtree node with X in its left subtree and Y in its right subtree, encode the following distribution over XY (see also Fig. 1.a and 1.c): Thus, each decision node decomposes the distribution into independent distributions over X and Y.In general, prime and sub variables are independent at PSDD node q given the prime base [q] [17].This base is the support of the node's distribution, over which it defines a non-zero probability and it is written as a logical sentence using the recursion [q] = i [p i ] ∧ [s i ].Kisa et al. [17] show that prime and sub variables are independent in PSDD node q given a prime base: = P r pi (X)P r si (Y) This equation encodes context specific independence [2], where variables (or sets of variables) are independent given a logical sentence.The structural constraints of the PSDD are meant to exploit such independencies, leading to a representation that can answer a number of complex queries in polynomial time [1], which is not guaranteed when performing inference on Bayesian Networks, as they don't encode and therefore can't exploit such local structures.
LearnPSDD.The LearnPSDD algorithm [20] generatively learns a PSDD by maximizing log-likelihood given available data.The algorithm starts by learning a vtree that minimizes the mutual information among all possible sets of variables.This vtree is then used to guide the PSDD structure learning stage, which relies on the iterative application of the Split and Clone operations [20].These operations keep the PSDD syntactically sound while improving likelihood of the distribution represented by the PSDD.A problem with LearnPSDD when using the resulting model for classification is that when the class variable is only weakly dependent on the features, the learner may choose to ignore that dependency, potentially rendering the model unfit for classification tasks.

A Discriminative Bias for PSDD learning
Generative learners such as LearnPSDD optimize the likelihood of the distribution given available data rather than the conditional likelihood of the class variable C given a full set of feature variables F. As a result, their accuracy is often worse than that of simple models such as Naive Bayes (NB), and its close relative Tree Augmented Naive Bayes (TANB) [12], which perform surprisingly well on classification tasks even though they encode a simple-or naive-structure [10].
One of the main reasons for their performance, despite being generative, is that (TA)NB models have a discriminative bias that directly encodes the conditional dependence of all the features on the class variable.
We introduce D-LearnPSDD, an extension to LearnPSDD based on the insight that the learned model should satisfy the "class conditional constraint" present in Bayesian Network classifiers.That is, all feature variables must be conditioned on the class variable.This enforces a structure that is beneficial for classification while still allowing to generatively learn a PSDD that encodes the distribution over all variables using a state-of-the-art learning strategy [20].

Discriminative bias
The classification task can be stated as a probabilistic query: Our goal is to learn a PSDD whose root decision node directly represents the conditional probability distribution Pr(F|C).This can be achieved by forcing the primes of the first line in Eq. 2 to be [p 0 ] = [¬c] and [p 1 ] = [c], where [c] states that the propositional variable c representing the class variable is true (i.e.C = 1), and similarly [¬c] represents C = 0.For now we assume the class is binary and will show later how to generalize to a multi-valued class variable.For the feature variables we can assume they are binary without loss of generality since a multi-valued variable can be converted to a set of binary variables via a one-hot encoding (see, for example [20]).To achieve our goal we first need the following proposition: Proposition 1.Given (i) a vtree with a single variable C as the prime and variables F as the sub of the root node, and (ii) an initial PSDD where the root decision node decomposes the distribution as ); applying the Split and Clone operators will never change the root decision decomposition Proof.The D-LearnPSDD algorithm iteratively applies two operations: Clone and Split (following the algorithm in [20]).First, the Clone operator requires a parent node, which is not available for the root node.Since the initial PSDD follows the logical formula described above, whose only restriction is on the root node, there is no parent available to clone and the root's base thus remains intact when applying the Clone operator.Second, the Split operator splits one of the subs to extend the sentence that is used to mutually exclusively and exhaustively define all children.Since the given vtree has only one variable, C, as the prime of the root node, there are no other variables available to add to the sub.The Split operator cant thus not be applied anymore and the root's base stays intact (see Figs. 1.c and 1.d).
We can now show that the resulting PSDD contains nodes that directly represent the distribution Pr(F|C).
) with c the propositional variable stating that the class variable is true, and s 0 and s 1 any formula with propositional feature variables f 0 , . . ., f n , directly expresses the distribution Pr(F|C).
Proof.Applying this to Eq. 1 results in: The learned PSDD thus contains a node s 0 with distribution Pr s0 that directly represents Pr(F|C = 0) and a node s 1 with distribution Pr s1 that represents Pr(F|C = 1).The PSDD thus encodes Pr(F|C) directly because the two possible value assignments of C are C = 0 and C = 1.
The following examples illustrate why both the specific vtree and initial PSDD are required.
Example 1. Fig. 2.b shows a PSDD that encodes a fully factorized probability distribution normalized for the vtree in 2.a.The PSDD shown in this example initializes the incremental learning procedure of LearnPSDD [20].Note that the vtree does not connect the class variable C to all feature variables (e.g.F 1 ).Therefore, when initializing the algorithm on this vtree-PSDD combination, there are no guarantees that the conditional relations between certain features and the class will be learned.
Example 2. Fig. 2.e shows a PSDD that explicitly conditions the feature variables on the class variables by normalizing for the vtree in 2.c and by following the logical formula from Proposition 2. This biased PSDD is then used to initialize the D-LearnPSDD learner.Note that the vtree in 2.c forces the prime of the root node to be the class variable C. Example 3. Fig. 2.d shows, however, that only setting the vtree in 2.c is not sufficient for the learner to condition the features on the class.When initializing on a PSDD that encodes a fully factorized formula, and then applying the Split and Clone operators, the relationship between the class variable and the features are not guaranteed to be learned.In this worst case scenario, the learned model could have an even worse performance than the case from Example 1.By applying Eq. 1 on the top split, we can give intuition why this is the case: The PSDD thus encodes a distribution that assumes that the class variable is independent from all feature variables.While this model might still have a high likelihood, its classification accuracy will be low.
We have so far introduced the D-LearnPSDD for a binary classification task.However, it can be easily generalized to an n-valued classification scenario: (1) The class variable C will be represented by multiple propositional variables c 0 , c 1 , . . ., c n that represent the set C = 0, C = 1, . . ., C = n, of which exactly one will be true at all times.(2) The vtree in Proposition 1 now starts as a right-linear tree over c 0 , . . ., c n .The F variables are the sub of the node that has c n as prime.(3) The initial PSDD in Proposition 2 now has a root the form [root] = i=0...n ([c i j:0...n∧i =j ¬c j ] ∧ [s i ]), which remains the same after applying Split and Clone.The root decision node now represents the distribution Pr q (CF) = i:0...n Pr ci j =i ¬cj (C = i) • Pr si (F|C = i) and therefore has nodes at the top of the tree that directly represent the discriminative bias.

Generative bias
Learning the distribution over the feature variables is a generative learning process and we can achieve this by applying the Split and Clone operators in the same way as the original LearnPSDD algorithm.In the previous section we had not yet defined how should Pr(F|C) from Proposition 2 be represented in the initial PSDD, we only explained how our constraint enforces it.So the question is how do we exactly define the nodes corresponding to s 0 and s 1 with distributions Pr(F|C = 0) and Pr(F|C = 1)?We follow the intuition behind (TA)NB and start with a PSDD that encodes a distribution where all feature variables are independent given the class variable (see Fig. 2.e).Next, the LearnPSDD algorithm will incrementally learn the relations between the feature variables by applying the Split and Clone operations following the approach in [20].

Obtaining the vtree
In learnPSDD, the decision nodes decompose the distribution into independent distributions.Thus, the vtree is learned from data by maximizing the approximate pairwise mutual information, as this metric quantifies the level of independence between two sets of variables.For D-LearnPSDD we are interested in the level of conditional independence between sets of feature variables given the class variable.We thus obtain the vtree by optimizing for Conditional Mutual Information instead and replace mutual information in the approach in [20] with: CM I(X, Y|Z) = x y z Pr(xy) log Pr(z) Pr (xyz)  Pr(xz) Pr(yz) .We compare the performance of D-LearnPSDD, LearnPSDD, two generative Bayesian classifiers (NB and TANB) and a discriminative classifier (logistic regression).In particular, we discuss the following research queries: (1) Section 4.2 examines whether the introduced discriminative bias improves classification performance on PSDDs.
(2) Section 4.3 analyzes the impact of the vtree and the imposed structural constraints on model tractability and performance.(3) Finally, Section 4.4 compares the robustness to missing values for all classification approaches.

Setup
We ran our experiments on the suite of 15 standard machine learning benchmarks listed in Table 1.All of the datasets come from the UCI machine learning repository [8], with exception of "Mofn" and "Corral" [18].As pre-processing steps, we applied the discretization method described in [9], and we binarized all variables using a one-hot encoding.Moreover, we removed instances with missing values and features whose value was always equal to 0. Table 1 summarizes the number of binary features |F|, the number of classes |C| and the available number of training samples |N| per dataset.

Evaluation of DG-LearnPSDD
Table 2 compares D-LearnPSDD, LearnPSDD, Naive Bayes (NB), Tree Augmented Naive Bayes (TANB) and logistic regression (LogReg) 4 in terms of accuracy via five fold cross validation 5 .For LearnPSDD, we incrementally learned a model on each fold until convergence on validation-data log-likelihood, following the methodology in [20].
For D-LearnPSDD, we incrementally learned a model on each fold until likelihood converged but then selected the incremental model with the highest training set accuracy.For NB and TANB, we learned a model per fold and compiled them to Arithmetic Circuits6 , a more general form of PSDDs [6], which allows us to compare the size of these Bayes net classifiers and the PSDDs.Finally, we compare all probabilistic models with a discriminative classifier, a multinomial logistic regression model with a ridge estimator.
Table 2 shows that the proposed D-LearnPSDD clearly benefits from the introduced discriminative bias, outperforming LearnPSDD in all but two datasets, as the latter method is not guaranteed to learn significant relations between feature and class variables.Moreover, it outperforms Bayesian classifiers in most benchmarks, as the learned PSDDs are more expressive and allow to encode complex relationships among sets of variables or local dependencies such as context specific independence, while remaining tractable.Finally, note that the D-LearnPSDD is competitive in terms of accuracy with respect to logistic regression (LogReg) a purely discriminative classification approach.

Impact of the vtree on discriminative performance
The structure and size of the learned PSDD is largely determined by the vtree it is normalized for.Naturally, the vtree also has an important role in determining the quality (in terms of log-likelihood) of the probability distribution encoded by the learned PSDD [20].In this section, we study the impact that the choice of vtree and learning strategy has on the trade-offs between model tractability, quality and discriminative performance.Fig. 3.a shows test-set log-likelihood and 3.b classification accuracy as a function of model size (in number of parameters) for the "Chess" dataset.We display average log-likelihood and accuracy over logarithmically distributed ranges of model size.This figure contrasts the results of three learning approaches: D-LearnPSDD when the vtree learning stage optimizes mutual information (MI, shown in light blue); when it optimizes conditional mutual information (CMI, shown in dark blue); and the traditional LearnPSDD (in orange).
Fig. 3.a shows that likelihood improves at a faster rate during the first iterations of LearnPSDD, but eventually settles to the same values as D-LearnPSDD because both optimize for log-likelihood.However, the discriminative bias guarantees that classification accuracy on the initial model will be at least as high as that of a Naive Bayes classifier (see Fig. 3.b).Moreover, this results in consistently superior accuracy (for the CMI case) compared to the purely generative LearnPSDD approach as shown also in Table 2.The dip in accuracy during the second and third intervals are a consequence of the generative learning, which optimizes for log-likelihood and can therefore initially yield feature-value correlations that decrease the model's performance as a classifier.
Finally, Fig. 3.b demonstrates that optimizing the vtree for conditional mutual information results in an overall better performance vs. accuracy trade-off when compared to optimizing for mutual information.Such a conditional mutual information objective function is consistent with the conditional independence constraint we impose on the structure of the PSDD and allows the model to consider the special status of the class variable in the discriminative task.

Robustness to missing features
The generative models in this paper encode a joint probability distribution over all variables and therefore tend to be more robust against missing features than discriminative models, which only learn relations relevant to their discriminative task.In this experiment, we assessed this robustness aspect by simulating the random failure of 10% of the original feature set per benchmark and per fold in five-fold cross-validation.Fig. 4 shows the average accuracy over 10 such feature failure trials in each of the 5 folds (flat markers) in relation to their full feature set accuracy reported in Table 2 (shaped markers).As expected, the performance of the discriminative classifier (LogReg) suffers the most during feature failure, while D-LearnPSDD and LearnPSDD are notably more robust than any other approach, with accuracy losses of no more than 8%.Note from the flat markers that the performance of D-LearnPSDD under feature failure is the best in all datasets but one.

Related work
A number of works have dealt with the conflict between generative and discriminative model learning, some dating back decades [14].There are multiple techniques that support learning of parameters [23,13] and structure [24,21] of probabilistic circuits.Typically, different approaches are followed to either learn generative or discriminative tasks, but some methods exploit discriminative models' properties to deal with missing variables [22].Other works that also constraint the structure of PSDDs have been proposed before, such as Choi et al. [3].However, they only do parameter learning, not structure learning: their approach to improve accuracy is to learn separate structured PSDDs for each distribution of features given the class and feed them to a NB classifier.In [5], Correira and de Campos propose a constrained SPN architecture that shows both computational efficiency and classification performance improvements.However, it focuses on decision robustness rather than robustness against missing values, essential to the application range discussed in this paper.There are also a number of methods that focus specifically on the interaction between discriminative and generative learning.In [15], Khosravi et al. provide a method to compute expected predictions of a discriminative model with respect to a probability distribution defined by an arbitrary generative model in a tractable manner.This combination allows to handle missing values using discriminative couterparts of generative classifiers [16].More distant to this work is the line of hybrid discriminative and generative models [19], their focus is on semisupervised learning and deals with missing labels.

Conclusion
This paper introduces a PSDD learning technique that improves classification performance by introducing a discriminative bias.Meanwhile, robustness against missing data is kept by exploiting generative learning.The method capitalizes on PSDDs' domain knowledge encoding capabilities to enforce the conditional relation between the class and the features.We prove that this constraint is guaranteed to be enforced throughout the learning process and we show how not encoding such a relation might lead to poor classification performance.Evaluation on a suite of benchmarking datasets shows that the proposed technique outperforms purely generative PSDDs in terms of classification accuracy and the other baseline classifiers in terms of robustness.

Fig. 3 .
Fig.3.Log-likelihood and accuracy vs. model size trade-off of the incremental PSDD learning approaches.MI and CMI denote mutual information and conditional mutual information vtree learning, respectively.