index
int64
0
20.3k
text
stringlengths
0
1.3M
year
stringdate
1987-01-01 00:00:00
2024-01-01 00:00:00
No
stringlengths
1
4
6,200
Variational Information Maximization for Feature Selection Shuyang Gao Greg Ver Steeg Aram Galstyan University of Southern California, Information Sciences Institute gaos@usc.edu, gregv@isi.edu, galstyan@isi.edu Abstract Feature selection is one of the most fundamental problems in machine learning. An extensive body of work on information-theoretic feature selection exists which is based on maximizing mutual information between subsets of features and class labels. Practical methods are forced to rely on approximations due to the difficulty of estimating mutual information. We demonstrate that approximations made by existing methods are based on unrealistic assumptions. We formulate a more flexible and general class of assumptions based on variational distributions and use them to tractably generate lower bounds for mutual information. These bounds define a novel information-theoretic framework for feature selection, which we prove to be optimal under tree graphical models with proper choice of variational distributions. Our experiments demonstrate that the proposed method strongly outperforms existing information-theoretic feature selection approaches. 1 Introduction Feature selection is one of the fundamental problems in machine learning research [1, 2]. Its problematic issues include a large number of features that are either irrelevant or redundant for the task at hand. In these cases, it is often advantageous to pick a smaller subset of features to avoid over-fitting, to speed up computation, or simply to improve the interpretability of the results. Feature selection approaches are usually categorized into three groups: wrapper, embedded and filter [3, 4, 5]. The first two methods, wrapper and embedded, are considered classifier-dependent, i.e., the selection of features somehow depends on the classifier being used. Filter methods, on the other hand, are classifier-independent and define a scoring function between features and labels in the selection process. Because filter methods may be employed in conjunction with a wide variety of classifiers, it is important that the scoring function of these methods is as general as possible. Since mutual information (MI) is a general measure of dependence with several unique properties [6], many MI-based scoring functions have been proposed as filter methods [7, 8, 9, 10, 11, 12]; see [5] for an exhaustive list. Owing to the difficulty of estimating mutual information in high dimensions, most existing MI-based feature selection methods are based on various low-order approximations for mutual information. While those approximations have been successful in certain applications, they are heuristic in nature and lack theoretical guarantees. In fact, as we demonstrate in Sec. 2.2, a large family of approximate methods are based on two assumptions that are mutually inconsistent. To address the above shortcomings, in this paper we introduce a novel feature selection method based on a variational lower bound on mutual information; a similar bound was previously studied within the Infomax learning framework [13]. We show that instead of maximizing the mutual information, which is intractable in high dimensions (hence the introduction of many heuristics), we can 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. maximize a lower bound on the MI with the proper choice of tractable variational distributions. We use this lower bound to define an objective function and derive a forward feature selection algorithm. We provide a rigorous proof that the forward feature selection is optimal under tree graphical models by choosing an appropriate variational distribution. This is in contrast with previous informationtheoretic feature selection methods which lack any performance guarantees. We also conduct empirical validation on various datasets and demonstrate that the proposed approach outperforms stateof-the-art information-theoretic feature selection methods. In Sec. 2 we introduce general MI-based feature selection methods and discuss their limitations. Sec. 3 introduces the variational lower bound on mutual information and proposes two specific variational distributions. In Sec. 4, we report results from our experiments, and compare the proposed approach with existing methods. 2 Information-Theoretic Feature Selection Background 2.1 Mutual Information-Based Feature Selection Consider a supervised learning scenario where x = {x1, x2, ..., xD} is a D-dimensional input feature vector, and y is the output label. In filter methods, the mutual information-based feature selection task is to select T features xS⇤= {xf1, xf2, ..., xfT } such that the mutual information between xS⇤and y is maximized. Formally, S⇤= arg max S I (xS : y) s.t. |S| = T (1) where I(·) denotes the mutual information [6]. Forward Sequential Feature Selection Maximizing the objective function in Eq. 1 is generally NP-hard. Many MI-based feature selection methods adopt a greedy method, where features are selected incrementally, one feature at a time. Let St−1 = {xf1, xf2, ..., xft−1} be the selected feature set after time step t −1. According to the greedy method, the next feature ft at step t is selected such that ft = arg max i/2St−1 I (xSt−1[i : y) (2) where xSt−1[i denotes x’s projection into the feature space St−1 [ i. As shown in [5], the mutual information term in Eq. 2 can be decomposed as: I (xSt−1[i : y) = I (xSt−1 : y) + I (xi : y|xSt−1) = I (xSt−1 : y) + I (xi : y) −I (xi : xSt−1) + I (xi : xSt−1|y) = I (xSt−1 : y) + I (xi : y) −(H (xSt−1) −H (xSt−1|xi)) + (H (xSt−1|y) −H (xSt−1|xi, y)) (3) where H(·) denotes the entropy [6]. Omitting the terms that do not depend on xi in Eq. 3, we can rewrite Eq. 2 as follows: ft = arg max i/2St−1 I (xi : y) + H (xSt−1|xi) −H (xSt−1|xi, y) (4) The greedy learning algorithm has been analyzed in [14]. 2.2 Limitations of Previous MI-Based Feature Selection Methods Estimating high-dimensional information-theoretic quantities is a difficult task. Therefore, most MI-based feature selection methods propose low-order approximation to H (xSt−1|xi) and H (xSt−1|xi, y) in Eq. 4. A general family of methods rely on the following approximations [5]: H (xSt−1|xi) ⇡ t−1 X k=1 H (xfk|xi) H (xSt−1|xi, y) ⇡ t−1 X k=1 H (xfk|xi, y) (5) 2 The approximations in Eq. 5 become exact under the following two assumptions [5]: Assumption 1. (Feature Independence Assumption) p (xSt−1|xi) = t−1 Q k=1 p (xfk|xi) Assumption 2. (Class-Conditioned Independence Assumption) p (xSt−1|xi, y) = t−1 Q k=1 p (xfk|xi, y) Assumption 1 and Assumption 2 mean that the selected features are independent and classconditionally independent, respectively, given the unselected feature xi under consideration. Assumption 1 Assumption 2 Satisfying both Assumption 1 and Assumption 2 Figure 1: The first two graphical models show the assumptions of traditional MI-based feature selection methods. The third graphical model shows a scenario when both Assumption 1 and Assumption 2 are true. Dashed line indicates there may or may not be a correlation between two variables. We now demonstrate that the two assumptions cannot be valid simultaneously unless the data has a very specific (and unrealistic) structure. Indeed, consider the graphical models consistent with either assumption, as illustrated in Fig. 1. If Assumption 1 holds true, then xi is the only common cause of the previously selected features St−1 = {xf1, xf2, ..., xft−1}, so that those features become independent when conditioned on xi. On the other hand, if Assumption 2 holds, then the features depend both on xi and class label y; therefore, generally speaking, distribution over those features does not factorize by solely conditioning on xi—there will be remnant dependencies due to y. Thus, if Assumption 2 is true, then Assumption 1 cannot be true in general, unless the data is generated according to a very specific model shown in the rightmost model in Fig. 1. Note, however, that in this case, xi becomes the most important feature because I(xi : y) > I(xSt−1 : y); then we should have selected xi at the very first step, contradicting the feature selection process. As we mentioned above, most existing methods implicitly or explicitly adopt both assumptions or their stronger versions, as shown in [5]—including mutual information maximization (MIM) [15], joint mutual information (JMI) [8], conditional mutual information maximization (CMIM) [9], maximum relevance minimum redundancy (mRMR) [10], conditional Infomax feature extraction (CIFE) [16], etc. Approaches based on global optimization of mutual information, such as quadratic programming feature selection (QPFS) [11] and the state-of-the-art conditional mutual information-based spectral method (SPECCMI) [12], are derived from the previous greedy methods and therefore also implicitly rely on those two assumptions. In the next section we address these issues by introducing a novel information-theoretic framework for feature selection. Instead of estimating mutual information and making mutually inconsistent assumptions, our framework formulates a tractable variational lower bound on mutual information, which allows a more flexible and general class of assumptions via appropriate choices of variational distributions. 3 Method 3.1 Variational Mutual Information Lower Bound Let p(x, y) be the joint distribution of input (x) and output (y) variables. Barber & Agkov [13] derived the following lower bound for mutual information I(x : y) by using the non-negativity of KL-divergence, i.e., P x p (x|y) log p(x|y) q(x|y) ≥0 gives: I (x : y) ≥H (x) + hln q (x|y)ip(x,y) (6) 3 where angled brackets represent averages and q(x|y) is an arbitrary variational distribution. This bound becomes exact if q(x|y) ⌘p(x|y). It is worthwhile to note that in the context of unsupervised representation learning, p(y|x) and q(x|y) can be viewed as an encoder and a decoder, respectively. In this case, y needs to be learned by maximizing the lower bound in Eq. 6 by iteratively adjusting the parameters of the encoder and decoder, such as [13, 17]. 3.2 Variational Information Maximization for Feature Selection Naturally, in terms of information-theoretic feature selection, we could also try to optimize the variational lower bound in Eq. 6 by choosing a subset of features S⇤in x, such that, S⇤= arg max S n H (xS) + hln q (xS|y)ip(xS,y) o (7) However, the H(xS) term in RHS of Eq. 7 is still intractable when xS is very high-dimensional. Nonetheless, by noticing that variable y is the class label, which is usually discrete, and hence H(y) is fixed and tractable, by symmetry we switch x and y in Eq. 6 and rewrite the lower bound as follows: I (x : y) ≥H (y) + hln q (y|x)ip(x,y) = ⌧ ln ✓q (y|x) p (y) ◆) p(x,y) (8) The equality in Eq. 8 is obtained by noticing that H(y) = h−ln p (y)ip(y). By using Eq. 8, the lower bound optimal subset S⇤of x becomes: S⇤= arg max S (⌧ ln ✓q (y|xS) p (y) ◆) p(xS,y) ) (9) 3.2.1 Choice of Variational Distribution q(y|xS) in Eq. 9 can be any distribution as long as it is normalized. We need to choose q(y|xS) to be as general as possible while still keeping the term hln q (y|xS)ip(xS,y) tractable in Eq. 9. As a result, we set q(y|xS) as q (y|xS) = q (xS, y) q (xS) = q (xS|y) p (y) P y0 q (xS|y0) p (y0) (10) We can verify that Eq. 10 is normalized even if q(xS|y) is not normalized. If we further denote, q (xS) = X y0 q (xS|y0) p (y0) (11) then by combining Eqs. 9 and 10, we get, I (xS : y) ≥ ⌧ ln ✓q (xS|y) q (xS) ◆) p(xS,y) ⌘ILB (xS : y) (12) And we also have the following equation which shows the gap between I(xS : y) and ILB(xS : y), I (xS : y) −ILB (xS : y) = hKL (p (y|xS) ||q (y|xS))ip(xS) (13) Auto-Regressive Decomposition. Now that q(y|xS) is defined, all we need to do is model q(xS|y) under Eq. 10, and q(xS) is easy to compute based on q(xS|y). Here we decompose q(xS|y) as an auto-regressive distribution assuming T features in S: q (xS|y) = q (xf1|y) T Y t=2 q (xft|xf<t, y) (14) 4 Figure 2: Auto-regressive decomposition for q(xS|y) where xf<t denotes {xf1, xf2, ..., xft−1}. The graphical model in Fig. 2 demonstrates this decomposition. The main advantage of this model is that it is well-suited for the forward feature selection procedure where one feature is selected at a time (which we will explain in Sec. 3.2.3). And if q (xft|xf<t, y) is tractable, then so is the whole distribution q(xS|y). Therefore, we would find tractable Q-distributions over q (xft|xf<t, y). Below we illustrate two such Q-distributions. Naive Bayes Q-distribution. A natural idea would be to assume xt is independent of other variables given y, i.e., q (xft|xf<t, y) = p (xft|y) (15) Then the variational distribution q(y|xS) can be written based on Eqs. 10 and 15 as follows: q (y|xS) = p (y) Q j2S p (xj|y) P y0 p (y0) Q j2S p (xj|y0) (16) And we also have the following theorem: Theorem 3.1 (Exact Naive Bayes). Under Eq. 16, the lower bound in Eq. 8 becomes exact if and only if data is generated by a Naive Bayes model, i.e., p (x, y) = p (y) Q i p (xi|y). The proof for Theorem 3.1 becomes obvious by using the mutual information definition. Note that the most-cited MI-based feature selection method mRMR [10] also assumes conditional independence given the class label y as shown in [5, 18, 19], but they make additional stronger independence assumptions among only feature variables. Pairwise Q-distribution. We now consider an alternative approach that is more general than the Naive Bayes distribution: q (xft|xf<t, y) = t−1 Y i=1 p (xft|xfi, y) ! 1 t−1 (17) In Eq. 17, we assume q (xft|xf<t, y) to be the geometric mean of conditional distributions q(xft|xfi, y). This assumption is tractable as well as reasonable because if the data is generated by a Naive Bayes model, the lower bound in Eq. 8 also becomes exact using Eq. 17 due to p (xft|xfi, y) ⌘p (xft|y) in that case. 3.2.2 Estimating Lower Bound From Data Assuming either Naive Bayes Q-distribution or pairwise Q-distribution, it is convenient to estimate q(xS|y) and q(xS) in Eq. 12 by using plug-in probability estimators for discrete data or one/twodimensional density estimators for continuous data. We also use the sample mean to approximate the expectation term in Eq. 12. Our final estimator for ILB (xS : y) is written as follows: bILB (xS : y) = 1 N X x(k),y(k) ln bq ⇣ x(k) S |y(k)⌘ bq ⇣ x(k) S ⌘ (18) where 2 x(k), y(k) are samples from data, and bq(·) denotes the estimate for q(·). 5 3.2.3 Variational Forward Feature Selection Under Auto-Regressive Decomposition After defining q(y|xS) in Eq. 10 and auto-regressive decomposition of q(xS|y) in Eq. 15, we are able to do the forward feature selection previously described in Eq. 2, but replace the mutual information with its lower bound bILB. Recall that St−1 is the set of selected features after step t −1, then the feature ft will be selected at step t such that ft = arg max i/2St−1 bILB (xSt−1[i : y) (19) where bILB (xSt−1[i : y) can be obtained from bILB (xSt−1 : y) recursively by auto-regressive decomposition q (xSt−1[i|y) = q (xSt−1|y) q (xi|xSt−1, y) where q (xSt−1|y) is stored at step t −1. This forward feature selection can be done under auto-regressive decomposition in Eqs. 10 and 14 for any Q-distribution. However, calculating q(xi|xSt, y) may vary according to different Qdistributions. We can verify that it is easy to get q(xi|xSt, y) recursively from q(xi|xSt−1, y) under Naive Bayes or pairwise Q-distribution. We call our algorithm under these two Q-distributions VMInaive and VMIpairwise respectively. It is worthwhile noting that the lower bound does not always increase at each step. A decrease in lower bound at step t indicates that the Q-distribution would approximate the underlying distribution worse than it did at previous step t −1. In this case, the algorithm would re-maximize the lower bound from zero with only the remaining unselected features. We summarize the concrete implementation of our algorithms in supplementary Sec. A. Time Complexity. Although our algorithm needs to calculate the distributions at each step, we only need to calculate the probability value at each sample point. For both VMInaive and VMIpairwise, the total computational complexity is O(NDT) assuming N as number of samples, D as total number of features, T as number of final selected features. The detailed time analysis is left for the supplementary Sec. A. As shown in Table 1, our methods VMInaive and VMIpairwise have the same time complexity as mRMR [10], while the state-of-the-art global optimization method SPECCMI [12] is required to precompute the pairwise mutual information matrix, which gives a time complexity of O(ND2). Table 1: Time complexity in number of features D, selected number of features d, and number of samples N Method mRMR VMInaive VMIpairwise SPECCMI Complexity O(NDT) O(NDT) O(NDT) O(ND2) Optimality Under Tree Graphical Models. Although our method VMInaive assumes a Naive Bayes model, we can prove that this method is still optimal if the data is generated according to tree graphical models. Indeed, both of our methods, VMInaive and VMIpairwise, will always prioritize the first layer features, as shown in Fig. 3. This optimality is summarized in Theorem B.1 in supplementary Sec. B. 4 Experiments Synthetic Data. We begin with the experiments on a synthetic model according to the tree structure illustrated in the left part of Fig. 3. The detailed data generating process is shown in supplementary section D. The root node Y is a binary variable, while other variables are continuous. We use VMInaive to optimize the lower bound ILB(x : y). 5000 samples are used to generate the synthethic data, and variational Q-distributions are estimated by the kernel density estimator. We can see from the plot in the right-hand part of Fig. 3 that our algorithm, VMInaive, selects x1, x2, x3 as the first three features, although x2 and x3 are only weakly correlated with y. If we continue to add deeper level features {x4, ..., x9}, the lower bound will decrease. For comparison, we also illustrate the mutual information between each single feature xi and y in Table 2. We can see from Table 2 that it would choose x1, x4 and x5 as the top three features by using the maximum relevance criteria [15]. 6 Figure 3: (Left) This is the generative model used for synthetic experiments. Edge thickness represents the relationship strength. (Right) Optimizing the lower bound by VMInaive. Variables under the blue line denote the features selected at each step. Dotted blue line shows the decreasing lower bound if adding more features. Ground-truth mutual information is obtained using N = 100, 000 samples. featurei x1 x2 x3 x4 x5 x6 x7 x8 x9 I(xi : y) 0.111 0.052 0.022 0.058 0.058 0.025 0.029 0.012 0.013 Table 2: Mutual information between label y and each feature xi for Fig. 3. I(xi : y) is estimated using N=100,000 samples. Top three variables with highest mutual information are highlighted in bold. Real-World Data. We compare our algorithms VMInaive and VMIpairwise with other popular information-theoretic feature selection methods, including mRMR [10], JMI [8], MIM [15], CMIM [9], CIFE [16], and SPECCMI [12]. We use 17 well-known datasets in previous feature selection studies [5, 12] (all data are discretized). The dataset summaries are illustrated in supplementary Sec. C. We use the average cross-validation error rate on the range of 10 to 100 features to compare different algorithms under the same setting as [12]. Tenfold cross-validation is employed for datasets with number of samples N ≥100 and leave-one-out cross-validation otherwise. The 3-nearest-neighbor classifier is used for Gisette and Madelon, following [5]. For the remaining datasets, the chosen classifier is Linear SVM, following [11, 12]. The experimental results can be seen in Table 3.1 The entries with ⇤and ⇤⇤indicate the best performance and the second best performance, respectively (in terms of average error rate). We also use the paired t-test at 5% significant level to test the hypothesis that VMInaive or VMIpairwise perform significantly better than other methods, or vice visa. Overall, we find that both of our methods, VMInaive and VMIpairwise, strongly outperform other methods. This indicates that our variational feature selection framework is a promising addition to the current literature of information-theoretic feature selection. Figure 4: Number of selected features versus average cross-validation error in datasets Semeion and Gisette. 1We omit the results for MIM and CIFE due to space limitations. The complete results are shown in the supplementary Sec. C. 7 Table 3: Average cross-validation error rate comparison of VMI against other methods. The last two lines indicate win(W)/tie (T)/ loss(L) for VMInaive and VMIpairwise respectively. Dataset mRMR JMI CMIM SPECCMI VMInaive VMIpairwise Lung 10.9±(4.7)⇤⇤ 11.6±(4.7) 11.4±(3.0) 11.6±(5.6) 7.4±(3.6)⇤ 14.5±(6.0) Colon 19.7±(2.6) 17.3±(3.0) 18.4±(2.6) 16.1±(2.0) 11.2±(2.7)⇤ 11.9±(1.7)⇤⇤ Leukemia 0.4±(0.7) 1.4±(1.2) 1.1±(2.0) 1.8±(1.3) 0.0±(0.1)⇤ 0.2±(0.5)⇤⇤ Lymphoma 5.6±(2.8) 6.6±(2.2) 8.6±(3.3) 12.0±(6.6) 3.7±(1.9)⇤ 5.2±(3.1)⇤⇤ Splice 13.6±(0.4)⇤ 13.7±(0.5)⇤⇤ 14.7±(0.3) 13.7±(0.5)⇤⇤ 13.7±(0.5)⇤⇤ 13.7±(0.5)⇤⇤ Landsat 19.5±(1.2) 18.9±(1.0) 19.1±(1.1) 21.0±(3.5) 18.8±(0.8)⇤ 18.8±(1.0)⇤⇤ Waveform 15.9±(0.5)⇤ 15.9±(0.5)⇤ 16.0±(0.7) 15.9±(0.6)⇤⇤ 15.9±(0.6)⇤⇤ 15.9±(0.5)⇤ KrVsKp 5.1±(0.7)⇤⇤ 5.2±(0.6) 5.3±(0.5) 5.1±(0.6)⇤ 5.3±(0.5) 5.1±(0.7)⇤⇤ Ionosphere 12.8±(0.9) 16.6±(1.6) 13.1±(0.8) 16.8±(1.6) 12.7±(1.9)⇤⇤ 12.0±(1.0)⇤ Semeion 23.4±(6.5) 24.8±(7.6) 16.3±(4.4) 26.0±(9.3) 14.0±(4.0)⇤ 14.5±(3.9)⇤⇤ Multifeat. 4.0±(1.6) 4.0±(1.6) 3.6±(1.2) 4.8±(3.0) 3.0±(1.1)⇤ 3.5±(1.1)⇤⇤ Optdigits 7.6±(3.3) 7.6±(3.2) 7.5±(3.4)⇤⇤ 9.2±(6.0) 7.2±(2.5)⇤ 7.6±(3.6) Musk2 12.4±(0.7)⇤ 12.8±(0.7) 13.0±(1.0) 15.1±(1.8) 12.8±(0.6) 12.6±(0.5)⇤⇤ Spambase 6.9±(0.7) 7.0±(0.8) 6.8±(0.7)⇤⇤ 9.0±(2.3) 6.6±(0.3)⇤ 6.6±(0.3)⇤ Promoter 21.5±(2.8) 22.4±(4.0) 22.1±(2.9) 24.0±(3.7) 21.2±(3.9)⇤⇤ 20.4±(3.1)⇤ Gisette 5.5±(0.9) 5.9±(0.7) 5.1±(1.3) 7.1±(1.3) 4.8±(0.9)⇤⇤ 4.2±(0.8)⇤ Madelon 30.8±(3.8) 15.3±(2.6)⇤ 17.4±(2.6) 15.9±(2.5)⇤⇤ 16.7±(2.7) 16.6±(2.9) #W1/T1/L1: 11/4/2 10/6/1 10/7/0 13/2/2 #W2/T2/L2: 9/6/2 9/6/2 13/3/1 12/3/2 We also plot the average cross-validation error with respect to number of selected features. Fig. 4 shows the two most distinguishable data sets, Semeion and Gisette. We can see that both of our methods, VMINaive and VMIpairwise, have lower error rates in these two data sets. 5 Related Work There has been a significant amount of work on information-theoretic feature selection in the past twenty years: [5, 7, 8, 9, 10, 15, 11, 12, 20], to name a few. Most of these methods are based on combinations of so-called relevant, redundant and complimentary information. Such combinations representing low-order approximations of mutual information are derived from two assumptions, and it has proved unrealistic to expect both assumptions to be true. Inspired by group testing [21], more scalable feature selection methods have been developed, but thos methods also require the calculation of high-dimensional mutual information as a basic scoring function. Estimating mutual information from data requires a large number of observations—especially when the dimensionality is high. The proposed variational lower bound can be viewed as a way of estimating mutual information between a high-dimensional continuous variable and a discrete variable. Only a few examples exist in literature [22] under this setting. We hope our method will shed light on new ways to estimate mutual information, similar to estimating divergences in [23]. 6 Conclusion Feature selection has been a significant endeavor over the past decade. Mutual information gives a general basis for quantifying the informativeness of features. Despite the clarity of mutual information, estimating it can be difficult. While a large number of information-theoretic methods exist, they are rather limited and rely on mutually inconsistent assumptions about underlying data distributions. We introduced a unifying variational mutual information lower bound to address these issues and showed that by auto-regressive decomposition, feature selection can be done in a forward manner by progressively maximizing the lower bound. We also presented two concrete methods using Naive Bayes and pairwise Q-distributions, which strongly outperform the existing methods. VMInaive only assumes a Naive Bayes model, but even this simple model outperforms the existing information-theoretic methods, indicating the effectiveness of our variational information maximization framework. We hope that our framework will inspire new mathematically rigorous algorithms for information-theoretic feature selection, such as optimizing the variational lower bound globally and developing more powerful variational approaches for capturing complex dependencies. 8 References [1] Manoranjan Dash and Huan Liu. Feature selection for classification. Intelligent data analysis, 1(3):131– 156, 1997. [2] Huan Liu and Hiroshi Motoda. Feature selection for knowledge discovery and data mining, volume 454. Springer Science & Business Media, 2012. [3] Ron Kohavi and George H John. Wrappers for feature subset selection. Artificial intelligence, 97(1):273– 324, 1997. [4] Isabelle Guyon and Andr´e Elisseeff. An introduction to variable and feature selection. The Journal of Machine Learning Research, 3:1157–1182, 2003. [5] Gavin Brown, Adam Pocock, Ming-Jie Zhao, and Mikel Luj´an. Conditional likelihood maximisation: a unifying framework for information theoretic feature selection. The Journal of Machine Learning Research, 13(1):27–66, 2012. [6] Thomas M Cover and Joy A Thomas. Elements of information theory. John Wiley & Sons, 2012. [7] Roberto Battiti. Using mutual information for selecting features in supervised neural net learning. Neural Networks, IEEE Transactions on, 5(4):537–550, 1994. [8] Howard Hua Yang and John E Moody. Data visualization and feature selection: New algorithms for nongaussian data. In NIPS, volume 99, pages 687–693. Citeseer, 1999. [9] Franc¸ois Fleuret. Fast binary feature selection with conditional mutual information. The Journal of Machine Learning Research, 5:1531–1555, 2004. [10] Hanchuan Peng, Fuhui Long, and Chris Ding. Feature selection based on mutual information criteria of max-dependency, max-relevance, and min-redundancy. Pattern Analysis and Machine Intelligence, IEEE Transactions on, 27(8):1226–1238, 2005. [11] Irene Rodriguez-Lujan, Ramon Huerta, Charles Elkan, and Carlos Santa Cruz. Quadratic programming feature selection. The Journal of Machine Learning Research, 11:1491–1516, 2010. [12] Xuan Vinh Nguyen, Jeffrey Chan, Simone Romano, and James Bailey. Effective global approaches for mutual information based feature selection. In Proceedings of the 20th ACM SIGKDD international conference on Knowledge discovery and data mining, pages 512–521. ACM, 2014. [13] David Barber and Felix Agakov. The im algorithm: a variational approach to information maximization. In Advances in Neural Information Processing Systems 16: Proceedings of the 2003 Conference, volume 16, page 201. MIT Press, 2004. [14] Abhimanyu Das and David Kempe. Submodular meets spectral: Greedy algorithms for subset selection, sparse approximation and dictionary selection. In Proceedings of the 28th International Conference on Machine Learning (ICML-11), pages 1057–1064, 2011. [15] David D Lewis. Feature selection and feature extraction for text categorization. In Proceedings of the workshop on Speech and Natural Language, pages 212–217. Association for Computational Linguistics, 1992. [16] Dahua Lin and Xiaoou Tang. Conditional infomax learning: an integrated framework for feature extraction and fusion. In Computer Vision–ECCV 2006, pages 68–82. Springer, 2006. [17] Shakir Mohamed and Danilo Jimenez Rezende. Variational information maximisation for intrinsically motivated reinforcement learning. In Advances in Neural Information Processing Systems, pages 2116– 2124, 2015. [18] Kiran S Balagani and Vir V Phoha. On the feature selection criterion based on an approximation of multidimensional mutual information. IEEE Transactions on Pattern Analysis & Machine Intelligence, (7):1342–1343, 2010. [19] Nguyen Xuan Vinh, Shuo Zhou, Jeffrey Chan, and James Bailey. Can high-order dependencies improve mutual information based feature selection? Pattern Recognition, 2015. [20] Hongrong Cheng, Zhiguang Qin, Chaosheng Feng, Yong Wang, and Fagen Li. Conditional mutual information-based feature selection analyzing for synergy and redundancy. ETRI Journal, 33(2):210– 218, 2011. [21] Yingbo Zhou, Utkarsh Porwal, Ce Zhang, Hung Q Ngo, Long Nguyen, Christopher R´e, and Venu Govindaraju. Parallel feature selection inspired by group testing. In Advances in Neural Information Processing Systems, pages 3554–3562, 2014. [22] Brian C Ross. Mutual information between discrete and continuous data sets. PloS one, 9(2):e87357, 2014. [23] XuanLong Nguyen, Martin J Wainwright, and Michael I Jordan. Estimating divergence functionals and the likelihood ratio by convex risk minimization. Information Theory, IEEE Transactions on, 56(11):5847–5861, 2010. [24] Shuyang Gao. Variational feature selection code. http://github.com/BiuBiuBiLL/ InfoFeatureSelection. [25] Chris Ding and Hanchuan Peng. Minimum redundancy feature selection from microarray gene expression data. Journal of bioinformatics and computational biology, 3(02):185–205, 2005. [26] Kevin Bache and Moshe Lichman. Uci machine learning repository, 2013. 9
2016
286
6,201
Learning Bound for Parameter Transfer Learning Wataru Kumagai Faculty of Engineering Kanagawa University kumagai@kanagawa-u.ac.jp Abstract We consider a transfer-learning problem by using the parameter transfer approach, where a suitable parameter of feature mapping is learned through one task and applied to another objective task. Then, we introduce the notion of the local stability and parameter transfer learnability of parametric feature mapping, and thereby derive a learning bound for parameter transfer algorithms. As an application of parameter transfer learning, we discuss the performance of sparse coding in selftaught learning. Although self-taught learning algorithms with plentiful unlabeled data often show excellent empirical performance, their theoretical analysis has not been studied. In this paper, we also provide the first theoretical learning bound for self-taught learning. 1 Introduction In traditional machine learning, it is assumed that data are identically drawn from a single distribution. However, this assumption does not always hold in real-world applications. Therefore, it would be significant to develop methods capable of incorporating samples drawn from different distributions. In this case, transfer learning provides a general way to accommodate these situations. In transfer learning, besides the availability of relatively few samples related with an objective task, abundant samples in other domains that are not necessarily drawn from an identical distribution, are available. Then, transfer learning aims at extracting some useful knowledge from data in other domains and applying the knowledge to improve the performance of the objective task. In accordance with the kind of knowledge that is transferred, approaches to solving transfer-learning problems can be classified into cases such as instance transfer, feature representation transfer, and parameter transfer (Pan and Yang (2010)). In this paper, we consider the parameter transfer approach, where some kind of parametric model is supposed and the transferred knowledge is encoded into parameters. Since the parameter transfer approach typically requires many samples to accurately learn a suitable parameter, unsupervised methods are often utilized for the learning process. In particular, transfer learning from unlabeled data for predictive tasks is known as self-taught learning (Raina et al. (2007)), where a joint generative model is not assumed to underlie unlabeled samples even though the unlabeled samples should be indicative of a structure that would subsequently be helpful in predicting tasks. In recent years, self-taught learning has been intensively studied, encouraged by the development of strong unsupervised methods. Furthermore, sparsity-based methods such as sparse coding or sparse neural networks have often been used in empirical studies of self-taught learning. Although many algorithms based on the parameter transfer approach have empirically demonstrated impressive performance in self-taught learning, some fundamental problems remain. First, the theoretical aspects of the parameter transfer approach have not been studied, and in particular, no learning bound was obtained. Second, although it is believed that a large amount of unlabeled data help to improve the performance of the objective task in self-taught learning, it has not been sufficiently clarified how many samples are required. Third, although sparsity-based methods are typically employed in self-taught learning, it is unknown how the sparsity works to guarantee the performance of self-taught learning. The aim of the research presented in this paper is to shed light on the above problems. We first consider a general model of parametric feature mapping in the parameter transfer approach. Then, we newly formulate the local stability of parametric feature mapping and the parameter transfer learnability for this mapping, and provide a theoretical learning bound for parameter transfer learning algorithms based on the notions. Next, we consider the stability of sparse coding. Then we discuss the parameter transfer learnability by dictionary learning under the sparse model. Applying the learning bound for parameter transfer learning algorithms, we provide a learning bound of the sparse coding algorithm in self-taught learning. This paper is organized as follows. In the remainder of this section, we refer to some related studies. In Section 2, we formulate the stability and the parameter transfer learnability of the parametric feature mapping. Then, we present a learning bound for parameter transfer learning. In Section 3, we show the stability of the sparse coding under perturbation of the dictionaries. Then, by imposing sparsity assumptions on samples and by considering dictionary learning, we derive the parameter transfer learnability for sparse coding. In particular, a learning bound is obtained for sparse coding in the setting of self-taught learning. In Section 4, we conclude the paper. 1.1 Related Works Approaches to transfer learning can be classified into some cases based on the kind of knowledge being transferred (Pan and Yang (2010)). In this paper, we consider the parameter transfer approach. This approach can be applied to various notable algorithms such as sparse coding, multiple kernel learning, and deep learning since the dictionary, weights on kernels, and weights on the neural network are regarded as parameters, respectively. Then, those parameters are typically trained or tuned on samples that are not necessarily drawn from a target region. In the parameter transfer setting, a number of samples in the source region are often needed to accurately estimate the parameter to be transferred. Thus, it is desirable to be able to use unlabeled samples in the source region. Self-taught learning corresponds to the case where only unlabeled samples are given in the source region while labeled samples are available in the target domain. In this sense, self-taught learning is compatible with the parameter transfer approach. Actually, in Raina et al. (2007) where self-taught learning was first introduced, the sparse coding-based method is employed and the parameter transfer approach is already used regarding the dictionary learnt from images as the parameter to be transferred. Although self-taught learning has been studied in various contexts (Dai et al. (2008); Lee et al. (2009); Wang et al. (2013); Zhu et al. (2013)), its theoretical aspects have not been sufficiently analyzed. One of the main results in this paper is to provide a first theoretical learning bound in self-taught learning with the parameter transfer approach. We note that our setting differs from the environment-based setting (Baxter (2000), Maurer (2009)), where a distribution on distributions on labeled samples, known as an environment, is assumed. In our formulation, the existence of the environment is not assumed and labeled data in the source region are not required. Self-taught learning algorithms are often based on sparse coding. In the seminal paper by Raina et al. (2007), they already proposed an algorithm that learns a dictionary in the source region and transfers it to the target region. They also showed the effectiveness of the sparse coding-based method. Moreover, since remarkable progress has been made in unsupervised learning based on sparse neural networks (Coates et al. (2011), Le (2013)), unlabeled samples of the source domain in self-taught learning are often preprocessed by sparsity-based methods. Recently, a sparse coding-based generalization bound was studied (Mehta and Gray (2013); Maurer et al. (2012)) and the analysis in Section 3.1 is based on (Mehta and Gray (2013)). 2 Learning Bound for Parameter Transfer Learning 2.1 Problem Setting of Parameter Transfer Learning We formulate parameter transfer learning in this subsection. We first briefly introduce notations and terminology in transfer learning (Pan and Yang (2010)). Let X and Y be a sample space and a label space, respectively. We refer to a pair of Z := X × Y and a joint distribution P(x, y) on Z as a region. Then, a domain comprises a pair consisting of a sample space X and a marginal probability of P(x) on X and a task consists of a pair containing a label set Y and a conditional distribution P(y|x). In addition, let H = {h : X →Y} be a hypothesis space and ℓ: Y × Y →R≥0 2 represent a loss function. Then, the expected risk and the empirical risk are defined by R(h) := E(x,y)∼P [ℓ(y, h(x))] and bRn(h) := 1 n ∑n j=1 ℓ(yj, h(xj)), respectively. In the setting of transfer learning, besides samples from a region of interest known as a target region, it is assumed that samples from another region known as a source region are also available. We distinguish between the target and source regions by adding a subscript T or S to each notation introduced above, (e.g. PT , RS). Then, the homogeneous setting (i.e., XS = XT ) is not assumed in general, and thus, the heterogeneous setting (i.e., XS ̸= XT ) can be treated. We note that self-taught learning, which is treated in Section 3, corresponds to the case when the label space YS in the source region is the set of a single element. We consider the parameter transfer approach, where the knowledge to be transferred is encoded into a parameter. The parameter transfer approach aims to learn a hypothesis with low expected risk for the target task by obtaining some knowledge about an effective parameter in the source region and transfer it to the target region. In this paper, we suppose that there are parametric models on both the source and target regions and that their parameter spaces are partly shared. Then, our strategy is to learn an effective parameter in the source region and then transfer a part of the parameter to the target region. We describe the formulation in the following. In the target region, we assume that YT ⊂R and there is a parametric feature mapping ψθ : XT →Rm on the target domain such that each hypothesis hT ,θ,w : XT →YT is represented by hT ,θ,w(x) := ⟨w, ψθ(x)⟩ (1) with parameters θ ∈Θ and w ∈WT , where Θ is a subset of a normed space with a norm ∥· ∥and WT is a subset of Rm. Then the hypothesis set in the target region is parameterized as HT = {hT ,θ,w|θ ∈Θ, w ∈WT }. In the following, we simply denote RT (hT ,θ,w) and bRT (hT ,θ,w) by RT (θ, w) and bRT (θ, w), respectively. In the source region, we suppose that there exists some kind of parametric model such as a sample distribution PS,θ,w or a hypothesis hS,θ,w with parameters θ ∈Θ and w ∈WS, and a part Θ of the parameter space is shared with the target region. Then, let θ∗ S ∈Θ and w∗ S ∈WS be parameters that are supposed to be effective in the source region (e.g., the true parameter of the sample distribution, the parameter of the optimal hypothesis with respect to the expected risk RS); however, explicit assumptions are not imposed on the parameters. Then, the parameter transfer algorithm treated in this paper is described as follows. Let N- and n-samples be available in the source and target regions, respectively. First, a parameter transfer algorithm outputs the estimator bθN ∈Θ of θ∗ S by using N-samples. Next, for the parameter w∗ T := argmin w∈WT RT (θ∗ S, w) in the target region, the algorithm outputs its estimator bwN,n := argmin w∈WT bRT ,n(bθN, w) + ρr(w) by using n-samples, where r(w) is a 1-strongly convex function with respect to ∥· ∥2 and ρ > 0. If the source region relates to the target region in some sense, the effective parameter θ∗ S in the source region is expected to also be useful for the target task. In the next subsection, we regard RT (θ∗ S, w∗ T ) as the baseline of predictive performance and derive a learning bound. 2.2 Learning Bound Based on Stability and Learnability We newly introduce the local stability and the parameter transfer learnability as below. These notions are essential to derive a learning bound in Theorem 1. Definition 1 (Local Stability). A parametric feature mapping ψθ is said to be locally stable if there exist ϵθ : X →R>0 for each θ ∈Θ and Lψ > 0 such that for θ′ ∈Θ ∥θ −θ′∥≤ϵθ(x) ⇒∥ψθ(x) −ψθ′(x)∥2 ≤Lψ∥θ −θ′∥. We term ϵθ(x) the permissible radius of perturbation for θ at x. For samples Xn = {x1, . . . xn}, we denote as ϵθ(Xn) := minj∈[n] ϵθ(xj), where [n] := {1, . . . , n} for a positive integer n. Next, we formulate the parameter transfer learnability based on the local stability. 3 Definition 2 (Parameter Transfer Learnability). Suppose that N-samples in the source domain and n-samples Xn in the target domain are available. Let a parametric feature mapping {ψθ}θ∈Θ be locally stable. For ¯δ ∈[0, 1), {ψθ}θ∈Θ is said to be parameter transfer learnable with probability 1 −¯δ if there exists an algorithm that depends only on N-samples in the source domain such that, the output bθN of the algorithm satisfies Pr [ ∥bθN −θ∗ S∥≤ϵθ∗ S(Xn) ] ≥1 −¯δ. In the following, we assume that parametric feature mapping is bounded as ∥ψθ(x)∥2 ≤Rψ for arbitrary x ∈X and θ ∈Θ and linear predictors are also bounded as ∥w∥2 ≤RW for any w ∈W. In addition, we suppose that a loss function ℓ(·, ·) is Lℓ-Lipschitz and convex with respect to the second variable. We denote as Rr := supw∈W |r(w)|. Then, the following learning bound is obtained, where the strong convexity of the regularization term ρr(w) is essential. Theorem 1 (Learning Bound). Suppose that the parametric feature mapping ψθ is locally stable and an estimator bθN learned in the source region satisfies the parameter transfer learnability with probability 1 −¯δ. When ρ = LℓRψ √ 8(32+log(2/δ)) Rrn , the following inequality holds with probability 1 −(δ + 2¯δ): RT ( bθN, bwN,n ) −RT (θ∗ S, w∗ T ) ≤ LℓRψ ( RW √ 2 log(2/δ) + 2 √ 2Rr(32 + log(2/δ)) ) 1 √n + LℓLψRψ bθN −θ∗ S +Lℓ √ LψRWRψ ( Rr 2(32 + log(2/δ)) ) 1 4 n 1 4 √ bθN −θ∗ S . (2) If the estimation error ∥bθN −θ∗ S∥can be evaluated in terms of the number N of samples, Theorem 1 clarifies which term is dominant, and in particular, the number of samples required in the source domain such that this number is sufficiently large compared to the samples in the target domain. 2.3 Proof of Learning Bound We prove Theorem 1 in this subsection. In this proof, we omit the subscript T for simplicity. In addition, we denote θ∗ S simply by θ∗. We set as bw∗ n := argmin w∈W 1 n n ∑ j=1 ℓ(yj, ⟨w, ψθ∗(xj)⟩) + ρr(w). Then, we have RT ( bθN, bwN,n ) −RT (θ∗, w∗) = E(x,y)∼P [ ℓ(y, ⟨bwN,n, ψbθN (x)⟩) ] −E(x,y)∼P [ℓ(y, ⟨bwN,n, ψθ∗(x)⟩)] +E(x,y)∼P [ℓ(y, ⟨bwN,n, ψθ∗(x)⟩)] −E(x,y)∼P [ℓ(y, ⟨bw∗ n, ψθ∗(x)⟩)] (3) +E(x,y)∼P [ℓ(y, ⟨bw∗ n, ψθ∗(x)⟩)] −E(x,y)∼P [ℓ(y, ⟨w∗, ψθ∗(x)⟩)] . In the following, we bound three parts of (3). First, we have the following inequality with probability 1 −(δ/2 + ¯δ): E(x,y)∼P [ ℓ(y, ⟨bwN,n, ψbθN (x)⟩) ] −E(x,y)∼P [ℓ(y, ⟨bwN,n, ψθ∗(x)⟩)] ≤ LℓRWE(x,y)∼P [ ψbθN (x) −ψθ∗(x) ] ≤ LℓRW 1 n n ∑ j=1 ψbθN (xj) −ψθ∗(xj) + LℓRWRψ √ 2 log(2/δ) n ≤ LℓLψRW bθN −θ∗ + LℓRWRψ √ 2 log(2/δ) n , 4 where we used Hoeffding’s inequality as the third inequality, and the local stability and parameter transfer learnability in the last inequality. Second, we have the following inequality with probability 1 −¯δ: E(x,y)∼P [ℓ(y, ⟨bwN,n, ψθ∗(x)⟩)] −E(x,y)∼P [ℓ(y, ⟨bw∗ n, ψθ∗(x)⟩)] ≤ LℓE(x,y)∼P [|⟨bwN,n, ψθ∗(x)⟩−⟨bw∗ n, ψθ∗(x)⟩|] ≤ LℓRψ ∥bwN,n −bw∗ n∥2 ≤ LℓRψ √ 2LℓLψRW ρ bθN −θ∗ , (4) where the last inequality is derived by the strong convexity of the regularizer ρr(w) in the Appendix. Third, the following holds by Theorem 1 of Sridharan et al. (2009) with probability 1 −δ/2: E(x,y)∼P [ℓ(y, ⟨bw∗ n, ψθ∗(x)⟩)] −E(x,y)∼P [ℓ(y, ⟨w∗, ψθ∗(x)⟩)] = E(x,y)∼P [ℓ(y, ⟨bw∗ n, ψθ∗(x)⟩) + ρr(bw∗ n)] −E(x,y)∼P [ℓ(y, ⟨w∗, ψθ∗(x)⟩) + ρr(w∗)] + ρ(r(w∗) −r(bw∗ n)) ≤ ( 8L2 ℓR2 ψ(32 + log(2/δ)) ρn ) + ρRr. Thus, when ρ = LℓRψ √ 8(32+log(2/δ)) Rrn , we have (2) with probability 1 −(δ + 2¯δ). 3 Stability and Learnability in Sparse Coding In this section, we consider the sparse coding in self-taught learning, where the source region essentially consists of the sample space XS without the label space YS. We assume that the sample spaces in both regions are Rd. Then, the sparse coding method treated here consists of a two-stage procedure, where a dictionary is learnt on the source region, and then a sparse coding with the learnt dictionary is used for a predictive task in the target region. First, we show that sparse coding satisfies the local stability in Section 3.1 and next explain that appropriate dictionary learning algorithms satisfy the parameter transfer learnability in Section 3.4. As a consequence of Theorem 1, we obtain the learning bound of self-taught learning algorithms based on sparse coding. We note that the results in this section are useful independent of transfer learning. We here summarize the notations used in this section. Let ∥· ∥p be the p-norm on Rd. We define as supp(a) := {i ∈[m]|ai ̸= 0} for a ∈Rm. We denote the number of elements of a set S by |S|. When a vector a satisfies ∥a∥0 = |supp(a)| ≤k, a is said to be k-sparse. We denote the ball with radius R centered at 0 by BRd(R) := {x ∈Rd|∥x∥2 ≤R}. We set as D := {D = [d1, . . . , dm] ∈ BRd(1)m| ∥dj∥2 = 1 (i = 1, . . . , m)} and each D ∈D a dictionary with size m. Definition 3 (Induced matrix norm). For an arbitrary matrix E = [e1, . . . , em] ∈Rd×m, 1) the induced matrix norm is defined by ∥E∥1,2 := maxi∈[m] ∥ei∥2. We adopt ∥· ∥1,2 to measure the difference of dictionaries since it is typically used in the framework of dictionary learning. We note that ∥D −˜D∥1,2 ≤2 holds for arbitrary dictionaries D, ˜D ∈D. 3.1 Local Stability of Sparse Representation We show the local stability of sparse representation under a sparse model. A sparse representation with dictionary parameter D of a sample x ∈Rd is expressed as follows: φD(x) := argmin z∈Rm 1 2∥x −Dz∥2 2 + λ∥z∥1, 1) In general, the (p, q)-induced norm for p, q ≥1 is defined by ∥E∥p,q := supv∈Rm,∥v∥p=1 ∥Ev∥q. Then, ∥· ∥1,2 in this general definition coincides with that in Definition 3 by Lemma 17 of Vainsencher et al. (2011). 5 where λ > 0 is a regularization parameter. This situation corresponds to the case where θ = D and ψθ = φD in the setting of Section 2.1. We prepare some notions to the stability of the sparse representation. The following margin and incoherence were introduced by Mehta and Gray (2013). Definition 4 (k-margin). Given a dictionary D = [d1, . . . , dm] ∈D and a point x ∈Rd, the k-margin of D on x is Mk(D, x) := max I⊂[m],|I|=m−k min j∈I {λ −|⟨dj, x −DφD(x)⟩|} . Definition 5 (µ-incoherence). A dictionary matrix D = [d1, . . . , dm] ∈D is termed µ-incoherent if |⟨di, dj⟩| ≤µ/ √ d for all i ̸= j. Then, the following theorem is obtained. Theorem 2 (Sparse Coding Stability). Let D ∈D be µ-incoherent and ∥D −˜D∥1,2 ≤λ. When ∥D −˜D∥1,2 ≤ϵk,D(x) := Mk,D(x)2λ 64 max{1, ∥x∥}4 , (5) the following stability bound holds: ∥φD(x) −φ ˜D(x)∥2 ≤ 4∥x∥2√ k (1 −µk/ √ d)λ ∥D −˜D∥1,2. From Theorem 2, ϵk,D(x) becomes the permissible radius of perturbation in Definition 1. Here, we refer to the relation with the sparse coding stability (Theorem 4) of Mehta and Gray (2013), who measured the difference of dictionaries by ∥· ∥2,2 instead of ∥· ∥1,2 and the permissible radius of perturbation is given by Mk,D(x)2λ except for a constant factor. Applying the simple inequality ∥E∥2,2 ≤√m∥E∥1,2 for E ∈Rd×m, we can obtain a variant of the sparse coding stability with the norm ∥· ∥1,2. However, then the dictionary size m affects the permissible radius of perturbation and the stability bound of the sparse coding stability. On the other hand, the factor of m does not appear in Theorem 2, and thus, the result is effective even for a large m. In addition, whereas ∥x∥≤1 is assumed in Mehta and Gray (2013), Theorem 2 does not assume that ∥x∥≤1 and clarifies the dependency for the norm ∥x∥. In existing studies related to sparse coding, the sparse representation φD(x) is modified as φD(x)⊗ x (Mairal et al. (2009)) or φD(x) ⊗(x −DφD(x)) (Raina et al. (2007)) where ⊗is the tensor product. By the stability of sparse representation (Theorem 2), it can be shown that such modified representations also have local stability. 3.2 Sparse Modeling and Margin Bound In this subsection, we assume a sparse structure for samples x ∈Rd and specify a lower bound for the k-margin used in (5). The result obtained in this section plays an essential role to show the parameter transfer learnability in Section 3.4. Assumption 1 (Model). There exists a dictionary matrix D∗such that every sample x is independently generated by a representation a and noise ξ as x = D∗a + ξ. Moreover, we impose the following three assumptions on the above model. Assumption 2 (Dictionary). The dictionary matrix D∗= [d1, . . . , dm] ∈D is µ-incoherent. Assumption 3 (Representation). The representation a is a random variable that is k-sparse (i.e., ∥a∥0 ≤k) and the non-zero entries are lower bounded by C > 0 (i.e., ai ̸= 0 satisfy |ai| ≥C). Assumption 4 (Noise). The noise ξ is independent across coordinates and sub-Gaussian with parameter σ/ √ d on each component. We note that the assumptions do not require the representation a or noise ξ to be identically distributed while those components are independent. This is essential because samples in the source and target domains cannot be assumed to be identically distributed in transfer learning. 6 Theorem 3 (Margin Bound). Let 0 < t < 1. We set as δt,λ := 2σ (1 −t) √ dλ exp ( −(1 −t)2dλ2 8σ2 ) + 2σm √ dλ exp ( −dλ2 8σ2 ) + 4σk C √ d(1 −µk/ √ d) exp ( −C2d(1 −µk/ √ d) 8σ2 ) + 8σ(d −k) √ dλ exp ( −dλ2 32σ2 ) . (6) We suppose that d ≥ {( 1 + 6 (1−t) ) µk }2 and λ = d−τ for arbitrary 1/4 ≤τ ≤1/2. Under Assumptions 1-4, the following inequality holds with probability 1 −δt,λ at least: Mk,D∗(x) ≥tλ. (7) We refer to the regularization parameter λ. An appropriate reflection of the sparsity of samples requires the regularization parameter λ to be set suitably. According to Theorem 4 of Zhao and Yu (2006)2), when samples follow the sparse model as in Assumptions 1-4 and λ ∼= d−τ for 1/4 ≤τ ≤ 1/2, the representation φD(x) reconstructs the true sparse representation a of sample x with a small error. In particular, when τ = 1/4 (i.e., λ ∼= d−1/4) in Theorem 3, the failure probability δt,λ ∼= e− √ d on the margin is guaranteed to become sub-exponentially small with respect to dimension d and is negligible for the high-dimensional case. On the other hand, the typical choice τ = 1/2 (i.e., λ ∼= d−1/2) does not provide a useful result because δt,λ is not small at all. 3.3 Proof of Margin Bound We give a sketch of proof of Theorem 3. We denote the first term, the second term and the sum of the third and fourth terms of (6) by δ1, δ2 and δ3, respectively From Assumptions 1 and 3, a sample is represented as x = D∗a + ξ and ∥a∥0 ≤k. Without loss of generality, we assume that the first m −k components of a are 0 and the last k components are not 0. Since Mk,D∗(x) ≥ min 1≤j≤m−k λ −⟨dj, x −D∗φD(x)⟩= min 1≤j≤m−k λ −⟨dj, ξ⟩−⟨D∗⊤dj, a −φD(x)⟩, it is enough to show that the following holds an arbitrary 1 ≤j ≤m −k to prove Theorem 3: Pr[⟨dj, ξ⟩+ ⟨D∗⊤dj, a −φD(x)⟩> (1 −t)λ] ≤δt,λ. (8) Then, (8) follows from the following inequalities: Pr [ ⟨dj, ξ⟩> 1 −t 2 λ ] ≤ δ1, (9) Pr [ ⟨D∗⊤dj, a −φD(x)⟩> 1 −t 2 λ ] ≤ δ2 + δ3. (10) The inequality (9) holds since ∥dj∥= 1 by the definition and Assumption 4. Thus, all we have to do is to show (10). We have ⟨D∗⊤dj, a −φD(x)⟩ = ⟨[⟨d1, dj⟩, . . . , ⟨dm, dj⟩]⊤, a −φD(x)⟩ = ⟨(1supp(a−φD(x)) ◦[⟨d1, dj⟩, . . . , ⟨dm, dj⟩])⊤, a −φD(x)⟩ ≤ ∥1supp(a−φD(x)) ◦[⟨d1, dj⟩, . . . , ⟨dm, dj⟩]∥2∥a −φD(x)∥2,(11) where u ◦v is the Hadamard product (i.e. component-wise product) between u and v, and 1A for a set A ⊂[m] is a vector whose i-th component is 1 if i ∈A and 0 otherwise. Applying Theorem 4 of Zhao and Yu (2006) and using the condition for λ, the following holds with probability 1 −δ3: supp(a) = supp(φD(x)). (12) 2)Theorem 4 of Zhao and Yu (2006) is stated for Gaussian noise. However, it can be easily generalized to sub-Gaussian noise as in Assumption 4. Our setting corresponds to the case in which c1 = 1/2, c2 = 1, c3 = (log κ + log log d)/ log d for some κ > 1 (i.e., edc3 ∼= dκ) and c4 = c in Theorem 4 of Zhao and Yu (2006). Note that our regularization parameter λ corresponds to λd/d in (Zhao and Yu (2006)). 7 Moreover, under (12), the following holds with probability 1 −δ2 by modifying Corollary 1 of Negahban et al. (2009) and using the condition for λ: ∥a −φD(x)∥2 ≤6 √ kλ 1 −µk √ d . (13) Thus, if both of (12) and (13) hold, the right hand side of (11) is bounded as follows: ∥1supp(a−φD(x)) ◦[⟨d1, dj⟩, . . . , ⟨dm, dj⟩]∥2∥a −φD(x)∥2 ≤ √ |supp(a −φD(x))| µ √ d 6 √ kλ 1 −µk √ d = 6µk √ d −µk λ ≤1 −t 2 λ, where we used Assumption 2 in the first inequality, (12) and Assumption 3 in the equality and the condition for d in the last inequality. From the above discussion, the left hand side of (10) is bounded by the sum of the probability δ3 that (12) does not hold and the probability δ2 that (12) holds but (13) does not hold. 3.4 Transfer Learnability for Dictionary Learning When the true dictionary D∗exists as in Assumption 1, we show that the output bDN of a suitable dictionary learning algorithm from N-unlabeled samples satisfies the parameter transfer learnability for the sparse coding φD. Then, Theorem 1 guarantees the learning bound in self-taught learning since the discussion in this section does not assume the label space in the source region. This situation corresponds to the case where θ∗ S = D∗, bθN = bDN and ∥· ∥= ∥· ∥1,2 in Section 2.1. We show that an appropriate dictionary learning algorithm satisfies the parameter transfer learnability for the sparse coding φD by focusing on the permissible radius of perturbation in (5) under some assumptions. When Assumptions 1-4 hold and λ = d−τ for 1/4 ≤τ ≤1/2, the margin bound (7) for x ∈X holds with probability 1 −δt,λ, and thus, we have ϵk,D∗(x) ≥ t2λ3 64 max{1, ∥x∥}4 = Θ(d−3τ). Thus, if a dictionary learning algorithm outputs the estimator bDN such that ∥bDN −D∗∥1,2 ≤O(d−3τ) (14) with probability 1 −δN, the estimator bDN of D∗satisfies the parameter transfer learnability for the sparse coding φD with probability ¯δ = δN + nδt,λ. Then, by the local stability of the sparse representation and the parameter transfer learnability of such a dictionary learning, Theorem 1 guarantees that sparse coding in self-taught learning satisfies the learning bound in (2). We note that Theorem 1 can apply to any dictionary learning algorithm as long as (14) is satisfied. For example, Arora et al. (2015) show that, when k = O( √ d/ log d), m = O(d), Assumptions 1-4 and some additional conditions are assumed, their dictionary learning algorithm outputs bDN which satisfies ∥bDN −D∗∥1,2 = O(d−M) with probability 1 −d−M ′ for arbitrarily large M, M ′ as long as N is sufficiently large. 4 Conclusion We derived a learning bound (Theorem 1) for a parameter transfer learning problem based on the local stability and parameter transfer learnability, which are newly introduced in this paper. Then, applying it to a sparse coding-based algorithm under a sparse model (Assumptions 1-4), we obtained the first theoretical guarantee of a learning bound in self-taught learning. Although we only consider sparse coding, the framework of parameter transfer learning includes other promising algorithms such as multiple kernel learning and deep neural networks, and thus, our results are expected to be effective to analyze the theoretical performance of these algorithms. Finally, we note that our learning bound can be applied to different settings from self-taught learning because Theorem 1 includes the case in which labeled samples are available in the source region. 8 References [1] S. Arora, R. Ge, T. Ma, and A. Moitra (2015) “Simple, efficient, and neural algorithms for sparse coding,” arXiv preprint arXiv:1503.00778. [2] J. Baxter (2000) “A model of inductive bias learning,” J. Artif. Intell. Res.(JAIR), Vol. 12, p. 3. [3] A. Coates, A. Y. Ng, and H. Lee (2011) “An analysis of single-layer networks in unsupervised feature learning,” in International conference on artificial intelligence and statistics, pp. 215– 223. [4] W. Dai, Q. Yang, G.-R. Xue, and Y. Yu (2008) “Self-taught clustering,” in Proceedings of the 25th international conference on Machine learning, pp. 200–207, ACM. [5] Q. V. Le (2013) “Building high-level features using large scale unsupervised learning,” in Acoustics, Speech and Signal Processing (ICASSP), 2013 IEEE International Conference on, pp. 8595–8598, IEEE. [6] H. Lee, R. Raina, A. Teichman, and A. Y. Ng (2009) “Exponential Family Sparse Coding with Application to Self-taught Learning,” in IJCAI, Vol. 9, pp. 1113–1119, Citeseer. [7] J. Mairal, J. Ponce, G. Sapiro, A. Zisserman, and F. R. Bach (2009) “Supervised dictionary learning,” in Advances in neural information processing systems, pp. 1033–1040. [8] A. Maurer (2009) “Transfer bounds for linear feature learning,” Machine learning, Vol. 75, pp. 327–350. [9] A. Maurer, M. Pontil, and B. Romera-Paredes (2012) “Sparse coding for multitask and transfer learning,” arXiv preprint arXiv:1209.0738. [10] N. Mehta and A. G. Gray (2013) “Sparsity-based generalization bounds for predictive sparse coding,” in Proceedings of the 30th International Conference on Machine Learning (ICML13), pp. 36–44. [11] S. Negahban, B. Yu, M. J. Wainwright, and P. K. Ravikumar (2009) “A unified framework for high-dimensional analysis of M-estimators with decomposable regularizers,” in Advances in Neural Information Processing Systems, pp. 1348–1356. [12] S. J. Pan and Q. Yang (2010) “A survey on transfer learning,” Knowledge and Data Engineering, IEEE Transactions on, Vol. 22, pp. 1345–1359. [13] R. Raina, A. Battle, H. Lee, B. Packer, and A. Y. Ng (2007) “Self-taught learning: transfer learning from unlabeled data,” in Proceedings of the 24th international conference on Machine learning, pp. 759–766, ACM. [14] K. Sridharan, S. Shalev-Shwartz, and N. Srebro (2009) “Fast rates for regularized objectives,” in Advances in Neural Information Processing Systems, pp. 1545–1552. [15] D. Vainsencher, S. Mannor, and A. M. Bruckstein (2011) “The sample complexity of dictionary learning,” The Journal of Machine Learning Research, Vol. 12, pp. 3259–3281. [16] H. Wang, F. Nie, and H. Huang (2013) “Robust and discriminative self-taught learning,” in Proceedings of The 30th International Conference on Machine Learning, pp. 298–306. [17] P. Zhao and B. Yu (2006) “On model selection consistency of Lasso,” The Journal of Machine Learning Research, Vol. 7, pp. 2541–2563. [18] X. Zhu, Z. Huang, Y. Yang, H. T. Shen, C. Xu, and J. Luo (2013) “Self-taught dimensionality reduction on the high-dimensional small-sized data,” Pattern Recognition, Vol. 46, pp. 215– 229. 9
2016
287
6,202
Matrix Completion has No Spurious Local Minimum Rong Ge Duke University 308 Research Drive, NC 27708 rongge@cs.duke.edu. Jason D. Lee University of Southern California 3670 Trousdale Pkwy, CA 90089 jasonlee@marshall.usc.edu. Tengyu Ma Princeton University 35 Olden Street, NJ 08540 tengyu@cs.princeton.edu. Abstract Matrix completion is a basic machine learning problem that has wide applications, especially in collaborative filtering and recommender systems. Simple non-convex optimization algorithms are popular and effective in practice. Despite recent progress in proving various non-convex algorithms converge from a good initial point, it remains unclear why random or arbitrary initialization suffices in practice. We prove that the commonly used non-convex objective function for positive semidefinite matrix completion has no spurious local minima – all local minima must also be global. Therefore, many popular optimization algorithms such as (stochastic) gradient descent can provably solve positive semidefinite matrix completion with arbitrary initialization in polynomial time. The result can be generalized to the setting when the observed entries contain noise. We believe that our main proof strategy can be useful for understanding geometric properties of other statistical problems involving partial or noisy observations. 1 Introduction Matrix completion is the problem of recovering a low rank matrix from partially observed entries. It has been widely used in collaborative filtering and recommender systems [Kor09, RS05], dimension reduction [CLMW11] and multi-class learning [AFSU07]. There has been extensive work on designing efficient algorithms for matrix completion with guarantees. One earlier line of results (see [Rec11, CT10, CR09] and the references therein) rely on convex relaxations. These algorithms achieve strong statistical guarantees, but are quite computationally expensive in practice. More recently, there has been growing interest in analyzing non-convex algorithms for matrix completion [KMO10, JNS13, Har14, HW14, SL15, ZWL15, CW15]. Let M 2 Rd⇥d be the target matrix with rank r ⌧d that we aim to recover, and let ⌦= {(i, j) : Mi,j is observed} be the set of observed entries. These methods are instantiations of optimization algorithms applied to the objective1, f(X) = 1 2 X (i,j)2⌦ ⇥ Mi,j −(XX>)i,j ⇤2 , (1.1) These algorithms are much faster than the convex relaxation algorithms, which is crucial for their empirical success in large-scale collaborative filtering applications [Kor09]. 1In this paper, we focus on the symmetric case when the true M has a symmetric decomposition M = ZZT . Some of previous papers work on the asymmetric case when M = ZW T , which is harder than the symmetric case. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. All of the theoretical analysis for the nonconvex procedures require careful initialization schemes: the initial point should already be close to optimum. In fact, Sun and Luo [SL15] showed that after this initialization the problem is effectively strongly-convex, hence many different optimization procedures can be analyzed by standard techniques from convex optimization. However, in practice people typically use a random initialization, which still leads to robust and fast convergence. Why can these practical algorithms find the optimal solution in spite of the nonconvexity? In this work we investigate this question and show that the matrix completion objective has no spurious local minima. More precisely, we show that any local minimum X of objective function f(·) is also a global minimum with f(X) = 0, and recovers the correct low rank matrix M. Our characterization of the structure in the objective function implies that (stochastic) gradient descent from arbitrary starting point converge to a global minimum. This is because gradient descent converges to a local minimum [GHJY15, LSJR16], and every local minimum is also a global minimum. 1.1 Main results Assume the target matrix M is symmetric and each entry of M is observed with probability p independently 2. We assume M = ZZ> for some matrix Z 2 Rd⇥r. There are two known issues with matrix completion. First, the choice of Z is not unique since M = (ZR)(ZR)> for any orthonormal matrix Z. Our goal is to find one of these equivalent solutions. Another issue is that matrix completion is impossible when M is “aligned” with standard basis. For example, when M is the identity matrix in its first r ⇥r block, we will very likely be observing only 0 entries. To address this issue, we make the following standard assumption: Assumption 1. For any row Zi of Z, we have kZik 6 µ/ p d · kZkF . Moreover, Z has a bounded condition number σmax(Z)/σmin(Z) = . Throughout this paper we think of µ and as small constants, and the sample complexity depends polynomially on these two parameters. Also note that this assumption is independent of the choice of Z: all Z such that ZZT = M have the same row norms and Frobenius norm. This assumption is similar to the “incoherence” assumption [CR09]. Our assumption is the same as the one used in analyzing non-convex algorithms [KMO10, SL15]. We enforce X to also satisfy this assumption by a regularizer f(X) = 1 2 X (i,j)2⌦ ⇥ Mi,j −(XX>)i,j ⇤2 + R(X), (1.2) where R(X) is a function that penalizes X when one of its rows is too large. See Section 4 and Section A for the precise definition. Our main result shows that in this setting, the regularized objective function has no spurious local minimum: Theorem 1.1. [Informal] All local minimum of the regularized objective (1.1) satisfy XXT = ZZT = M when p > poly(, r, µ, log d)/d. Combined with the results in [GHJY15, LSJR16] (see more discussions in Section 1.2), we have, Theorem 1.2 (Informal). With high probability, stochastic gradient descent on the regularized objective (1.1) will converge to a solution X such that XXT = ZZT = M in polynomial time from any starting point. Gradient descent will converge to such a point with probability 1 from a random starting point. Our results are also robust to noise. Even if each entry is corrupted with Gaussian noise of standard deviation µ2kZk2 F /d (comparable to the magnitude of the entry itself!), we can still guarantee that all the local minima satisfy kXXT −ZZT kF 6 " when p is large enough. See the discussion in Appendix B for results on noisy matrix completion. 2The entries (i, j) and (j, i) are the same. With probability p we observe both entries and otherwise we observe neither. 2 Our main technique is to show that every point that satisfies the first and second order necessary conditions for optimality must be a desired solution. To achieve this we use new ideas to analyze the effect of the regularizer and show how it is useful in modifying the first and second order conditions to exclude any spurious local minimum. 1.2 Related Work Matrix Completion. The earlier theoretical works on matrix completion analyzed the nuclear norm heuristic [Rec11, CT10, CR09]. This line of work has the cleanest and strongest theoretical guarantees; [CT10, Rec11] showed that if |⌦| & drµ2 log2 d the nuclear norm convex relaxation recovers the exact underlying low rank matrix. The solution can be computed via the solving a convex program in polynomial time. However the primary disadvantage of nuclear norm methods is their computational and memory requirements. The fastest known algorithms have running time O(d3) and require O(d2) memory, which are both prohibitive for moderate to large values of d. These concerns led to the development of the low-rank factorization paradigm of [BM03]; Burer and Monteiro proposed factorizing the optimization variable c M = XXT , and optimizing over X 2 Rd⇥r instead of c M 2 Rd⇥d . This approach only requires O(dr) memory, and a single gradient iteration takes time O(r|⌦|), so has much lower memory requirement and computational complexity than the nuclear norm relaxation. On the other hand, the factorization causes the optimization problem to be non-convex in X, which leads to theoretical difficulties in analyzing algorithms. Under incoherence and sufficient sample size assumptions, [KMO10] showed that well-initialized gradient descent recovers M. Similary, [HW14, Har14, JNS13] showed that well-initialized alternating least squares or block coordinate descent converges to M, and [CW15] showed that well-initialized gradient descent converges to M. [SL15, ZWL15] provided a more unified analysis by showing that with careful initialization many algorithms, including gradient descent and alternating least squres, succeed. [SL15] accomplished this by showing an analog of strong convexity in the neighborhood of the solution M. Non-convex Optimization. Recently, a line of work analyzes non-convex optimization by separating the problem into two aspects: the geometric aspect which shows the function has no spurious local minimum and the algorithmic aspect which designs efficient algorithms can converge to local minimum that satisfy first and (relaxed versions) of second order necessary conditions. Our result is the first that explains the geometry of the matrix completion objective. Similar geometric results are only known for a few problems: phase retrieval/synchronization, orthogonal tensor decomposition, dictionary learning [GHJY15, SQW15, BBV16]. The matrix completion objective requires different tools due to the sampling of the observed entries, as well as carefully managing the regularizer to restrict the geometry. Parallel to our work Bhojanapalli et al.[BNS16] showed similar results for matrix sensing, which is closely related to matrix completion. Loh and Wainwright [LW15] showed that for many statistical settings that involve missing/noisy data and non-convex regularizers, any stationary point of the non-convex objective is close to global optima; furthermore, there is a unique stationary point that is the global minimum under stronger assumptions [LW14]. On the algorithmic side, it is known that second order algorithms like cubic regularization [NP06] and trust-region [SQW15] algorithms converge to local minima that approximately satisfy first and second order conditions. Gradient descent is also known to converge to local minima [LSJR16] from a random starting point. Stochastic gradient descent can converge to a local minimum in polynomial time from any starting point [Pem90, GHJY15]. All of these results can be applied to our setting, implying various heuristics used in practice are guaranteed to solve matrix completion. 2 Preliminaries Notations: For ⌦⇢[d] ⇥[d], let P⌦be the linear operator that maps a matrix A to P⌦(A), where P⌦(A) has the same values as A on ⌦, and 0 outside of ⌦. We will use the following matrix norms: k · kF the frobenius norm, k · k spectral norm, |A|1 elementwise infinity norm, and |A|p!q = maxkxkp=1 kAkq. We use the shorthand kAk⌦= kP⌦AkF . The trace inner product of two matrices is hA, Bi = tr(A>B), and σmin(X), σmax(X) are the smallest and largest singular values of X. We also use Xi to denote the i-th row of a matrix X. 3 2.1 Necessary conditions for Optimality Given an objective function f(x) : Rn ! R, we use rf(x) to denote the gradient of the function, and r2f(x) to denote the Hessian of the function (r2f(x) is an n ⇥n matrix where [r2f(x)]i,j = @2 @xi@xj f(x)). It is well known that local minima of the function f(x) must satisfy some necessary conditions: Definition 2.1. A point x satisfies the first order necessary condition for optimality (later abbreviated as first order optimality condition) if rf(x) = 0. A point x satisfies the second order necessary condition for optimality (later abbreviated as second order optimality condition)if r2f(x) ⌫0. These conditions are necessary for a local minimum because otherwise it is easy to find a direction where the function value decreases. We will also consider a relaxed second order necessary condition, where we only require the smallest eigenvalue of the Hessian r2f(x) to be not very negative: Definition 2.2. For ⌧> 0, a point x satisfies the ⌧-relaxed second order optimality condition, if r2f(x) ⌫−⌧· I. This relaxation to the second order condition makes the conditions more robust, and allows for efficient algorithms. Theorem 2.3. [NP06, SQW15, GHJY15] If every point x that satisfies first order and ⌧-relaxed second order necessary condition is a global minimum, then many optimization algorithms (cubic regularization, trust-region, stochastic gradient descent) can find the global minimum up to " error in function value in time poly(1/", 1/⌧, d). 3 Proof Strategy: “simple” proofs are more generalizable In this section, we demonstrate the key ideas behind our analysis using the rank r = 1 case. In particular, we first give a “simple” proof for the fully observed case. Then we show this simple proof can be easily generalized to the random observation case. We believe that this proof strategy is applicable to other statistical problems involving partial/noisy observations. The proof sketches in this section are only meant to be illustrative and may not be fully rigorous in various places. We refer the readers to Section 4 and Section A for the complete proofs. In the rank r = 1 case, we assume M = zz>, where kzk = 1, and kzk1 6 µ p d. Let " ⌧1 be the target accuracy that we aim to achieve in this section and let p = poly(µ, log d)/(d"). For simplicity, we focus on the following domain B of incoherent vectors where the regularizer R(x) vanishes, B = ⇢ x : kxk1 < 2µ p d & . (3.1) Inside this domain B, we can restrict our attention to the objective function without the regularizer, defined as, ˜g(x) = 1 2 · kP⌦(M −xx>)k2 F . (3.2) The global minima of ˜g(·) are z and −z with function value 0. Our goal of this section is to (informally) prove that all the local minima of ˜g(·) are O(p")-close to ±z. In later section we will formally prove that the only local minima are ±z. Lemma 3.1 (Partial observation case, informally stated). Under the setting of this section, in the domain B, all local mimina of the function ˜g(·) are O(p")-close to ±z. It turns out to be insightful to consider the full observation case when ⌦= [d]⇥[d]. The corresponding objective is g(x) = 1 2 · kM −xx>k2 F . (3.3) Observe that ˜g(x) is a sampled version of the g(x), and therefore we expect that they share the same geometric properties. In particular, if g(x) does not have spurious local minima then neither does ˜g(x). 4 Lemma 3.2 (Full observation case, informally stated). Under the setting of this section, in the domain B, the function g(·) has only two local minima {±z} . Before introducing the “simple” proof, let us first look at a delicate proof that does not generalize well. Difficult to Generalize Proof of Lemma 3.2. We compute the gradient and Hessian of g(x), rg(x) = Mx −kxk2x, r2g(x) = 2xx> −M + kxk2 · I .Therefore, a critical point x satisfies rg(x) = Mx −kxk2x = 0, and thus it must be an eigenvector of M and kxk2 is the corresponding eigenvalue. Next, we prove that the hessian is only positive definite at the top eigenvector . Let x be an eigenvector with eigenvalue λ = kxk2, and λ is strictly less than the top eigenvalue λ⇤. Let z be the top eigenvector. We have that hz, r2g(x)zi = −hz, Mzi + kxk2 = −λ⇤+ λ < 0, which shows that x is not a local minimum. Thus only z can be a local minimizer, and it is easily verified that r2g(z) is indeed positive definite. The difficulty of generalizing the proof above to the partial observation case is that it uses the properties of eigenvectors heavily. Suppose we want to imitate the proof above for the partial observation case, the first difficulty is how to solve the equation ˜g(x) = P⌦(M −xx>)x = 0. Moreover, even if we could have a reasonable approximation for the critical points (the solution of r˜g(x) = 0), it would be difficult to examine the Hessian of these critical points without having the orthogonality of the eigenvectors. “Simple” and Generalizable proof. The lessons from the subsection above suggest us find an alternative proof for the full observation case which is generalizable. The alternative proof will be simple in the sense that it doesn’t use the notion of eigenvectors and eigenvalues. Concretely, the key observation behind most of the analysis in this paper is the following, Proofs that consist of inequalities that are linear in 1⌦are often easily generalizable to partial observation case. Here statements that are linear in 1⌦mean the statements of the form P ij 1(i,j)2⌦Tij 6 a. We will call these kinds of proofs “simple” proofs in this section. Roughly speaking, the observation follows from the law of large numbers — Suppose Tij, (i, j) 2 [d]⇥[d] is a sequence of bounded real numbers, then the sampled sum P (i,j)2⌦Tij = P i,j 1(i,j)2⌦Tij is an accurate estimate of the sum p P i,j Tij, when the sampling probability p is relatively large. Then, the mathematical implications of p P Tij 6 a are expected to be similar to the implications of P (i,j)2⌦Tij 6 a, up to some small error introduced by the approximation. To make this concrete, we give below informal proofs for Lemma 3.2 and Lemma 3.1 that only consists of statements that are linear in 1⌦. Readers will see that due to the linearity, the proof for the partial observation case (shown on the right column) is a direct generalization of the proof for the full observation case (shown on the left column) via concentration inequalities (which will be discussed more at the end of the section). A “simple” proof for Lemma 3.2. Claim 1f. Suppose x 2 B satisfies rg(x) = 0, then hx, zi2 = kxk4. Proof. We have, rg(x) = (zz> −xx>)x = 0 ) hx, rg(x)i = hx, (zz> −xx>)xi = 0 (3.4) ) hx, zi2 = kxk4 Intuitively, this proof says that the norm of a critical point x is controlled by its correlation with z. Here at the lasa sampling version of the f the lasa sampling ver the f the lasa sampling vesio Generalization to Lemma 3.1. Claim 1p. Suppose x 2 B satisfies r˜g(x) = 0, then hx, zi2 = kxk4 −". Proof. Imitating the proof on the left, we have r˜g(x) = P⌦(zz> −xx>)x = 0 ) hx, r˜g(x)i = hx, P⌦(zz> −xx>)xi = 0 (3.5) ) hx, zi2 > kxk4 −" The last step uses the fact that equation (3.4) and (3.5) are approximately equal up to scaling factor p for any x 2 B, since (3.5) is a sampled version of (3.4). 5 Claim 2f. If x 2 B has positive Hessian r2g(x) ⌫0, then kxk2 > 1/3. Proof. By the assumption on x, we have that hz, r2g(x)zi > 0. Calculating the quadratic form of the Hessian (see Proposition 4.1 for details), hz, r2g(x)zi = kzx> + xz>k2 −2z>(zz> −xx>)z > 0aaaaaa (3.6) ) kxk2 + 2hz, xi2 > 1 ) kxk2 > 1/3 (since hz, xi2 6 kxk2) aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa Claim 2p. If x 2 B has positive Hessian r2˜g(x) ⌫0, then kxk2 > 1/3 −". Proof. Imitating the proof on the left, calculating the quadratic form over the Hessian at z (see Proposition 4.1) , we have aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa hz, r2˜g(x)zi = kP⌦(zx> + xz>)k2 −2z>P⌦(zz> −xx>)z > 0 (3.7) ) · · · · · · (same step as the left) ) kxk2 > 1/3 −" Here we use the fact that hz, r2˜g(x)zi ⇡ phz, r2g(x)zi for any x 2 B. With these two claims, we are ready to prove Lemma 3.2 and 3.1 by using another step that is linear in 1⌦. Proof of Lemma 3.2. By Claim 1f and 2f, we have x satisfies hx, zi2 > kxk4 > 1/9. Moreover, we have that rg(x) = 0 implies hz, rg(x)i = hz, (zz> −xx>)xi = 0 (3.8) ) hx, zi(1 −kxk2) = 0 ) kxk2 = 1 (by hx, zi2 > 1/9) Then by Claim 1f again we obtain hx, zi2 = 1, and therefore x = ±z. aaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa Proof of Lemma 3.1. By Claim 1p and 2p, we have x satisfies hx, zi2 > kxk4 > 1/9 −O("). Moreover, we have that r˜g(x) = 0 implies hz, r˜g(x)i = hz, P⌦(zz> −xx>)xi = 0 (3.9) ) · · · · · · (same step as the left) ) kxk2 = 1 ± O(") (same step as the left) Since (3.9) is the sampled version of equation (3.8), we expect they lead to the same conclusion up to some approximation. Then by Claim 1p again we obtain hx, zi2 = 1±O("), and therefore x is O(p")-close to either of ±z. Subtleties regarding uniform convergence. In the proof sketches above, our key idea is to use concentration inequalities to link the full observation objective g(x) with the partial observation counterpart. However, we require a uniform convergence result. For example, we need a statement like “w.h.p over the choice of ⌦, equation (3.4) and (3.5) are similar to each other up to scaling”. This type of statement is often only true for x inside the incoherent ball B. The fix to this is the regularizer. For non-incoherent x, we will use a different argument that uses the property of the regularizer. This is besides the main proof strategy of this section and will be discussed in subsequent sections. 4 Warm-up: Rank-1 Case In this section, using the general proof strategy described in previous section, we provide a formal proof for the rank-1 case. In subsection 4.1, we formally work out the proof sketches of Section 3 inside the incoherent ball. The rest of the proofs is deferred to supplementary material. In the rank-1 case, the objective function simplifies to, f(x) = 1 2kP⌦(M −xx>)k2 F + λR(x) . (4.1) Here we use the the regularization R(x) R(x) = d X i=1 h(xi), and h(t) = (|t| −↵)4 It>↵. 6 The parameters λ and ↵will be chosen later as in Theorem 4.2. We will choose ↵> 10µ/ p d so that R(x) = 0 for incoherent x, and thus it only penalizes coherent x. Moreover, we note R(x) has Lipschitz second order derivative. 3 We first state the optimality conditions, whose proof is deferred to Appendix A. Proposition 4.1. The first order optimality condition of objective (4.1) is, 2P⌦(M −xx>)x = λrR(x) , (4.2) and the second order optimality condition requires: 8v 2 Rd, kP⌦(vx> + xv>)k2 F + λv>r2R(x)v > 2v>P⌦(M −xx>)v . (4.3) Moreover, The ⌧-relaxed second order optimality condition requires 8v 2 Rd, kP⌦(vx> + xv>)k2 F + λv>r2R(x)v > 2v>P⌦(M −xx>)v −⌧kvk2 . (4.4) We give the precise version of Theorem 1.1 for the rank-1 case. Theorem 4.2. For p > cµ6 log1.5 d d where c is a large enough absolute constant, set ↵= 10µ p 1/d and λ > µ2p/↵2.Then, with high probability over the randomness of ⌦, the only points in Rd that satisfy both first and second order optimality conditions (or ⌧-relaxed optimality conditions with ⌧< 0.1p) are z and −z. In the rest of this section, we will first prove that when x is constrained to be incoherent (and hence the regularizer is 0 and concentration is straightforward) and satisfies the optimality conditions, then x has to be z or −z. Then we go on to explain how the regularizer helps us to change the geometry of those points that are far away from z so that we can rule out them from being local minimum. For simplicity, we will focus on the part that shows a local minimum x must be close enough to z. Lemma 4.3. In the setting of Theorem 4.2, suppose x satisfies the first-order and second-order optimality condition (4.2) and (4.3). Then when p is defined as in Theorem 4.2, ))xx> −zz>))2 F 6 O(") . where " = µ3(pd)−1/2. This turns out to be the main challenge. Once we proved x is close, we can apply the result of Sun and Luo [SL15] (see Lemma C.1), and obtain Theorem 4.2. 4.1 Handling incoherent x To demonstrate the key idea, in this section we restrict our attention to the subset of Rd which contains incoherent x with `2 norm bounded by 1, that is, we consider, B = ⇢ x : kxk1 6 2µ p d , kxk 6 1 & . (4.5) Note that the desired solution z is in B, and the regularization R(x) vanishes inside B. The following lemmas assume x satisfies the first and second order optimality conditions, and deduce a sequence of properties that x must satisfy. Lemma 4.4. Under the setting of Theorem 4.2 , with high probability over the choice of ⌦, for any x 2 B that satisfies second-order optimality condition (4.3) we have, kxk2 > 1/4. The same is true if x 2 B only satisfies ⌧-relaxed second order optimality condition for ⌧6 0.1p. Proof. We plug in v = z in the second-order optimality condition (4.3), and obtain that ))P⌦(zx> + xz>) ))2 F > 2z>P⌦(M −xx>)z . (4.6) 3This is the main reason for us to choose 4-th power instead of 2-nd power. 7 Intuitively, when restricted to ⌦, the squared Frobenius on the LHS and the quadratic form on the RHS should both be approximately a p fraction of the unrestricted case. In fact, both LHS and RHS can be written as the sum of terms of the form hP⌦(uvT ), P⌦(stT )i, because ))P⌦(zx> + xz>) ))2 F = 2hP⌦(zxT ), P⌦(zxT )i + 2hP⌦(zxT ), P⌦(xzT )i 2z>P⌦(M −xx>)z = 2hP⌦(zzT ), P⌦(zzT )i −2hP⌦(xxT ), P⌦(zzT )i. Therefore we can use concentration inequalities (Theorem D.1), and simplify the equation LHS of (4.6) = p ))zx> + xz>))2 F ± O( p pdkxk21kzk21kxk2kzk2) = 2pkxk2kzk2 + 2phx, zi2 ± O(p") , (Since x, z 2 B) where " = O(µ2q log d pd ). Similarly, by Theorem D.1 again, we have RHS of (4.6) = 2 + hP⌦(zz>), P⌦(zz>)i −hP⌦(xx>), P⌦(zz>)i , (Since M = zz>) = 2pkzk4 −2phx, zi2 ± O(p") (by Theorem D.1 and x, z 2 B) (Note that even we use the ⌧-relaxed second order optimality condition, the RHS only becomes 1.99pkzk4 −2phx, zi2 ± O(p") which does not effect the later proofs.) Therefore plugging in estimates above back into equation (4.6), we have that 2pkxk2kzk2 + 2phx, zi2 ± O(p") > 2kzk4 −2hx, zi2 ± O(p") , which implies that 6pkxk2kzk2 > 2pkxk2kzk2 + 4phx, zi2 > 2pkzk4 −O(p"). Using kzk2 = 1, and " being sufficiently small, we complete the proof. Next we use first order optimality condition to pin down another property of x – it has to be close to z after scaling. Note that this doesn’t mean directly that x has to be close to z since x = 0 also satisfies first order optimality condition (and therefore the conclusion (4.7) below). Lemma 4.5. With high probability over the randomness of ⌦, for any x 2 B that satisfies first-order optimality condition (4.2), we have that x also satisfies ))hz, xiz −kxk2x )) 6 O(") . (4.7) where " = ˜O(µ3(pd)−1/2). Finally we combine the two optimality conditions and show equation (4.7) implies xxT must be close to zzT . Lemma 4.6. Suppose vector x satisfies that kxk2 > 1/4, and that ))hz, xiz −kxk2x )) 6 δ . Then for δ 2 (0, 0.1), ))xx> −zz>))2 F 6 O(δ) . 5 Conclusions Although the matrix completion objective is non-convex, we showed the objective function has very nice properties that ensures the local minima are also global. This property gives guarantees for many basic optimization algorithms. An important open problem is the robustness of this property under different model assumptions: Can we extend the result to handle asymmetric matrix completion? Is it possible to add weights to different entries (similar to the settings studied in [LLR16])? Can we replace the objective function with a different distance measure rather than Frobenius norm (which is related to works on 1-bit matrix sensing [DPvdBW14])? We hope this framework of analyzing the geometry of objective function can be applied to other problems. 8 References [AFSU07] Yonatan Amit, Michael Fink, Nathan Srebro, and Shimon Ullman. Uncovering shared structures in multiclass classification. In Proceedings of the 24th international conference on Machine learning, pages 17–24. ACM, 2007. [BBV16] Afonso S Bandeira, Nicolas Boumal, and Vladislav Voroninski. On the low-rank approach for semidefinite programs arising in synchronization and community detection. arXiv preprint arXiv:1602.04426, 2016. [BM03] Samuel Burer and Renato DC Monteiro. A nonlinear programming algorithm for solving semidefinite programs via low-rank factorization. Mathematical Programming, 95(2):329–357, 2003. [BNS16] S. Bhojanapalli, B. Neyshabur, and N. Srebro. Global Optimality of Local Search for Low Rank Matrix Recovery. ArXiv e-prints, May 2016. [CLMW11] Emmanuel J Cand`es, Xiaodong Li, Yi Ma, and John Wright. Robust principal component analysis? Journal of the ACM (JACM), 58(3):11, 2011. [CR09] Emmanuel J Cand`es and Benjamin Recht. Exact matrix completion via convex optimization. Foundations of Computational mathematics, 9(6):717–772, 2009. [CT10] Emmanuel J Cand`es and Terence Tao. The power of convex relaxation: Near-optimal matrix completion. Information Theory, IEEE Transactions on, 56(5):2053–2080, 2010. [CW15] Yudong Chen and Martin J Wainwright. Fast low-rank estimation by projected gradient descent: General statistical and algorithmic guarantees. arXiv preprint arXiv:1509.03025, 2015. [DPvdBW14] Mark A Davenport, Yaniv Plan, Ewout van den Berg, and Mary Wootters. 1-bit matrix completion. Information and Inference, 3(3):189–223, 2014. [GHJY15] Rong Ge, Furong Huang, Chi Jin, and Yang Yuan. Escaping from saddle points—online stochastic gradient for tensor decomposition. arXiv:1503.02101, 2015. [Har14] Moritz Hardt. Understanding alternating minimization for matrix completion. In FOCS 2014. IEEE, 2014. [HKZ12] Daniel Hsu, Sham M Kakade, and Tong Zhang. A tail inequality for quadratic forms of subgaussian random vectors. Electron. Commun. Probab, 17(52):1–6, 2012. [HW14] Moritz Hardt and Mary Wootters. Fast matrix completion without the condition number. In COLT 2014, pages 638–678, 2014. [Imb10] R. Imbuzeiro Oliveira. Sums of random Hermitian matrices and an inequality by Rudelson. ArXiv e-prints, April 2010. [JNS13] Prateek Jain, Praneeth Netrapalli, and Sujay Sanghavi. Low-rank matrix completion using alternating minimization. In Proceedings of the forty-fifth annual ACM symposium on Theory of computing, pages 665–674. ACM, 2013. [KMO10] Raghunandan H Keshavan, Andrea Montanari, and Sewoong Oh. Matrix completion from a few entries. Information Theory, IEEE Transactions on, 56(6):2980–2998, 2010. [Kor09] Yehuda Koren. The bellkor solution to the netflix grand prize. Netflix prize documentation, 81, 2009. [LLR16] Yuanzhi Li, Yingyu Liang, and Andrej Risteski. Recovery guarantee of weighted low-rank approximation via alternating minimization. arXiv preprint arXiv:1602.02262, 2016. [LSJR16] Jason D Lee, Max Simchowitz, Michael I Jordan, and Benjamin Recht. Gradient descent converges to minimizers. University of California, Berkeley, 1050:16, 2016. [LW14] Po-Ling Loh and Martin J Wainwright. Support recovery without incoherence: A case for nonconvex regularization. arXiv preprint arXiv:1412.5632, 2014. [LW15] Po-Ling Loh and Martin J. Wainwright. Regularized m-estimators with nonconvexity: statistical and algorithmic theory for local optima. Journal of Machine Learning Research, 16:559–616, 2015. [NP06] Yurii Nesterov and Boris T Polyak. Cubic regularization of Newton method and its global performance. Mathematical Programming, 108(1):177–205, 2006. [Pem90] Robin Pemantle. Nonconvergence to unstable points in urn models and stochastic approximations. The Annals of Probability, pages 698–712, 1990. [Rec11] Benjamin Recht. A simpler approach to matrix completion. The Journal of Machine Learning Research, 12:3413–3430, 2011. [RS05] Jasson DM Rennie and Nathan Srebro. Fast maximum margin matrix factorization for collaborative prediction. In Proceedings of the 22nd international conference on Machine learning, pages 713–719. ACM, 2005. [SL15] Ruoyu Sun and Zhi-Quan Luo. Guaranteed matrix completion via nonconvex factorization. In Foundations of Computer Science (FOCS), 2015 IEEE 56th Annual Symposium on, pages 270–289. IEEE, 2015. [SQW15] Ju Sun, Qing Qu, and John Wright. When are nonconvex problems not scary? arXiv preprint arXiv:1510.06096, 2015. [ZWL15] Tuo Zhao, Zhaoran Wang, and Han Liu. A nonconvex optimization framework for low rank matrix estimation. In Advances in Neural Information Processing Systems, pages 559–567, 2015. 9
2016
288
6,203
Deep Submodular Functions: Definitions & Learning Brian Dolhansky‡ <bdol@cs.washington.edu> Jeff Bilmes†‡ <bilmes@uw.edu> Dept. of Computer Science and Engineering‡ University of Washington Seattle, WA 98105 Dept. of Electrical Engineering† University of Washington Seattle, WA 98105 Abstract We propose and study a new class of submodular functions called deep submodular functions (DSFs). We define DSFs and situate them within the broader context of classes of submodular functions in relationship both to various matroid ranks and sums of concave composed with modular functions (SCMs). Notably, we find that DSFs constitute a strictly broader class than SCMs, thus motivating their use, but that they do not comprise all submodular functions. Interestingly, some DSFs can be seen as special cases of certain deep neural networks (DNNs), hence the name. Finally, we provide a method to learn DSFs in a max-margin framework, and offer preliminary results applying this both to synthetic and real-world data instances. 1 Introduction Submodular functions are attractive models of many physical processes primarily because they possess an inherent naturalness to a wide variety of problems (e.g., they are good models of diversity, information, and cooperative costs) while at the same time they enjoy properties sufficient for efficient optimization. For example, submodular functions can be minimized without constraints in polynomial time [12] even though they lie within a 2n-dimensional cone in R2n. Moreover, while submodular function maximization is NP-hard, submodular maximization is one of the easiest of the NP-hard problems since constant factor approximation algorithms are often available — e.g., in the cardinality constrained case, the classic 1 −1/e result of Nemhauser [21] via the greedy algorithm. Other problems also have guarantees, such as submodular maximization subject to knapsack or multiple matroid constraints [8, 7, 18, 15, 16]. One of the critical problems associated with utilizing submodular functions in machine learning contexts is selecting which submodular function to use, and given that submodular functions lie in such a vast space with 2n degrees of freedom, it is a non-trivial task to find one that works well, if not optimally. One approach is to attempt to learn the submodular function based on either queries of some form or based on data. This has led to results, mostly in the theory community, showing how learning submodularity can be harder or easier depending on how we judge what is being learnt. For example, it was shown that learning submodularity in the PMAC setting is fairly hard [2] although in some cases things are a bit easier [11]. In both of these cases, learning is over all points in the hypercube. Learning can be made easier if we restrict ourselves to learn within only a subfamily of submodular functions. For example, in [24, 19], it is shown that one can learn mixtures of submodular functions using a max-margin learning framework — here the components of the mixture are fixed and it is only the mixture parameters that are learnt, leading often to a convex optimization problem. In some cases, computing gradients of the convex problem can be done using submodular maximization [19], while in other cases, even a gradient requires minimizing a difference of two submodular functions [27]. Learning over restricted families rather than over the entire cone is desirable for the same reasons that any form of regularization in machine learning is useful. By restricting the family over which learning occurs, it decreases the complexity of the learning problem, thereby increasing the chance that one finds a good model within that family. This can be seen as a classic bias-variance tradeoff, where 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. V = V (0) V (1) V (2) V (3) v1 4 v1 3 v1 2 v1 1 v3 v2 1 v2 2 v2 3 v0 6 v0 5 v0 4 v0 3 v0 2 v0 1 ground set features meta features fnal feature w(1) w(2) w(3) V = V (0) V (1) V (2) V (3) v1 4 v1 3 v1 2 v1 1 v3 v2 1 v2 2 v2 3 v0 6 v0 5 v0 4 v0 3 v0 2 v0 1 ground set features meta features fnal feature (a) (b) Figure 1: Left: A layered DSF with K = 3 layers. Right: a 3-block DSF allowing layer skipping. increasing bias can reduce variance. Up to now, learning over restricted families has apparently (to the authors knowledge) been limited to learning mixtures over fixed components. This can be quite limited if the components are restricted, and if not might require a very large number of components. Therefore, there is a need for a richer and more flexible family of submodular functions over which learning is still possible. In this paper (and in [5]), we introduce a new family of submodular functions that we term “deep submodular functions,” or DSFs. DSFs strictly generalize, as we show below, many of the kinds of submodular functions that are useful in machine learning contexts. These include the so-called “decomposable” submodular functions, namely those that can be represented as a sum of concave composed with modular functions [25]. We describe the family of DSFs and place them in the context of the general submodular family. In particular, we show that DSFs strictly generalize standard decomposable functions, thus theoretically motivating the use of deeper networks as a family over which to learn. Moreover, DSFs can represent a variety of complex submodular functions such as laminar matroid rank functions. These matroid rank functions include the truncated matroid rank function [13] that is often used to show theoretical worst-case performance for many constrained submodular minimization problems. We also show, somewhat surprisingly, that like decomposable functions, DSFs are unable to represent all possible cycle matroid rank functions. This is interesting in and of itself since there are laminar matroids that are not cycle matroids. On the other hand, we show that the more general DSFs share a variety of useful properties with decomposable functions. Namely, that they: (1) can leverage the vast amount of practical work on feature engineering that occurs in the machine learning community and its applications; (2) can operate on multi-modal data if the data can be featurized in the same space; (3) allow for training and testing on distinct sets since we can learn a function from the feature representation level on up, similar to the work in [19]; and (4) are useful for streaming applications since functions can be evaluated without requiring knowledge of the entire ground set. These advantages are made apparent in Section 2. Interestingly, DSFs also share certain properties with deep neural networks (DNNs), which have become widely popular in the machine learning community. For example, DNNs with weights that are strictly non-negative correspond to a DSF. This suggests, as we show in Section 5, that it is possible to develop a learning framework over DSFs leveraging DNN learning frameworks. Unlike standard deep neural networks, which typically are trained either in classification or regression frameworks, however, learning submodularity often takes the form of trying to adjust the parameters so that a set of “summary” data sets are offered a high value. We therefore extend the max-margin learning framework of [24, 19] to apply to DSFs. Our approach can be seen as a max-margin learning approach for DNNs but restricted to DSFs. We show that DSFs can be learnt effectively in a variety of contexts (Section 6). In the below, we discuss basic definitions and an initial implementation of learning DSFS while in [5] we provide complete definitions, properties, relationships to concavity, proofs, and a set of applications. 2 Background Submodular functions are discrete set functions that have the property of diminishing returns. Assume a given finite size n set of objects V (the large ground set of data items), where each v ∈V is a distinct data sample (e.g., a sentence, training pair, image, video, or even a highly structured object such as a tree or a graph). A valuation set function f : 2V →R that returns a real value for any subset X ⊆V is said to be submodular if for all X ⊆Y and v /∈Y the following inequality holds: 2 f(X ∪{v}) −f(X) ≥f(Y ∪{v}) −f(Y ). This means that the incremental value (or gain) of adding another sample v to a subset decreases when the context in which v is considered grows from X to Y . We can define the gain of v in the context of X as f(v|X) ≜f(X ∪{v}) −f(X). Thus, f is submodular if f(v|X) ≥f(v|Y ). If the gain of v is identical for all different contexts i.e., f(v|X) = f(v|Y ), ∀X, Y ⊆V , then the function is said to be modular. A function might also have the property of being normalized (f(∅) = 0) and monotone non-decreasing (f(X) ≤f(Y ) whenever X ⊆Y ). If the negation of f, −f, is submodular, then f is called supermodular. A useful class of submodular functions in machine learning are decomposable functions [25], and one example of useful instances of these for applications are called feature-based functions. Given a set of non-negative monotone non-decreasing normalized (φ(0) = 0) concave functions φi : R+ →R+ and a corresponding set of non-negative modular functions mi : V →R+, the function f : 2V →R+ defined as f(X) = P i φi(mi(X)) = P i φi(P x∈X mi(x)) is known to be submodular. Such functions have been called “decomposable” in the past, but in this work we will refer to them as the family of sums of concave over modular functions (SCMs). SCMs have been shown to be quite flexible [25], being able to represent a diverse set of functions such as graph cuts, set cover functions, and multiclass queuing system functions and yield efficient algorithms for minimization [25, 22]. Such functions are useful also for applications involving maximization. Suppose that each element v ∈V is associated with a set of “features” U in the sense of, say, how TFIDF is used in natural language processing (NLP). Feature based submodular functions are those defined via the set of features. Feature based functions take the the form f(X) = P u∈U wuφu(mu(X)), where φu is a non-decreasing non-negative univariate normalized concave function, mu(X) is a feature-specific non-negative modular function, and wu is a non-negative feature weight. The result is the class of feature-based submodular functions (instances of SCMs). Such functions have been successfully used for data summarization [29]. Another advantage of such functions is that they do not require the construction of a pairwise graph and therefore do not have quadratic cost as would, say a facility location function (e.g., f(X) = P v∈V maxx∈X wxv), or any function based on pair-wise distances, all of which have cost O(n2) to evaluate. Feature functions have an evaluation cost of O(n|U|), linear in the ground set V size and therefore are more scalable to large data set sizes. Finally, unlike the facility location and other graph-based functions, feature-based functions do not require the use of the entire ground set for each evaluation and hence are appropriate for streaming algorithms [1, 9] where future ground elements are unavailable. Defining ψ : Rn →R as ψ(x) = P i φi(⟨mi, x⟩), we get a monotone non-decreasing concave function, which we refer to as univariate sum of concaves (USCs). 3 Deep Submodular Functions While feature-based submodular functions are indisputably useful, their weakness lies in that features themselves may not interact, although one feature u′ might be partially redundant with another feature u′′. For example, when describing a sentence via its component n-grams features, higherorder n-grams always include lower-order n-grams, so n-gram features are partially redundant. We may address this problem by utilizing an additional “layer” of nested concave functions as in f(X) = P s∈S ωsφs(P u∈U ws,uφu(mu(X))), where S is a set of meta-features, ωs is a metafeature weight, φs is a non-decreasing concave function associated with meta-feature s, and ws,u is now a meta-feature specific feature weight. With this construct, φs assigns a discounted value to the set of features in U, which can be used to represent feature redundancy. Interactions between the meta-features might be needed as well, and this can be done via meta-meta-features, and so on, resulting in a hierarchy of increasingly higher-level features. We hence propose a new class of submodular functions that we call deep submodular functions (DSFs). They may make use of a series of disjoint sets (see Figure 1-(a)): V = V (0), which is the function’s ground set, and additional sets V (1), V (2), . . . , V (K). U = V (1) can be seen as a set of “features”, V (2) as a set of meta-features, V (3) as a set of meta-meta features, etc. up to V (K). The size of V (i) is di = |V (i)|. Two successive sets (or “layers”) i −1 and i are connected by a matrix w(i) ∈Rdi×di−1 + , for i ∈{1, . . . , K}. Given vi ∈V (i), define w(i) vi to be the row of w(i) corresponding to element vi, and w(i) vi (vi−1) is the element of matrix w(i) at row vi and column vi−1. We may think of w(i) vi : V (i−1) →R+ as a modular function defined on set V (i−1). Thus, this matrix contains di such modular functions. Further, let φvk : R+ →R+ be a non-negative non-decreasing 3 concave function. Then, a K-layer DSF f : 2V →R+ can be expressed as follows, for any A ⊆V : f(A) = φvK X vK−1∈V (K−1) w(K) vK (vK−1)φvK−1  . . . X v2∈V (2) w(3) v3 (v2)φv2  X v1∈V (1) w(2) v2 (v1)φv1 X a∈A w(1) v1 (a) ! (1) Submodularity follows since a composition of a monotone non-decreasing function f and a monotone non-decreasing concave function φ (g(·) = φ(f(·))) is submodular (Theorem 1 in [20]) — a DSF is submodular via recursive application and since submodularity is closed under conic combinations. A more general way to define a DSF (useful for the theorems below) uses recursion directly. We are given a directed acyclic graph (DAG) G = (V, E) where for any given node v ∈V, we say pa(v) ⊂V are the parents of (vertices pointing towards) v. A given size n subset of nodes V ⊂V corresponds to the ground set and for any v ∈V , pa(v) = ∅. A particular “root” noder ∈V \ V has the distinction thatr /∈pa(q) for any q ∈V. Given a non-ground node v ∈V \ V , we define the concave function ψv : RV →R+ ψv(x) = φv  X u∈pa(v)\V wuvψu(x) + ⟨mv, x⟩  (2) where φv : R+ →R+ is a non-decreasing univariate concave function, wuv ∈R+, mv : Rpa(v)∩V → R+ is a non-negative linear function that evaluates as ⟨mv, x⟩= P u∈pa(v)∩V mv(u)x(u)) (i.e., ⟨mv, x⟩is a sparse dot-product over elements pa(v)∩V ⊆V ). The base case, where pa(v) ⊆V therefore has ψv(x) = φv(⟨mv, x⟩), so ψv(1A) is a SCM function with only one term in the sum (1A is the characteristic vector of set A). A general DSF is defined as follows: for all A ⊆V , f(A) = ψr(1A)+ m±(A), where m± : V →R is an arbitrary modular function (i.e., it may include positive and negative elements). From the perspective of defining a submodular function, there is no loss of generality by adding the final modular function m± to a monotone non-decreasing function — this is because any submodular function can be expressed as a sum of a monotone non-decreasing submodular function and a modular function [10]. This form of DSF is more general than the layered approach mentioned above which, in the current form, would partition V = {V (0), V (1), . . . , V (K)} into layers, and where for any v ∈V (i), pa(v) ⊆V (i−1). Figure 1-(a) corresponds to a layered graph G = (V, E) where r = v3 1 and V = {v0 1, v0 2, . . . , v0 6}. Figure 1-(b) uses the same partitioning but where units are allowed to skip by more than one layer at a time. More generally, we can order the vertices in V with order σ so that {σ1, σ2, . . . , σn} = V where n = |V |, σm = r = vK where m = |V| and where σi ∈pa(σj) iff i < j. This allows an arbitrary pattern of skipping while maintaining submodularity. The layered definition in Equation (1) is reminiscent of feed-forward deep neural networks (DNNs) owing to its multi-layered architecture. Interestingly, if one restricts the weights of a DNN at every layer to be non-negative, then for many standard hidden-unit activation functions the DNN constitutes a submodular function when given Boolean input vectors. The result follows for any activation function that is monotone non-decreasing concave for non-negative reals, such as the sigmoid, the hyperbolic tangent, and the rectified linear functions. This suggests that DSFs can be trained in a fashion similar to DNNs, as is further developed in Section 5. The recursive definition of DSFs, in Equation (2) is more general and, moreover, useful for the analysis in Section 4. DSFs should be useful for many applications in machine learning. First, they retain the advantages of feature-based functions (i.e., they require neither O(n2) nor access to the entire ground set for evaluation). Hence, DSFs can be both fast, and useful for streaming applications. Second, they allow for a nested hierarchy of features, similar to advantages a deep model has over a shallow model. For example, a one-layer DSF must construct a valuation over a set of objects from a large number of low-level features which can lead to fewer opportunities for feature sharing while a deeper network fosters distributed representations, analogous to DNNs [3, 4]. Below, we show that DSFs constitute a strictly larger family of submodular functions than SCMs. 4 Analysis of the DSF family DSFs represent a family that, at the very least, contain the family of SCMs. We argued intuitively that DSFs might extend SCMs as they allow components themselves to interact, and the interactions may propagate up a many-layered hierarchy. In this section, we formally place DSF within the context of more general submodular functions. We show that DSFs strictly generalize SCMs while preserving many of their attractive attributes. We summarize the results of this section in Figure 2, and that includes familial relationships amongst other classes of submodular functions (e.g., various matroid rank functions), useful for our main theorems. 4 All Submodular Functions Laminar Matroid Rank DSFs SCMs Partition Matroid Rank Cycle Matroid Rank Figure 2: Containment properties of the set of functions studied in this paper. Thanks to concave composition closure rules [6], the root function ψr(x) : Rn →R in Eqn. (2) is a monotone non-decreasing multivariate concave function that, by the concave-submodular composition rule [20], yields a submodular function ψr(1A). It is widely known that any univariate concave function composed with non-negative modular functions yields a submodular function. However, given an arbitrary multivariate concave function this is not the case. Consider, for example, any concave function ψ over R2 that offers the follow evaluations: ψ(0, 0) = ψ(1, 1) = 1, ψ(0, 1) = ψ(1, 0) = 0. Then f(A) = ψ(1A) is not submodular. Given a multivariate concave function ψ : Rn →R, the superdifferential ∂ψ(x) at x is defined as: ∂ψ(x) = {h ∈Rn : ψ(y) −ψ(x) ≤⟨h, y⟩−⟨h, x⟩, ∀y ∈Rn} and a particular supergradient hx is a member hx ∈∂ψ(x). If ψ(x) is differentiable at x then ∂ψ(x) = {∇ψ(x)}. A concave function is said to have an antitone superdifferential if for all x ≤y we have that hx ≥hy for all hx ∈∂ψ(x) and hy ∈∂ψ(y) (here, x ≤y ⇔x(v) ≤y(v)∀v). Apparently, the following result has not been previously reported. Theorem 4.1. Let ψ : Rn →R be a concave function. Then if ψ has an antitone superdifferential, then the set function f : 2V →R defined as f(A) = ψ(1A) for all A ⊆V is submodular. A DSF’s associated concave function has an antitone superdifferential. Concavity is not necessary in general (e.g., multilinear extensions of submodular functions are not concave but have properties analogous to an antitone superdifferential, see [5]). Lemma 4.3. Composition of monotone non-decreasing scalar concave and antitone superdifferential concave functions, and conic combinations thereof, preserves superdifferential antitonicity. Corollary 4.3.1. The concave function ψr associated with a DSF has an antitone superdifferential. A matroid M [12] is a set system M = (V, I) where I = {I1, I2, . . .} is a set of subsets Ii ⊆V that are called independent. A matroid has the property that ∅∈I, that I is subclusive (i.e., given I ∈I and I′ ⊂I then I′ ∈I) and that all maximally independent sets have the same size (i.e., given A, B ∈I with |A| < |B|, there exists a b ∈B \ A such that A + b ∈I). The rank of a matroid, a set function r : 2V →Z+ defined as r(A) = maxI∈I |I ∩A|, is a powerful class of submodular functions. All matroids are uniquely defined by their rank function. All monotone non-decreasing non-negative rational submodular functions can be represented by grouping and then evaluating grouped ground elements in a matroid [12]. A particularly useful matroid is the partition matroid, where a partition (V1, V2, . . . , Vℓ) of V is formed, along with a set of capacities k1, k2, . . . , kℓ∈Z+. It’s rank function is defined as: r(X) = Pℓ i=1 min(|X ∩Vi|, ki) and, therefore, is an SCM, owing to the fact that φ(x) = min(⟨x, 1Vi⟩, ki) is USC. A cycle matroid is a different type of matroid based on a graph G = (V, E) where the rank function r(A) for A ⊆E is defined as the size of the maximum spanning forest (i.e., a spanning tree for each connected component) in the edge-induced subgraph GA = (V, A). From the perspective of matroids, we can consider classes of submodular functions via their rank. If a given type of matroid cannot represent another kind, their ranks lie in distinct families. To study where DSFs are situated in the space of all submodular functions, it is useful first to study results regarding matroid rank functions. Lemma 4.4. There are partition matroids that are not cycle matroids. In a laminar matroid, a generalization of a partition matroid, we start with a set V and a family F = {F1, F2, . . . , } of subsets Fi ⊆V that is laminar, namely that for all i ̸= j either Fi ∩Fj = ∅ or Fi ⊆Fj or Fj ⊆Fi (i.e., sets in F are either non-intersecting or comparable). In a laminar matroid, we also have for every F ∈F an associated capacity kF ∈Z+. A set I is independent if |I ∩F| ≤kF for all F ∈F. A laminar family of sets can be organized in a tree, where there is one root R ∈F in the tree that, w.l.o.g., can be V itself. Then the immediate parents pa(F) ⊂F of a set F ∈F in the tree are the set of maximal subsets of F in F, i.e., pa(F) = {F ′ ∈F : F ′ ⊂F and ̸ ∃F ′′ ∈F s.t. F ′ ⊂F ′′ ⊂F}. We then define the following for all F ∈F: rF (A) = min( X F ′∈pa(F ) rF ′(A ∩F ′) + |A \ [ F ′∈pa(F ) F|, kF ). (3) A laminar matroid rank has a recursive definition r(A) = rR(A) = rV (A). Hence, if the family F forms a partition of V , we have a partition matroid. More interestingly, when compared to Eqn. (2), we see that a laminar matroid rank function is an instance of a DSF with a tree-structured DAG rather 5 than the non-tree DAGs in Figure 1. Thus, within the family of DSFs lie the truncated matroid rank functions used to show information theoretic hardness for many constrained submodular optimization problems [13]. Moreover, laminar matroids strictly generalize partition matroids. Lemma 4.5. Laminar matroids strictly generalize partition matroids Since a laminar matroid generalizes a partition matroid, this portends well for DSFs generalizing SCMs. Before considering that, we already are up against some limits of laminar matroids, i.e.: Lemma 4.6 (peeling proof). Laminar matroid cannot represent all cycle matroids. We call this proof a “peeling proof” since it recursively peels off each layer (in the sense of a DSF) of a laminar matroid rank until it boils down to a partition matroid rank function, where the base case is clear. The proof is elucidating, moreover, since it motivates the proof of Theorem 4.14 showing that DSFs extend SCMs. We also have the immediate corollary. Corollary 4.6.1. Partition matroids cannot represent all cycle matroids. We see that SCMs generalize partition matroid rank functions and DSFs generalize laminar matroid rank functions. We might expect, from the above results, that DSFs might generalize SCMs — this is not immediately obvious since SCMs are significantly more flexible than partition matroid rank functions because: (1) the concave functions need not be simple truncations at integers, (2) each term can have its own non-negative modular function, (3) there is no requirement to partition the ground elements over terms in an SCM, and (4) we may with relative impunity extend the family of SCMs to ones where we add an additional arbitrary modular function (what we will call SCMMs below). We see, however, that SCMMs are also unable to represent the cycle matroid rank function over K4, very much like the partition matroid rank function. Hence the above flexibility does not help in this case. We then show that DSFs strictly generalize SCMMs, which means that DSFs indeed provide a richer family of submodular functions to utilize, ones that as discussed above, retain many of the advantages of SCMMs. We end the section by showing that DSFs, even with an additional arbitrary modular function, are still unable to represent matroid rank over K4, implying that although DSFs extend SCMMs, they cannot express all monotone non-decreasing submodular functions. We define a family of sums of concave over modular functions with an additional modular term (SCMMs), taking the form: f(A) = P i φi(mi(A)) + m±(A) where each φi and mi as in an SCM, but where m± : 2V →R is an arbitrary modular function, so if m±(·) = 0 the SCMM is an SCM. Before showing that DSFs extend SCMMs, we include a result showing that SCMMs are strictly smaller than the set of all submodular functions. We include an unpublished result [28] showing that SCMMs can not represent the cycle matroid rank function, as described above, over the graph K4. Theorem 4.11 (Vondrak[28]). SCMMs ⊂Space of Submodular Functions We next show that DSFs strictly generalize SCMMs, thus providing justification for using DSFs over SCMMs and, moreover, generalizing Lemma 4.5. The DSF we choose is, again, a laminar matroid, so SCMMs are unable to represent laminar matroid rank functions. Since DSFs generalize laminar matroid rank functions, the result follows. Theorem 4.14. The DSF family is strictly larger than that of SCMs. The proof shows that it is not possible to represent a function of the form f(X) = min(P i min(|X ∩ Bi|, ki), k) using an SCMM. Theorem 4.15 also has an immediate consequence for concave functions. Corollary 4.14.1. There exists a non-USC concave function with an antitone superdifferential. The corollary follows since, as mentioned above, DSF functions have at their core a multivarate concave function with an antitone superdifferential, and thanks to Theorem 4.14 it is not always possible to represent this as a sum of concave over linear functions. It is currently an open problem if DSFs with ℓlayers extend the family of DSFs with ℓ′ < ℓlayers, for ℓ′ ≥2. Our final result shows that, while DSFs are richer than SCMMs, they still do not encompass all polymatroid functions. We show this by proving that the cycle matroid rank function on K4 is not achievable with DSFs. Theorem 4.15. DSFs ⊂Polymatroids Proofs of these theorems and more may be found in [5]. 6 5 Learning DSFs As mentioned above, learning submodular functions is generally difficult [11, 13]. Learning mixtures of fixed submodular component functions [24, 19], however, can give good empirical results on several tasks, including image [27] and document [19] summarization. In these examples, rather than attempting to learn a function at all 2n points, a max-margin approach is used only to approximate a submodular function on its large values. Typically when training a summarizer, one is given a ground set of items, and a set of representative sets of excerpts (usually human generated) each of which summarizes the ground set. Within this setting, access to an oracle function h(A) — that, if available, could be used in a regression-style learning approach — might not be available. Even if available, such learning is often overkill. Thus, instead of trying to learn h everywhere, we only seek to learn the parameters w of a function fw that lives within some family, parameterized by w, so that if B ∈argmaxA⊆V :|A|≤k fw(A), then h(B) ≥αh(A∗) for some α ∈[0, 1] where A∗∈argmaxA⊆V :|A|≤k h(A). In practice, this corresponds to selecting the best summary for a given document based on the learnt function, in the hope that it mirrors what a human believes to be best. Fortunately, the max-margin training approach directly addresses the above and is immediately applicable to learning DSFs. Also, given the ongoing research on learning DNNs, which have achieved state-of-the-art results on a plethora of machine learning tasks [17], and given the similarity between DSFs and DNNs, we may leverage the DNN learning techniques (such as dropout, AdaGrad, learning rate scheduling, etc.) to our benefit. 5.1 Using max-margin learning for DSFs Given an unknown but desired function h : 2V →R+ and a set of representative sets S = {S1, S2, . . .}, with Si ⊆V and where for each S ∈S, h(S) is highly scored, a max-margin learning approach may be used to train a DSF f so that if A ∈argmaxA⊆V f(A), h(A) is also highly scored by h. Under the large-margin approach [24, 19, 27], we learn the parameters w of fw such that for all S ∈S, fw(S) is high, while for A ∈2V , fw(A) is lower by some given loss. This may be performed by maximizing the loss-dependent margin so that for all S ∈S and A ∈2V , fw(S) ≥fw(A) + ℓS(A). For a given loss function ℓS(A), optimization reduces to finding parameters so that fw(S) ≥maxA∈2V [fw(A)+ℓS(A)] is satisfied for S ∈S. The task of finding the maximizing set is known as loss-augmented inference (LAI) [26], which for general ℓ(A) is NP-hard. With regularization, and defining the hinge operator (x)+ = max(0, x), the optimization becomes: min w≥0 X S∈S  max A∈2V [f(A) + ℓS(A)] −f(S) + + λ 2 ||w||2 2. (4) Given a LAI procedure, the subgradient of weight wi is ∂ ∂wi f(A) − ∂ ∂wi f(S) + λwi, and in the case of a DSF, each subgradient can be computed efficiently with backpropagation, similar to the approach of [23], but to retain polymatroidality of f, projected gradient descent is used ensure w ⪰0 For arbitrary set functions, f(A) and ℓS(A), LAI is generally intractable. Even if f(A) is submodular, the choice of loss can affect the computational feasibility of LAI. For submodular ℓ(A), the greedy algorithm can find an approximately maximizing set [21]. For supermodular ℓ(A), the task of solving maxA∈2V \S[f(A) + ℓ(A)] involves maximizing the difference of two submodular functions and the submodular-supermodular procedure [14] can be used. Once a DSF is learnt, we may wish to find maxA⊆V :|A|≤k f(A) and this can be done, e.g., using the greedy algorithm when m± ≥0. The task of summarization, however, might involve learning based on one set of ground sets and testing via a different (set of) ground set(s) [19, 27]. To do this, any particular element v ∈V may be represented by a vector of non-negative feature weights (m1(v), m2(v), . . . ) (e.g., mi(v) counts the number of times a unigram i appears in sentence v), and the feature i weight for any set A ⊆V can is represented as the i-specific modular evaluation mi(A) = P a∈A mi(a). We can treat the set of modular functions {mi : V →R+}i as a matrix to be used as the first layer in DSF (e.g., w(1) in Figure 1 (left)) that is fixed during the training of subsequent layers. This preserves submodularity, and allows all later layers (i.e., w(2), w(3), . . . ) to be learnt generically over any set of objects that can be represented in the same feature space — this also allows training over one set of ground sets, and testing on a totally separate set of ground sets. Max-margin learning, in fact, remains ignorant that this is happening since it sees the data only post feature representation. In fact, learning can be cross modal — e.g., images and sentences, represented in the same feature space, can be learnt simultaneously. This is analogous to the “shells” of [19]. In 7 0 50 100 150 200 Iteration 0.0 0.5 1.0 1.5 2.0 2.5 3.0 Cycle matroid rank Greedy set value (a) Cycle matroid 0 50 100 150 200 Iteration 0.0 0.2 0.4 0.6 0.8 1.0 Laminar rank Greedy set value (b) Laminar matroid 0 20 40 60 80 100 Epoch 0.0 0.5 1.0 1.5 2.0 Normalized VROUGE value Average greedy VROUGE (Train) DSF SCMM Human avg. Random avg. 0 200 400 600 800 Epoch 0.0 0.5 1.0 Average greedy VROUGE (Test) (c) Image summarization Figure 3: (a),(b) show matroid learning via a DSF is possible in a max-margin setting; (c) shows that learning and generalization of a DSF can happen, via featurization, on real image data. that case, however, mixtures were learnt over fixed components, some of which required a O(n2) calculation for element-pair similarity scores. Via featurization in the first layer of a DSF, however, we may learn a DSF over a training set, preserving submodularity, avoid any O(n2) cost, and test on any new data represented in the same feature space. 6 Empirical Experiments on Learning DSFs We offer preliminary feasibility results showing it is possible to train a DSF on synthetic datasets and, via featurization, on a real image summarization dataset. The first synthetic experiment trains a DSF to learn a cycle matroid rank function on K4. Although Theorem 4.15 shows a DSF cannot represent such a rank function everywhere, we show that the max-margin framework can learn a DSF that, when maximized via maxA⊆V :|A|≤3 f(A) does not return a 3-cycle (as is desirable). We used a simple two-layer DSF, where the first hidden layer consisted of four hidden units with square root activation functions, and a normalized sigmoid ˆσ(x) = 2 · (σ(x) −0.5) at the output. Figure 3a shows that after sufficient learning iterations, greedy applied to the DSF returns independent sized-three sets. Further analysis shows that the function is not learnt everywhere, as predicted by Theorem 4.15. We next tested a scaled laminar matroid rank r(A) = (1/8) min P10 i=1 min(|A ∩Bi|, 1), 8  where the Bi’s are each size 10 and form a partition of V , with |V | = 100. Thus maximal independent sets argmaxI∈I |I| have r(I) = 1 with |I| = 8. A DSF is trained with a hidden layer of 10 units of activation g(x) = max(x, 1), and a normalized sigmoid ˆσ at the output. We randomly generated 200 matroid bases, and trained the network. The greedy solution to maxA⊆V :|A|≤8 f(A) on the learnt DSF produces sets that are maximally independent (Figure 3b). For our real-world instance of learning DSFs, we use the dataset of [27], which consists of 14 distinct image sets, 100 images each. The task is to select the best 10-image summary in terms of a visual ROUGE-like function that is defined over a bag of visual features. For each of the 14 ground sets, we trained on the other 13 sets and evaluated the performance of the trained DSF on the test set. We use a simple DSF of the form f(A) = ˆσ P u∈U wu p mu(A)  , where mu(A) is modular for feature u, and ˆσ is a sigmoid. We used (diagonalized) Adagrad, a decaying learning rate, weight decay, and dropout (which was critical for test-set performance). We compared to an SCMM of comparable complexity and number of parameters (i.e., the same form and features but a linear output), and performance of the SCMM is much worse (Figure 3c) perhaps because of a DSF’s “depth.” Notably, we only require |U| = 628 visual-word features (as covered in Section 5 of [27]), while the approach in [27] required 594 components of O(n2) graph values, or roughly 5.94 million precomputed values. The loss function is ℓ(A) = 1 −R(A), where R(A) is a ROUGE-like function defined over visual-words. During training, we achieve numbers comparable to [27]. We do not yet match the generalization results in [27], but we do not use strong O(n2) graph components, and we expect better results perhaps with a deeper network and/or better base features. Acknowledgments: Thanks to Reza Eghbali and Kai Wei for useful discussions. This material is based upon work supported by the National Science Foundation under Grant No. IIS-1162606, the National Institutes of Health under award R01GM103544, and by a Google, a Microsoft, a Facebook, and an Intel research award. This work was supported in part by TerraSwarm, one of six centers of STARnet, a Semiconductor Research Corporation program sponsored by MARCO and DARPA. 8 References [1] A. Badanidiyuru, B. Mirzasoleiman, A. Karbasi, and A. Krause. Streaming submodular maximization: Massive data summarization on the fly. In Proceedings of the 20th ACM SIGKDD international conference on Knowledge discovery and data mining, pages 671–680. ACM, 2014. [2] M. Balcan and N. Harvey. Learning submodular functions. Technical report, arXiv:1008.2159, 2010. [3] Y. Bengio. Learning Deep Architectures for AI. Foundations and Trends R⃝in Machine Learning, 2(1):1–127, 2009. [4] Y. Bengio, A. Courville, and P. Vincent. Representation Learning: A Review and New Perspectives. IEEE Transactions on Pattern Analysis and Machine Intelligence, 35(8):1798–1828, 2013. [5] Jeffrey Bilmes and Wenruo Bai. Deep Submodular Functions. Arxiv, abs/1701.08939, Jan 2017. http: //arxiv.org/abs/1701.08939. [6] S.P. Boyd and L. Vandenberghe. Convex optimization. Cambridge Univ Pr, 2004. [7] Niv Buchbinder, Moran Feldman, Joseph SeffiNaor, and Roy Schwartz. Submodular maximization with cardinality constraints. In Proceedings of the Twenty-Fifth Annual ACM-SIAM Symposium on Discrete Algorithms, pages 1433–1452. Society for Industrial and Applied Mathematics, 2014. [8] Gruia Calinescu, Chandra Chekuri, Martin Pál, and Jan Vondrák. Maximizing a monotone submodular function subject to a matroid constraint. SIAM Journal on Computing, 40(6):1740–1766, 2011. [9] Chandra Chekuri, Shalmoli Gupta, and Kent Quanrud. Streaming algorithms for submodular function maximization. In International Colloquium on Automata, Languages, and Programming, pages 318–330. Springer, 2015. [10] W. H. Cunningham. Testing membership in matroid polyhedra. J Combinatorial Theory B, 36:161–188, 1984. [11] V. Feldman and J. Vondrák. Optimal bounds on approximation of submodular and XOS functions by juntas. CoRR, abs/1307.3301, 2013. [12] S. Fujishige. Submodular Functions and Optimization. Number 58 in Annals of Discrete Mathematics. Elsevier Science, 2nd edition, 2005. [13] M.X. Goemans, N.J.A. Harvey, S. Iwata, and V. Mirrokni. Approximating submodular functions everywhere. In SODA, pages 535–544, 2009. [14] R. Iyer and J. Bilmes. Algorithms for approximate minimization of the difference between submodular functions, with applications. Uncertainty in Artificial Intelligence (UAI), 2012. [15] Rishabh Iyer and Jeff Bilmes. Submodular optimization with submodular cover and submodular knapsack constraints. In Neural Information Processing Society (NIPS), Lake Tahoe, CA, December 2013. [16] Rishabh Iyer, Stefanie Jegelka, and Jeff A. Bilmes. Fast semidifferential-based submodular function optimization. In International Conference on Machine Learning (ICML), Atlanta, Georgia, 2013. [17] Y. LeCun, Y. Bengio, and G. Hinton. Deep learning. Nature, 521(7553):436–444, may 2015. [18] Jon Lee, Vahab S Mirrokni, Viswanath Nagarajan, and Maxim Sviridenko. Non-monotone submodular maximization under matroid and knapsack constraints. In Proceedings of the forty-first annual ACM symposium on Theory of computing, pages 323–332. ACM, 2009. [19] H. Lin and J. Bilmes. Learning mixtures of submodular shells with application to document summarization. In Uncertainty in Artificial Intelligence (UAI), Catalina Island, USA, July 2012. AUAI. [20] Hui Lin and Jeff Bilmes. A Class of Submodular Functions for Document Summarization, 2011. [21] G. L. Nemhauser, L. A. Wolsey, and M. L. Fisher. An analysis of approximations for maximizing submodular functions-I. Math. Program., 14:265–294, 1978. [22] R. Nishihara, S Jegelka, and M. I. Jordan. On the convergence rate of decomposable submodular function minimization. In Advances in Neural Information Processing Systems, pages 640–648, 2014. [23] W. Pei. Max-Margin Tensor Neural Network for Chinese Word Segmentation. Transactions of the Association of Computational Linguistics, pages 293–303, 2014. [24] R. Sipos, P. Shivaswamy, and T. Joachims. Large-margin learning of submodular summarization models. In Proceedings of the 13th Conference of the European Chapter of the Association for Computational Linguistics, pages 224–233. Association for Computational Linguistics, 2012. [25] P. Stobbe and A. Krause. Efficient minimization of decomposable submodular functions. In NIPS, 2010. [26] B. Taskar, V. Chatalbashev, D. Koller, and C. Guestrin. Learning structured prediction models: A large margin approach. Proceedings of the 22nd international conference on Machine learning, (December):896– 903, 2005. [27] S. Tschiatschek, R. Iyer, H. Wei, and J. Bilmes. Learning mixtures of submodular functions for image collection summarization. In Neural Information Processing Society (NIPS), Montreal, Canada, December 2014. [28] J. Vondrak. Personal Communication, 2011. [29] K. Wei, Y. Liu, K. Kirchhoff, and J. Bilmes. Unsupervised submodular subset selection for speech data. In Proc. IEEE Intl. Conf. on Acoustics, Speech, and Signal Processing, Florence, Italy, 2014. 9
2016
289
6,204
Avoiding Imposters and Delinquents: Adversarial Crowdsourcing and Peer Prediction Jacob Steinhardt Stanford University Gregory Valiant Stanford University Moses Charikar Stanford University Abstract We consider a crowdsourcing model in which n workers are asked to rate the quality of n items previously generated by other workers. An unknown set of αn workers generate reliable ratings, while the remaining workers may behave arbitrarily and possibly adversarially. The manager of the experiment can also manually evaluate the quality of a small number of items, and wishes to curate together almost all of the high-quality items with at most an ϵ fraction of low-quality items. Perhaps surprisingly, we show that this is possible with an amount of work required of the manager, and each worker, that does not scale with n: the dataset can be curated with ˜O  1 βα3ϵ4  ratings per worker, and ˜O  1 βϵ2  ratings by the manager, where β is the fraction of high-quality items. Our results extend to the more general setting of peer prediction, including peer grading in online classrooms. 1 Introduction How can we reliably obtain information from humans, given that the humans themselves are unreliable, and might even have incentives to mislead us? Versions of this question arise in crowdsourcing (Vuurens et al., 2011), collaborative knowledge generation (Priedhorsky et al., 2007), peer grading in online classrooms (Piech et al., 2013; Kulkarni et al., 2015), aggregation of customer reviews (Harmon, 2004), and the generation/curation of large datasets (Deng et al., 2009). A key challenge is to ensure high information quality despite the fact that many people interacting with the system may be unreliable or even adversarial. This is particularly relevant when raters have an incentive to collude and cheat as in the setting of peer grading, as well as for reviews on sites like Amazon and Yelp, where artists and firms are incentivized to manufacture positive reviews for their own products and negative reviews for their rivals (Harmon, 2004; Mayzlin et al., 2012). One approach to ensuring quality is to use gold sets — questions where the answer is known, which can be used to assess reliability on unknown questions. However, this is overly constraining — it does not make sense for open-ended tasks such as knowledge generation on wikipedia, nor even for crowdsourcing tasks such as “translate this paragraph” or “draw an interesting picture” where there are different equally good answers. This approach may also fail in settings, such as peer grading in massive online open courses, where students might collude to inflate their grades. In this work, we consider the challenge of using crowdsourced human ratings to accurately and efficiently evaluate a large dataset of content. In some settings, such as peer grading, the end goal is to obtain the accurate evaluation of each datum; in other settings, such as the curation of a large dataset, accurate evaluations could be leveraged to select a high-quality subset of a larger set of variable-quality (perhaps crowd-generated) data. There are several confounding difficulties that arise in extracting accurate evaluations. First, many raters may be unreliable and give evaluations that are uncorrelated with the actual item quality; second, some reliable raters might be harsher or more lenient than others; third, some items may be harder to evaluate than others and so error rates could vary from item to item, even among reliable 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. raters; finally, some raters may even collude or want to hack the system. This raises the question: can we obtain information from the reliable raters, without knowing who they are a priori? In this work, we answer this question in the affirmative, under surprisingly weak assumptions: • We do not assume that the majority of workers are reliable. • We do not assume that the unreliable workers conform to any statistical model; they could behave fully adversarially, in collusion with each other and with full knowledge of how the reliable workers behave. • We do not assume that the reliable worker ratings match the true ratings, but only that they are “approximately monotonic” in the true ratings, in a sense that will be formalized later. • We do not assume that there is a “gold set” of items with known ratings presented to each user (as an adversary could identify and exploit this). Instead, we rely on a small number of reliable judgments on randomly selected items, obtained after the workers submit their own ratings; in practice, these could be obtained by rating those items oneself. For concreteness, we describe a simple formalization of the crowdsourcing setting (our actual results hold in a more general setting). We imagine that we are the dataset curator, so that “us” and “ourselves” refers in general to whoever is curating the data. There are n raters and m items to evaluate, which have an unknown quality level in [0, 1]. At least αn workers are “reliable” in that their judgments match our own in expectation, and they make independent errors. We assign each worker to evaluate at most k randomly selected items. In addition, we ourselves judge k0 items. Our goal is to recover the β-quantile: the set T ∗of the βm highest-quality items. Our main result implies the following: Theorem 1. In the setting above, suppose n = m. Then there is k = O( 1 βα3ϵ4 ), and k0 = ˜O( 1 βϵ2 ) such that, with probability 99%, we can identify βm items with average quality only ϵ worse than T ∗. Interestingly, the amount of work that each worker (and we ourselves) has to do does not grow with n; it depends only on the fraction α of reliable workers and the desired accuracy ϵ. While the number of evaluations k for each worker is likely not optimal, we note that the amount of work k0 required of us is close to optimal: for α ≤β, it is information theoretically necessary for us to evaluate Ω(1/βϵ2) items, via a reduction to estimating noisy coin flips. Why is it necessary to include some of our own ratings? If we did not, and α < 1 2, then an adversary could create a set of dishonest raters that were identical to the reliable raters except with the item indices permuted by a random permutation of {1, . . . , m}. In this case, there is no way to distinguish the honest from the dishonest raters except by breaking the symmetry with our own ratings. Our main result holds in a considerably more general setting where we require a weaker form of inter-rater agreement — for example, our results hold even if some of the reliable raters are harsher than others, as long as the expected ratings induce approximately the same ranking. The focus on quantiles rather than raw ratings is what enables this. Note that once we estimate the quantiles, we can approximately recover the ratings by evaluating a few items in each quantile. items r∗ true ratings 1 0.8 0.6 0.4 0.2 0.1 T ∗ 1 1 1 0 0 0         ˜A good raters .9 .8 .7 .6 .5 .4 =⇒ M ∗ 1 1 1 0 0 0 1 .9 .8 .2 .1 0 1 1 1 0 0 0 random 1 0 1 0 1 0 1 0 1 0 1 0 adversaries 1 .8 .6 0 0 1 1 1 0 0 0 1 1 .8 .6 0 0 1 1 1 0 0 0 1 Figure 1: Illustration of our problem setting. We observe a small number of ratings from each rater (indicated in blue), which we represent as entries in a matrix ˜A (unobserved ratings in red, treated as zero by our algorithm). There is also a true rating r∗that we would assign to each item; by rating some items ourself, we observe some entries of r∗(also in blue). Our goal is to recover the set T ∗ representing the top β fraction of items under r∗. As an intermediate step, we approximately recover a matrix M ∗that indicates the top items for each individual rater. 2 Our technical tools draw on semidefinite programming methods for matrix completion, which have been used to study graph clustering as well as community detection in the stochastic block model (Holland et al., 1983; Condon and Karp, 2001). Our setting corresponds to the sparse case of graphs with constant degree, which has recently seen great interest (Decelle et al., 2011; Mossel et al., 2012; 2013b;a; Massoulié, 2014; Guédon and Vershynin, 2014; Mossel et al., 2015; Chin et al., 2015; Abbe and Sandon, 2015a;b; Makarychev et al., 2015). Makarychev et al. (2015) in particular provide an algorithm that is robust to adversarial perturbations, but only if the perturbation has size o(n); see also Cai and Li (2015) for robustness results when the degree of the graph is logarithmic. Several authors have considered semirandom settings for graph clustering, which allow for some types of adversarial behavior (Feige and Krauthgamer, 2000; Feige and Kilian, 2001; Coja-Oghlan, 2004; Krivelevich and Vilenchik, 2006; Coja-Oghlan, 2007; Makarychev et al., 2012; Chen et al., 2014; Guédon and Vershynin, 2014; Moitra et al., 2015; Agarwal et al., 2015). In our setting, these semirandom models are unsuitable because they rule out important types of strategic behavior, such as an adversary rating some items accurately to gain credibility. By allowing arbitrary behavior from the adversary, we face a key technical challenge: while previous analyses consider errors relative to a ground truth clustering, in our setting the ground truth only exists for rows of the matrix corresponding to reliable raters, while the remaining rows could behave arbitrarily even in the limit where all ratings are observed. This necessitates a more careful analysis, which helps to clarify what properties of a clustering are truly necessary for identifying it. 2 Algorithm and Intuition We now describe our recovery algorithm. To fix notation, we assume that there are n raters and m items, and that we observe a matrix ˜A ∈[0, 1]n×m: ˜Aij = 0 if rater i does not rate item j, and otherwise ˜Aij is the assigned rating, which takes values in [0, 1]. In the settings we care about ˜A is very sparse — each rater only rates a few items. Remember that our goal is to recover the β-quantile T ∗of the best items according to our own rating. Our algorithm is based on the following intuition: the reliable raters must (approximately) agree on the ranking of items, and so if we can cluster the rows of ˜A appropriately, then the reliable raters should form a single very large cluster (of size αn). There can be at most 1 α disjoint clusters of this size, and so we can manually check the accuracy of each large cluster (by checking agreement with our own rating on a few randomly selected items) and then choose the best one. One major challenge in using the clustering intuition is the sparsity of ˜A: any two rows of ˜A will almost certainly have no ratings in common, so we must exploit the global structure of ˜A to discover clusters, rather than using pairwise comparisons of rows. The key is to view our problem as a form of noisy matrix completion — we imagine a matrix A∗in which all the ratings have been filled in and all noise from individual ratings has been removed. We define a matrix M ∗that indicates the top βm items in each row of A∗: M ∗ ij = 1 if item j has one of the top βm ratings from rater i, and M ∗ ij = 0 otherwise (this differs from the actual definition of M ∗given in Section 4, but is the same in spirit). If we could recover M ∗, we would be close to obtaining the clustering we wanted. Algorithm 1 Algorithm for recovering β-quantile matrix ˜ M using (unreliable) ratings ˜A. 1: Parameters: reliable fraction α, quantile β, tolerance ϵ, number of raters n, number of items m 2: Input: noisy rating matrix ˜A 3: Let ˜ M be the solution of the optimization problem (1): maximize ⟨˜A, M⟩, (1) subject to 0 ≤Mij ≤1 ∀i, j, P jMij ≤βm ∀j, ∥M∥∗≤2 αϵ p αβnm, where ∥· ∥∗denotes nuclear norm. 4: Output ˜ M. 3 Algorithm 2 Algorithm for recovering an accurate β-quantile T from the β-quantile matrix ˜ M. 1: Parameters: tolerance ϵ, reliable fraction α 2: Input: matrix ˜ M of approximate β-quantiles, noisy ratings ˜r 3: Select 2 log(2/δ)/α indices i ∈[n] at random. 4: Let i∗be the index among these for which ⟨˜ Mi, ˜r⟩is largest, and let T0 ←˜ Mi∗. ▷T0 ∈[0, 1]m 5: do T ←RANDOMIZEDROUND(T0) while ⟨T −T0, ˜r⟩< −ϵ 4βk 6: return T ▷T ∈{0, 1}m The key observation that allows us to approximate M ∗given only the noisy, incomplete ˜A is that M ∗ has low-rank structure: since all of the reliable raters agree with each other, their rows in M ∗are all identical, and so there is an (αn)×m submatrix of M ∗with rank 1. This inspires the low-rank matrix completion algorithm for recovering ˜ M given in Algorithm 1. Each row of M is constrained to have sum at most βm, and M as a whole is constrained to have nuclear norm ∥M∥∗at most 2 αϵ √αβnm. Recall that the nuclear norm is the sum of the singular values of M; in the same way that the ℓ1-norm is a convex surrogate for the ℓ0-norm, the nuclear norm acts as a convex surrogate for the rank of M (i.e., number of non-zero singular values). The optimization problem (1) therefore chooses a set of βm items in each row to maximize the corresponding values in ˜A, while constraining the item sets to have low rank (where low rank is relaxed to low nuclear norm to obtain a convex problem). This low-rank constraint acts as a strong regularizer that quenches the noise in ˜A. Once we have recovered ˜ M using Algorithm 1, it remains to recover a specific set T that approximates the β-quantile according to our ratings. Algorithm 2 provides a recipe for doing so: first, rate k0 items at random, obtaining the vector ˜r: ˜rj = 0 if we did not rate item j, and otherwise ˜rj is the (possibly noisy) rating that we assign to item j. Next, score each row ˜ Mi based on the noisy ratings P j ˜ Mij˜rj, and let T0 be the highest-scoring ˜ Mi among O(log(2/δ)/α) randomly selected i. Finally, randomly round the vector T0 ∈[0, 1]m to a discrete vector T ∈{0, 1}m, and treat T as the indicator function of a set approximating the β-quantile (see Section 5 for details of the rounding algorithm). In summary, given a noisy rating matrix ˜A, we will first run Algorithm 1 to recover a β-quantile matrix ˜ M for each rater, and then run Algorithm 2 to recover our personal β-quantile using ˜ M. Possible attacks by adversaries. In our algorithm, the adversaries can influence ˜ Mi for reliable raters i via the nuclear norm constraint (note that the other constraints are separable across rows). This makes sense because the nuclear norm is what causes us to pool global structure across raters (and thus potentially pool bad information). In order to limit this influence, the constraint on the nuclear norm is weaker than is typical by a factor of 2 ϵ ; it is not clear to us whether this is actually necessary or due to a loose analysis. The constraint P j Mij ≤βm is not typical in the literature. For instance, (Chen et al., 2014) place no constraint on the sum of each row in M (they instead normalize ˜ M to lie in [−1, 1]n×m, which recovers the items with positive rating rather than the β-quantile). Our row normalization constraint prevents an attack in which a spammer rates a random subset of items as high as possible and rates the remaining items as low as possible. If the actual set of high-quality items has density much smaller than 50%, then the spammer gains undue influence relative to honest raters that only rate e.g. 10% of the items highly. Normalizing M to have a fixed row sum prevents this; see Section B for details. 3 Assumptions and Approach We now state our assumptions more formally, state the general form of our results, and outline the key ingredients of the proof. In our setting, we can query a rater i ∈[n] and item j ∈[m] to obtain a rating ˜Aij ∈[0, 1]. Let r∗∈[0, 1]m denote the vector of true ratings of the items. We can also query an item j (by rating it ourself) to obtain a noisy rating ˜rj such that E[˜rj] = r∗ j . Let C ⊆[n] be the set of reliable raters, where |C| ≥αn. Our main assumption is that the reliable raters make independent errors: Assumption 1 (Independence). When we query a pair (i, j) with i ∈C, we obtain an output ˜Aij whose value is independent of all of the other queries so far. Similarly, when we query an item j, we obtain an output ˜rj that is independent of all of the other queries so far. 4 Algorithm 3 Algorithm for obtaining (unreliable) ratings matrix ˜A and noisy ratings ˜r, ˜r′. 1: Input: number of raters n, number of items m, and number of ratings k and k0. 2: Initially assign each rater to each item independently with probability k/m. 3: For each rater with more than 2k items, arbitrarily unassign items until there are 2k remaining. 4: For each item with more than 2k raters, arbitrarily unassign raters until there are 2k remaining. 5: Have the raters submit ratings of their assigned items, and let ˜A denote the resulting matrix of ratings with missing entries fill in with zeros. 6: Generate ˜r by rating items with probability k0 m (fill in missing entries with zeros) 7: Output ˜A, ˜r Note that Assumption 1 allows the unreliable ratings to depend on all previous ratings and also allows arbitrary collusion among the unreliable raters. In our algorithm, we will generate our own ratings after querying everyone else, which ensures that at least ˜r is independent of the adversaries. We need a way to formalize the idea that the reliable raters agree with us. To this end, for i ∈C let A∗ ij = E[ ˜Aij] be the expected rating that rater i assigns to item j. We want A∗to be roughly increasing in r∗: Definition 1 (Monotonic raters). We say that the reliable raters are (L, ϵ)-monotonic if r∗ j −r∗ j′ ≤L · (A∗ ij −A∗ ij′) + ϵ (2) whenever r∗ j ≥r∗ j′, for all i ∈C and all j, j′ ∈[m]. The (L, ϵ)-monotonicity property says that if we think that one item is substantially better than another item, the reliable raters should think so as well. As an example, suppose that our own ratings are binary (r∗ j ∈{0, 1}) and that each rating ˜Ai,j matches r∗ j with probability 3 5. Then A∗ i,j = 2 5 + 1 5r∗ j , and hence the ratings are (5, 0)-monotonic. In general, the monotonicity property is fairly mild — if the reliable ratings are not (L, ϵ)-monotonic, it is not clear that they should even be called reliable! Algorithm for collecting ratings. Under the model given in Assumption 1, our algorithm for collecting ratings is given in Algorithm 3. Given integers k and k0, Algorithm 3 assigns each rater at most 2k ratings, and assigns us k0 ratings in expectation. The output is a noisy rating matrix ˜A ∈[0, 1]n×m as well as a noisy rating vector ˜r ∈[0, 1]m. Our main result states that we can use ˜A and ˜r to estimate the β-quantile T ∗; throughout we will assume that m is at least n. Theorem 2. Let m ≥n. Suppose that Assumption 1 holds, that the reliable raters are (L, ϵ0)monotonic, and that we run Algorithm 3 to obtain noisy ratings. Then there is k = O  log3(2/δ) βα3ϵ4 m n  and k0 = O  log(2/αβϵδ) βϵ2  such that, with probability 1 −δ, Algorithms 1 and 2 output a set T with 1 βm  X j∈T ∗ r∗ j − X j∈T r∗ j  ≤(2L + 1) · ϵ + 2ϵ0. (3) Note that the amount of work for the raters scales as m n . Some dependence on m n is necessary, since we need to make sure that every item gets rated at least once. The proof of Theorem 2 can be split into two parts: analyzing Algorithm 1 (Section 4), and analyzing Algorithm 2 (Section 5). At a high level, analyzing Algorithm 1 involves showing that the nuclear norm constraint in (1) imparts sufficient noise robustness while not allowing the adversary too much influence over the reliable rows of ˜ M. Analyzing Algorithm 2 is far more straightforward, and requires only standard concentration inequalities and a standard randomized rounding idea (though the latter is perhaps not well-known, so we will explain it briefly in Section 5). 4 Recovering ˜ M (Algorithm 1) The goal of this section is to show that solving the optimization problem (1) recovers a matrix ˜ M that approximates the β-quantile of r∗in the following sense: 5 Proposition 1. Under the conditions of Theorem 2 and the corresponding values of k and k0, Algorithm 1 outputs a matrix ˜ M satisfying 1 |C| 1 βm X i∈C X j∈[m] (T ∗ j −˜ Mij)A∗ ij ≤ϵ (4) with probability 1 −δ, where T ∗ j = 1 if j lies in the β-quantile of r∗, and is 0 otherwise. Proposition 1 says that the row ˜ Mi is good according to rater i’s ratings A∗ i . Note that (L, ϵ0)monotonicity then implies that ˜ Mi is also good according to r∗. In particular (see A.2 for details) 1 |C| 1 βm X i∈C X j∈[m] (T ∗ j −˜ Mij)r∗ j ≤L · 1 |C| 1 βm X i∈C X j∈[m] (T ∗ j −˜ Mij)A∗ ij + ϵ0 ≤L · ϵ + ϵ0. (5) Proving Proposition 1 involves two major steps: showing (a) that the nuclear norm constraint in (1) imparts noise-robustness, and (b) that the constraint does not allow the adversaries to influence ˜ MC too much. (For a matrix X we let XC denote the rows indexed by C and XC the remaining rows.) In a bit more detail, if we let M ∗denote the “ideal” value of ˜ M, and B denote a denoised version of ˜A, we first show (Lemma 1) that ⟨B, ˜ M −M ∗⟩≥−ϵ′ for some ϵ′ determined below. This is established via the matrix concentration inequalities in Le et al. (2015). Lemma 1 would already suffice for standard approaches (e.g., Guédon and Vershynin, 2014), but in our case we must grapple with the issue that the rows of B could be arbitrary outside of C, and hence closeness according to B may not imply actual closeness between ˜ M and M ∗. Our main technical contribution, Lemma 2, shows that ⟨BC, ˜ MC −M ∗ C⟩≥⟨B, ˜ M −M ∗⟩−ϵ′; that is, closeness according to B implies closeness according to BC. We can then restrict attention to the reliable raters, and obtain Proposition 1. Part 1: noise-robustness. Let B be the matrix satisfying BC = k mA∗ C, BC = ˜AC, which denoises ˜A on C. The scaling k m is chosen so that E[ ˜AC] ≈BC. Also define R ∈Rn×m by Rij = T ∗ j . Ideally, we would like to have MC = RC, i.e., M matches T ∗on all the rows of C. In light of this, we will let M ∗be the solution to the following “corrected” program, which we don’t have access to (since it involves knowledge of A∗and C), but which will be useful for analysis purposes: maximize ⟨B, M⟩, (6) subject to MC = RC, 0 ≤Mij ≤1 ∀i, j, P jMij ≤βm ∀i, ∥M∥∗≤2 αϵ p αβnm Importantly, (6) enforces M ∗ ij = T ∗ j for all i ∈C. Lemma 1 shows that ˜ M is “close” to M ∗: Lemma 1. Let m ≥n. Suppose that Assumption 1 holds. Then there is a k = O  log3(2/δ) βα3ϵ4 m n  such that the solution ˜ M to (1) performs nearly as well as M ∗under B; specifically, with probability 1 −δ, ⟨B, ˜ M⟩≥⟨B, M ∗⟩−ϵαβkn. (7) Note that ˜ M is not necessarily feasible for (6), because of the constraint MC = RC; Lemma 1 merely asserts that ˜ M approximates M ∗in objective value. The proof of Lemma 1, given in Section A.3, primarily involves establishing a uniform deviation result; if we let P denote the feasible set for (1), then we wish to show that |⟨˜A −B, M⟩| ≤1 2ϵαβkn for all M ∈P. This would imply that the objectives of (1) and (6) are essentially identical, and so optimizing one also optimizes the other. Using the inequality |⟨˜A −B, M⟩| ≤∥˜A −B∥op∥M∥∗, where ∥· ∥op denotes operator norm, it suffices to establish a matrix concentration inequality bounding ∥˜A −B∥op. This bound follows from the general matrix concentration result of Le et al. (2015), stated in Section A.1. Part 2: bounding the influence of adversaries. We next show that the nuclear norm constraint does not give the adversaries too much influence over the de-noised program (6); this is the most novel aspect of our argument. 6 ∥M∥∗≤ρ MC = RC B BC−ZC MC MC M ∗ ⟨BC−ZC, M ∗−M⟩≤ϵ ˜ M Figure 2: Illustration of our Lagrangian duality argument, and of the role of Z. The blue region represents the nuclear norm constraint and the gray region the remaining constraints. Where the blue region slopes downwards, a decrease in MC can be offset by an increase in MC when measuring ⟨B, M⟩. By linearizing the nuclear norm constraint, the vector B −Z accounts for this offset, and the red region represents the constraint ⟨BC −ZC, M ∗ C −MC⟩≤ϵ, which will contain ˜ M. Suppose that the constraint on ∥M∥∗were not present in (6). Then the adversaries would have no influence on M ∗ C, because all the remaining constraints in (6) are separable across rows. How can we quantify the effect of this nuclear norm constraint? We exploit Lagrangian duality, which allows us to replace constraints with appropriate modifications to the objective function. To gain some intuition, consider Figure 2. The key is that the Lagrange multiplier ZC can bound the amount that ⟨B, M⟩can increase due to changing M outside of C. If we formalize this and analyze Z in detail, we obtain the following result: Lemma 2. Let m ≥n. Then there is a k = O  log3(2/δ) αβϵ2 m n  such that, with probability at least 1 −δ, there exists a matrix Z with rank(Z) = 1, ∥Z∥F ≤ϵk p αβn/m, and ⟨BC −ZC, M ∗ C −MC⟩≤⟨B, M ∗−M⟩for all M ∈P. (8) By localizing ⟨B, M ∗−M⟩to C via (8), Lemma 2 bounds the effect that the adversaries can have on ˜ MC. It is therefore the key technical tool powering our results, and is proved in Section A.4. Proposition 1 is proved from Lemmas 1 and 2 in Section A.5. 5 Recovering T (Algorithm 2) In this section we show that if ˜ M satisfies the conclusion of Proposition 1, then Algorithm 2 recovers a set T that approximates T ∗well. We represent the sets T and T ∗as {0, 1}-vectors, and use the notation ⟨T, r⟩to denote P j∈[m] Tjrj. Formally, we show the following: Proposition 2. Suppose Assumption 1 holds. For some k0 = O  log(2/αβϵδ) βϵ2  , with probability 1−δ, Algorithm 2 outputs a set T satisfying ⟨T ∗−T, r∗⟩≤2 |C|  X i∈C ⟨T ∗−˜ Mi, r∗⟩  + ϵβm. (9) To establish Proposition 2, first note that with probability 1−δ 2, at least one of the 2 log(2/δ) α randomly selected i from Algorithm 2 will have cost ⟨T ∗−˜ Mi, r∗⟩within twice the average cost across i ∈C. This is because with probability α, a randomly selected i will lie in C, and with probability 1 2, an i ∈C will have cost at most twice the average cost (by Markov’s inequality). The remainder of the proof hinges on two results. First, we establish a concentration bound showing that P j ˜ Mij˜rj is close to k0 m P j ˜ Mijr∗ j for any fixed i, and hence (by a union bound) also for the 2 log(2/δ) α randomly selected i. This yields the following lemma, which is a straightforward application of Bernstein’s inequality (see Section A.6 for a proof): 7 Lemma 3. Let i∗be the row selected in Algorithm 2. Suppose that ˜r satisfies Assumption 1. For some k0 = O  log(2/αδ) βϵ2  , with probability 1 −δ, we have ⟨T ∗−˜ Mi∗, r∗⟩≤2 |C|  X i∈C ⟨T ∗−˜ Mi, r∗⟩  + ϵ 4βm. (10) Having recovered a good row T0 = ˜ Mi∗, we need to turn T0 into a binary vector so that Algorithm 2 can output a set; we do so via randomized rounding, obtaining a vector T ∈{0, 1}m such that E[T] = T0 (where the randomness is with respect to the choices made by the algorithm). Our rounding procedure is given in Algorithm 4; the following lemma, proved in A.7, asserts its correctness: Lemma 4. The output T of Algorithm 4 satisfies E[T] = T0, ∥T∥0 ≤βm. Algorithm 4 Randomized rounding algorithm. 1: procedure RANDOMIZEDROUND(T0) ▷T0 ∈[0, 1]m satisfies ∥T0∥1 ≤βm 2: Let s be the vector of partial sums of T0 ▷i.e., sj = (T0)1 + · · · + (T0)j 3: Sample u ∼Uniform([0, 1]). 4: T ←[0, . . . , 0] ∈Rm 5: for z = 0 to βm −1 do 6: Find j such that u + z ∈[sj−1, sj), and set Tj = 1. ▷if no such j exists, skip this step 7: end for 8: return T 9: end procedure The remainder of the proof involves lower-bounding the probability that T is accepted in each stage of the while loop in Algorithm 2. We refer the reader to Section A.8 for details. 6 Open Directions and Related Work Future Directions. On the theoretical side, perhaps the most immediate open question is whether it is possible to improve the dependence of k (the amount of work required per worker) on the parameters α, β, and ϵ. It is tempting to hope that when m = n a tight result would have k = ˜O  1 αβϵ2  , in loose analogy to recent results for the stochastic block model (Abbe and Sandon, 2015b;a; Banks and Moore, 2016). For stochastic block models, there is conjectured to be a gap between computational and information-theoretic thresholds, and it would be interesting to see if a similar phenomenon holds here (the scaling for k given above is based on the conjectured computational threshold). A second open question concerns the scaling in n: if n ≫m, can we get by with much less work per rater? Finally, it would be interesting to consider adaptivity: if the choice of queries is based on previous worker ratings, can we reduce the amount of work? Related work. Our setting is closely related to the problem of peer prediction (Miller et al., 2005), in which we wish to obtain truthful information from a population of raters by exploiting inter-rater agreement. While several mechanisms have been proposed for these tasks, they typically assume that rater accuracy is observable online (Resnick and Sami, 2007), that the dishonest raters are rational agents maximizing a payoff function (Dasgupta and Ghosh, 2013; Kamble et al., 2015; Shnayder et al., 2016), that the raters follow a simple statistical model (Karger et al., 2014; Zhang et al., 2014; Zhou et al., 2015), or some combination of the above (Shah and Zhou, 2015; Shah et al., 2015). Ghosh et al. (2011) allow o(n) adversaries to behave arbitrarily but require the rest to be stochastic. The work closest to ours is Christiano (2014; 2016), which studies online collaborative prediction in the presence of adversaries; roughly, when raters interact with an item they predict its quality and afterwards observe the actual quality; the goal is to minimize the number of incorrect predictions among the honest raters. This differs from our setting in that (i) the raters are trying to learn the item qualities as part of the task, and (ii) there is no requirement to induce a final global estimate of the high-quality items, which is necessary for estimating quantiles. It seems possible however that there are theoretical ties between this setting and ours, which would be interesting to explore. Acknowledgments. JS was supported by a Fannie & John Hertz Foundation Fellowship, an NSF Graduate Research Fellowship, and a Future of Life Institute grant. GV was supported by NSF CAREER award CCF1351108, a Sloan Foundation Research Fellowship, and a research grant from the Okawa Foundation. MC was supported by NSF grants CCF-1565581, CCF-1617577, CCF-1302518 and a Simons Investigator Award. 8 References E. Abbe and C. Sandon. Community detection in general stochastic block models: fundamental limits and efficient recovery algorithms. arXiv, 2015a. E. Abbe and C. Sandon. Detection in the stochastic block model with multiple clusters: proof of the achievability conjectures, acyclic BP, and the information-computation gap. arXiv, 2015b. N. Agarwal, A. S. Bandeira, K. Koiliaris, and A. Kolla. Multisection in the stochastic block model using semidefinite programming. arXiv, 2015. J. Banks and C. Moore. Information-theoretic thresholds for community detection in sparse networks. arXiv, 2016. T. T. Cai and X. Li. Robust and computationally feasible community detection in the presence of arbitrary outlier nodes. The Annals of Statistics, 43(3):1027–1059, 2015. Y. Chen, S. Sanghavi, and H. Xu. Improved graph clustering. IEEE Transactions on Information Theory, 2014. P. Chin, A. Rao, and V. Vu. Stochastic block model and community detection in the sparse graphs: A spectral algorithm with optimal rate of recovery. In Conference on Learning Theory (COLT), 2015. P. Christiano. Provably manipulation-resistant reputation systems. arXiv, 2014. P. Christiano. Robust collaborative online learning. arXiv, 2016. A. Coja-Oghlan. Coloring semirandom graphs optimally. Automata, Languages and Programming, 2004. A. Coja-Oghlan. Solving NP-hard semirandom graph problems in polynomial expected time. Journal of Algorithms, 62(1):19–46, 2007. A. Condon and R. M. Karp. Algorithms for graph partitioning on the planted partition model. Random Structures and Algorithms, pages 116–140, 2001. A. Dasgupta and A. Ghosh. Crowdsourced judgement elicitation with endogenous proficiency. In WWW, 2013. A. Decelle, F. Krzakala, C. Moore, and L. Zdeborová. Asymptotic analysis of the stochastic block model for modular networks and its algorithmic applications. Physical Review E, 84(6), 2011. J. Deng, W. Dong, R. Socher, L. Li, K. Li, and L. Fei-Fei. ImageNet: A large-scale hierarchical image database. In Computer Vision and Pattern Recognition (CVPR), pages 248–255, 2009. U. Feige and J. Kilian. Heuristics for semirandom graph problems. Journal of Computer and System Sciences, 63(4):639–671, 2001. U. Feige and R. Krauthgamer. Finding and certifying a large hidden clique in a semirandom graph. Random Structures and Algorithms, 16(2):195–208, 2000. A. Ghosh, S. Kale, and P. McAfee. Who moderates the moderators?: crowdsourcing abuse detection in user-generated content. In 12th ACM conference on Electronic commerce, pages 167–176, 2011. O. Guédon and R. Vershynin. Community detection in sparse networks via Grothendieck’s inequality. arXiv, 2014. A. Harmon. Amazon glitch unmasks war of reviewers. New York Times, 2004. P. W. Holland, K. B. Laskey, and S. Leinhardt. Stochastic blockmodels: Some first steps. Social Networks, 1983. V. Kamble, N. Shah, D. Marn, A. Parekh, and K. Ramachandran. Truth serums for massively crowdsourced evaluation tasks. arXiv, 2015. D. R. Karger, S. Oh, and D. Shah. Budget-optimal task allocation for reliable crowdsourcing systems. Operations Research, 62(1):1–24, 2014. M. Krivelevich and D. Vilenchik. Semirandom models as benchmarks for coloring algorithms. In Meeting on Analytic Algorithmics and Combinatorics, pages 211–221, 2006. C. Kulkarni, P. W. Koh, H. Huy, D. Chia, K. Papadopoulos, J. Cheng, D. Koller, and S. R. Klemmer. Peer and self assessment in massive online classes. Design Thinking Research, pages 131–168, 2015. C. M. Le, E. Levina, and R. Vershynin. Concentration and regularization of random graphs. arXiv, 2015. K. Makarychev, Y. Makarychev, and A. Vijayaraghavan. Approximation algorithms for semi-random partitioning problems. In Symposium on Theory of Computing (STOC), pages 367–384, 2012. K. Makarychev, Y. Makarychev, and A. Vijayaraghavan. Learning communities in the presence of errors. arXiv, 2015. L. Massoulié. Community detection thresholds and the weak Ramanujan property. In STOC, 2014. D. Mayzlin, Y. Dover, and J. A. Chevalier. Promotional reviews: An empirical investigation of online review manipulation. Technical report, National Bureau of Economic Research, 2012. N. Miller, P. Resnick, and R. Zeckhauser. Eliciting informative feedback: The peer-prediction method. Management Science, 51(9):1359–1373, 2005. A. Moitra, W. Perry, and A. S. Wein. How robust are reconstruction thresholds for community detection? arXiv, 2015. E. Mossel, J. Neeman, and A. Sly. Stochastic block models and reconstruction. arXiv, 2012. E. Mossel, J. Neeman, and A. Sly. Belief propagation, robust reconstruction, and optimal recovery of block models. arXiv, 2013a. E. Mossel, J. Neeman, and A. Sly. A proof of the block model threshold conjecture. arXiv, 2013b. E. Mossel, J. Neeman, and A. Sly. Consistency thresholds for the planted bisection model. In STOC, 2015. C. Piech, J. Huang, Z. Chen, C. Do, A. Ng, and D. Koller. Tuned models of peer assessment in MOOCs. arXiv, 2013. R. Priedhorsky, J. Chen, S. T. K. Lam, K. Panciera, L. Terveen, and J. Riedl. Creating, destroying, and restoring value in Wikipedia. In International ACM Conference on Supporting Group Work, pages 259–268, 2007. P. Resnick and R. Sami. The influence limiter: provably manipulation-resistant recommender systems. In ACM Conference on Recommender Systems, pages 25–32, 2007. N. Shah, D. Zhou, and Y. Peres. Approval voting and incentives in crowdsourcing. In ICML, 2015. N. B. Shah and D. Zhou. Double or nothing: Multiplicative incentive mechanisms for crowdsourcing. In Advances in Neural Information Processing Systems (NIPS), 2015. V. Shnayder, R. Frongillo, A. Agarwal, and D. C. Parkes. Strong truthfulness in multi-task peer prediction, 2016. J. Vuurens, A. P. de Vries, and C. Eickhoff. How much spam can you take? An analysis of crowdsourcing results to increase accuracy. ACM SIGIR Workshop on Crowdsourcing for Information Retrieval, 2011. Y. Zhang, X. Chen, D. Zhou, and M. I. Jordan. Spectral methods meet EM: A provably optimal algorithm for crowdsourcing. arXiv, 2014. D. Zhou, Q. Liu, J. C. Platt, C. Meek, and N. B. Shah. Regularized minimax conditional entropy for crowdsourcing. arXiv, 2015. 9
2016
29
6,205
Adaptive optimal training of animal behavior Ji Hyun Bak1,4 Jung Yoon Choi2,3 Athena Akrami3,5 Ilana Witten2,3 Jonathan W. Pillow2,3 1Department of Physics, 2Department of Psychology, Princeton University 3Princeton Neuroscience Institute, Princeton University 4School of Computational Sciences, Korea Institute for Advanced Study 5Howard Hughes Medical Institute jhbak@kias.re.kr, {jungchoi,aakrami,iwitten,pillow}@princeton.edu Abstract Neuroscience experiments often require training animals to perform tasks designed to elicit various sensory, cognitive, and motor behaviors. Training typically involves a series of gradual adjustments of stimulus conditions and rewards in order to bring about learning. However, training protocols are usually hand-designed, relying on a combination of intuition, guesswork, and trial-and-error, and often require weeks or months to achieve a desired level of task performance. Here we combine ideas from reinforcement learning and adaptive optimal experimental design to formulate methods for adaptive optimal training of animal behavior. Our work addresses two intriguing problems at once: first, it seeks to infer the learning rules underlying an animal’s behavioral changes during training; second, it seeks to exploit these rules to select stimuli that will maximize the rate of learning toward a desired objective. We develop and test these methods using data collected from rats during training on a two-interval sensory discrimination task. We show that we can accurately infer the parameters of a policy-gradient-based learning algorithm that describes how the animal’s internal model of the task evolves over the course of training. We then formulate a theory for optimal training, which involves selecting sequences of stimuli that will drive the animal’s internal policy toward a desired location in the parameter space. Simulations show that our method can in theory provide a substantial speedup over standard training methods. We feel these results will hold considerable theoretical and practical implications both for researchers in reinforcement learning and for experimentalists seeking to train animals. 1 Introduction An important first step in many neuroscience experiments is to train animals to perform a particular sensory, cognitive, or motor task. In many cases this training process is slow (requiring weeks to months) or difficult (resulting in animals that do not successfully learn the task). This increases the cost of research and the time taken for experiments to begin, and poorly trained animals—for example, animals that incorrectly base their decisions on trial history instead of the current stimulus—may introduce variability in experimental outcomes, reducing interpretability and increasing the risk of false conclusions. In this paper, we present a principled theory for the design of normatively optimal adaptive training methods. The core innovation is a synthesis of ideas from reinforcement learning and adaptive experimental design: we seek to reverse engineer an animal’s internal learning rule from its observed behavior in order to select stimuli that will drive learning as quickly as possible toward a desired objective. Our approach involves estimating a model of the animal’s internal state as it evolves over training sessions, including both the current policy governing behavior and the learning rule used to 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. A B past observations ... ... ... optimal stimulus selection stimulus stimulus space active training schematic weights response stimulus 1 stimulus 2 target weights animal’s learning rule x Figure 1: (A) Stimulus space for a 2AFC discrimination task, with optimal separatrix between correct “left” and “right” choices shown in red. Filled circles indicate a “reduced” set of stimuli (consisting of those closest to the decision boundary) which have been used in several prominent studies [3, 6, 9]. (B) Schematic of active training paradigm. We infer the animal’s current weights wt and its learning rule (“RewardMax”), parametrized by φ, and use them to determine an optimal stimulus xt for the current trial (“AlignMax”), where optimality is determined by the expected weight change towards the target weights wgoal. modify this policy in response to feedback. We model the animal as using a policy-gradient based learning rule [15], and show that parameters of this learning model can be successfully inferred from a behavioral time series dataset collected during the early stages of training. We then use the inferred learning rule to compute an optimal sequence of stimuli, selected adaptively on a trial-by-trial basis, that will drive the animal’s internal model toward a desired state. Intuitively, optimal training involves selecting stimuli that maximally align the predicted change in model parameters with the trained behavioral goal, which is defined as a point in the space of model parameters. We expect this research to provide both practical and theoretical benefits: the adaptive optimal training protocol promises a significantly reduced training time required to achieve a desired level of performance, while providing new scientific insights into how and what animals learn over the course of the training period. 2 Modeling animal decision-making behavior Let us begin by defining the ingredients of a generic decision-making task. In each trial, the animal is presented with a stimulus x from a bounded stimulus space X, and is required to make a choice y among a finite set of available responses Y . There is a fixed reward map r : {X, Y } →R. It is assumed that this behavior is governed by some internal model, or the psychometric function, described by a set of parameters or weights w. We introduce the “y-bar” notation ¯y(x) to indicate the correct choice for the given stimulus x, and let Xy denote the “stimulus group” for a given y, defined as the set of all stimuli x that map to the same correct choice y = ¯y(x). For concreteness, we consider a two-alternative forced-choice (2AFC) discrimination task where the stimulus vector for each trial, x = (x1, x2), consists of a pair of scalar-valued stimuli that are to be compared [6, 8, 9, 16]. The animal should report either x1 > x2 or x1 < x2, indicating its choice with a left (y = L) or right (y = R) movement, respectively. This results in a binary response space, Y = {L, R}. We define the reward function r(x, y) to be a Boolean function that indicates whether a stimulus-response pair corresponds to a correct choice (which should therefore be rewarded) or not: r(x, y) = 1 if {x1 > x2, y = L} or {x1 < x2, y = R}; 0 otherwise. (1) Figure 1A shows an example 2-dimensional stimulus space for such a task, with circles representing a discretized set of possible stimuli X, and the desired separatrix (the boundary separating the two stimulus groups XL and XR) shown in red. In some settings, the experimenter may wish to focus on some “reduced” set of stimuli, as indicated here by filled symbols [3, 6, 9]. We model the animal’s choice behavior as arising from a Bernoulli generalized linear model (GLM), also known as the logistic regression model. The choice probabilities for the two possible stimuli at trial t are given by pR(xt, wt) = 1 1 + exp(−g(xt)⊤wt), pL(xt, wt) = 1 −pR(xt, wt) (2) 2 where g(x) = (1, x⊤)⊤is the input carrier vector, and w = (b, a⊤)⊤is the vector of parameters or weights governing behavior. Here b describes the animal’s internal bias to choosing “right” (y = R), and a = (a1, a2) captures the animal’s sensitivity to the stimulus.1 We may also incorporate the trial history as additional dimensions of the input governing the animal’s behavior; humans and animals alike are known to exhibit history-dependent behavior in trial-based tasks [1, 3, 5, 7]. Based on some preliminary observations from animal behavior (see Supplementary Material for details), we encode the trial history as a compressed stimulus history, using a binary variable ϵ¯y(x) defined as ϵL = −1 and ϵR = +1. Taking into account the previous d trials, the input carrier vector and the weight vector become: g(xt) →(1, x⊤ t , ϵ¯y(xt−1), · · · , ϵ¯y(xt−d))⊤, wt →(b, a⊤, h1, · · · , hd). (3) The history dependence parameter hd describes the animal’s tendency to stick to the correct answer from the previous trial (d trials back). Because varying number of history terms d gives a family of psychometric models, determining the optimal d is a well-defined model selection problem. 3 Estimating time-varying psychometric function In order to drive the animal’s performance toward a desired objective, we first need a framework to describe, and accurately estimate, the time-varying model parameters of the animal behavior, which is fundamentally non-stationary while training is in progress. 3.1 Constructing the random walk prior We assume that the single-step weight change at each trial t follows a random walk, wt −wt−1 = ξt, where ξt ∼N(0, σ2 t ), for t = 1, · · · , N. Let w0 be some prior mean for the initial weight. We assume σ2 = · · · = σN = σ, which is to believe that although the behavior is variable, the variability of the behavior is a constant property of the animal. We can write this more concisely using a statespace representation [2, 11], in terms of the vector of time-varying weights w = (w1, w2, · · · , wN)⊤ and its prior mean w0 = w01: D(w −w0) = ξ ∼N(0, Σ), (4) where Σ = diag(σ2 1, σ2, · · · , σ2) is the N × N covariance matrix, and D is the sparse banded matrix with first row of an identity matrix and subsequent rows computing first order differences. Rearranging, the full random walk prior on the N-dimensional vector w is w ∼N(w0, C), where C−1 = D⊤Σ−1D. (5) In many practical cases there are multiple weights in the model, say K weights. The full set of parameters should now be arranged into an N × K array of weights {wti}, where the two subscripts consistently indicate the trial number (t = 1, · · · , N) and the type of parameter (i = 1, · · · , K), respectively. This gives a matrix W = {wti} = (w∗1, · · · , w∗i, · · · , w∗K) = (w1∗, · · · , wt∗, · · · , wN∗)⊤ (6) where we denote the vector of all weights at trial t as wt∗= (wt1, wt2, · · · , wtK)⊤, and the time series of the i-th weight as w∗i = (w1i, w2i, · · · , wNi)⊤. Let w = vec(W) = (w⊤ ∗1, · · · , w⊤ ∗K)⊤be the vectorization of W, a long vector with the columns of W stacked together. Equation (5) still holds for this extended weight vector w, where the extended D and Σ are written as block diagonal matrices D = diag(D1, D2, · · · , DK) and Σ = diag(Σ1, Σ2, · · · , ΣK), respectively, where Di is the weight-specific N × N difference matrix and Σi is the corresponding covariance matrix. Within a linear model one can freely renormalize the units of the stimulus space in order to keep the sizes of all weights comparable, and keep all Σi’s equal. We used a transformed stimulus space in which the center is at 0 and the standard deviation is 1. 1We use a convention in which a single-indexed tensor object is automatically represented as a column vector (in boldface notation), and the operation (·, ·, · · · ) concatenates objects horizontally. 3 3.2 Log likelihood Let us denote the log likelihood of the observed data by L = PN t=1 Lt, where Lt = log p(yt|xt, wt∗) is the trial-specific log likelihood. Within the binomial model we have Lt = (1 −δyt,R) log(1 −pR(xt, wt∗)) + δyt,R log pR(xt, wt∗). (7) Abbreviating pR(xt, wt∗) = pt and pL(xt, wt∗) = 1 −pt, the trial-specific derivatives are solved to be ∂Lt/∂wt∗= (δyt,R −pt) g(xt) ≡∆t and ∂2Lt/∂wt∗∂wt∗= −pt(1 −pt)g(xt)g(xt)⊤≡Λt. Extension to the full weight vector is straightforward because distinct trials do not interact. Working out with the indices, we may write ∂L ∂w = vec([∆1, · · · , ∆N]⊤), ∂2L ∂w2 =   M11 M12 · · · M1K M21 M22 M2K ... ... ... MK1 MK2 · · · MKK   (8) where the (i, j)-th block of the full second derivative matrix is an N × N diagonal matrix defined by Mij = ∂2L/∂w∗i∂w∗j = diag((Λ1)ij, · · · , (Λt)ij, · · · , (ΛN)ij). After this point, we can simplify our notation such that wt = wt∗. The weight-type-specific w∗i will no longer appear. 3.3 MAP estimate of w The posterior distribution of w is a combination of the prior and the likelihood (Bayes’ rule): log p(w|D) ∼ 1 2 log C−1 −1 2(w −w0)⊤C−1(w −w0)  + L. (9) We can perform a numerical maximization of the log posterior using Newton’s method (we used the Matlab function fminunc), knowing its gradient j and the hessian H explicitly: j = ∂(log p) ∂w = −C−1(w −w0) + ∂L ∂w, H = ∂2(log p) ∂w2 = −C−1 + ∂2L ∂w2 . (10) The maximum a posteriori (MAP) estimate ˆw is where the gradient vanishes, j( ˆw) = 0. If we work with a Laplace approximation, the posterior covariance is Cov = −H−1 evaluated at w = ˆw. 3.4 Hyperparameter optimization The model hyperparameters consist of σ1, governing the variance of w1, the weights on the first trial of a session, and σ, governing the variance of the trial-to-trial diffusive change of the weights. To set these hyperparameters, we fixed σ1 to a large default value, and used maximum marginal likelihood or “evidence optimization” over a fixed grid of σ [4, 11, 13]. The marginal likelihood is given by: p(y|x, σ) = Z dwp(y|x, w)p(w|σ) = p(y|x, w)p(w|σ) p(w|x, y, σ) ≈exp(L) · N(w|w0, C) N(w| ˆw, −H−1) , (11) where ˆw is the MAP estimate of the entire vector of time-varying weights and H is the Hessian of the log-posterior over w at its mode. This formula for marginal likelihood results from the well-known Laplace approximation to the posterior [11, 12]. We found the estimate not to be insensitive to σ1 so long as it is sufficiently large. 3.5 Application We tested our method using a simulation, drawing binary responses from a stimulus-free GLM yt ∼logistic(wt), where wt was diffused as wt+1 ∼N(wt, σ2) with a fixed hyperparameter σ. Given the time series of responses {yt}, our method captures the true σ through evidence maximization, and provides a good estimate of the time-varying w = {wt} (Figure 2A). Whereas the estimate of the weight wt is robust over independent realizations of the responses, the instantaneous weight changes ∆w = wt+1 −wt are not reproducible across realizations (Figure 2B). Therefore it is difficult to analyze the trial-to-trial weight changes directly from real data, where only one realization of the learning process is accessible. 4 0 1000 2000 trials -0.5 0 0.5 1 weight w true weight best fit -8 -6 -4 log2 -12 -8 -4 0 log evd. (rel.) log evd max-evd true 0 1000 2000 trials -0.5 0 0.5 1 weight w true weight repeated fits -2 0 2 4 w (rep 1) 10-3 -2 0 2 4 w (rep 2) 10-3 -0.5 0 0.5 bias b 0 0.5 1 sensitivity a1 sensitivity a2 0 2000 4000 6000 trials 0.5 1 1.5 history dependence h -12 -10 -8 -6 -4 log2 -400 -300 -200 -100 0 log evd. (rel.) log evd max-evd 0 1 2 3 4 5 d (trials back) -200 -100 0 BIC (rel.) early mid late A B D C E Figure 2: Estimating time-varying model parameters. (A-B) Simulation: (A) Our method captures the true underlying variability σ by maximizing evidence. (B) Weight estimates are accurate and robust over independent realizations of the responses, but weight changes across realizations are not reproducible. (C-E) From the choice behavior of a rat under training, we could (C) estimate the time-varying weights of its psychometric model, and (D) determine the characteristic variability by evidence maximization. (E) The number of history terms to be included in the model was determined by comparing the BIC, using the early/mid/late parts of the rat dataset. Because log-likelihood is calculated up to a constant normalization, both log-evidence and BIC are shown in relative values. We also applied our method to an actual experimental dataset from rats during the early training period for a 2AFC discrimination task, as introduced in Section 2 (using classical training methods [3], see Supplementary Material for detailed description). We estimated the time-varying weights of the GLM (Figure 2C), and estimated the characteristic variability of the rat behavior σrat = 2−7 by maximizing marginal likelihood (Figure 2D). To determine the length d of the trial history dependence, we fit models with varying d and used the Bayesian Information Criterion BIC(d) = −2 log L(d) + K(d) log N (Figure 2E). We found that animal behavior exhibits long-range history depedence at the beginning of training, but this dependence becomes shorter as training progresses. Near the end of the dataset, the behavior of the rat is best described drat = 1 (single-trial history dependence), and we use this value for the remainder of our analyses. 4 Incorporating learning The fact that animals show improved performance, as training progresses, suggests that we need a non-random component in our model that accounts for learning. We will first introduce a simple model of weight change based on the ideas from reinforcement learning, then discuss how we can incorporate the learning model into our time-varying estimate method. A good candidate model for animal learning is the policy gradient update from reinforcement learning, for example as in [15]. There are debates as to whether animals actually learn using policy-based methods, but it is difficult to define a reasonable value function that is consistent with our preliminary observations of rat behavior (e.g. win-stay/lose-switch). A recent experimental study supports the use of policy-based models in human learning behavior [10]. 4.1 RewardMax model of learning (policy gradient update) Here we consider a simple model of learning, in which the learner attempts to update its policy (here the weight parameters in the model) to maximize the expected reward. Given some fixed reward function r(x, y), the expected reward at the next-upcoming trial t is defined as ρ(wt) = D ⟨r(xt, yt)⟩p(yt|xt,wt) E PX(xt) (12) where PX(xt) reflects the subject animal’s knowledge as to the probability that a given stimulus x will be presented at trial t, which may be dynamically updated. One way to construct the empirical 5 0 1000 2000 trials -1 0 1 model weights true estimated -9 -8 -7 -6 log2 -2 -1 0 log evidence (rel.) log evidence true max-evd -11 -10 -9 -8 -7 log2 -8 -7 -6 -5 log2 -20 -15 -10 -5 0 log evidence (rel.) A B C Figure 3: Estimating the learning model. (A-B) Simulated learner with σsim = αsim = 2−7. (A) The four weight parameters of the simulated model are successfully recovered by our MAP estimate with the learning effect incorporated, where (B) the learning rate α is accurately determined by evidence maximization. (C) Evidence maximization analysis on the rat training dataset reveals σrat = 2−6 and αrat = 2−10. Displayed is a color plot of log evidence on the hyperparameter plane (in relative values). The optimal set of hyperparameters is marked with a star. PX is to accumulate the stimulus statistics up to some timescale τ ≥0; here we restrict to the simplest limit τ = 0, where only the most recent stimulus is remembered. That is, PX(xt) = δ(xt −xt−1). In practice ρ can be evaluated at wt = wt−1, the posterior mean from previous observations. Under the GLM (2), the choice probability is p(y|x, w) = 1/(1 + exp(−ϵyg(x)⊤w)), where ϵL = −1 and ϵR = +1, trial index suppressed. Therefore the expected reward can be written out explicitly, as well as its gradient with respect to w: ∂ρ ∂w = X x∈X PX(x) f(x) pR(x, w) pL(x, w) g(x) (13) where we define the effective reward function f(x) ≡P y∈Y ϵyr(x, y) for each stimulus. In the spirit of the policy gradient update, we consider the RewardMax model of learning, which assumes that the animal will try to climb up the gradient of the expected reward by ∆wt = α ∂ρ ∂w t ≡v(wt, xt; φ), (14) where ∆wt = (wt+1 −wt). In this simplest setting, the learning rate α is the only learning hyperparameter φ = {α}. The model can be extended by incorporating more realistic aspects of learning, such as the non-isotropic learning rate, the rate of weight decay (forgetting), or the skewness between experienced and unexperienced rewards. For more discussion, see Supplementary Material. 4.2 Random walk prior with drift Because our observation of a given learning process is stochastic and the estimate of the weight change is not robust (Figure 2B), it is difficult to test the learning rule (14) on any individual dataset. However, we can still assume that the learning rule underlies the observed weight changes as ⟨∆w⟩= v(w, x; φ) (15) where the average ⟨·⟩is over hypothetical repetitions of the same learning process. This effect of non-random learning can be incorporated into our random walk prior as a drift term, to make a fully Bayesian model for an imperfect learner. The new weight update prior is written as D(w −w0) = v + ξ, where v is the “drift velocity” and ξ ∼N(0, Σ) is the noise. The modified prior is w −D−1v ∼N(w0, C), C−1 = D⊤Σ−1D. (16) Equations (9-10) can be re-written with the additional term D−1v. For the RewardMax model v = α∂ρ/∂w, in particular, the first and second derivatives of the modified log posterior can be written out analytically. Details can be found in Supplementary Material. 4.3 Application To test the model with drift, a simulated RewardMax learner was generated, based on the same task structure as in the rat experiment. The two hyperparameters {σsim, αsim} were chosen such that the 6 resulting time series data is qualitatively similar to the rat data. The simulated learning model can be recovered by maximizing the evidence (11), now with the learning hyperparameter α as well as the variability σ. The solution accurately reflects the true αsim, shown where σ is fixed at the true σsim (Figures 3A-3B). Likewise, the learning model of a real rat was obtained by performing a grid search on the full hyperparameter plane {σ, α}. We get σrat = 2−6 and αrat = 2−10 (Figure 3C). 2 Can we determine whether the rat’s behavior is in a regime where the effect of learning dominates the effect of noise, or vice versa? The obtained values of σ and α depend on our choice of units which is arbitrary; more precisely, α ∼[w2] and σ ∼[w] where [w] scales as the weight. Dimensional analysis suggests a (dimensionless) order parameter β = α/σ2, where β ≫1 would indicate a regime where the effect of learning is larger than the effect of noise. Our estimate of the hyperparameters gives βrat = αrat/σ2 rat ≈4, which leaves us optimistic. 5 AlignMax: Adaptive optimal training Whereas the goal of the learner/trainee is (presumably) to maximize the expected reward, the trainer’s goal is to drive the behavior of the trainee as close as possible to some fixed model that corresponds to a desirable, yet hypothetically achievable, performance. Here we propose a simple algorithm that aims to align the expected model parameter change of the trainee ⟨∆wt⟩= v(wt, xt; φ) towards a fixed goal wgoal. We can summarize this in an AlignMax training formula xt+1 = argmax x (wgoal −wt)⊤⟨∆wt⟩. (17) Looking at Equations (13), (14) and (17), it is worth noting that g(x) puts a heavier weight on more distinguishable or “easier” stimuli (exploitation), while pLpR puts more weight on more difficult stimuli, with more uncertainty (exploration); an exploitation-exploration tradeoff emerges naturally. We tested the AlignMax training protocol3 using a simulated learner with fixed hyperparameters αsim = 0.005 and σsim = 0, using wgoal = (b, a1, a2, h)goal = (0, −10, 10, 0) in the current paradigm. We chose a noise-free learner for clear visualization, but the algorithm works as well in the presence of noise (σ > 0, see Supplementary Material for a simulated noisy learner). As expected, our AlignMax algorithm achieves a much faster training compared to the usual algorithm where stimuli are presented randomly (Figure 4). The task performance was measured in terms of the success rate, the expected reward (12), and the Kullback-Leibler (KL) divergence. The KL divergence is defined as DKL = P x∈X PX(x) P y∈Y ˆpy(x) log(ˆpy(x)/py(x)) where ˆpy(x) = r(x, y) is the “correct” psychometric function, and a smaller value of DKL indicates a behavior that is closer to the ideal. Both the expected reward and the KL divergence were evaluated using a uniform stimulus distribution PX(x). The low success rate is a distinctive feature of the adaptive training algorithm, which selects adversarial stimuli such that the “lazy flukes” are actively prevented (e.g. such that a left-biased learner wouldn’t get thoughtless rewards from the left side). It is notable that the AlignMax training eliminates the bias b and the history dependence h (the two stimulus-independent parameters) much more quickly compared to the conventional (random) algorithm, as shown in Figure 4A. Two general rules were observed from the optimal trainer. First, while the history dependence h is non-zero, AlignMax alternates between different stimulus groups in order to suppress the win-stay behavior; once h vanishes, AlignMax tries to neutralize the bias b by presenting more stimuli from the “non-preferred” stimulus group yet being careful not to re-install the history dependence. For example, it would give LLRLLR... for an R-biased trainee. This suggests that a pre-defined, non-adaptive de-biasing algorithm may be problematic as it may reinforce an unwanted history dependence (see Supp. Figure S1). Second, AlignMax exploits the full stimulus space by starting from some “easier” stimuli in the early stage of training (farther away from the true separatrix x1 = x2), and presenting progressively more difficult stimuli (closer to the separatrix) as the trainee performance improves. This suggests that using the reduced stimulus space may be suboptimal for training purposes. Indeed, training was faster on the full stimulus plane, than on the reduced set (Figures 4B-4C). 2Based on a 2000-trial subset of the rat dataset. 3When implementing the algorithm within the current task paradigm, because of the way we model the history variable as part of the stimulus, it is important to allow the algorithm to choose up to d + 1 future stimuli, in this case as a pair {xt+1, xt+2} , in order to generate a desired pattern of trial history. 7 Figure 4: AlignMax training (solid lines) compared to a random training (dashed lines), for a simulated noise-free learner. (A) Weights evolving as training progresses, shown from a simulated training on the full stimulus space shown in Figure 1A. (B-C) Performances measured in terms of the success rate (moving average over 500 trials), the expected reward and the KL divergence. The simulated learner was trained either (B) in the full stimulus space, or (C) in the reduced stimulus space. The low success rate is a natural consequence of the active training algorithm, which tends to select adversarial stimuli to facilitate learning. 6 Discussion In this work, we have formulated a theory for designing an optimal training protocol of animal behavior, which works adaptively to drive the current internal model of the animal toward a desired, pre-defined objective state. To this end, we have first developed a method to accurately estimate the time-varying parameters of the psychometric model directly from animal’s behavioral time series, while characterizing the intrinsic variability σ and the learning rate α of the animal by empirical Bayes. Interestingly, a dimensional analysis based on our estimate of the learning model suggests that the rat indeed lives in a regime where the effect of learning is stronger than the effect of noise. Our method to infer the learning model from data is different from many conventional approaches of inverse reinforcement learning, which also seek to infer the underlying learning rules from externally observable behavior, but usually rely on the stationarity of the policy or the value function. On the contrary, our method works directly on the non-stationary behavior. Our technical contribution is twofold: first, building on the existing framework for estimation of state-space vectors [2, 11, 14], we provide a case in which parameters of a non-stationary model are successfully inferred from real time-series data; second, we develop a natural extension of the existing Bayesian framework where non-random model change (learning) is incorporated into the prior information. The AlignMax optimal trainer provides important insights into the general principles of effective training, including a balanced strategy to neutralize both the bias and the history dependence of the animal, and a dynamic tradeoff between difficult and easy stimuli that makes efficient use of a broad range of the stimulus space. There are, however, two potential issues that may be detrimental to the practical success of the algorithm: First, the animal may suffer a loss of motivation due to the low success rate, which is a natural consequence of the adaptive training algorithm. Second, as with any model-based approach, mismatch of either the psychometric model (logistic, or any generalization model) or the learning model (RewardMax) may result in poor performances of the training algorithm. These issues are subject to tests on real training experiments. Otherwise, the algorithm is readily applicable. We expect it to provide both a significant reduction in training time and a set of reliable measures to evaluate the training progress, powered by direct access to the internal learning model of the animal. Acknowledgments JHB was supported by the Samsung Scholarship and the NSF PoLS program. JWP was supported by grants from the McKnight Foundation, Simons Collaboration on the Global Brain (SCGB AWD1004351) and the NSF CAREER Award (IIS-1150186). We thank Nicholas Roy for the careful reading of the manuscript. 8 References [1] A. Abrahamyan, L. L. Silva, S. C. Dakin, M. Carandini, and J. L. Gardner. Adaptable history biases in human perceptual decisions. Proc. Nat. Acad. Sci., 113(25):E3548–E3557, 2016. [2] Y. Ahmadian, J. W. Pillow, and L. Paninski. Efficient Markov chain Monte Carlo methods for decoding neural spike trains. Neural Computation, 23(1):46–96, 2011. [3] A. Akrami, C. Kopec, and C. Brody. Trial history vs. sensory memory - a causal study of the contribution of rat posterior parietal cortex (ppc) to history-dependent effects in working memory. Society for Neuroscience Abstracts, 2016. [4] C. M. Bishop. Pattern Recognition and Machine Learning. Information science and statistics. Springer, 2006. [5] L. Busse, A. Ayaz, N. T. Dhruv, S. Katzner, A. B. Saleem, M. L. Schölvinck, A. D. Zaharia, and M. Carandini. The detection of visual contrast in the behaving mouse. J. Neurosci., 31(31):11351–11361, 2011. [6] A. Fassihi, A. Akrami, V. Esmaeili, and M. E. Diamond. Tactile perception and working memory in rats and humans. Proc. Nat. Acad. Sci., 111(6):2331–2336, 2014. [7] I. Fründ, F. A. Wichmann, and J. H. Macke. Quantifying the effect of intertrial dependence on perceptual decisions. J. Vision, 14(7):9–9, 2014. [8] D. M. Green and J. A. Swets. Signal Detection Theory and Psychophysics. Wiley, New York, 1966. [9] A. Hernández, E. Salinas, R. García, and R. Romo. Discrimination in the sense of flutter: new psychophysical measurements in monkeys. J. Neurosci., 17(16):6391–6400, 1997. [10] J. Li and N. D. Daw. Signals in human striatum are appropriate for policy update rather than value prediction. J. Neurosci., 31(14):5504–5511, 2011. [11] L. Paninski, Y. Ahmadian, D. G. Ferreira, S. Koyama, K. Rahnama Rad, M. Vidne, J. Vogelstein, and W. Wu. A new look at state-space models for neural data. J. Comp. Neurosci., 29(1):107– 126, 2010. [12] J. W. Pillow, Y. Ahmadian, and L. Paninski. Model-based decoding, information estimation, and change-point detection techniques for multineuron spike trains. Neural Comput, 23(1):1–45, Jan 2011. [13] M. Sahani and J. F. Linden. Evidence optimization techniques for estimating stimulus-response functions. In S. Becker, S. Thrun, and K. Obermayer, editors, Adv. Neur. Inf. Proc. Sys. 15, pages 317–324. MIT Press, 2003. [14] A. C. Smith, L. M. Frank, S. Wirth, M. Yanike, D. Hu, Y. Kubota, A. M. Graybiel, W. A. Suzuki, and E. N. Brown. Dynamic analysis of learning in behavioral experiments. J. Neurosci., 24(2):447–461, 2004. [15] R. S. Sutton, D. Mcallester, S. Singh, and Y. Mansour. Policy gradient methods for reinforcement learning with function approximation. In S. A. Solla, T. K. Leen, and K. Muller, editors, Adv. Neur. Inf. Proc. Sys. 12, pages 1057–1063. MIT Press, 2000. [16] C. W. Tyler and C.-C. Chen. Signal detection theory in the 2afc paradigm: Attention, channel uncertainty and probability summation. Vision Research, 40(22):3121–3144, 2000. 9
2016
290
6,206
Structured Matrix Recovery via the Generalized Dantzig Selector Sheng Chen Arindam Banerjee Dept. of Computer Science & Engineering University of Minnesota, Twin Cities {shengc,banerjee}@cs.umn.edu Abstract In recent years, structured matrix recovery problems have gained considerable attention for its real world applications, such as recommender systems and computer vision. Much of the existing work has focused on matrices with low-rank structure, and limited progress has been made on matrices with other types of structure. In this paper we present non-asymptotic analysis for estimation of generally structured matrices via the generalized Dantzig selector based on sub-Gaussian measurements. We show that the estimation error can always be succinctly expressed in terms of a few geometric measures such as Gaussian widths of suitable sets associated with the structure of the underlying true matrix. Further, we derive general bounds on these geometric measures for structures characterized by unitarily invariant norms, a large family covering most matrix norms of practical interest. Examples are provided to illustrate the utility of our theoretical development. 1 Introduction Structured matrix recovery has found a wide spectrum of applications in real world, e.g., recommender systems [22], face recognition [9], etc. The recovery of an unknown structured matrix Θ∗∈Rd×p essentially needs to consider two aspects: the measurement model, i.e., what kind of information about the unknown matrix is revealed from each measurement, and the structure of the underlying matrix, e.g., sparse, low-rank, etc. In the context of structured matrix estimation and recovery, a widely used measurement model is the linear measurement, i.e., one has access to n observations of the form yi = ⟨⟨Θ∗, Xi⟩⟩+ ωi for Θ∗, where ⟨⟨·, ·⟩⟩denotes the matrix inner product, i.e., ⟨⟨A, B⟩⟩= Tr(AT B) for any A, B ∈Rd×p, and ωi’s are additive noise. In the literature, various types of measurement matrices Xi has been investigated, for example, Gaussian ensemble where Xi consists of i.i.d. standard Gaussian entries [11], rank-one projection model where Xi is randomly generated with constraint rank(Xi) = 1 [7]. A special case of rank-one projection is the matrix completion model [8], in which Xi has a single entry equal to 1 with all the rest set to 0, i.e., yi takes the value of one entry from Θ∗at each measurement. Other measurement models include row-and-column affine measurement [34], exponential family matrix completion [21, 20], etc. Previous work has shown that low-complexity structure of Θ∗, often captured by a small value of some norm R(·), can significantly benefit its recovery [11, 26]. For instance, one of the popular structures of Θ∗is low-rank, which can be approximated by a small value of trace norm (i.e., nuclear norm) ∥· ∥tr. Under the low-rank assumption of Θ∗, recovery guarantees have been established for different measurement matrices using convex programs, e.g., trace-norm regularized least-square estimator [10, 27, 26, 21], min Θ∈Rd×p 1 2 n X i=1 (yi −⟨⟨Xi, Θ⟩⟩)2 + βn∥Θ∗∥tr , (1) 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. and constrained trace-norm minimization estimators [10, 27, 11, 7, 20], such as min Θ∈Rd×p ∥Θ∥tr s.t. n X i=1 (⟨⟨Xi, Θ⟩⟩−yi) Xi op ≤λn , (2) where βn, λn are tuning parameters, and ∥· ∥op denotes the operator (spectral) norm. Among the convex approaches, the exact recovery guarantee of a matrix-form basis-pursuit [14] estimator was analyzed for the noiseless setting in [27], under certain matrix-form restricted isometry property (RIP). In the presence of noise, [10] also used matrix RIP to establish the recovery error bound for both regularized and constraint estimators, i.e., (1) and (2). In [7], a variant of estimator (2) was proposed and its recovery guarantee was built on a so-called restricted uniform boundedness (RUB) condition, which is more suitable for the rank-one projection based measurement model. Despite the fact that the low-rank structure has been well studied, only a few works extend to more general structures. In [26], the regularized estimator (1) was generalized by replacing the trace norm with a decomposable norm R(·) for other structures. [11] extended the estimator in [27] with ∥·∥tr replaced by a norm from a broader class called atomic norm, but the consistency of the estimator is only available when the noise vector is bounded. In this work, we make two key contributions. First, we present a general framework for estimation of structured matrices via the generalized Dantzig sector (GDS) [12, 6] as follows ˆΘ = argmin Θ∈Rd×p R(Θ) s.t. R∗ n X i=1 (⟨⟨Xi, Θ⟩⟩−yi) Xi ! ≤λn , (3) in which R(·) can be any norm and its dual norm is R∗(·). GDS has been studied in the context of structured vectors [12], so (3) can be viewed as a natural generalization to matrices. Note that the estimator (2) is a special case of the formulation above, as operator norm is dual to trace norm. Our deterministic analysis of the estimation error ∥ˆΘ −Θ∗∥F relies on a condition based on a suitable choice of λn and the restricted strong convexity (RSC) condition [26, 3]. By assuming sub-Gaussian Xi and ωi, we show that these conditions are satisfied with high probability, and the recovery error can be expressed in terms of certain geometric measures of sets associated with Θ∗. Such a geometric characterization is inspired by related advances in recent years [26, 11, 3]. One key ingredient in such characterization is the Gaussian width [18], which measures the size of sets in Rd×p. Related advances can be found in [11, 12, 6], but they all rely on the Gaussian measurements, to which classical concentration results [18] are directly applicable. In contrast, our work allows general sub-Gaussian measurement matrices and noise, by suitably using ideas from generic chaining [30], a powerful geometric approach to bounding stochastic processes. Our results can also be extended to heavy tailed measurement and noise, following recent advances [28]. Recovery guarantees of the GDS were analyzed for general norms in matrix completion setting [20], but it is different from our work since its measurement model is not sub-Gaussian as we consider. Our second contribution is motivated by the fact that though certain existing analyses end up with the geometric measures such as Gaussian widths, limited attention has been paid in bounding these measures in terms of more easily understandable quantities especially for matrix norms. Here our key novel contribution is deriving general bounds for those geometric measures for the class of unitarily invariant norms, which are invariant under any unitary transformation, i.e., for any matrix Θ ∈Rd×p, its norm value is equal to that of UΘV if both U ∈Rd×d and V ∈Rp×p are unitary matrices. The widely-used trace norm, spectral norm and Frobenius norm all belong to this class. A well-known result is that any unitarily invariant matrix norm is equivalent to some vector norm applied on the set of singular values [23] (see Lemma 1 for details), and this equivalence allows us to build on the techniques developed in [13] for vector norms to derive the bounds of the geometric measures for unitarily invariant norms. Previously these general bounds were not available in the literature for the matrix setting, and bounds were only in terms the geometric measures, which can be hard to interpret or bound in terms of understandable quantities. We illustrate concrete versions of the general bounds using the trace norm and the recently proposed spectral k-support norm [24]. The rest of the paper is organized as follows: we first provide the deterministic analysis in Section 2. In Section 3, we introduce some probability tools, which are used in the later analysis. In Section 4, we present the probabilistic analysis for sub-Gaussian measurement matrices and noise, along with the general bounds of the geometric measures for unitarily invariant norms. Section 5 is dedicated to the examples for the application of general bounds, and we conclude in Section 6. 2 2 Deterministic Recovery Guarantees To evaluate the performance of GDS (3), we focus on the Frobenius-norm error, i.e., ∥ˆΘ −Θ∗∥F . Throughout the paper, w.l.o.g. we assume that d ≤p. For convenience, we denote the collection of Xi’s by X = {Xi}n i=1, and let ω = [ω1, ω2, . . . , ωn]T be the noise vector. In the following theorem, we provide a deterministic bound for ∥ˆΘ −Θ∗∥F under some standard assumptions on λn and X. Theorem 1 Define the set ER(Θ∗) = cone{ ∆∈Rd×p | R(∆+ Θ∗) ≤R(Θ∗)} . Assume that λn ≥R∗ n X i=1 ωiXi ! , and n X i=1 ⟨⟨Xi, ∆⟩⟩2/ ∥∆∥2 F ≥α > 0, ∀∆∈ER(Θ∗) . (4) Then the estimation ∥ˆΘ −Θ∗∥F error satisfies ∥ˆΘ −Θ∗∥F ≤2ΨR(Θ∗)λn α , (5) where ΨR(·) is the restricted compatibility constant defined as ΨR(Θ∗) = sup∆∈ER(Θ∗) R(∆) ∥∆∥F . The proof is deferred to the supplement. The convex cone ER(Θ∗) plays a important role in characterizing the error bound, and its geometry is determined by R(·) and Θ∗. The recovery bound assumes no knowledge of the norm R(·) and true matrix Θ∗, thus allowing general structures. The second condition in 4 is often referred to as restricted strong convexity [26]. In this work, we are particularly interested in R(·) from the class of unitarily invariant matrix norm, which essentially satisfies the following property, R(Θ) = R(UΘV ) for any Θ ∈Rd×p and unitary matrices U ∈Rd×d, V ∈Rp×p. A useful result for such norms is given in Lemma 1 (see [23, 4] for details). Lemma 1 Suppose that the singular values of a matrix Θ ∈ Rd×p are given by σ = [σ1, σ2, . . . , σd]T . A unitarily invariant norm R : Rd×p 7→R can be characterized by some symmetric gauge function1 f : Rd 7→R as R(Θ) = f(σ), and its dual norm is given by R∗(Θ) = f ∗(σ). As the sparsity of σ equals the rank of Θ, the class of unitarily invariant matrix norms is useful in structured low-rank matrix recovery and includes many widely used norms, e.g., trace norm with f(·) = ∥· ∥1, Frobenius norm with f(·) = ∥· ∥2, Schatten p-norm with f(·) = ∥· ∥p, Ky Fan k-norm when f(·) is the ℓ1 norm of the largest k elements in magnitude, etc. Before proceeding with the analysis, we introduce some notations. For the rest of paper, we denote by σ(Θ) ∈Rd the vector of singular values (sorted in descending order) of matrix Θ ∈Rd×p, and may use the shorthand σ∗for σ(Θ∗). For any θ ∈Rd, we define the corresponding |θ|↓by arranging the absolute values of elements of θ in descending order. Given any matrix Θ ∈Rd×p and subspace M ⊆Rd×p, we denote by ΘM the orthogonal projection of Θ onto M. Besides we let colsp(Θ) (rowsp(Θ)) be the subspace spanned by columns (rows) of Θ. The notation Sdp−1 represents the unit sphere of Rd×p, i.e., the set {Θ|∥Θ∥F = 1}. The unit ball of norm R(·) is denoted by ΩR = {Θ | R(Θ) ≤1}. Throughout the paper, the symbols c, C, c0, C0, etc., are reserved for universal constants, which may be different at each occurrence. In the rest of our analysis, we will frequently use the so-called ordered weighted ℓ1 (OWL) norm for Rd [17], which is defined as ∥θ∥w ≜⟨|θ|↓, |w|↓⟩, where w ∈Rd is a predefined weight vector. Noting that the OWL norm is a symmetric gauge, we define the spectral OWL norm for Θ as: ∥Θ∥w ≜∥σ(Θ)∥w, i.e., applying the OWL norm on σ(Θ). 3 Background and Preliminaries The tools for our probabilistic analysis include the notion of Gaussian width [18], sub-Gaussian random matrices, and generic chaining [30]. Here we briefly introduce the basic ideas and results for each of them as needed for our analysis. 1Symmetric gauge function is a norm that is invariant under sign-changes and permutations of the elements. 3 3.1 Gaussian width and sub-Gaussian random matrices The Gaussian width can be defined for any subset A ⊆Rd×p as follows [18, 19], w(A) ≜EG h sup Z∈A ⟨⟨G, Z⟩⟩ i , (6) where G is a random matrix with i.i.d. standard Gaussian entries, i.e., Gij ∼N(0, 1). The Gaussian width essentially measures the size of the set A, and some of its properties can be found in [11, 1]. A random matrix X is sub-Gaussian with |||X|||ψ2 ≤κ if |||⟨⟨X, Z⟩⟩|||ψ2 ≤κ for any Z ∈Sdp−1, where the ψ2 norm for sub-Gaussian random variable x is defined as |||x|||ψ2 = supq≥1 q−1 2 (E|x|q) 1 q (see [31] for more details of ψ2 norm). One nice property of sub-Gaussian random variable is the thin tail, i.e., P(|x| > ϵ) ≤e · exp(−cϵ2/∥x∥2 ψ2), in which c is a constant. 3.2 Generic chaining Generic chaining is a powerful tool for bounding the supreme of stochastic processes [30]. Suppose {Zt}t∈T is a centered stochastic process, where each Zt is a centered random variable. We assume the index set T is endowed with some metric s(·, ·). In order to use generic chaining bound, the critical condition for {Zt}t∈T to satisfy is that, for any u, v ∈T , P (|Zu −Zv| ≥ϵ) ≤c1 · exp −c2ϵ2/s2(u, v)  , where c1 and c2 are constants. Under this condition, we have E[sup t∈T Zt] ≤c0γ2 (T , s) , (7) P  sup u,v∈T |Zu −Zv| ≥C1 (γ2(T , s) + ϵ · diam (T , s))  ≤C2 exp −ϵ2 , (8) where diam (T , s) is the diameter of set T w.r.t. the metric s(·, ·). (7) is often referred to as generic chaining bound (see Theorem 2.2.18 and 2.2.19 in [30]), and (8) is the Theorem 2.2.27 in [30]. The functional γ2(T , s) essentially measures the geometric size of the set T under the metric s(·, ·). To avoid unnecessary complications, we omit the definition of γ2(T , s) here (see Chapter 2 of [30] for an introduction if one is interested), but provide two of its properties below, γ2(T , s1) ≤γ2(T , s2) if s1(u, v) ≤s2(u, v) ∀u, v ∈T , (9) γ2(T , ηs) = η · γ2(T , s) for any η > 0 . (10) The important aspect of γ2-functional is the following majorizing measure theorem [29, 30]. Theorem 2 Given any Gaussian process {Yt}t∈T , define s(u, v) = p E|Yu −Yv|2 for u, v ∈T . Then γ2(T , s) can be upper bounded by γ2(T , s) ≤C0E [supt∈T Yt]. This theorem is essentially Theorem 2.4.1 in [30]. For our purpose, we simply focus on the Gaussian process {Y∆= ⟨⟨G, ∆⟩⟩}∆∈A, in which A ⊆Rd×p and G is a standard Gaussian random matrix. Given Theorem 2, the metric s(U, V ) = p E|⟨⟨G, U −V ⟩⟩|2 = ∥U −V ∥F . Therefore we have γ2 (A, ∥· ∥F ) ≤C0E[ sup ∆∈A ⟨⟨G, ∆⟩⟩] = C0w(A) , (11) 4 Error Bounds with Sub-Gaussian Measurement and Noise Though the deterministic recovery bound (5) in Section 2 applies to any measurement X and noise ω as long as the assumptions in (4) are satisfied, it is of practical interest to express the bound in terms of the problem parameters, e.g., d, p and n, for random X and ω sampled from some general and widely used family of distributions. For this work, we assume that Xi’s in X are i.i.d. copies of a zero-mean random vector X, which is sub-Gaussian with |||X|||ψ2 ≤κ for a constant κ, and the noise ω contains i.i.d. centered random variables with ∥ωi∥ψ2 ≤τ for a constant τ. In this section, we show that each quantity in (5) can be bounded using certain geometric measures associated with the true matrix Θ∗. Further, we show that for unitarily invariant norms, the geometric measures can themselves be bounded in terms of d, p, n, and structures associated with Θ∗. 4 4.1 Bounding restricted compatibility constant Given the definition of restricted compatibility constant in Theorem 1, it involves no randomness and purely depends on R(·) and the geometry of ER(Θ∗). Hence we directly work on its upper bound for unitarily invariant norms. In general, characterizing the error cone ER(Θ∗) is difficult, especially for non-decomposable R(·). To address the issue, we first define the seminorm below. Definition 1 Given two orthogonal subspaces M1, M2 ⊆Rd×p and two vectors w, z ∈Rd, the subspace spectral OWL seminorm for Rd×p is defined as ∥Θ∥w,z ≜∥ΘM1∥w + ∥ΘM2∥z, where ΘM1 and ΘM2 are the orthogonal projections of Θ onto M1 and M2, respectively. Next we will construct such a seminorm based on a subgradient θ∗of the symmetric gauge f associated with R(·) at σ∗, which can be obtained by solving the so-called polar operator [32] θ∗∈argmax x:f ∗(x)≤1 ⟨x, σ∗⟩. (12) Given that σ∗is sorted, w.l.o.g. we may assume that θ∗is nonnegative and sorted because ⟨σ∗, θ∗⟩≤ ⟨σ∗, |θ∗|↓⟩and f ∗(θ∗) = f ∗(|θ∗|↓). Also, we denote by θ∗ max (θ∗ min) the largest (smallest) element of the θ∗, and define ρ = θ∗ max/θ∗ min (if θ∗ min = 0, we define ρ = +∞). Throughout the paper, we will frequently use these notations. As shown in the lemma below, a constructed seminorm based on θ∗will induce a set E′ that contains ER(Θ∗) and is considerably easier to work with. Lemma 2 Assume that rank(Θ∗) = r and its compact SVD is given by Θ∗= UΣV T , where U ∈ Rd×r, Σ ∈ Rr×r and V ∈ Rp×r. Let θ∗be any subgradient of f(σ∗), w = [θ∗ 1, θ∗ 2, . . . , θ∗ r, 0, . . . , 0]T ∈Rd, z = [θ∗ r+1, θ∗ r+2, . . . , θ∗ d, 0, . . . , 0]T ∈Rd, U = colsp(U) and V = rowsp(V T ), and define M1, M2 as M1 = {Θ | colsp(Θ) ⊆U, rowsp(Θ) ⊆ V}, M2 = {Θ | colsp(Θ) ⊆U⊥, rowsp(Θ) ⊆V⊥}, where U⊥, V⊥are orthogonal complements of U and V respectively. Then the specified subspace spectral OWL seminorm ∥· ∥w,z satisfies ER(Θ∗) ⊆E′ ≜cone{∆| ∥∆+ Θ∗∥w,z ≤∥Θ∗∥w,z} The proof is given in the supplementary. Base on the superset E′, we are able to bound the restricted compatibility constant for unitarily invariant norms by the following theorem. Theorem 3 Assume there exist η1 and η2 such that the symmetric gauge f for R(·) satisfies f(δ) ≤ max {η1∥δ∥1, η2∥δ∥2} for any δ ∈Rd. Then given a rank-r Θ∗, the restricted compatibility constant ΨR(Θ∗) is upper bounded by ΨR(Θ∗) ≤2Φf(r) + max  η2, η1(1 + ρ)√r , (13) where ρ = θ∗ max/θ∗ min, and Φf(r) = sup∥δ∥0≤r f(δ)/∥δ∥2 is called sparse compatibility constant. Remark: The assumption for Theorem 3 might seem cumbersome at the first glance, but the different combinations of η1 and η2 give us more flexibility. In fact, it trivially covers two cases, η2 = 0 along with f(δ) ≤η1∥δ∥1 for any δ, and the other way around, η1 = 0 along with f(δ) ≤η2∥δ∥2. 4.2 Bounding restricted convexity α The second condition in (4) is equivalent to Pn i=1⟨⟨Xi, ∆⟩⟩2 ≥α > 0, ∀∆∈ER(Θ∗) ∩Sdp−1. In the following theorem, we express the restricted convexity α in terms of Gaussian width. Theorem 4 Assume that Xi’s are i.i.d. copies of a centered isotropic sub-Gaussian random matrix X with |||X|||ψ2 ≤κ, and let AR(Θ∗) = ER(Θ∗) ∩Sdp−1. With probability at least 1 −exp(−ζw2(AR(Θ∗))), the following inequality holds with absolute constant ζ and ξ, inf ∆∈A 1 n n X i=1 ⟨⟨Xi, ∆⟩⟩2 ≥1 −ξκ2 · w(AR(Θ∗)) √n . (14) 5 The proof is essentially an application of generic chaining [30] and the following theorem from [25]. Related line of works can be found in [15, 16, 5]. Theorem 5 (Theorem D in [25]) There exist absolute constants c1, c2, c3 for which the following holds. Let (Ω, µ) be a probability space, H be a subset of the unit sphere of L2(µ), i.e., H ⊆SL2 = {h : |||h|||L2 = 1}, and assume suph∈H |||h|||ψ2 ≤κ. Then, for any β > 0 and n ≥1 satisfying c1κγ2(H, |||·|||ψ2) ≤β√n, with probability at least 1 −exp(−c2β2n/κ4), we have sup h∈H 1 n n X i=1 h2(Xi) −E  h2 ≤β . (15) Proof of Theorem 4: For simplicity, we use A as shorthand for AR(Θ∗). Let (Ω, µ) be the probability space that X is defined on, and construct H = {h(·) = ⟨⟨·, ∆⟩⟩| ∆∈A} . |||X|||ψ2 ≤κ immediately implies that suph∈H |||h|||ψ2 ≤κ. As X is isotropic, i.e., E[⟨⟨X, ∆⟩⟩2] = 1 for any ∆∈A ⊆Sdp−1, thus H ⊆SL2 and E[h2] = 1 for any h ∈H. Given h1 = ⟨⟨·, ∆1⟩⟩, h2 = ⟨⟨·, ∆2⟩⟩∈H, where ∆1, ∆2 ∈A, the metric induced by ψ2 norm satisfies |||h1 −h2|||ψ2 = |||⟨⟨X, ∆1 −∆2⟩⟩|||ψ2 ≤κ∥∆1 −∆2∥F . Using the properties of γ2-functional and the majorizing measure theorem in Section 3, we have γ2(H, |||·|||ψ2) ≤κγ2(A, ∥· ∥F ) ≤κc4w(A) , where c4 is an absolute constant. Hence, by choosing β = c1c4κ2w(A)/√n, we can guarantee that condition c1κγ2(H, |||·|||ψ2) ≤β√n holds for H. Applying Theorem 5 to this H, with probability at least 1 −exp(−c2c2 1c2 4w2(A)), we have suph∈H 1 n Pn i=1 h2(Xi) −1 ≤β, which implies inf ∆∈A 1 n n X i=1 ⟨⟨Xi, ∆⟩⟩2 ≥1 −β . Letting ζ = c2c2 1c2 4, ξ = c1c4, we complete the proof. The bound (14) involves the Gaussian width of set AR(Θ∗), i.e., the error cone intersecting with unit sphere. For unitarily invariant R, the theorem below provides a general way to bound w(AR(Θ∗)). Theorem 6 Under the setting of Lemma 2, let ρ = θ∗ max/θ∗ min and rank(Θ∗) = r. The Gaussian width w(AR(Θ∗)) satisfies w(AR(Θ∗)) ≤min np dp, p (2ρ2 + 1) (d + p −r) r o . (16) The proof of Theorem 6 is included in the supplementary material, which relies on a few specific properties of Gaussian random matrix [1, 11]. 4.3 Bounding regularization parameter λn In view of Theorem 1, we should choose the λn large enough to satisfy the condition in (4). Hence we an upper bound for random quantity R∗(Pn i=1 ωiXi), which holds with high probability. Theorem 7 Assume that X = {Xi}n i=1 are i.i.d. copies of a centered isotropic sub-Gaussian random matrix X with |||X|||ψ2 ≤κ, and the noise ω consists of i.i.d. centered entries with |||ωi|||ψ2 ≤τ. Let ΩR be the unit ball of R(·) and η = sup∆∈ΩR ∥∆∥F . With probability at least 1 −exp(−c1n) −c2 exp −w2(ΩR)/c2 3η2 , the following inequality holds R∗ n X i=1 ωiXi ! ≤c0κτ · √nw(ΩR) . (17) 6 Proof: For each entry in ω, we have p E[ω2 i ] ≤ √ 2|||ωi|||ψ2 = √ 2τ, and ω2 i −E[ω2 i ] ψ1 ≤ 2 ω2 i ψ1 ≤4|||ωi|||2 ψ2 ≤4τ 2, where we use the definition of ψ2 norm and its relation to ψ1 norm [31]. By Bernstein’s inequality, we get P(∥ω∥2 2 −2τ 2 ≥ϵ) ≤P ∥ω∥2 2 −E[∥ω∥2 2] ≥ϵ  ≤exp −c1 min ϵ2/16τ 4n, ϵ/4τ 2 . Taking ϵ = 4τ 2n, we have P ∥ω∥2 ≥τ √ 6n  ≤exp (−c1n). Denote Yu = Pn i=1 uiXi for u ∈Rn. For any u ∈Sn−1, we get |||Yu|||ψ2 ≤cκ due to |||⟨⟨Yu, ∆⟩⟩|||ψ2 = n X i=1 ui⟨⟨Xi, ∆⟩⟩ ψ2 ≤c v u u t n X i=1 u2 i |||⟨⟨Xi, ∆⟩⟩|||2 ψ2 ≤cκ for any ∆∈Sdp−1. For the rest of the proof, we may drop the subscript of Yu for convenience. We construct the stochastic process {Z∆= ⟨⟨Y, ∆⟩⟩}∆∈ΩR, and note that any ZU and ZV from this process satisfy P (|ZU −ZV | ≥ϵ) = P (|⟨⟨Y, U −V ⟩⟩| ≥ϵ) ≤e · exp −Cϵ2/κ2∥U −V ∥2 F  , for some universal constant C due to the sub-Gaussianity of Y . As ΩR is symmetric, it follows that sup U,V ∈ΩR |ZU −ZV | = 2 sup ∆∈ΩR Z∆, sup U,V ∈ΩR ∥U −V ∥F = 2 sup ∆∈ΩR ∥∆∥F = 2η . Let s(·, ·) be the metric induced by norm κ∥· ∥F and T = ΩR. Using deviation bound (8), we have P  2 sup ∆∈ΩR Z∆≥c4κ (γ2(ΩR, ∥· ∥F ) + ϵ · 2η)  ≤c2 exp −ϵ2 , where c2 and c4 are absolute constant. By (11), there exist constants c3 and c5 such that P (2R∗(Y ) ≥c5κ (w(ΩR) + ϵ)) = P  2 sup ∆∈ΩR Z∆≥c5κ (w(ΩR) + ϵ)  ≤c2 exp −ϵ2/c2 3η2 . Letting ϵ = w(ΩR), we have P (R∗(Yu) ≥c5κw(ΩR)) ≤c2 exp  −(w(ΩR)/c3η)2 for any u ∈ Sn−1. Combining this with the bound for ∥ω∥2 and letting c0 = √ 6c5, by union bound, we have P R∗ n X i=1 ωiXi ! ≥c0κτ√nw(ΩR) ! ≤P R∗(Yω) ∥ω∥2 ≥c5κw(ΩR)  + P  ∥ω∥2 ≥τ √ 6n  ≤ sup u∈Sn−1 P (R∗(Yu) ≥c5κw(ΩR)) + P  ∥ω∥2 ≥τ √ 6n  ≤c2 exp −w2(ΩR)/c2 3η2 + exp (−c1n) , which completes the proof. The theorem above shows that the lower bound of λn depends on the Gaussian width of the unit ball of R(·). Next we give its general bound for the unitarily invariant matrix norm. Theorem 8 Suppose that the symmetric gauge f associated with R(·) satisfies f(·) ≥ν∥· ∥1. Then the Gaussian width w(ΩR) is upper bounded by w(ΩR) ≤ √ d + √p ν . (18) 5 Examples Combining results in Section 4, we have that if the number of measurements n > O(w2(AR(Θ∗))), then the recovery error, with high probability, satisfies ∥ˆΘ−Θ∗∥F ≤O (ΨR(Θ∗)w(ΩR)/√n). Here we give two examples based on the trace norm [10] and the recently proposed spectral k-support norm [24] to illustrate how to bound the geometric measures and obtain the error bound. 7 5.1 Trace norm Trace norm has been widely used in low-rank matrix recovery. The trace norm of Θ∗is basically the ℓ1 norm of σ∗, i.e., f = ∥· ∥1. Now we turn to the three geometric measures. Assuming that rank(Θ∗) = r ≪d, one subgradient of ∥σ∗∥1 is θ∗= [1, 1, . . . , 1]T . Restricted compatibility constant Ψtr(Θ∗): It is obvious that assumption in Theorem 3 will hold for f by choosing η1 = 1 and η2 = 0, and we have ρ = 1. The sparse compatibility constant Φℓ1(r) is √r because ∥δ∥1 ≤√r∥δ∥2 for any r-sparse δ. Using Theorem 3, we have Ψtr(Θ∗) ≤4√r. Gaussian width w(Atr(Θ∗)): As ρ = 1, Theorem 6 implies that w(Atr(Θ∗)) ≤ p 3r(d + p −r). Gaussian width w(Ωtr): Using Theorem 8 with ν = 1, it is easy to see that w(Ωtr) ≤ √ d + √p. Putting all the results together, we have ∥ˆΘ −Θ∗∥F ≤O( p rd/n + p rp/n) holds with high probability when n > O(r(d + p −r)), which matches the bound in [8]. 5.2 Spectral k-support norm The k-support norm proposed in [2] is defined as ∥θ∥sp k ≜inf n X i ∥ui∥2 ∥ui∥0 ≤k, X i ui = θ o , (19) and its dual norm is simply given by ∥θ∥sp∗ k = ∥|θ|↓ 1:k∥2. It is shown that k-support norm has similar behavior as elastic-net regularizer [33]. Spectral k-support norm (denoted by ∥· ∥sk) of Θ∗is defined by applying the k-support norm on σ∗, i.e., f = ∥· ∥sp k , which has demonstrated better performance than trace norm in matrix completion task [24]. For simplicity, We assume that rank(Θ∗) = r = k and ∥σ∗∥2 = 1. One subgradient of ∥σ∗∥sp k can be θ∗= [σ∗ 1, σ∗ 2, . . . , σ∗ r, σ∗ r, . . . , σ∗ r]T . Restricted compatibility constant Ψsk(Θ∗): The following relation has been shown for k-support norm in [2], max{∥· ∥2, ∥· ∥1/ √ k} ≤∥· ∥sp k ≤ √ 2 max{∥· ∥2, ∥· ∥1/ √ k} . (20) Hence the assumption in Theorem 3 will hold for η1 = q 2 k and η2 = √ 2, and we have ρ = σ∗ 1/σ∗ r. The sparse compatibility constant Φsp k (r) = Φsp k (k) = 1 because ∥δ∥sp k = ∥δ∥2 for any k-sparse δ. Using Theorem 3, we have Ψsk(Θ∗) ≤2 √ 2 + √ 2 (1 + σ∗ 1/σ∗ r) = √ 2 (3 + σ∗ 1/σ∗ r). Gaussian width w(Ask(Θ∗)): Theorem 6 implies w(Ask(Θ∗)) ≤ p r(d + p −r) [2σ∗2 1 /σ∗2 r + 1]. Gaussian width w(Ωsk): The relation above for k-support norm shown in [2] also implies that ν = 1/ √ k = 1/√r. By Theorem 8, we get w(Ωsk) ≤√r( √ d + √p). Given the upper bounds for geometric measures, with high probability, we have ∥ˆΘ −Θ∗∥F ≤ O( p rd/n + p rp/n) when n > O(r(d + p −r)). The spectral k-support norm was first introduced in [24], in which no statistical results are provided. Although [20] investigated the statistical aspects of spectral k-support norm in matrix completion setting, the analysis was quite different from our setting. Hence this error bound is new in the literature. 6 Conclusions In this work, we present the recovery analysis for matrices with general structures, under the setting of sub-Gaussian measurement and noise. Base on generic chaining and Gaussian width, the recovery guarantees can be succinctly summarized in terms of some geometric measures. For the class of unitarily invariant norms, we also provide novel general bounds of these measures, which can significantly facilitate the analysis in future. Acknowledgements The research was supported by NSF grants IIS-1563950, IIS-1447566, IIS-1447574, IIS-1422557, CCF-1451986, CNS- 1314560, IIS-0953274, IIS-1029711, NASA grant NNX12AQ39A, and gifts from Adobe, IBM, and Yahoo. 8 References [1] D. Amelunxen, M. Lotz, M. B. McCoy, and J. A. Tropp. Living on the edge: Phase transitions in convex programs with random data. Inform. Inference, 3(3):224–294, 2014. [2] A. Argyriou, R. Foygel, and N. Srebro. Sparse prediction with the k-support norm. In NIPS, 2012. [3] A. Banerjee, S. Chen, F. Fazayeli, and V. Sivakumar. Estimation with norm regularization. In NIPS, 2014. [4] R. Bhatia. Matrix Analysis. Springer, 1997. [5] J. Bourgain, S. Dirksen, and J. Nelson. Toward a unified theory of sparse dimensionality reduction in Euclidean space. Geometric and Functional Analysis, 25(4):1009–1088, 2015. [6] T. T. Cai, T. Liang, and A. Rakhlin. Geometrizing Local Rates of Convergence for High-Dimensional Linear Inverse Problems. arXiv:1404.4408, 2014. [7] T. T. Cai and A. Zhang. ROP: Matrix recovery via rank-one projections. The Annals of Statistics, 43(1):102–138, 2015. [8] E. Candès and B. Recht. Exact matrix completion via convex optimization. Communications of the ACM, 55(6):111–119, 2012. [9] E. J. Candès, X. Li, Y. Ma, and J. Wright. Robust principal component analysis? Journal of the ACM, 58(3):11:1–11:37, 2011. [10] E. J. Candès and Y. Plan. Tight oracle inequalities for low-rank matrix recovery from a minimal number of noisy random measurements. IEEE Transactions on Information Theory, 57(4):2342–2359, 2011. [11] V. Chandrasekaran, B. Recht, P. A. Parrilo, and A. S. Willsky. The convex geometry of linear inverse problems. Foundations of Computational Mathematics, 12(6):805–849, 2012. [12] S. Chatterjee, S. Chen, and A. Banerjee. Generalized dantzig selector: Application to the k-support norm. In Advances in Neural Information Processing Systems (NIPS), 2014. [13] S. Chen and A. Banerjee. Structured estimation with atomic norms: General bounds and applications. In NIPS, pages 2908–2916, 2015. [14] S. S. Chen, D. L. Donoho, and M. A. Saunders. Atomic decomposition by basis pursuit. SIAM Rev., 43(1):129–159, 2001. [15] S. Dirksen. Dimensionality reduction with subgaussian matrices: a unified theory. arXiv:1402.3973, 2014. [16] S. Dirksen. Tail bounds via generic chaining. Electron. J. Probab., 20, 2015. [17] M. A. T. Figueiredo and R. D. Nowak. Ordered weighted l1 regularized regression with strongly correlated covariates: Theoretical aspects. In AISTATS, 2016. [18] Y. Gordon. Some inequalities for Gaussian processes and applications. Israel Journal of Mathematics, 50(4):265–289, 1985. [19] Y. Gordon. On Milman’s inequality and random subspaces which escape through a mesh in Rn. In Geometric Aspects of Functional Analysis, volume 1317 of Lecture Notes in Mathematics, pages 84–106. Springer, 1988. [20] S. Gunasekar, A. Banerjee, and J. Ghosh. Unified view of matrix completion under general structural constraints. In NIPS, pages 1180–1188, 2015. [21] S. Gunasekar, P. Ravikumar, and J. Ghosh. Exponential family matrix completion under structural constraints. In International Conference on Machine Learning (ICML), 2014. [22] Y. Koren, R. Bell, and C. Volinsky. Matrix factorization techniques for recommender systems. Computer, 42(8):30–37, 2009. [23] A. S. Lewis. The Convex Analysis of Unitarily Invariant Matrix Functions. Journal of Convex Analysis, 2(1-2):173–183, 1995. [24] A. M. McDonald, M. Pontil, and D. Stamos. Spectral k-support norm regularization. In NIPS, 2014. [25] S. Mendelson, A. Pajor, and N. Tomczak-Jaegermann. Reconstruction and subGaussian operators in asymptotic geometric analysis. Geometric and Functional Analysis, 17:1248–1282, 2007. [26] S. Negahban, P. Ravikumar, M. J. Wainwright, and B. Yu. A unified framework for the analysis of regularized M-estimators. Statistical Science, 27(4):538–557, 2012. [27] B. Recht, M. Fazel, and P. A. Parrilo. Guaranteed minimum-rank solutions of linear matrix equations via nuclear norm minimization. SIAM Review, 52(3):471–501, 2010. [28] V. Sivakumar, A. Banerjee, and P. Ravikumar. Beyond sub-gaussian measurements: High-dimensional structured estimation with sub-exponential designs. In NIPS, pages 2206–2214, 2015. [29] M. Talagrand. A simple proof of the majorizing measure theorem. Geometric & Functional Analysis GAFA, 2(1):118–125, 1992. [30] M. Talagrand. Upper and Lower Bounds for Stochastic Processes. Springer, 2014. [31] R. Vershynin. Introduction to the non-asymptotic analysis of random matrices. In Y. Eldar and G. Kutyniok, editors, Compressed Sensing, chapter 5, pages 210–268. Cambridge University Press, 2012. [32] X. Zhang, Y. Yu, and D. Schuurmans. Polar operators for structured sparse estimation. In NIPS, 2013. [33] H. Zou and T. Hastie. Regularization and variable selection via the elastic net. Journal of the Royal Statistical Society, Series B, 67:301–320, 2005. [34] O. Zuk and A. Wagner. Low-rank matrix recovery from row-and-column affine measurements. In International Conference on Machine Learning (ICML), 2015. 9
2016
291
6,207
Robust k-means: a Theoretical Revisit Alexandros Georgogiannis School of Electrical and Computer Engineering Technical University of Crete, Greece alexandrosgeorgogiannis at gmail.com Abstract Over the last years, many variations of the quadratic k-means clustering procedure have been proposed, all aiming to robustify the performance of the algorithm in the presence of outliers. In general terms, two main approaches have been developed: one based on penalized regularization methods, and one based on trimming functions. In this work, we present a theoretical analysis of the robustness and consistency properties of a variant of the classical quadratic k-means algorithm, the robust k-means, which borrows ideas from outlier detection in regression. We show that two outliers in a dataset are enough to breakdown this clustering procedure. However, if we focus on “well-structured” datasets, then robust k-means can recover the underlying cluster structure in spite of the outliers. Finally, we show that, with slight modifications, the most general non-asymptotic results for consistency of quadratic k-means remain valid for this robust variant. 1 Introduction Let φ : R →R+ be a lower semi-continuous (lsc) and symmetric function with minimum value φ(0). Given a set of points X n = {x1, . . . , xn} ⊂Rp, consider the generalized k-means problem (GKM) [7] min c1,...,ck Rn(c1, . . . , ck) = n ! i=1 min 1≤l≤k φ(||xi −cl||2) subject to cl ∈Rp, l ∈{1, . . . , k}. (GKM) Our aim is to find a set of k centers {c1, . . . , ck} that minimize the clustering risk Rn. These centers define a partition of X n into k clusters A = {A1, . . . , Ak}, defined as Al = " x ∈X n : l = argmin1≤j≤k φ(||x −cj||2) # , (1) where ties are broken randomly. Varying φ beyond the usual quadratic function (φ(t) = t2) we expect to gain some robustness against the outliers [9]. When φ is upper bounded by δ, the clusters are defined as follows. For l ≤k, let Al = " x ∈X n : l = argmin1≤j≤k φ(||x −cj||2) and φ(||x −cl||2) ≤δ # , (2) and define the extra cluster Ak+1 = " x ∈X n : min 1≤j≤k φ(||x −cj||2) > δ # . (3) This extra cluster contains points whose distance from their closest center, when measured according to φ(||x−cl||2), is larger than δ and, as will become clear later, it represents the set of outliers. From now on, given a set of centers {c1, . . . , ck}, we write just A = {A1, . . . , Ak} and implicitly mean A ∪Ak+1 when φ is bounded.1 1 For a similar definition for the set of clusters induced by a bounded φ see also Section 4 in [2]. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. Now, consider the following instance of (GKM), for the same set of points X n, min c1,...,ck R′ n(c1, . . . , ck) = n ! i=1 min 1≤l≤k " min oi 1 2||xi −cl −oi||2 2 + fλ(||oi||2) $ %& ' φ(||xi−cl||2) # subject to cl ∈Rp, l = 1, . . . , k, oi ∈Rp, i = 1, . . . , n, (RKM) where fλ : R →R+ is a symmetric, lsc, proper2 and bounded from below function, with minimum value fλ(0), and λ a non-negative parameter. This problem is called robust k-means (RKM) and, as we show later, it takes the form of (GKM) when φ equals the Moreau envelope of fλ. The problem (RKM) [5, 24] describes the following simple model: we allow each observation xi to take on an “error” term oi and we penalize the errors, using a group penalty, in order to encourage most of the observations’ errors to be equal to zero. We consider functions fλ where the parameter λ ≥0 has the following effect: for λ = 0, all oi’s may become arbitrary large (all observations are outliers), while, for λ →∞, all oi’s become zero (no outliers); non-trivial cases occur for intermediate values 0 < λ < ∞. Our interest is in understanding the robustness and consistency properties of (RKM). Robustness: Although robustness is an important notion, it has not been given a standard technical definition in the literature. Here, we focus on the finite sample breakdown point [18], which counts how many outliers a dataset may contain without causing significant damage in the estimates of the centers. Such damage is reflected to an arbitrarily large magnitude of at least one center. In Section 3, we show that two outliers in a dataset are enough to breakdown some centers. On the other hand, if we restrict our focus on some “well structured” datasets, then (RKM) has some remarkable robustness properties even if there is a considerable amount of contamination. Consistency: Much is known about the consistency of (GKM) when the function φ is lsc and increasing [11, 15]. It turns out that this case also includes the case of (RKM) when fλ is convex (see Section 3.1 for details). In Section 4, we show that the known non-asymptotic results about consistency of quadratic k-means may remain valid even when fλ is non-convex. 2 Preliminaries and some technical remarks We start our analysis with a few technical tools from variational analysis [19]. Here, we introduce the necessary notation and a lemma (the proofs are in the appendix). The Moreau envelope eµ f(x) with parameter µ > 0 (Definition 1.22 in [19]) of an lsc, proper, and bounded from below function f : Rp →R and the associated (possibly multivalued) proximal map P µ f : Rp → →Rp are eµ f(x) = min z∈Rp 1 2µ ||x −z||2 2 + f(z) and P µ f (x) = argminz∈Rp 1 2µ||x −z||2 2 + f(z), (4) respectively. In order to simplify the notation, in the following, we fix µ to 1 and suppress the superscript. The Moreau envelope is a continuous approximation from below of f having the same set of minimizers while the proximal map gives the (possibly non-unique) minimizing arguments in (4). For (GKM), we define Φ : Rp →R as Φ(x) := φ(||x||2). Accordingly, for (RKM), we define Fλ : Rp →R as Fλ(x) := fλ(||x||2). Thus, we obtain the following pairs: efλ(x) := min o∈R 1 2(x −o)2 + fλ(o), Pfλ(x) := argmino∈Refλ(x), x ∈R (5a) eFλ(x) := min o∈Rp 1 2||x −o||2 2 + Fλ(o), PFλ(x) := argmino∈RpeFλ(x), x ∈Rp. (5b) Obviously, (RKM) is equivalent to (GKM) when Φ(x) = eFλ(x). Every map P : R → →R throughout the text is assumed to be i) odd, i.e., P(−x) = −P(x), ii) compact-valued, iii) non-decreasing, and iv) have a closed graph. We know that for any such map there exists at least one function fλ such that P = Pfλ (Proposition 3 in [26]).3 Finally, for our purposes (outlier detection), it is natural 2We call f proper if f(x) < ∞for at least one x ∈Rn, and f(x) > −∞for all x ∈Rn; in words, if the domain of f is a nonempty set on which f is finite (see page 5 in [19]). 3 Accordingly, for a general function φ : R →[0, ∞) to be a Moreau envelope, i.e., φ(·) = efλ(·) as defined in (5a) for some function fλ, we require that φ(·) −1 2| · |2 is a concave function (Proposition 1 in [26]). 2 to require that v) P is a shrinkage rule, i.e., P(x) ≤x, ∀x ≥0. The following corollary is quite straightforward and useful in the sequel. Corollary 1. Using the notation in definitions (5a) and (5b), we have PFλ(x) = x ||x||2 Pfλ(||x||2) and eFλ(x) = efλ(||x||2). (6) Passing from a model of minimization in terms of a single problem, like (GKM), to a model in which a problem is expressed in a particular parametric form, like (RKM) with the Moreau envelope, the description of optimality conditions is opened to the incorporation of the multivalued map PFλ. The next lemma describes the necessary conditions for a center cl to be (local) optimal for (RKM). Since we deal with the general case, well known results, such as smoothness of the Moreau envelope or convexity of its subgradients, can no longer be taken for granted. Remark 1. Let Φ(·) = eFλ(·). The usual subgradient, denoted as ˆ∂Φ(x), is not sufficient to characterize the differentiability properties of R′ n in (RKM). Instead, we use the (generalized) subdifferential ∂Φ(x) (Definition 8.3 in [19]). For all x, we have ˆ∂Φ(x) ⊆∂Φ(x). Usually, the previous two sets coincide at a point x. In this case, Φ is called regular at x. However, it is common in practice that the sets ˆ∂Φ(x) and ∂Φ(x) are different (for a detailed exposition on subgradients see Chapter 8 in [19]; see also Example 1 in Appendix A.9). Lemma 1. Let PFλ : Rp → →Rp be a proximal map and set Φ(·) = eFλ(·). The necessary (generalized) first order conditions for the centers {c1, . . . , ck} ⊂Rp to be optimal for (RKM) are 0 ∈∂ " ! i∈Al Φ(xi −cl) # ⊆ ! i∈Al ∂Φ(xi −cl) ⊆ ! i∈Al (cl −xi + PFλ(xi −cl)) , l ∈{1, . . . , k}. (7) The interpretation of the set inclusion above is the following: for any center cl ∈Rp, every subgradient vector in ∂Φ(xi −cl) must be a vector associated with a vector in PFλ(xi −cl) (Theorem 10.13 in [19]). However, in general, the converse does not hold true. We note that when the proximal map is single-valued and continuous, which happens for example not only when fλ is convex, but also for many popular non-convex penalties, both set inclusions become equalities and the converse holds, i.e., every vector in PFλ(xi −cl) is a vector associated with a subgradient in ∂Φ(xi −cl) (Theorem 10.13 in [19] and Proposition 7 in [26]). We close this section with some useful remarks on the properties of the Moreau envelope as a map between two spaces of functions. There exist cases where two different functions, fλ ̸= f ′ λ, have equal Moreau envelopes, efλ = ef ′ λ (Proposition 1 in [26]), implying that two different forms of (RKM) correspond to the same φ in (GKM). For example, the proximal hull of fλ, defined as hµ fλ(x) := −eµ (−eµ fλ)(x), is a function different from fλ but has the same Moreau envelope as fλ (see also Example 1.44 in [19], Proposition 2 and Example 3 in [26]). This is the main reason we preferred the proximal map instead of the penalty function point of view for the analysis of (RKM). 3 On the breakdown properties of robust k-means In this section, we study the finite sample breakdown point of (RKM) and, more specifically, its universal breakdown point. Loosely speaking, the breakdown point measures the minimum fraction of outliers that can cause excessive damage in the estimates of the centers. Here, it will become clear how the interplay between the two forms, (GKM) and (RKM), helps the analysis. Given a dataset X n = {x1, . . . , xn} and a nonnegative integer m ≤n, we say that X n m is an m-modification if it arises from X n after replacing m of its elements by arbitrary elements x′ i ∈Rp [6]. Denote as r(λ) the non-outlier samples, as counted after solving (RKM), for a dataset X n and some λ ≥0, i.e., 4 r(λ) := ((({xi ∈X n : ||oi||2 = 0, i = 1, . . . , n} (((. (8) Then, the number of estimated outliers is q(λ) = n −r(λ). In order to simplify notation, we drop the dependence of r and q on λ. With this notation, we proceed to the following definition. 4More than one λ can yield the same r, but this does not affect our analysis. 3 Definition 1 (universal breakdown point for the centers [6]). Let n, r, k be such that n ≥r ≥k + 1. Given a dataset X n m in Rp, let {c1, . . . , ck} denote the (global) optimal set of centers for (RKM). The universal breakdown value of (RKM) is β(n, r, k) := min X n min 1≤m≤n "m n : sup X n m max 1≤l≤k ||cl||2 = ∞ # . (9) Here, X n = {x1, . . . , xn} ⊂Rp while X n m ⊂Rp runs over all m-modifications of X n. According to the concept of universal breakdown point, (RKM) breaks down at the first integer m for which there exists a set X n such that the estimates of the cluster centers become arbitrarily bad for a suitable modification X n m. Our analysis is based on Pfλ and considers two cases: those of biased and unbiased proximal maps. The former corresponds to the class of convex functions fλ, while the latter corresponds to a class of non-convex fλ. 3.1 Biased proximal maps: the case of convex fλ If fλ is convex, then Φ = eFλ is also convex while PFλ is continuous, single-valued, and satisfies [19] ||x −PFλ(x)||2 →∞ as ||x||2 →∞. (10) Proximal maps with this property are called biased since, as the l2-norm of x increases, so does the norm of the difference in (10). In this case, for each xi ∈Al, from Lemma 1 and expression (10), we have ||∇Φ(xi−cl)||2 = ||∇eFλ(xi−cl)||2 = ||cl−xi+PFλ(xi−cl)||2 →∞as ||xi−cl||2 →∞. (11) The supremum value of ||∇Φ(x −cl)||2 is closely related to the gross error sensitivity of an estimator [9]. It is interpreted as the worst possible influence which a sample x can have on cl [7]. In view of (11) and the definition of the clusters in (1), (RKM) is extremely sensitive. Although it can detect an outlier, i.e., a sample xi with a nonzero estimate for ||oi||2, it does not reject it since the influence of xi on its closest center never vanishes.5 The l1-norm, fλ(x) = λ|x|, which has Moreau envelope equal to the Huber loss-function [24], is the limiting case for the class of convex penalty functions that, although it keeps the difference ||x −PFλ(x)||2 in (10) constant and equal to λ, introduces a bias term proportional to λ in the estimate cl. The following proposition shows that (RKM) with a biased PFλ has breakdown point equal to 1 n, i.e., one outlier suffices to breakdown a center. Proposition 1. Assume k ≥2, k + 1 < r ≤n. Given a biased proximal map, there exist a dataset X n and a modification X n 1 such that (RKM) breaks down. 3.2 Unbiased proximal maps: the case of non-convex fλ Consider now the l0-(pseudo)norm on R, fλ(z) := λ|z|0 = λ2 2 {z̸=0}, and the associated hardthresholding proximal operator Pλ|·|0 : R → →R, Pλ|·|0(x) = arg minz∈R 1 2(x −z)2 + fλ(z) = ⎧ ⎨ ⎩ 0, |x| < λ, {0, x}, |x| = λ, x, |x| > λ. (12) According to Lemma 1, for p = 1 (scalar case), we have ∂Φ(xi −cl) ⊆cl −xi + Pλ|·|0(xi −cl) (12) = {0} for |xi −cl| > λ, xi ∈Al, (13) implying that Φ(xi −cl), as a function of cl, remains constant for |xi −cl| > λ. As a consequence of (13), if cl is local optimal, then 0 ∈∂{, i∈Al Φ(xi −cl)} and 0 ∈ ! i∈Al, |xi−cl|<λ (cl −xi) + ! i∈Al, |xi−cl|=λ cl −xi + Pλ|·|(xi −cl) . . (14) Depending on the value of λ, (RKM) with the l0-norm is able to ignore samples with distance from their closest center larger than λ. This is done since Pλ|·|0(xi −cl) = xi −cl whenever |xi −cl| > λ 5See the analysis in [7] about the influence function of (GKM) when φ is convex. 4 and the influence of xi vanishes. In fact, there is a whole family of non-convex fλ’s whose proximal map Pfλ satisfies Pfλ(x) = x, for all |x| > τ, (15) for some τ > 0. These are called unbiased proximal maps [13, 20] and have the useful property that, as one observation is arbitrarily modified, all estimated cluster centers remain bounded by a constant that depends only on the remaining unmodified samples. Under certain circumstances, the proof of the following proposition reveals that, if there exists one outlier in the dataset, then robust k-means will reject it. Proposition 2. Assume k ≥2, k + 1 < r ≤n, and consider the dataset X n = {x1, . . . , xn} along with its modification by one replacement y, X n 1 = {x1, . . . , xn−1, y}. If we solve (RKM) with X n 1 and an unbiased proximal map satisfying (15), then all estimates for the cluster centers remain bounded by a constant that depends only on the unmodified samples of X n. Next, we show that, even for this class of maps, there always exists a dataset that causes one of the estimated centers to breakdown as two particular observations are suitably replaced. Theorem 1 (Universal breakdown point for (RKM)). Assume k ≥2 and n ≥r ≥k + 2. Given an unbiased proximal map satisfying (15), there exist a dataset X n and a modification X n 2 , such that (RKM) breaks down. Figure 1: The top subfigure is the unmodified dataset X 9. Theorem 1 states that every subset of the modification X 9 2 (bottom subfigure) with size 8 contains an outlier. Hence, the universal breakdown point of (RKM) with an unbiased proximal map is 2 n. In Figure 1, we give a visual interpretation of Theorem 1. The top subfigure depicts the unmodified initial dataset X 9 = {x1, . . . , x9} (black circles) with a clear two-cluster structure; the bottom subfigure shows the modification X 9 2 (dashed line arrows). Theorem 1 states that (RKM) on X 9 2 fails to be robust since, every subset of X 9 2 with r = 8 points has a cluster containing an outlier. 3.3 Restricted robustness of robust k-means for well-clustered data The result of Theorem 1 is disappointing but it is not (RKM) to be blamed for the poor performance but the tight notion of the definition about the breakdown point [6, 7]; allowing any kind of contamination in a dataset is a very general assumption. In this section, we place two restrictions: i) we consider datasets where inlier samples can be covered by unions of balls with centers that are “far apart” each other, and ii) we ask a question different from the finite sample breakdown point. We want to exploit as much as possible the results of [2] concerning a new quantitative measure of noise robustness which compares the output of (RKM) on a contaminated dataset to its output on the uncontaminated version of the dataset. Our aim is to show that (RKM), with a certain class of proximal maps and datasets that are well-structured ignores the influence of outliers when grouping the inliers. First, we introduce Corollary 2 which states the form that Pfλ should have in order the results of [2] to apply to (RKM) and, second, we give details about the datasets which we consider as wellstructured. Using this corollary we are able to design proximal maps for which Theorems 3, 4, and 5 in [2] apply; otherwise, it is not clear how the analysis of [2] is valid for (RKM). Let h : R →R be a continuous function with the following properties: 1. h is odd and non-decreasing (h+(·) is used to denote its restriction on [0, ∞)); 2. h is a shrinkage rule: 0 ≤h+(x) ≤x, ∀x ∈[0, ∞); 3. the difference x −h+(x) is non-decreasing, i.e., for 0 ≤x1 ≤x2 we have x1 −h+(x1) ≤ x2 −h+(x2). 5 Define the map Pfλ(x) := ⎧ ⎨ ⎩ h(x), |x| < λ, {h(x), x}, |x| = λ, x, |x| > λ. (16) Multivaluedness of Pfλ at |x| = λ signals that efλ is non-smooth at these points. An immediate consequence for the Moreau envelope associated with the previous map is the following. Corollary 2. Let the function g : [0, ∞) →[0, ∞) be defined as g(x) := / x 0 (u −h(u))du, x ∈[0, ∞). (17) Then, the Moreau envelope associated with Pfλ in (16) is efλ(x) = min{g(|x|), g(λ)} = g(min{|x|, λ}). (18) Next, we define what it means for a dataset to be (ρ1, ρ2)-balanced; this is the class of datasets which we consider to be well-structured. Definition 2 ((ρ1, ρ2) balanced dataset [2]). Assume that a set X n ⊂Rp has a subset I (inliers), with at least n 2 samples, and the following properties: 1. I = 0k l=1 Bl, where Bl = B(bl, r) is a ball in Rp with bounded radius r and center bl; 2. ρ1|I| ≤|Bl| ≤ρ2|I| for every l, where |Bl| is the number of samples in Bl and ρ1,ρ2 > 0; 3. ||bl −bl′||2 > v for every l ̸= l′, i.e., the centers of the balls are at least v > 0 apart. Then, X n is a (ρ1, ρ2)-balanced dataset. We now state the form that Theorem 3 in [2] takes for (RKM). Theorem 2 (Restricted robustness of (RKM)). If i) efλ is as in Corollary 2, i.e., efλ(||x||2) = g(min{||x||2, λ}), ii) X n has a (ρ1, ρ2)-balanced subset of samples I with k balls, and iii) the centers of the balls are at least v > 4r + 2g−1( ρ1+ρ2 ρ1 g(r)) apart, then for λ ∈ 1 v 2, g−1 2 |I| |X n\I|(ρ1g( v 2 −2r) −(ρ1 + ρ2)g(r)) 3 3 the set of outliers X n\I has no effect on the grouping of inliers I. In other words, if {x, y} ∈Bl and {c1, . . . , ck} are the optimal centers when solving (RKM) for a λ as described before, then l = argmin1≤j≤kefλ(||x −cj||2) = argmin1≤j≤kefλ(||y −cj||2). For the sake of completeness, we give a proof of this theorem in the appendix. In a similar way, we can recast the results of Theorems 4 and 5 in [2] to be valid for (RKM). 4 On the consistency of robust k-means Let X n be a set with n independent and identically distributed random samples xi from a fixed but unknown probability distribution µ. Let ˆC be the empirical optimal set of centers, i.e., ˆC := argminc1...,ck∈RpR′ n(c1, . . . , ck). (19) The population optimal set of centers is the set C∗:= argminc1...,ck∈RpR′(c1, . . . , ck), (20) where R′ is the population clustering risk, defined as R′(c1, . . . , ck) := / min 1≤l≤k " min o∈Rp 1 2||x −cl −o||2 2 + fλ(||o||2) $ %& ' φ(||x−cl||2)=efλ(||x−cl||2) # µ(dx). (21) Loss consistency and (simply) consistency for (RKM) require, respectively, that R′ n( ˆC) n→∞ −→R′(C∗) and ˆC n→∞ −→C∗. (22) 6 In words, as the size n of the dataset X n increases, the empirical clustering risk R′ n( ˆC) converges almost surely to the minimum population risk R′(C∗) and (for n large enough) ˆC can effectively replace the optimal set C∗in quantizing the unknown probability measure µ. For the case of convex fλ, non-asymptotic results describing the rate of convergence of R′ n to R in (22) are already known ([11], Theorem 3). Noting that the Moreau envelope of a non-convex fλ belongs to a class of functions with polynomial discrimination [16] (the shatter coefficient of this class is bounded by a polynomial) we give a sketch proof of the following result. Theorem 3 (Consistency of (RKM)). Let the samples xi ∈X n, i ∈{1, . . . , n}, come from a fixed but unknown probability measure µ. For any k ≥1 and any unbiased proximal map, we have lim n→∞ER′( ˆC) →R′(C∗) and lim n→∞ ˆC →C∗(convergence in probability). (23) Theorem 3 reads like an asymptotic convergence result. However, its proof (given in the appendix) uses combinatorial tools from Vapnik-Chervonenkis theory, revealing that the non-asymptotic rate of convergence of ER′( ˆC) to R′(C∗) is of order O( 4 log n/n) (see Corollary 12.1 in [4]). 5 Relating (RKM) to trimmed k-means As the effectiveness of robust k-means on real world and synthetic data has already been evaluated [5, 24], the purpose of this section is to relate (RKM) to trimmed k-means (TKM) [7]. Trimmed kmeans is based on the methodology of “impartial trimming”, which is a combinatorial problem fundamentally different from (RKM). Despite their differences, the experiments show that, both (RKM) and (TKM) perform remarkably similar in practice. The solution of (TKM) (which is also a set of k centers) is the solution of quadratic k-means on the subsample containing ⌈n(1 −α)⌉ points with the smallest mean deviation (0 < α < 1). The only common characteristic of (RKM) and (TKM) is that they both have the same universal breakdown point, i.e., 2 n, for arbitrary datasets. Trimmed k-means takes as input a dataset X n, the number of clusters k, and a proportion of outliers a ∈(0, 1) to remove.6 A popular heuristic algorithm for (TKM) is the following. After the initialization, each iteration of (TKM) consists of the following steps: i) the distance of each observation from its closest center is computed, ii) the top ⌈an⌉observations with larger distance from its closest center are removed, iii) the remaining points are used to update the centers. The previous three steps are repeated untill the centers converge.7 As for robust k-means, we solve the (RKM) problem with a coordinate optimization procedure (see Appendix A.9 for details). The synthetic data for the experiments come from a mixture of Gaussians with 10 components and without any overlap between them.8 The number of inlier samples is 500 and each inlier xi ∈ [−1, 1]10 for i ∈{1, . . . , 500}. On top of the inliers lie 150 outliers in R10 distributed uniformly in general positions over the entire space. We consider two scenarios: in the first, the outliers lie in [−3, 3]10 (call it mild-contamination), while, in the second, the outliers lie in [−6, 6]10 (call it heavy-contamination). The parameter a in trimmed k-means (the percentage of outliers) is set to a = 0.3, while the value of the parameter λ for which (RKM) yields 150 outliers is found through a search over a grid on the set λ ∈(0, λmax) (we set λmax as the maximum distance between two points in a dataset). Both algorithms, as they are designed, require as input an initial set of k points; these points form the initial set of centers. In all experiments, both (RKM) and (TKM) take the same k vectors as initial centers, i.e., k points sampled randomly from the dataset. The statistics we use for the comparison are: i) the rand-index for clustering accuracy [17] ii) the cluster estimation error, i.e., the root mean square error between the estimated cluster centers and the sample mean of each cluster, iii) the true positive outlier detection rate, and finally, iv) the false positive outlier detection rate. In Figures 2-3, we plot the results for a proximal map Pf like the one in (16) with h(x) = αx and α = 0.005; with this choice for h, we mimic the hard-thresholding operator. The results for each scenario (accuracy, cluster estimation error, etc) are averages over 150 runs of the experiment. As seen, both algorithms share almost the same statistics in all cases. 6We use the implementation of trimmed k-means in the R package trimcluster [10]. 7The previous three steps are performed also by another robust variant of k-means, the k-means−(see [3]). 8We use the R toolbox MixSim [14] that guarantees no overlap among the 10 mixtures. 7 ● ● ● ● ● ● ● ●●● ● ● ●● ● ● ● ● ● ●● ●● ●● ● ●● ●●● ● ● ● ●●● ● ●●● ● ●●● ● ● ● ● ● ● ●● ● ● ●● 0.5 0.7 0.9 robust k−means trimmed k−means Accuracy 5.0 7.5 10.0 12.5 robust k−means trimmed k−means Center Estimation Error ● ● ● ● 0.925 0.950 0.975 robust k−meanstrimmed k−means True Positive Error Rate ● ● ● ● 0.000 0.005 0.010 0.015 robust k−meanstrimmed k−means False Positive Error Rate ●●● ● ●● ● ●● ● ● ● 0 3 6 9 robust k−means trimmed k−means Cluster Radius Estimation Error Figure 2: Performance of robust and trimmed k-means on a mixture of 10 Gaussians without overlap. On top of the 500 samples from the mixture there are 150 outliers uniformly distributed in [−1, 1]10. ● ● ●● ●●● ● ● ●● ● 0.2 0.4 0.6 0.8 robust k−means trimmed k−means Accuracy ● ● ● ● 10.0 12.5 15.0 17.5 robust k−means trimmed k−means Center Estimation Error ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● 0.00 0.25 0.50 0.75 1.00 robust k−means trimmed k−means True Positive Error Rate ● ● ● ● ● ● ● ● ● ● ●● ● ● 0.0 0.1 0.2 0.3 robust k−means trimmed k−means False Positive Error Rate 1 2 3 4 robust k−means trimmed k−means Cluster Radius Estimation Error Figure 3: The same setup as in Figure 2 except that the coordinates of each outlier lie in [−3, 3]10. ● ● ●●● ● ●●●●●●●● ● ●●●● ●● ● ● ●● ● ● ●●●●●●● ● ●●●● ● ●● ● ● 0.6 0.8 1.0 robust k−means trimmed k−means Accuracy ● ● ● ● ● ●● ● 10 20 30 robust k−means trimmed k−means Center Estimation Error ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● 0.900 0.925 0.950 0.975 1.000 robust k−meanstrimmed k−means True Positive Error Rate ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● 0.00 0.01 0.02 0.03 0.04 robust k−means trimmed k−means False Positive Error Rate 0.0 2.5 5.0 7.5 robust k−means trimmed k−means Cluster Radius Estimation Error Figure 4: Results on two spherical clusters with equal radius r, each one with 150 samples, and centers are at least 4r apart. On top of the samples lie 150 outliers uniformly distributed in [−6, 6]10. In Figure 4, we plot the results for the case of two spherical clusters in R10 with equal radius r, each one with 150 samples, and centers that are at least 4r apart from each other. The inlier samples are in [−3, 3]10. The outliers are 150 (half of the dataset is contaminated) and are uniformly distributed in [−6, 6]10. The results (accuracy, cluster estimation error, etc) are averages over 150 runs of the experiment. This configuration is a heavy contamination scenario but, due to the structure of the dataset, as expected from Theorem 2, (RKM) performs remarkably well; the same holds for (TKM). 6 Conclusions We provided a theoretical analysis for the robustness and consistency properties of a variation of the classical quadratic k-means called robust k-means (RKM). As a by-product of the analysis, we derived a detailed description of the optimality conditions for the associated minimization problem. In most cases, (RKM) shares the computational simplicity of quadratic k-means, making it a “computationally cheap” candidate for robust nearest neighbor clustering. We show that (RKM) cannot be robust against any type of contamination and any type of datasets, no matter the form of the proximal map we use. If we restrict our attention to “well-structured” datasets, then the algorithm exhibits some desirable noise robustness. As for the consistency properties, we showed that most general results for consistency of quadratic k-means still remain valid for this robust variant. Acknowledgments The author would like to thank Athanasios P. Liavas for useful comments and suggestions that improved the quality of the article. 8 References [1] Anestis Antoniadis and Jianqing Fan. Regularization of wavelet approximations. Journal of the American Statistical Association, 2011. [2] Shai Ben-David and Nika Haghtalab. Clustering in the presence of background noise. In Proceedings of the 31st International Conference on Machine Learning (ICML-14), pages 280–288, 2014. [3] Sanjay Chawla and Aristides Gionis. k-means-: A unified approach to clustering and outlier detection. SIAM. [4] L. Devroye, L. Gy¨orfi, and G. Lugosi. A Probabilistic Theory of Pattern Recognition. Stochastic Modelling and Applied Probability. Springer New York, 1997. [5] Pedro A Forero, Vassilis Kekatos, and Georgios B Giannakis. Robust clustering using outlier-sparsity regularization. Signal Processing, IEEE Transactions on, 60(8):4163–4177, 2012. [6] Mar´ıa Teresa Gallegos and Gunter Ritter. A robust method for cluster analysis. Annals of Statistics, pages 347–380, 2005. [7] Luis ´Angel Garc´ıa-Escudero and Alfonso Gordaliza. Robustness properties of k-means and trimmed k-means. Journal of the American Statistical Association, 94(447):956–969, 1999. [8] Michael R. Garey and David S. Johnson. Computers and Intractability: A Guide to the Theory of NPCompleteness. W. H. Freeman & Co., New York, NY, USA, 1979. [9] Frank R Hampel, Elvezio M Ronchetti, Peter J Rousseeuw, and Werner A Stahel. Robust statistics: the approach based on influence functions, volume 114. John Wiley & Sons, 2011. [10] Christian Hennig. trimcluster: Cluster analysis with trimming, 2012. R package version 0.1-2. [11] Tam´as Linder. Learning-theoretic methods in vector quantization. In Principles of nonparametric learning, pages 163–210. Springer, 2002. [12] Stuart P Lloyd. Least squares quantization in pcm. Information Theory, IEEE Transactions on, 28(2):129– 137, 1982. [13] Rahul Mazumder, Jerome H Friedman, and Trevor Hastie. Sparsenet: Coordinate descent with nonconvex penalties. Journal of the American Statistical Association, 2012. [14] Volodymyr Melnykov, Wei-Chen Chen, and Ranjan Maitra. MixSim: An R package for simulating data to study performance of clustering algorithms. Journal of Statistical Software, 51(12):1–25, 2012. [15] David Pollard. Strong consistency of k-means clustering. The Annals of Statistics, 9(1):135–140, 1981. [16] David Pollard. Convergence of stochastic processes. Springer Science & Business Media, 1984. [17] William M Rand. Objective criteria for the evaluation of clustering methods. Journal of the American Statistical association, 66(336):846–850, 1971. [18] G. Ritter. Robust Cluster Analysis and Variable Selection. Chapman & Hall/CRC Monographs on Statistics & Applied Probability. CRC Press, 2014. [19] R Tyrrell Rockafellar and Roger J-B Wets. Variational analysis, volume 317. Springer Science & Business Media, 2009. [20] Yiyuan She et al. Thresholding-based iterative selection procedures for model selection and shrinkage. Electronic Journal of statistics, 3:384–415, 2009. [21] Marc Teboulle. A unified continuous optimization framework for center-based clustering methods. The Journal of Machine Learning Research, 8:65–102, 2007. [22] Paul Tseng. Convergence of a block coordinate descent method for nondifferentiable minimization. Journal of optimization theory and applications, 109(3):475–494, 2001. [23] Sara Van De Geer. Empirical processes in m-estimation. June 13, 2003. Handout at New Directions in General Equilibrium Analysis (Cowles Workshop, Yale University). [24] Daniela M Witten. Penalized unsupervised learning with outliers. Statistics and its Interface, 6(2):211, 2013. [25] Stephen J Wright. Coordinate descent algorithms. Mathematical Programming, 151(1):3–34, 2015. [26] Yaoliang Yu, Xun Zheng, Micol Marchetti-Bowick, and Eric P Xing. Minimizing nonconvex nonseparable functions. In AISTATS, 2015. 9
2016
292
6,208
Tree-Structured Reinforcement Learning for Sequential Object Localization Zequn Jie1, Xiaodan Liang2, Jiashi Feng1, Xiaojie Jin1, Wen Feng Lu1, Shuicheng Yan1 1 National University of Singapore, Singapore 2 Carnegie Mellon University, USA Abstract Existing object proposal algorithms usually search for possible object regions over multiple locations and scales separately, which ignore the interdependency among different objects and deviate from the human perception procedure. To incorporate global interdependency between objects into object localization, we propose an effective Tree-structured Reinforcement Learning (Tree-RL) approach to sequentially search for objects by fully exploiting both the current observation and historical search paths. The Tree-RL approach learns multiple searching policies through maximizing the long-term reward that reflects localization accuracies over all the objects. Starting with taking the entire image as a proposal, the Tree-RL approach allows the agent to sequentially discover multiple objects via a tree-structured traversing scheme. Allowing multiple near-optimal policies, Tree-RL offers more diversity in search paths and is able to find multiple objects with a single feedforward pass. Therefore, Tree-RL can better cover different objects with various scales which is quite appealing in the context of object proposal. Experiments on PASCAL VOC 2007 and 2012 validate the effectiveness of the Tree-RL, which can achieve comparable recalls with current object proposal algorithms via much fewer candidate windows. 1 Introduction Modern state-of-the-art object detection systems [1, 2] usually adopt a two-step pipeline: extract a set of class-independent object proposals at first and then classify these object proposals with a pre-trained classifier. Existing object proposal algorithms usually search for possible object regions over dense locations and scales separately [3, 4, 5]. However, the critical correlation cues among different proposals (e.g., relative spatial layouts or semantic correlations) are often ignored. This in fact deviates from the human perception process — as claimed in [6], humans do not search for objects within each local image patch separately, but start with perceiving the whole scene and successively explore a small number of regions of interest via sequential attention patterns. Inspired by this observation, extracting one object proposal should incorporate the global dependencies of proposals by considering the cues from the previous predicted proposals and future possible proposals jointly. In this paper, in order to fully exploit global interdependency among objects, we propose a novel Tree-structured Reinforcement Learning (Tree-RL) approach that learns to localize multiple objects sequentially based on both the current observation and historical search paths. Starting from the entire image, the Tree-RL approach sequentially acts on the current search window either to refine the object location prediction or discover new objects by following a learned policy. In particular, the localization agent is trained by deep RL to learn the policy that maximizes a long-term reward for localizing all the objects, providing better global reasoning. For better training the agent, we 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. scaling local translation scaling scaling local translation local translation Figure 1: Illustration of Tree-RL. Starting from the whole image, the agent recursively selects the best actions from both action groups to obtain two next windows for each window. Red and orange solid windows are obtained by taking scaling and local translation actions, respectively. For each state, green dashed windows are the initial windows before taking actions, which are result windows from the last level. propose a novel reward stimulation that well balances the exploration of uncovered new objects and refinement of the current one for quantifying the localization accuracy improvements. The Tree-RL adopts a tree-structured search scheme that enables the agent to more accurately find objects with large variation in scales. The tree search scheme consists of two branches of pre-defined actions for each state, one for locally translating the current window and the other one for scaling the window to a smaller one. Starting from the whole image, the agent recursively selects the best action from each of the two branches according to the current observation (see Fig. 1). The proposed tree search scheme enables the agent to learn multiple near-optimal policies in searching multiple objects. By providing a set of diverse near-optimal policies, Tree-RL can better cover objects in a wide range of scales and locations. Extensive experiments on PASCAL VOC 2007 and 2012 [7] demonstrate that the proposed model can achieve a similar recall rate as the state-of-the-art object proposal algorithm RPN [5] yet using a significantly smaller number of candidate windows. Moreover, the proposed approach also provides more accurate localizations than RPN. Combined with the Fast R-CNN detector [2], the proposed approach also achieves higher detection mAP than RPN. 2 Related Work Our work is related to the works which utilize different object localization strategies instead of sliding window search in object detection. Existing works trying to reduce the number of windows to be evaluated in the post-classification can be roughly categorized into two types, i.e., object proposal algorithms and active object search with visual attention. Early object proposal algorithms typically rely on low-level image cues, e.g., edge, gradient and saliency [3, 4, 8]. For example, Selective Search [9] hierarchically merges the most similar segments to form proposals based on several low-level cues including color and texture; Edge Boxes [4] scores a set of densely distributed windows based on edge strengths fully inside the window and outputs the high scored ones as proposals. Recently, RPN [5] utilizes a Fully Convolutional Network (FCN) [10] to densely generate the proposals in each local patch based on several pre-defined “anchors” in the patch, and achieves state-of-the-art performance in object recall rate. Nevertheless, object proposal algorithms assume that the proposals are independent and usually perform window-based classification on a set of reduced windows individually, which may still be wasteful for images containing only a few objects. Another type of works attempts [11, 12, 13, 14] to reduce the number of windows with an active object detection strategy. Lampert et al. [15] proposed a branch-and-bound approach to find the highest scored windows while only evaluating a few locations. Alexe et al. [11] proposed a context driven active object searching method, which involves a nearest-neighbor search over all the training 2 scaling actions local translation actions Figure 2: Illustration of the five scaling actions and eight local translation actions. Each yellow window with dashed lines represents the next window after taking the corresponding action. images. Gonzeles-Garcia et al. [12] proposed an active search scheme to sequentially evaluate selective search object proposals based on spatial context information. Visual attention models are also related to our work. These models are often leveraged to facilitate the decision by gathering information from previous steps in the sequential decision making vision tasks. Xu et al. [16] proposed an attention model embedded in recurrent neural networks (RNN) to generate captions for images by focusing on different regions in the sequential word prediction process. Minh et al. [17] and Ba et al. [18] also relied on RNN to gradually refine the focus regions to better recognize characters. Perhaps [19] and [20] are the closest works to ours. [19] learned an optimal policy to localize a single object through deep Q-learning. To handle multiple objects cases, it runs the whole process starting from the whole image multiple times and uses an inhibition-of-return mechanism to manually mark the objects already found. [20] proposed a top-down search strategy to recursively divide a window into sub-windows. Then similar to RPN, all the visited windows serve as “anchors” to regress the locations of object bounding boxes. Compared to them, our model can localize multiple objects in a single run starting from the whole image. The agent learns to balance the exploration of uncovered new objects and the refinement of covered ones with deep Q-learning. Moreover, our top-down tree search does not produce “anchors” to regress the object locations, but provides multiple near-optimal search paths and thus requires less computation. 3 Tree-Structured Reinforcement Learning for Object Localization 3.1 Multi-Object Localization as a Markov Decision Process The Tree-RL is based on a Markov decision process (MDP) which is well suitable for modeling the discrete time sequential decision making process. The localization agent sequentially transforms image windows within the whole image by performing one of pre-defined actions. The agent aims to maximize the total discounted reward which reflects the localization accuracy of all the objects during the whole running episode. The design of the reward function enables the agent to consider the trade-off between further refinement of the covered objects and searching for uncovered new objects. The actions, state and reward of our proposed MDP model are detailed as follows. Actions: The available actions of the agent consist of two groups, one for scaling the current window to a sub-window, and the other one for translating the current window locally. Specifically, the scaling group contains five actions, each corresponding to a certain sub-window with the size 0.55 times as the current window (see Fig. 2). The local translation group is composed of eight actions, with each one changing the current window in one of the following ways: horizontal moving to left/right, vertical moving to up/down, becoming shorter/longer horizontally and becoming shorter/longer vertically, as shown in Fig. 2, which are similar to [19]. Each local translation action moves the window by 0.25 times of the current window size. The next state is then deterministically obtained after taking the last action. The scaling actions are designed to facilitate the search of objects in various scales, which cooperate well with the later discussed tree search scheme in localizing objects in a wide range of scales. The translation actions aim to perform successive changes of visual focus, playing an important role in both refining the current attended object and searching for uncovered new objects. 3 States: At each step, the state of MDP is the concatenation of three components: the feature vector of the current window, the feature vector of the whole image and the history of taken actions. The features of both the current window and the whole image are extracted using a VGG-16 [21] layer CNN model pre-trained on ImageNet. We use the feature vector of layer “fc6” in our problem. To accelerate the feature extraction, all the feature vectors are computed on top of pre-computed feature maps of the layer “conv5_3” after using ROI Pooling operation to obtain a fixed-length feature representation of the specific windows, which shares the spirit of Fast R-CNN. It is worth mentioning that the global feature here not only provides context cues to facilitate the refinement of the currently attended object, but also allows the agent to be aware of the existence of other uncovered new objects and thus make a trade-off between further refining the attended object and exploring the uncovered ones. The history of the taken actions is a binary vector that tells which actions have been taken in the past. Therefore, it implies the search paths that have already been gone through and the objects already attended by the agent. Each action is represented by a 13-d binary vector where all values are zeros except for the one corresponding to the taken action. 50 past actions are encoded in the state to save a full memory of the paths from the start. Rewards: The reward function r(s, a) reflects the localization accuracy improvements of all the objects by taking the action a under the state s. We adopt the simple yet indicative localization quality measurement, Intersection-over-Union (IoU) between the current window and the ground-truth object bounding boxes. Given the current window w and a ground-truth object bounding box g, IoU between w and g is defined as IoU(w, g) ≜area(w ∩g)/area(w ∪g). Assuming that the agent moves from state s to state s′ after taking the action a, each state s has an associated window w, and there are n ground-truth objects g1 ... gn, then the reward r(s, a) is defined as follows: r(s, a) = max 1≤i≤n sign(IoU(w′, gi) −IoU(w, gi)). (1) This reward function returns +1 or −1. Basically, if any ground-truth object bounding box has a higher IoU with the next window than the current one, the reward of the action moving from the current window to the next one is +1, and −1 otherwise. Such binary rewards reflect more clearly which actions can drive the window towards the ground-truths and thus facilitate the agent’s learning. This reward function encourages the agent to localize any objects freely, without any limitation or guidance on which object should be localized at that step. Such a free localization strategy is especially important in a multi-object localization system for covering multiple objects by running only a single episode starting from the whole image. Another key reward stimulation +5 is given to those actions which cover any ground-truth objects with an IoU greater than 0.5 for the first time. For ease of explanation, we define fi,t as the hit flag of the ground-truth object gi at the tth step which indicates whether the maximal IoU between gi and all the previously attended windows {wj}t j=1 is greater than 0.5, and assign +1 to fi,t if max1≤j≤t IoU(wj, gi) is greater than 0.5 and −1 otherwise. Then supposing the action a is taken at the tth step under state s, the reward function integrating the first-time hit reward can be written as follows: r(s, a) =    +5, if max 1≤i≤n(fi,t+1 −fi,t) > 0 max 1≤i≤n sign(IoU(w′, gi) −IoU(w, gi)), otherwise. (2) The high reward given to the actions which hit the objects with an IoU > 0.5 for the first time avoids the agent being trapped in the endless refinement of a single object and promotes the search for uncovered new objects. 3.2 Tree-Structured Search The Tree-RL relies on a tree structured search strategy to better handle objects in a wide range of scales. For each window, the actions with the highest predicted value in both the scaling action group and the local translation action group are selected respectively. The two best actions are both taken to obtain two next windows: one is a sub-window of the current one and the other is a nearby window to the current one after local translation. Such bifurcation is performed recursively by each window starting from the whole image in a top-down fashion, as illustrated in Fig. 3. With tree search, the agent is enforced to take both scaling action and local translation action simultaneously at 4 level 1 level 2 level 3 level 4 pre-computed conv5_3 feature map RoI RoI pooling layer 650-d action history 4096-d image feature 4096-d RoI feature 4096-d 1024-d 1024-d 1024-d 13 actions Figure 3: Illustration of the top-down tree search. Starting from the whole image, each window recursively takes the best actions from both action groups. Solid arrows and dashed arrows represent scaling actions and local translation actions, respectively. Figure 4: Illustration of our Q-network. The regional feature is computed on top of the pre-computed “conv5_3” feature maps extracted by VGG-16 pre-trained model. It is concatenated with the whole image feature and the history of past actions to be fed into an MLP. The MLP predicts the estimated values of the 13 actions. each state, and thus travels along multiple near-optimal search paths instead of a single optimal path. This is crucial for improving the localization accuracy for objects in different scales. Because only the scaling actions significantly change the scale of the attended window while the local translation actions almost keep the scale the same as the previous one. However there is no guarantee that the scaling actions are often taken as the agent may tend to go for large objects which are easier to be covered with an IoU larger than 0.5, compared to scaling the window to find small objects. 3.3 Deep Q-learning The optimal policy of maximizing the sum of the discounted rewards of running an episode starting from the whole image is learned with reinforcement learning. However, due to the high-dimensional continuous image input data and the model-free environment, we resort to the Q-learning algorithm combined with the function approximator technique to learn the optimal value for each state-action pair which generalizes well to unseen inputs. Specifically, we use the deep Q-network proposed by [22, 23] to estimate the value for each state-action pair using a deep neural network. The detailed architecture of our Q-network is illustrated in Fig. 4. Please note that similar to [23], we also use the pre-trained CNN as the regional feature extractor instead of training the whole hierarchy of CNN, considering the good generalization of the CNN trained on ImageNet [24]. During training, the agent runs sequential episodes which are paths from the root of the tree to its leafs. More specifically, starting from the whole image, the agent takes one action from the whole action set at each step to obtain the next state. The agent’s behavior during training is ϵ-greedy. Specifically, the agent selects a random action from the whole action set with probability ϵ, and selects a random action from the two best actions in the two action groups (i.e. scaling group and local translation group) with probability 1 −ϵ, which differs from the usual exploitation behavior that the single best action with the highest estimated value is taken. Such exploitation is more consistent with the proposed tree search scheme that requires the agent to take the best actions from both action groups. We also incorporate a replay memory following [23] to store the experiences of the past episodes, which allows one transition to be used in multiple model updates and breaks the short-time strong correlations between training samples. Each time Q-learning update is applied, a mini batch randomly sampled from the replay memory is used as the training samples. The update for the network weights at the ith iteration θi given transition samples (s, a, r, s′) is as follows: θi+1 = θi + α(r + γ max a′ Q(s′, a′; θi) −Q(s, a; θi))∇θiQ(s, a; θi), (3) where a′ represents the actions that can be taken at state s′, α is the learning rate and γ is the discount factor. 3.4 Implementation Details We train a deep Q-network on VOC 2007+2012 trainval set [7] for 25 epochs. The total number of training images is around 16,000. Each epoch is ended after performing an episode in each training 5 Table 1: Recall rates (in %) of single optimal search path RL with different numbers of search steps and under different IoU thresholds on VOC 07 testing set. We only report 50 steps instead of 63 steps as the maximal number of steps is 50. Table 2: Recall rates (in %) of Tree-RL with different numbers of search steps and under different IoU thresholds on VOC 07 testing set. 31 and 63 steps are obtained by setting the number of levels in Tree-RL to 5 and 6, respectively. # steps large/small IoU=0.5 IoU=0.6 IoU=0.7 31 large 62.2 53.1 40.2 31 small 18.9 15.6 11.2 31 all 53.8 45.8 34.5 50 large 62.3 53.2 40.4 50 small 19.0 15.8 11.3 50 all 53.9 45.9 34.8 # steps large/small IoU=0.5 IoU=0.6 IoU=0.7 31 large 78.9 69.8 53.3 31 small 23.2 12.5 4.5 31 all 68.1 58.7 43.8 63 large 83.3 76.3 61.9 63 small 39.5 28.9 15.1 63 all 74.8 67.0 52.8 image. During ϵ-greedy training, ϵ is annealed linearly from 1 to 0.1 over the first 10 epochs. Then ϵ is fixed to 0.1 in the last 15 epochs. The discount factor γ is set to 0.9. We run each episode with maximal 50 steps during training. During testing, using the tree search, one can set the number of levels of the search tree to obtain the desired number of proposals. The replay memory size is set to 800,000, which contains about 1 epoch of transitions. The mini batch size in training is set to 64. The implementations are based on the publicly available Torch7 [25] platform on a single NVIDIA GeForce Titan X GPU with 12GB memory. 4 Experimental Results We conduct comprehensive experiments on PASCAL VOC 2007 and 2012 testing sets of detection benchmarks to evaluate the proposed method. The recall rate comparisons are conducted on VOC 2007 testing set because VOC 2012 does not release the ground-truth annotations publicly and can only return a detection mAP (mean average precision) of the whole VOC 2012 testing set from the online evaluation server. Tree-RL vs Single Optimal Search Path RL: We first compare the performance in recall rate between the proposed Tree-RL and a single optimal search path RL on PASCAL VOC 2007 testing set. For the single optimal search path RL, it only selects the best action with the highest estimated value by the deep Q-network to obtain one next window during testing, instead of taking two best actions from the two action groups. As for the exploitation in the ϵ-greedy behavior during training, the agent in the single optimal path RL always takes the action with the highest estimated value in the whole action set with probability 1 −ϵ. Apart from the different search strategy in testing and exploitation behavior during training, all the actions, state and reward settings are the same as Tree-RL. Please note that for Tree-RL, we rank the proposals in the order of the tree depth levels. For example, when setting the number of levels to 5, we have 1+2+4+8+16=31 proposals. The recall rates of the single optimal search path RL and Tree-RL are shown in Table 1 and Table 2, respectively. It is found that the single optimal search path RL achieves an acceptable recall with a small number of search steps. This verifies the effectiveness of the proposed MDP model (including reward, state and actions setting) in discovering multiple objects. It does not rely on running multiple episodes starting from the whole image like [19] to find multiple objects. It is also observed that Tree-RL outperforms the single optimal search path RL in almost all the evaluation scenarios, especially for large objects1. The only case where Tree-RL is worse than the single optimal search path RL is the recall of small objects within 31 steps at IoU threshold 0.6 and 0.7. This may be because the agent performs a breadth-first-search from the whole image, and successively narrows down to a small region. Therefore, the search tree is still too shallow (i.e. 5 levels) to accurately cover all the small objects using 31 windows. Moreover, we also find that recalls of the single optimal search path RL become stable with a few steps and hardly increase with the increasing of steps. In contrast, the recalls of Tree-RL keep increasing as the levels of the search tree increase. Thanks to the multiple diverse near-optimal search paths, a better coverage of the whole image in both locations and scales is achieved by Tree-RL. 1Throughout the paper, large objects are defined as those containing more than 2,000 pixels. The rest are small objects. 6 IoU overlap threshold 0.5 0.6 0.7 0.8 0.9 1 recall 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 (a) 31 proposals per image IoU overlap threshold 0.5 0.6 0.7 0.8 0.9 1 recall 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 (b) 255 proposals per image IoU overlap threshold 0.5 0.6 0.7 0.8 0.9 1 recall 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 (c) 1023 proposals per image Tree-RL Bing EdgeBoxes Geodesic RPN SelectiveSearch # proposals 101 102 103 recall at IoU threshold 0.50 0 0.2 0.4 0.6 0.8 1 (e) Recall at 0.5 IoU # proposals 101 102 103 recall at IoU threshold 0.80 0 0.2 0.4 0.6 0.8 1 (f) Recall at 0.8 IoU # proposals 101 102 103 average recall 0 0.2 0.4 0.6 0.8 1 (g) Average recall (0.5<IoU<1) Tree-RL Bing EdgeBoxes Geodesic RPN SelectiveSearch Figure 5: Recall comparisons between Tree-RL and other state-of-the-art methods on PASCAL VOC 2007 testing set. Recall Comparison to Other Object Proposal Algorithms: We then compare the recall rates of the proposed Tree-RL and the following object proposal algorithms: BING [3], Edge Boxes [4], Geodesic Object Proposal [26], Selective Search [9] and Region Proposal Network (RPN) [5] (VGG16 network trained on VOC 07+12 trainval) on VOC 2007 testing set. All the proposals of other methods are provided by [27]. Fig. 5 (a)-(c) show the recall when varying the IoU threshold within the range [0.5,1] for different numbers of proposals. We set the number of levels in Tree-RL to 5, 8 and 10 respectively to obtain the desired numbers of proposals. Fig. 5 (e)-(g) demonstrate the recall when changing the number of proposals for different IoU thresholds. It can be seen that Tree-RL outperforms other methods including RPN significantly with a small number of proposals (e.g. 31). When increasing the number of proposals, the advantage of Tree-RL over other methods becomes smaller, especially at a low IoU threshold (e.g. 0.5). For high IoU thresholds (e.g. 0.8), Tree-RL stills performs the best among all the methods. Tree-RL also behaves well on the average recall between IoU 0.5 to 1 which is shown to correlate extremely well with detector performance [27]. Detection mAP Comparison to Faster R-CNN: We conduct experiments to evaluate the effects on object detection of the proposals generated by the proposed Tree-RL. The two baseline methods are RPN (VGG-16) + Fast R-CNN (ResNet-101) and Faster R-CNN (ResNet-101). The former one trains a Fast R-CNN detector (ResNet-101 network) on the proposals generated by a VGG-16 based RPN to make fair comparisons with the proposed Tree-RL which is also based on VGG-16 network. The latter one, i.e. Faster-RCNN (ResNet-101), is a state-of-the-art detection framework integrating both proposal generation and object detector in an end-to-end trainable system which is based on ResNet-101 network. Our method, Tree-RL (VGG-16) + Fast R-CNN (ResNet-101) trains a Fast R-CNN detector (ResNet-101 network) on the proposals generated by the VGG-16 based Tree-RL. All the Fast R-CNN detectors are fine-tuned from the publicly released ResNet-101 model pre-trained on ImageNet. The final average pooling layer and the 1000-d fc layer of ResNet-101 are replaced by a new fc layer directly connecting the last convolution layer to the output (classification and bounding box regression) during fine-tuning. For Faster-RCNN (ResNet-101), we directly use the reported results in [28]. For the other two methods, we train and test the Fast R-CNN using the top 255 proposals. Table 3 and Table 4 show the average precision of 20 categories and mAP on PASCAL VOC 2007 and 2012 testing set, respectively. It can be seen that the proposed Tree-RL combined with Fast R-CNN outperforms two baselines, especially the recent reported Faster R-CNN (ResNet-101) on the detection mAP. Considering the fact that the proposed Tree-RL relies on only VGG-16 network which is much shallower than ResNet-101 utilized by Faster R-CNN in proposal generation, the proposed Tree-RL is able to generate high-quality object proposals which are effective when used in object detection. 7 Table 3: Detection results comparison on PASCAL VOC 2007 testing set. method aero bike bird boat bottle bus car cat chair cow table dog horse mbike person plant sheep sofa train tv mAP RPN (VGG-16)+ Fast R-CNN (ResNet-101) 77.7 82.7 77.4 68.5 54.7 85.5 80.0 87.6 60.7 83.2 71.8 84.8 85.1 75.6 76.9 52.0 76.8 79.1 81.1 73.9 75.8 Faster R-CNN (ResNet-101) [28] 79.8 80.7 76.2 68.3 55.9 85.1 85.3 89.8 56.7 87.8 69.4 88.3 88.9 80.9 78.4 41.7 78.6 79.8 85.3 72.0 76.4 Tree-RL (VGG-16)+ Fast R-CNN (ResNet-101) 78.2 82.4 78.0 69.3 55.4 86.0 79.3 88.4 60.8 85.3 74.0 85.7 86.3 78.2 77.2 51.4 76.4 80.5 82.2 74.5 76.6 Table 4: Detection results comparison on PASCAL VOC 2012 testing set. method aero bike bird boat bottle bus car cat chair cow table dog horse mbike person plant sheep sofa train tv mAP RPN (VGG-16)+ Fast R-CNN (ResNet-101) 86.9 83.3 75.6 55.4 50.8 79.2 76.9 92.8 48.8 79.0 57.2 90.2 85.4 82.1 79.4 46.0 77.0 66.4 83.3 66.0 73.1 Faster R-CNN (ResNet-101) [28] 86.5 81.6 77.2 58.0 51.0 78.6 76.6 93.2 48.6 80.4 59.0 92.1 85.3 84.8 80.7 48.1 77.3 66.5 84.7 65.6 73.8 Tree-RL (VGG-16)+ Fast R-CNN (ResNet-101) 85.9 79.3 77.1 62.1 53.4 77.8 77.4 90.1 52.3 79.2 56.2 88.9 84.5 80.8 81.1 51.7 77.3 66.9 82.6 68.5 73.7 Visualizations: We show the visualization examples of the proposals generated by Tree-RL in Fig. 6. As can be seen, within only 15 proposals (the sum of level 1 to level 4), Tree-RL is able to localize the majority of objects with large or middle sizes. This validates the effectiveness of Tree-RL again in its ability to find multiple objects with a small number of windows. Figure 6: Examples of the proposals generated by Tree-RL. We only show the proposals of level 2 to level 4. Green, yellow and red windows are generated by the 2nd, 3rd and 4th level respectively. The 1st level is the whole image. 5 Conclusions In this paper, we proposed a novel Tree-structured Reinforcement Learning (Tree-RL) approach to sequentially search for objects with the consideration of global interdependency between objects. It follows a top-down tree search scheme to allow the agent to travel along multiple near-optimal paths to discovery multiple objects. The experiments on PASCAL VOC 2007 and 2012 validate the effectiveness of the proposed Tree-RL. Briefly, Tree-RL is able to achieve a comparable recall to RPN with fewer proposals and has higher localization accuracy. Combined with Fast R-CNN detector, Tree-RL achieves comparable detection mAP to the state-of-the-art detection system Faster R-CNN (ResNet-101). Acknowledgment The work of Jiashi Feng was partially supported by National University of Singapore startup grant R263-000-C08-133 and Ministry of Education of Singapore AcRF Tier One grant R-263-000-C21-112. 8 References [1] Ross Girshick, Jeff Donahue, Trevor Darrell, and Jitendra Malik. Rich feature hierarchies for accurate object detection and semantic segmentation. In CVPR, 2014. [2] Ross Girshick. Fast r-cnn. In ICCV, 2015. [3] Ming-Ming Cheng, Ziming Zhang, Wen-Yan Lin, and Philip Torr. Bing: Binarized normed gradients for objectness estimation at 300fps. In CVPR, 2014. [4] C Lawrence Zitnick and Piotr Dollár. Edge boxes: Locating object proposals from edges. In ECCV. 2014. [5] Shaoqing Ren, Kaiming He, Ross Girshick, and Jian Sun. Faster r-cnn: Towards real-time object detection with region proposal networks. In NIPS, 2015. [6] Jiri Najemnik and Wilson S Geisler. Optimal eye movement strategies in visual search. Nature, 434(7031):387–391, 2005. [7] Mark Everingham, Luc Van Gool, Christopher KI Williams, John Winn, and Andrew Zisserman. The pascal visual object classes (voc) challenge. IJCV, 88(2):303–338, 2010. [8] Bogdan Alexe, Thomas Deselaers, and Vittorio Ferrari. What is an object? In CVPR, 2010. [9] Jasper RR Uijlings, Koen EA van de Sande, Theo Gevers, and Arnold WM Smeulders. Selective search for object recognition. IJCV, 104(2):154–171, 2013. [10] Jonathan Long, Evan Shelhamer, and Trevor Darrell. Fully convolutional networks for semantic segmentation. In CVPR, 2015. [11] Bogdan Alexe, Nicolas Heess, Yee W Teh, and Vittorio Ferrari. Searching for objects driven by context. In NIPS, 2012. [12] Abel Gonzalez-Garcia, Alexander Vezhnevets, and Vittorio Ferrari. An active search strategy for efficient object class detection. In CVPR, 2015. [13] Stefan Mathe and Cristian Sminchisescu. Multiple instance reinforcement learning for efficient weaklysupervised detection in images. arXiv preprint arXiv:1412.0100, 2014. [14] Stefan Mathe, Aleksis Pirinen, and Cristian Sminchisescu. Reinforcement learning for visual object detection. In CVPR, 2016. [15] Christoph H Lampert, Matthew B Blaschko, and Thomas Hofmann. Efficient subwindow search: A branch and bound framework for object localization. TPAMI, 31(12):2129–2142, 2009. [16] Kelvin Xu, Jimmy Ba, Ryan Kiros, Aaron Courville, Ruslan Salakhutdinov, Richard Zemel, and Yoshua Bengio. Show, attend and tell: Neural image caption generation with visual attention. arXiv preprint arXiv:1502.03044, 2015. [17] Volodymyr Mnih, Nicolas Heess, Alex Graves, et al. Recurrent models of visual attention. In NIPS, 2014. [18] Jimmy Ba, Volodymyr Mnih, and Koray Kavukcuoglu. Multiple object recognition with visual attention. arXiv preprint arXiv:1412.7755, 2014. [19] Juan C Caicedo and Svetlana Lazebnik. Active object localization with deep reinforcement learning. In ICCV, 2015. [20] Yongxi Lu, Tara Javidi, and Svetlana Lazebnik. Adaptive object detection using adjacency and zoom prediction. arXiv preprint arXiv:1512.07711, 2015. [21] Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014. [22] Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Alex Graves, Ioannis Antonoglou, Daan Wierstra, and Martin Riedmiller. Playing atari with deep reinforcement learning. arXiv preprint arXiv:1312.5602, 2013. [23] Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Andrei A Rusu, Joel Veness, Marc G Bellemare, Alex Graves, Martin Riedmiller, Andreas K Fidjeland, Georg Ostrovski, et al. Human-level control through deep reinforcement learning. Nature, 518(7540):529–533, 2015. [24] Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In CVPR, 2009. [25] Ronan Collobert, Koray Kavukcuoglu, and Clément Farabet. Torch7: A matlab-like environment for machine learning. In NIPS Workshop, 2011. [26] Philipp Krähenbühl and Vladlen Koltun. Geodesic object proposals. In ECCV. 2014. [27] J. Hosang, R. Benenson, P. Dollár, and B. Schiele. What makes for effective detection proposals? TPAMI, 38(4):814–830, 2016. [28] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. arXiv preprint arXiv:1512.03385, 2015. 9
2016
293
6,209
One-vs-Each Approximation to Softmax for Scalable Estimation of Probabilities Michalis K. Titsias Department of Informatics Athens University of Economics and Business mtitsias@aueb.gr Abstract The softmax representation of probabilities for categorical variables plays a prominent role in modern machine learning with numerous applications in areas such as large scale classification, neural language modeling and recommendation systems. However, softmax estimation is very expensive for large scale inference because of the high cost associated with computing the normalizing constant. Here, we introduce an efficient approximation to softmax probabilities which takes the form of a rigorous lower bound on the exact probability. This bound is expressed as a product over pairwise probabilities and it leads to scalable estimation based on stochastic optimization. It allows us to perform doubly stochastic estimation by subsampling both training instances and class labels. We show that the new bound has interesting theoretical properties and we demonstrate its use in classification problems. 1 Introduction Based on the softmax representation, the probability of a variable y to take the value k ∈{1, . . . , K}, where K is the number of categorical symbols or classes, is modeled by p(y = k|x) = efk(x;w) PK m=1 efm(x;w) , (1) where each fk(x; w) is often referred to as the score function and it is a real-valued function indexed by an input vector x and parameterized by w. The score function measures the compatibility of input x with symbol y = k so that the higher the score is the more compatible x becomes with y = k. The most common application of softmax is multiclass classification where x is an observed input vector and fk(x; w) is often chosen to be a linear function or more generally a non-linear function such as a neural network [3, 8]. Several other applications of softmax arise, for instance, in neural language modeling for learning word vector embeddings [15, 14, 18] and also in collaborating filtering for representing probabilities of (user, item) pairs [17]. In such applications the number of symbols K could often be very large, e.g. of the order of tens of thousands or millions, which makes the computation of softmax probabilities very expensive due to the large sum in the normalizing constant of Eq. (1). Thus, exact training procedures based on maximum likelihood or Bayesian approaches are computationally prohibitive and approximations are needed. While some rigorous bound-based approximations to the softmax exists [5], they are not so accurate or scalable and therefore it would be highly desirable to develop accurate and computationally efficient approximations. In this paper we introduce a new efficient approximation to softmax probabilities which takes the form of a lower bound on the probability of Eq. (1). This bound draws an interesting connection between the exact softmax probability and all its one-vs-each pairwise probabilities, and it has several desirable properties. Firstly, for the non-parametric estimation case it leads to an approximation of the 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. likelihood that shares the same global optimum with exact maximum likelihood, and thus estimation based on the approximation is a perfect surrogate for the initial estimation problem. Secondly, the bound allows for scalable learning through stochastic optimization where data subsampling can be combined with subsampling categorical symbols. Thirdly, whenever the initial exact softmax cost function is convex the bound remains also convex. Regarding related work, there exist several other methods that try to deal with the high cost of softmax such as methods that attempt to perform the exact computations [9, 19], methods that change the model based on hierarchical or stick-breaking constructions [16, 13] and sampling-based methods [1, 14, 7, 11]. Our method is a lower bound based approach that follows the variational inference framework. Other rigorous variational lower bounds on the softmax have been used before [4, 5], however they are not easily scalable since they require optimizing data-specific variational parameters. In contrast, the bound we introduce in this paper does not contain any variational parameter, which greatly facilitates stochastic minibatch training. At the same time it can be much tighter than previous bounds [5] as we will demonstrate empirically in several classification datasets. 2 One-vs-each lower bound on the softmax Here, we derive the new bound on the softmax (Section 2.1) and we prove its optimality property when performing approximate maximum likelihood estimation (Section 2.2). Such a property holds for the non-parametric case, where we estimate probabilities of the form p(y = k), without conditioning on some x, so that the score functions fk(x; w) reduce to unrestricted parameters fk; see Eq. (2) below. Finally, we also analyze the related bound derived by Bouchard [5] and we compare it with our approach (Section 2.3). 2.1 Derivation of the bound Consider a discrete random variable y ∈{1, . . . , K} that takes the value k with probability, p(y = k) = Softmaxk(f1, . . . , fK) = efk PK m=1 efm , (2) where each fk is a free real-valued scalar parameter. We wish to express a lower bound on p(y = k) and the key step of our derivation is to re-write p(y = k) as p(y = k) = 1 1 + P m̸=k e−(fk−fm) . (3) Then, by exploiting the fact that for any non-negative numbers α1 and α2 it holds 1 + α1 + α2 ≤ 1 + α1 + α2 + α1α2 = (1 + α1)(1 + α2), and more generally it holds (1 + P i αi) ≤Q i(1 + αi) where each αi ≥0, we obtain the following lower bound on the above probability, p(y = k) ≥ Y m̸=k 1 1 + e−(fk−fm) = Y m̸=k efk efk + efm = Y m̸=k σ(fk −fm). (4) where σ(·) denotes the sigmoid function. Clearly, the terms in the product are pairwise probabilities each corresponding to the event y = k conditional on the union of pairs of events, i.e. y ∈{k, m} where m is one of the remaining values. We will refer to this bound as one-vs-each bound on the softmax probability, since it involves K −1 comparisons of a specific event y = k versus each of the K −1 remaining events. Furthermore, the above result can be stated more generally to define bounds on arbitrary probabilities as the following statement shows. Proposition 1. Assume a probability model with state space Ωand probability measure P(·). For any event A ⊂Ωand an associated countable set of disjoint events {Bi} such that ∪iBi = Ω\ A, it holds P(A) ≥ Y i P(A|A ∪Bi). (5) Proof. Given that P(A) = P (A) P (Ω) = P (A) P (A)+P i P (Bi), the result follows by applying the inequality (1 + P i αi) ≤Q i(1 + αi) exactly as done above for the softmax parameterization. 2 Remark. If the set {Bi} consists of a single event B then by definition B = Ω\ A and the bound is exact since in such case P(A|A ∪B) = P(A). Furthermore, based on the above construction we can express a full class of hierarchically ordered bounds. For instance, if we merge two events Bi and Bj into a single one, then the term P(A|A ∪ Bi)P(A|A ∪Bj) in the initial bound is replaced with P(A|A ∪Bi ∪Bj) and the associated new bound, obtained after this merge, can only become tighter. To see a more specific example in the softmax probabilistic model, assume a small subset of categorical symbols Ck, that does not include k, and denote the remaining symbols excluding k as ¯Ck so that k ∪Ck ∪¯Ck = {1, . . . , K}. Then, a tighter bound, that exists higher in the hierarchy, than the one-vs-each bound (see Eq. 4) takes the form, p(y = k) ≥Softmaxk(fk, fCk)×Softmaxk(fk, f ¯Ck) ≥Softmaxk(fk, fCk)× Y m∈¯Ck σ(fk −fm), (6) where Softmaxk(fk, fCk) = efk efk +P m∈Ck efm and Softmaxk(fk, f ¯Ck) = efk efk +P m∈¯ Ck efm . For simplicity of our presentation in the remaining of the paper we do not discuss further these more general bounds and we focus only on the one-vs-each bound. The computationally useful aspect of the bound in Eq. (4) is that it factorizes into a product, where each factor depends only on a pair of parameters (fk, fm). Crucially, this avoids the evaluation of the normalizing constant associated with the global probability in Eq. (2) and, as discussed in Section 3, it leads to scalable training using stochastic optimization that can deal with very large K. Furthermore, approximate maximum likelihood estimation based on the bound can be very accurate and, as shown in the next section, it is exact for the non-parametric estimation case. The fact that the one-vs-each bound in (4) is a product of pairwise probabilities suggests that there is a connection with Bradley-Terry (BT) models [6, 10] for learning individual skills from paired comparisons and the associated multiclass classification systems obtained by combining binary classifiers, such as one-vs-rest and one-vs-one approaches [10]. Our method differs from BT models, since we do not combine binary probabilistic models to a posteriori form a multiclass model. Instead, we wish to develop scalable approximate algorithms that can surrogate the training of multiclass softmax-based models by maximizing lower bounds on the exact likelihoods of these models. 2.2 Optimality of the bound for maximum likelihood estimation Assume a set of observation (y1, . . . , yN) where each yi ∈{1, . . . , K}. The log likelihood of the data takes the form, L(f) = log N Y i=1 p(yi) = log K Y k=1 p(y = k)Nk, (7) where f = (f1, . . . , fK) and Nk denotes the number of data points with value k. By substituting p(y = k) from Eq. (2) and then taking derivatives with respect to f we arrive at the standard stationary conditions of the maximum likelihood solution, efk PK m=1 efm = Nk N , k = 1, . . . , K. (8) These stationary conditions are satisfied for fk = log Nk + c where c ∈R is an arbitrary constant. What is rather surprising is that the same solutions fk = log Nk + c satisfy also the stationary conditions when maximizing a lower bound on the exact log likelihood obtained from the product of one-vs-each probabilities. More precisely, by replacing p(y = k) with the bound from Eq. (4) we obtain a lower bound on the exact log likelihood, F(f) = log K Y k=1  Y m̸=k efk efk + efm   Nk = X k>m log P(fk, fm), (9) where P(fk, fm) = h efk efk +efm iNk h efm efk +efm iNm is a likelihood involving only the data of the pair of states (k, m), while there exist K(K −1)/2 possible such pairs. If instead of maximizing the exact log likelihood from Eq. (7) we maximize the lower bound we obtain the same parameter estimates. 3 Proposition 2. The maximum likelihood parameter estimates fk = log Nk + c, k = 1, . . . , K for the exact log likelihood from Eq. (7) globally also maximize the lower bound from Eq. (9). Proof. By computing the derivatives of F(f) we obtain the following stationary conditions K −1 = X m̸=k Nk + Nm Nk efk efk + efm , k = 1, . . . , K, (10) which form a system of K non-linear equations over the unknowns (f1, . . . , fK). By substituting the values fk = log Nk + c we can observe that all K equations are simultaneously satisfied which means that these values are solutions. Furthermore, since F(f) is a concave function of f we can conclude that the solutions fk = log Nk + c globally maximize F(f). Remark. Not only is F(f) globally maximized by setting fk = log Nk + c, but also each pairwise likelihood P(fk, fm) in Eq. (9) is separately maximized by the same setting of parameters. 2.3 Comparison with Bouchard’s bound Bouchard [5] proposed a related bound that next we analyze in terms of its ability to approximate the exact maximum likelihood training in the non-parametric case, and then we compare it against our method. Bouchard [5] was motivated by the problem of applying variational Bayesian inference to multiclass classification and he derived the following upper bound on the log-sum-exp function, log K X m=1 efm ≤α + K X m=1 log 1 + efm−α , (11) where α ∈R is a variational parameter that needs to be optimized in order for the bound to become as tight as possible. The above induces a lower bound on the softmax probability p(y = k) from Eq. (2) that takes the form p(y = k) ≥ efk−α QK m=1 (1 + efm−α) . (12) This is not the same as Eq. (4), since there is not a value for α for which the above bound will reduce to our proposed one. For instance, if we set α = fk, then Bouchard’s bound becomes half the one in Eq. (4) due to the extra term 1 + efk−fk = 2 in the product in the denominator.1 Furthermore, such a value for α may not be the optimal one and in practice α must be chosen by minimizing the upper bound in Eq. (11). While such an optimization is a convex problem, it requires iterative optimization since there is not in general an analytical solution for α. However, for the simple case where K = 2 we can analytically find the optimal α and the optimal f parameters. The following proposition carries out this analysis and provides a clear understanding of how Bouchard’s bound behaves when applied for approximate maximum likelihood estimation. Proposition 3. Assume that K = 2 and we approximate the probabilities p(y = 1) and p(y = 2) from (2) with the corresponding Bouchard’s bounds given by ef1−α (1+ef1−α)(1+ef2−α) and ef2−α (1+ef1−α)(1+ef2−α). These bounds are used to approximate the maximum likelihood solution by maximizing a bound F(f1, f2, α) which is globally maximized for α = f1 + f2 2 , fk = 2 log Nk + c, k = 1, 2. (13) The proof of the above is given in the Supplementary material. Notice that the above estimates are biased so that the probability of the most populated class (say the y = 1 for which N1 > N2) is overestimated while the other probability is underestimated. This is due to the factor 2 that multiplies log N1 and log N2 in (13). Also notice that the solution α = f1+f2 2 is not a general trend, i.e. for K > 2 the optimal α is not the mean of fks. In such cases approximate maximum likelihood estimation based on Bouchard’s bound requires iterative optimization. Figure 1a shows some estimated softmax probabilities, using a dataset 1Notice that the product in Eq. (4) excludes the value k, while Bouchard’s bound includes it. 4 of 200 points each taking one out of ten values, where f is found by exact maximum likelihood, the proposed one-vs-each bound and Bouchard’s method. As expected estimation based on the bound in Eq. (4) gives the exact probabilities, while Bouchard’s bound tends to overestimate large probabilities and underestimate small ones. 1 2 3 4 5 6 7 8 9 10 0 0.05 0.1 0.15 0.2 0.25 Values Estimated Probability −3 −2 −1 0 1 2 −2 −1 0 1 2 0 2000 4000 6000 8000 10000 −300 −250 −200 −150 −100 −50 Iterations Lower bound (a) (b) (c) Figure 1: (a) shows the probabilities estimated by exact softmax (blue bar), one-vs-each approximation (red bar) and Bouchard’s method (green bar). (b) shows the 5-class artificial data together with the decision boundaries found by exact softmax (blue line), one-vs-each (red line) and Bouchard’s bound (green line). (c) shows the maximized (approximate) log likelihoods for the different approaches when applied to the data of panel (b) (see Section 3). Notice that the blue line in (c) is the exact maximized log likelihood while the remaining lines correspond to lower bounds. 3 Stochastic optimization for extreme classification Here, we return to the general form of the softmax probabilities as defined by Eq. (1) where the score functions are indexed by input x and parameterized by w. We consider a classification task where given a training set {xn, yn}N n=1, where yn ∈{1, . . . , K}, we wish to fit the parameters w by maximizing the log likelihood, L = log N Y n=1 efyn(xn;w) PK m=1 efm(xn;w) . (14) When the number of training instances is very large, the above maximization can be carried out by applying stochastic gradient descent (by minimizing −L) where we cycle over minibatches. However, this stochastic optimization procedure cannot deal with large values of K because the normalizing constant in the softmax couples all scores functions so that the log likelihood cannot be expressed as a sum across class labels. To overcome this, we can use the one-vs-each lower bound on the softmax probability from Eq. (4) and obtain the following lower bound on the previous log likelihood, F = log N Y n=1 Y m̸=yn 1 1 + e−[fyn(xn;w)−fm(xn;w)] = − N X n=1 X m̸=yn log  1 + e−[fyn(xn;w)−fm(xn;w)] (15) which now consists of a sum over both data points and labels. Interestingly, the sum over the labels, P m̸=yn, runs over all remaining classes that are different from the label yn assigned to xn. Each term in the sum is a logistic regression cost, that depends on the pairwise score difference fyn(xn; w)−fm(xn; w), and encourages the n-th data point to get separated from the m-th remaining class. The above lower bound can be optimized by stochastic gradient descent by subsampling terms in the double sum in Eq. (15), thus resulting in a doubly stochastic approximation scheme. Next we further discuss the stochasticity associated with subsampling remaining classes. The gradient for the cost associated with a single training instance (xn, yn) is ∇Fn = X m̸=yn σ (fm(xn; w) −fyn(xn; w)) [∇wfyn(xn; w) −∇wfm(xn; w)] . (16) This gradient consists of a weighted sum where the sigmoidal weights σ (fm(xn; w) −fyn(xn; w)) quantify the contribution of the remaining classes to the whole gradient; the more a remaining class overlaps with yn (given xn) the higher its contribution is. A simple way to get an unbiased stochastic estimate of (16) is to randomly subsample a small subset of remaining classes from the set {m|m ̸= yn}. More advanced schemes could be based on importance sampling where we introduce 5 a proposal distribution pn(m) defined on the set {m|m ̸= yn} that could favor selecting classes with large sigmoidal weights. While such more advanced schemes could reduce variance, they require prior knowledge (or on-the-fly learning) about how classes overlap with one another. Thus, in Section 4 we shall experiment only with the simple random subsampling approach and leave the above advanced schemes for future work. To illustrate the above stochastic gradient descent algorithm we simulated a two-dimensional data set of 200 instances, shown in Figure 1b, that belong to five classes. We consider a linear classification model where the score functions take the form fk(xn, w) = wT k xn and where the full set of parameters is w = (w1, . . . , wK). We consider minibatches of size ten to approximate the sum P n and subsets of remaining classes of size one to approximate P m̸=yn. Figure 1c shows the stochastic evolution of the approximate log likelihood (dashed red line), i.e. the unbiased subsampling based approximation of (15), together with the maximized exact softmax log likelihood (blue line), the non-stochastically maximized approximate lower bound from (15) (red solid line) and Bouchard’s method (green line). To apply Bouchard’s method we construct a lower bound on the log likelihood by replacing each softmax probability with the bound from (12) where we also need to optimize a separate variational parameter αn for each data point. As shown in Figure 1c our method provides a tighter lower bound than Bouchard’s method despite the fact that it does not contain any variational parameters. Also, Bouchard’s method can become very slow when combined with stochastic gradient descent since it requires tuning a separate variational parameter αn for each training instance. Figure 1b also shows the decision boundaries discovered by the exact softmax, one-vs-each bound and Bouchard’s bound. Finally, the actual parameters values found by maximizing the one-vs-each bound were remarkably close (although not identical) to the parameters found by the exact softmax. 4 Experiments 4.1 Toy example in large scale non-parametric estimation Here, we illustrate the ability to stochastically maximize the bound in Eq. (9) for the simple nonparametric estimation case. In such case, we can also maximize the bound based on the analytic formulas and therefore we will be able to test how well the stochastic algorithm can approximate the optimal/known solution. We consider a data set of N = 106 instances each taking one out of K = 104 possible categorical values. The data were generated from a distribution p(k) ∝u2 k, where each uk was randomly chosen in [0, 1]. The probabilities estimated based on the analytic formulas are shown in Figure 2a. To stochastically estimate these probabilities we follow the doubly stochastic framework of Section 3 so that we subsample data instances of minibatch size b = 100 and for each instance we subsample 10 remaining categorical values. We use a learning rate initialized to 0.5/b (and then decrease it by a factor of 0.9 after each epoch) and performed 2 × 105 iterations. Figure 2b shows the final values for the estimated probabilities, while Figure 2c shows the evolution of the estimation error during the optimization iterations. We can observe that the algorithm performs well and exhibits a typical stochastic approximation convergence. 0 2000 4000 6000 8000 10000 0 0.5 1 1.5 2 2.5 3 3.5 x 10 −4 Values Estimated Probability 0 2000 4000 6000 8000 10000 0 0.5 1 1.5 2 2.5 3 3.5 x 10 −4 Values Estimated Probability 0 0.5 1 1.5 2 x 10 5 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 Iterations Error (a) (b) (c) Figure 2: (a) shows the optimally estimated probabilities which have been sorted for visualizations purposes. (b) shows the corresponding probabilities estimated by stochastic optimization. (c) shows the absolute norm for the vector of differences between exact estimates and stochastic estimates. 4.2 Classification Small scale classification comparisons. Here, we wish to investigate whether the proposed lower bound on the softmax is a good surrogate for exact softmax training in classification. More precisely, we wish to compare the parameter estimates obtained by the one-vs-each bound with the estimates 6 obtained by exact softmax training. To quantify closeness we use the normalized absolute norm norm = |wsoftmax −w∗| |wsoftmax| , (17) where wsoftmax denotes the parameters obtained by exact softmax training and w∗denotes estimates obtained by approximate training. Further, we will also report predictive performance measured by classification error and negative log predictive density (nlpd) averaged across test data, error = (1/Ntest) Ntest X i=1 I(yi ̸= ti), nlpd = (1/Ntest) Ntest X i=1 −log p(ti|xi), (18) where ti denotes the true label of a test point and yi the predicted one. We trained the linear multiclass model of Section 3 with the following alternative methods: exact softmax training (SOFT), the onevs-each bound (OVE), the stochastically optimized one-vs-each bound (OVE-SGD) and Bouchard’s bound (BOUCHARD). For all approaches, the associated cost function was maximized together with an added regularization penalty term, −1 2λ||w||2, which ensures that the global maximum of the cost function is achieved for finite w. Since we want to investigate how well we surrogate exact softmax training, we used the same fixed value λ = 1 in all experiments. We considered three small scale multiclass classification datasets: MNIST2, 20NEWS3 and BIBTEX [12]; see Table 1 for details. Notice that BIBTEX is originally a multi-label classification dataset [2]. where each example may have more than one labels. Here, we maintained only a single label for each data point in order to apply standard multiclass classification. The maintained label was the first label appearing in each data entry in the repository files4 from which we obtained the data. Figure 3 displays convergence of the lower bounds (and for the exact softmax cost) for all methods. Recall, that the methods SOFT, OVE and BOUCHARD are non-stochastic and therefore their optimization can be carried out by standard gradient descent. Notice that in all three datasets the one-vs-each bound gets much closer to the exact softmax cost compared to Bouchard’s bound. Thus, OVE tends to give a tighter bound despite that it does not contain any variational parameters, while BOUCHARD has N extra variational parameters, i.e. as many as the training instances. The application of OVE-SGD method (the stochastic version of OVE) is based on a doubly stochastic scheme where we subsample minibatches of size 200 and subsample remaining classes of size one. We can observe that OVE-SGD is able to stochastically approach its maximum value which corresponds to OVE. Table 2 shows the parameter closeness score from Eq. (17) as well as the classification predictive scores. We can observe that OVE and OVE-SGD provide parameters closer to those of SOFT than the parameters provided by BOUCHARD. Also, the predictive scores for OVE and OVE-SGD are similar to SOFT, although they tend to be slightly worse. Interestingly, BOUCHARD gives the best classification error, even better than the exact softmax training, but at the same time it always gives the worst nlpd which suggests sensitivity to overfitting. However, recall that the regularization parameter λ was fixed to the value one and it was not optimized separately for each method using cross validation. Also notice that BOUCHARD cannot be easily scaled up (with stochastic optimization) to massive datasets since it introduces an extra variational parameter for each training instance. Large scale classification. Here, we consider AMAZONCAT-13K (see footnote 4) which is a large scale classification dataset. This dataset is originally multi-labelled [2] and here we maintained only a single label, as done for the BIBTEX dataset, in order to apply standard multiclass classification. This dataset is also highly imbalanced since there are about 15 classes having the half of the training instances while they are many classes having very few (or just a single) training instances. Further, notice that in this large dataset the number of parameters we need to estimate for the linear classification model is very large: K × (D + 1) = 2919 × 203883 parameters where the plus one accounts for the biases. All methods apart from OVE-SGD are practically very slow in this massive dataset, and therefore we consider OVE-SGD which is scalable. We applied OVE-SGD where at each stochastic gradient update we consider a single training instance (i.e. the minibatch size was one) and for that instance we randomly select five remaining classes. This 2http://yann.lecun.com/exdb/mnist 3http://qwone.com/~jason/20Newsgroups/ 4http://research.microsoft.com/en-us/um/people/manik/downloads/XC/XMLRepository. html 7 Table 1: Summaries of the classification datasets. Name Dimensionality Classes Training examples Test examples MNIST 784 10 60000 10000 20NEWS 61188 20 11269 7505 BIBTEX 1836 148 4880 2515 AMAZONCAT-13K 203882 2919 1186239 306759 Table 2: Score measures for the small scale classification datasets. SOFT BOUCHARD OVE OVE-SGD (error, nlpd) (norm, error, nlpd) (norm, error, nlpd) (norm, error, nlpd) MNIST (0.074, 0.271) (0.64, 0.073, 0.333) (0.50, 0.082, 0.287) (0.53, 0.080, 0.278) 20NEWS (0.272, 1.263) (0.65, 0.249, 1.337) (0.05, 0.276, 1.297) (0.14, 0.276, 1.312) BIBTEX (0.622, 2.793) (0.25, 0.621, 2.955) (0.09, 0.636, 2.888) (0.10, 0.633, 2.875) 0 0.5 1 1.5 2 x 10 5 −7 −6 −5 −4 −3 −2 x 10 4 Iterations Lower bound SOFT OVE OVE−SGD BOUCHARD 0 5 10 x 10 5 −4000 −3500 −3000 −2500 −2000 −1500 Iterations Lower bound 0 5 10 x 10 5 −6000 −5000 −4000 −3000 Iterations Lower bound 0 5 10 x 10 5 −1000 −800 −600 −400 −200 0 Iterations Lower bound (a) (b) (c) (d) Figure 3: (a) shows the evolution of the lower bound values for MNIST, (b) for 20NEWS and (c) for BIBTEX. For more clear visualization the bounds of the stochastic OVE-SGD have been smoothed using a rolling window of 400 previous values. (d) shows the evolution of the OVE-SGD lower bound (scaled to correspond to a single data point) in the large scale AMAZONCAT-13K dataset. Here, the plotted values have been also smoothed using a rolling window of size 4000 and then thinned by a factor of 5. leads to sparse parameter updates, where the score function parameters of only six classes (the class of the current training instance plus the remaining five ones) are updated at each iteration. We used a very small learning rate having value 10−8 and we performed five epochs across the full dataset, that is we performed in total 5 × 1186239 stochastic gradient updates. After each epoch we halve the value of the learning rate before next epoch starts. By taking into account also the sparsity of the input vectors each iteration is very fast and full training is completed in just 26 minutes in a stand-alone PC. The evolution of the variational lower bound that indicates convergence is shown in Figure 3d. Finally, the classification error in test data was 53.11% which is significantly better than random guessing or by a method that decides always the most populated class (where in AMAZONCAT-13K the most populated class occupies the 19% of the data so the error of that method is around 79%). 5 Discussion We have presented the one-vs-each lower bound on softmax probabilities and we have analyzed its theoretical properties. This bound is just the most extreme case of a full family of hierarchically ordered bounds. We have explored the ability of the bound to perform parameter estimation through stochastic optimization in models having large number of categorical symbols, and we have demonstrated this ability to classification problems. There are several directions for future research. Firstly, it is worth investigating the usefulness of the bound in different applications from classification, such as for learning word embeddings in natural language processing and for training recommendation systems. Another interesting direction is to consider the bound not for point estimation, as done in this paper, but for Bayesian estimation using variational inference. Acknowledgments We thank the reviewers for insightful comments. We would like also to thank Francisco J. R. Ruiz for useful discussions and David Blei for suggesting the name one-vs-each for the proposed method. 8 References [1] Yoshua Bengio and Jean-Sébastien Sénécal. Quick training of probabilistic neural nets by importance sampling. In Proceedings of the conference on Artificial Intelligence and Statistics (AISTATS), 2003. [2] Kush Bhatia, Himanshu Jain, Purushottam Kar, Manik Varma, and Prateek Jain. Sparse local embeddings for extreme multi-label classification. In C. Cortes, N. D. Lawrence, D. D. Lee, M. Sugiyama, and R. Garnett, editors, Advances in Neural Information Processing Systems 28, pages 730–738. Curran Associates, Inc., 2015. [3] Christopher M. Bishop. Pattern Recognition and Machine Learning (Information Science and Statistics). Springer-Verlag New York, Inc., Secaucus, NJ, USA, 2006. [4] D. Bohning. Multinomial logistic regression algorithm. Annals of the Inst. of Statistical Math, 44:197–200, 1992. [5] Guillaume Bouchard. Efficient bounds for the softmax function and applications to approximate inference in hybrid models. Technical report, 2007. [6] R. A. Bradley and M. E. Terry. Rank analysis of incomplete block designs: I. The method of paired comparisons. Biometrika, 39(3/4):324–345, 1952. [7] Jacob Devlin, Rabih Zbib, Zhongqiang Huang, Thomas Lamar, Richard Schwartz, and John Makhoul. Fast and robust neural network joint models for statistical machine translation. In Proceedings of the 52nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1370–1380, Baltimore, Maryland, June 2014. Association for Computational Linguistics. [8] Ian Goodfellow, Yoshua Bengio, and Aaron Courville. Deep learning. Book in preparation for MIT Press, 2016. [9] Siddharth Gopal and Yiming Yang. Distributed training of large-scale logistic models. In Sanjoy Dasgupta and David Mcallester, editors, Proceedings of the 30th International Conference on Machine Learning (ICML-13), pages 289–297. JMLR Workshop and Conference Proceedings, 2013. [10] Tzu-Kuo Huang, Ruby C. Weng, and Chih-Jen Lin. Generalized Bradley-Terry models and multi-class probability estimates. J. Mach. Learn. Res., 7:85–115, December 2006. [11] Shihao Ji, S. V. N. Vishwanathan, Nadathur Satish, Michael J. Anderson, and Pradeep Dubey. Blackout: Speeding up recurrent neural network language models with very large vocabularies. 2015. [12] Ioannis Katakis, Grigorios Tsoumakas, and Ioannis Vlahavas. Multilabel text classification for automated tag suggestion. In In: Proceedings of the ECML/PKDD-08 Workshop on Discovery Challenge, 2008. [13] Mohammad Emtiyaz Khan, Shakir Mohamed, Benjamin M. Marlin, and Kevin P. Murphy. A stickbreaking likelihood for categorical data analysis with latent Gaussian models. In Proceedings of the Fifteenth International Conference on Artificial Intelligence and Statistics, AISTATS 2012, La Palma, Canary Islands, April 21-23, 2012, pages 610–618, 2012. [14] Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S Corrado, and Jeff Dean. Distributed representations of words and phrases and their compositionality. In C. J. C. Burges, L. Bottou, M. Welling, Z. Ghahramani, and K. Q. Weinberger, editors, Advances in Neural Information Processing Systems 26, pages 3111–3119. Curran Associates, Inc., 2013. [15] Andriy Mnih and Yee Whye Teh. A fast and simple algorithm for training neural probabilistic language models. In Proceedings of the 29th International Conference on Machine Learning, pages 1751–1758, 2012. [16] F. Morin and Y. Bengio. Hierarchical probabilistic neural network language model. In Proceedings of the Tenth International Workshop on Artificial Intelligence and Statistics, pages 246–252. Citeseer, 2005. [17] Ulrich Paquet, Noam Koenigstein, and Ole Winther. Scalable Bayesian modelling of paired symbols. CoRR, abs/1409.2824, 2012. [18] Jeffrey Pennington, Richard Socher, and Christopher Manning. Glove: Global Vectors for Word Representation. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 1532–1543, Doha, Qatar, October 2014. Association for Computational Linguistics. [19] Sudheendra Vijayanarasimhan, Jonathon Shlens, Rajat Monga, and Jay Yagnik. Deep networks with large output spaces. CoRR, abs/1412.7479, 2014. 9
2016
294
6,210
Poisson–Gamma Dynamical Systems Aaron Schein College of Information and Computer Sciences University of Massachusetts Amherst Amherst, MA 01003 aschein@cs.umass.edu Mingyuan Zhou McCombs School of Business The University of Texas at Austin Austin, TX 78712 mingyuan.zhou@mccombs.utexas.edu Hanna Wallach Microsoft Research New York 641 Avenue of the Americas New York, NY 10011 hanna@dirichlet.net Abstract We introduce a new dynamical system for sequentially observed multivariate count data. This model is based on the gamma–Poisson construction—a natural choice for count data—and relies on a novel Bayesian nonparametric prior that ties and shrinks the model parameters, thus avoiding overfitting. We present an efficient MCMC inference algorithm that advances recent work on augmentation schemes for inference in negative binomial models. Finally, we demonstrate the model’s inductive bias using a variety of real-world data sets, showing that it exhibits superior predictive performance over other models and infers highly interpretable latent structure. 1 Introduction Sequentially observed count vectors y(1), . . . , y(T ) are the main object of study in many real-world applications, including text analysis, social network analysis, and recommender systems. Count data pose unique statistical and computational challenges when they are high-dimensional, sparse, and overdispersed, as is often the case in real-world applications. For example, when tracking counts of user interactions in a social network, only a tiny fraction of possible edges are ever active, exhibiting bursty periods of activity when they are. Models of such data should exploit this sparsity in order to scale to high dimensions and be robust to overdispersed temporal patterns. In addition to these characteristics, sequentially observed multivariate count data often exhibit complex dependencies within and across time steps. For example, scientific papers about one topic may encourage researchers to write papers about another related topic in the following year. Models of such data should therefore capture the topic structure of individual documents as well as the excitatory relationships between topics. The linear dynamical system (LDS) is a widely used model for sequentially observed data, with many well-developed inference techniques based on the Kalman filter [1, 2]. The LDS assumes that each sequentially observed V -dimensional vector r(t) is real valued and Gaussian distributed: r(t) ∼N(Φ θ(t), Σ), where θ(t) ∈RK is a latent state, with K components, that is linked to the observed space via Φ ∈RV ×K. The LDS derives its expressive power from the way it assumes that the latent states evolve: θ(t) ∼N(Π θ(t−1), ∆), where Π ∈RK×K is a transition matrix that captures between-component dependencies across time steps. Although the LDS can be linked to non-real observations via the extended Kalman filter [3], it cannot efficiently model real-world count data because inference is O((K + V )3) and thus scales poorly with the dimensionality of the data [2]. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. Many previous approaches to modeling sequentially observed count data rely on the generalized linear modeling framework [4] to link the observations to a latent Gaussian space—e.g., via the Poisson–lognormal link [5]. Researchers have used this construction to factorize sequentially observed count matrices under a Poisson likelihood, while modeling the temporal structure using well-studied Gaussian techniques [6, 7]. Most of these previous approaches assume a simple Gaussian state-space model—i.e., θ(t) ∼N(θ(t−1), ∆)—that lacks the expressive transition structure of the LDS; one notable exception is the Poisson linear dynamical system [8]. In practice, these approaches exhibit prohibitive computational complexity in high dimensions, and the Gaussian assumption may fail to accommodate the burstiness often inherent to real-world count data [9]. 1988 1991 1994 1997 2000 5 10 15 20 25 Figure 1: The time-step factors for three components inferred by the PGDS from a corpus of NIPS papers. Each component is associated with a feature factor for each word type in the corpus; we list the words with the largest factors. The inferred structure tells a familiar story about the rise and fall of certain subfields of machine learning. We present the Poisson–gamma dynamical system (PGDS)—a new dynamical system, based on the gamma–Poisson construction, that supports the expressive transition structure of the LDS. This model naturally handles overdispersed data. We introduce a new Bayesian nonparametric prior to automatically infer the model’s rank. We develop an elegant and efficient algorithm for inferring the parameters of the transition structure that advances recent work on augmentation schemes for inference in negative binomial models [10] and scales with the number of non-zero counts, thus exploiting the sparsity inherent to real-world count data. We examine the way in which the dynamical gamma– Poisson construction propagates information and derive the model’s steady state, which involves the Lambert W function [11]. Finally, we use the PGDS to analyze a diverse range of real-world data sets, showing that it exhibits excellent predictive performance on smoothing and forecasting tasks and infers interpretable latent structure, an example of which is depicted in figure 1. 2 Poisson–Gamma Dynamical Systems We can represent a data set of V -dimensional sequentially observed count vectors y(1), . . . , y(T ) as a V × T count matrix Y . The PGDS models a single count y(t) v ∈{0, 1, . . .} in this matrix as follows: y(t) v ∼Pois(δ(t) PK k=1φvk θ(t) k ) and θ(t) k ∼Gam(τ0 PK k2=1πkk2 θ(t−1) k2 , τ0), (1) where the latent factors φvk and θ(t) k are both positive, and represent the strength of feature v in component k and the strength of component k at time step t, respectively. The scaling factor δ(t) captures the scale of the counts at time step t, and therefore obviates the need to rescale the data as a preprocessing step. We refer to the PGDS as stationary if δ(t) =δ for t = 1, . . . , T. We can view the feature factors as a V ×K matrix Φ and the time-step factors as a T ×K matrix Θ. Because we can also collectively view the scaling factors and time-step factors as a T ×K matrix Ψ, where element ψtk = δ(t) θ(t) k , the PGDS is a form of Poisson matrix factorization: Y ∼Pois(Φ ΨT ) [12, 13, 14, 15]. The PGDS is characterized by its expressive transition structure, which assumes that each time-step factor θ(t) k is drawn from a gamma distribution, whose shape parameter is a linear combination of the K factors at the previous time step. The latent transition weights π11, . . . , πk1k2, . . . , πKK, which we can view as a K × K transition matrix Π, capture the excitatory relationships between components. The vector θ(t) = (θ(t) 1 , . . . , θ(t) K ) has an expected value of E[θ(t) | θ(t−1), Π] = Π θ(t−1) and is therefore analogous to a latent state in the the LDS. The concentration parameter τ0 determines the variance of θ(t)—specifically, Var (θ(t) | θ(t−1), Π) = (Π θ(t−1)) τ −1 0 —without affecting its expected value. To model the strength of each component, we introduce K component weights ν = (ν1, . . . , νK) and place a shrinkage prior over them. We assume that the time-step factors and transition weights for component k are tied to its component weight νk. Specifically, we define the following structure: θ(1) k ∼Gam(τ0 νk, τ0) and πk ∼Dir(ν1νk, . . . , ξνk . . . , νKνk) and νk ∼Gam( γ0 K , β), (2) 2 where πk = (π1k, . . . , πKk) is the kth column of Π. Because PK k1=1 πk1k = 1, we can interpret πk1k as the probability of transitioning from component k to component k1. (We note that interpreting Π as a stochastic transition matrix relates the PGDS to the discrete hidden Markov model.) For a fixed value of γ0, increasing K will encourage many of the component weights to be small. A small value of νk will shrink θ(1) k , as well as the transition weights in the kth row of Π. Small values of the transition weights in the kth row of Π therefore prevent component k from being excited by the other components and by itself. Specifically, because the shape parameter for the gamma prior over θ(t) k involves a linear combination of θ(t−1) and the transition weights in the kth row of Π, small transition weights will result in a small shape parameter, shrinking θ(t) k . Thus, the component weights play a critical role in the PGDS by enabling it to automatically turn off any unneeded capacity and avoid overfitting. Finally, we place Dirichlet priors over the feature factors and draw the other parameters from a noninformative gamma prior: φk = (φ1k, . . . , φV k) ∼Dir(η0, . . . , η0) and δ(t), ξ, β ∼Gam(ϵ0, ϵ0). The PGDS therefore has four positive hyperparameters to be set by the user: τ0, γ0, η0, and ϵ0. Bayesian nonparametric interpretation: As K →∞, the component weights and their corresponding feature factor vectors constitute a draw G = P∞ k=1 νk1φk from a gamma process GamP (G0, β), where β is a scale parameter and G0 is a finite and continuous base measure over a complete separable metric space Ω[16]. Models based on the gamma process have an inherent shrinkage mechanism because the number of atoms with weights greater than ε > 0 follows a Poisson distribution with a finite mean—specifically, Pois(γ0 R ∞ ε dν ν−1 exp (−β ν)), where γ0 = G0(Ω) is the total mass under the base measure. This interpretation enables us to view the priors over Π and Θ as novel stochastic processes, which we call the column-normalized relational gamma process and the recurrent gamma process, respectively. We provide the definitions of these processes in the supplementary material. Non-count observations: The PGDS can also model non-count data by linking the observed vectors to latent counts. A binary observation b(t) v can be linked to a latent Poisson count y(t) v via the Bernoulli– Poisson distribution: b(t) v = 1(y(t) v ≥1) and y(t) v ∼Pois(δ(t) PK k=1 φvk θ(t) k ) [17]. Similarly, a real-valued observation r(t) v can be linked to a latent Poisson count y(t) v via the Poisson randomized gamma distribution [18]. Finally, Basbug and Engelhardt [19] recently showed that many types of non-count matrices can be linked to a latent count matrix via the compound Poisson distribution [20]. 3 MCMC Inference MCMC inference for the PGDS consists of drawing samples of the model parameters from their joint posterior distribution given an observed count matrix Y and the model hyperparameters τ0, γ0, η0, ϵ0. In this section, we present a Gibbs sampling algorithm for drawing these samples. At a high level, our approach is similar to that used to develop Gibbs sampling algorithms for several other related models [10, 21, 22, 17]; however, we extend this approach to handle the unique properties of the PGDS. The main technical challenge is sampling Θ from its conditional posterior, which does not have a closed form. We address this challenge by introducing a set of auxiliary variables. Under this augmented version of the model, marginalizing over Θ becomes tractable and its conditional posterior has a closed form. Moreover, by introducing these auxiliary variables and marginalizing over Θ, we obtain an alternative model specification that we can subsequently exploit to obtain closed-form conditional posteriors for Π, ν, and ξ. We marginalize over Θ by performing a “backward filtering” pass, starting with θ(T ). We repeatedly exploit the following three definitions in order to do this. Definition 1: If y· =PN n=1 yn, where yn ∼Pois(θn) are independent Poisson-distributed random variables, then (y1, . . . , yN) ∼Mult(y·, ( θ1 PN n=1 θn , . . . , θN PN n=1 θn )) and y· ∼Pois(PN n=1 θn) [23, 24]. Definition 2: If y ∼Pois(c θ), where c is a constant, and θ ∼Gam(a, b), then y ∼NB(a, c b+c) is a negative binomial–distributed random variable. We can equivalently parameterize it as y ∼NB(a, g(ζ)), where g(z) = 1 −exp (−z) is the Bernoulli–Poisson link [17] and ζ = ln (1 + c b). Definition 3: If y ∼NB(a, g(ζ)) and l ∼CRT(y, a) is a Chinese restaurant table–distributed random variable, then y and l are equivalently jointly distributed as y ∼SumLog(l, g(ζ)) and l ∼Pois(a ζ) [21]. The sum logarithmic distribution is further defined as the sum of l independent and identically logarithmic-distributed random variables—i.e., y = Pl i=1 xi and xi ∼Log(g(ζ)). 3 Marginalizing over Θ: We first note that we can re-express the Poisson likelihood in equation 1 in terms of latent subcounts [13]: y(t) v = y(t) v· = PK k=1 y(t) vk and y(t) vk ∼Pois(δ(t) φvk θ(t) k ). We then define y(t) ·k = PV v=1 y(t) vk . Via definition 1, we obtain y(t) ·k ∼Pois(δ(t) θ(t) k ) because PV v=1 φvk = 1. We start with θ(T ) k because none of the other time-step factors depend on it in their priors. Via definition 2, we can immediately marginalize over θ(T ) k to obtain the following equation: y(T ) ·k ∼NB(τ0 PK k2=1πkk2 θ(T −1) k2 , g(ζ(T ))), where ζ(T ) = ln (1 + δ(T ) τ0 ). (3) Next, we marginalize over θ(T −1) k . To do this, we introduce an auxiliary variable: l(T ) k ∼ CRT(y(T ) ·k , τ0 PK k2=1πkk2 θ(T −1) k2 ). We can then re-express the joint distribution over y(T ) ·k and l(T ) k as y(T ) ·k ∼SumLog(l(T ) k , g(ζ(T )) and l(T ) k ∼Pois(ζ(T ) τ0 PK k2=1πkk2 θ(T −1) k2 ). (4) We are still unable to marginalize over θ(T −1) k because it appears in a sum in the parameter of the Poisson distribution over l(T ) k ; however, via definition 1, we can re-express this distribution as l(T ) k = l(T ) k· = PK k2=1l(T ) kk2 and l(T ) kk2 ∼Pois(ζ(T ) τ0 πkk2 θ(T −1) k2 ). (5) We then define l(T ) ·k = PK k1=1 l(T ) k1k. Again via definition 1, we can express the distribution over l(T ) ·k as l(T ) ·k ∼Pois(ζ(T ) τ0 θ(T −1) k ). We note that this expression does not depend on the transition weights because PK k1=1 πk1k = 1. We also note that definition 1 implies that (l(T ) 1k , . . . , l(T ) Kk) ∼Mult(l(T ) ·k , (π1, . . . , πK)). Next, we introduce m(T −1) k = y(T −1) ·k + l(T ) ·k , which summarizes all of the information about the data at time steps T −1 and T via y(T −1) ·k and l(T ) ·k , respectively. Because y(T −1) ·k and l(T ) ·k are both Poisson distributed, we can use definition 1 to obtain m(T −1) k ∼Pois(θ(T −1) k (δ(T −1) + ζ(T ) τ0)). (6) Combining this likelihood with the gamma prior in equation 1, we can marginalize over θ(T −1) k : m(T −1) k ∼NB(τ0 PK k2=1πkk2 θ(T −2) k2 , g(ζ(T −1))), where ζ(T −1) = ln (1 + δ(T −1) τ0 + ζ(T )). (7) We then introduce l(T −1) k ∼CRT(m(T −1) k , τ0 PK k2=1 πkk2 θ(T −2) k2 ) and re-express the joint distribution over l(T −1) k and m(T −1) k as the product of a Poisson and a sum logarithmic distribution, similar to equation 4. This then allows us to marginalize over θ(T −2) k to obtain a negative binomial distribution. We can repeat the same process all the way back to t = 1, where marginalizing over θ(1) k yields m(1) k ∼ NB(τ0 νk, g(ζ(1))). We note that just as m(t) k summarizes all of the information about the data at time steps t, . . . , T, ζ(t) = ln (1 + δ(t) τ0 + ζ(t+1)) summarizes all of the information about δ(t), . . . , δ(T ). l(1) k· ∼Pois(ζ(1) τ0 νk) (l(t) 1k , . . . , l(t) Kk) ∼Mult(l(t) ·k , (π1k, . . . , πKk)) for t > 1 l(t) k· = PK k2=1l(t) kk2 for t > 1 m(t) k ∼SumLog(l(t) k· , g(ζ(t))) (y(t) ·k , l(t+1) ·k ) ∼Bin(m(t) k , ( δ(t) δ(t)+ζ(t+1)τ0 , ζ(t+1)τ0 δ(t)+ζ(t+1)τ0 )) (y(t) 1k , . . . , y(t) V k) ∼Mult(y(t) ·k , (φ1k, . . . , φV k)) Figure 2: Alternative model specification. As we mentioned previously, introducing these auxiliary variables and marginalizing over Θ also enables us to define an alternative model specification that we can exploit to obtain closed-form conditional posteriors for Π, ν, and ξ. We provide part of its generative process in figure 2. We define m(T ) k = y(T ) ·k + l(T +1) ·k , where l(T +1) ·k = 0, and ζ(T +1) = 0 so that we can present the alternative model specification concisely. Steady state: We draw particular attention to the backward pass ζ(t) = ln (1 + δ(t) τ0 + ζ(t+1)) that propagates information about δ(t), . . . , δ(T ) as we marginalize over Θ. In the case of the stationary PGDS—i.e., δ(t) = δ—the backward pass has a fixed point that we define in the following proposition. 4 Proposition 1: The backward pass has a fixed point of ζ⋆= −W−1(−exp (−1 −δ τ0 )) −1 −δ τ0 . The function W−1(·) is the lower real part of the Lambert W function [11]. We prove this proposition in the supplementary material. During inference, we perform the O(T) backward pass repeatedly. The existence of a fixed point means that we can assume the stationary PGDS is in its steady state and replace the backward pass with an O(1) computation1 of the fixed point ζ∗. To make this assumption, we must also assume that l(T +1) ·k ∼Pois(ζ⋆τ0 θ(T ) k ) instead of l(T +1) ·k = 0. We note that an analogous steady-state approximation exists for the LDS and is routinely exploited to reduce computation [25]. Gibbs sampling algorithm: Given Y and the hyperparameters, Gibbs sampling involves resampling each auxiliary variable or model parameter from its conditional posterior. Our algorithm involves a “backward filtering” pass and a “forward sampling” pass, which together form a “backward filtering– forward sampling” algorithm. We use −\ Θ(≥t) to denote everything excluding θ(t), . . . , θ(T ). Sampling the auxiliary variables: This step is the “backward filtering” pass. For the stationary PGDS in its steady state, we first compute ζ∗and draw (l(T +1) ·k | −) ∼Pois(ζ⋆τ0 θ(T ) k ). For the other variants of the model, we set l(T +1) ·k = ζ(T +1) = 0. Then, working backward from t = T, . . . , 2, we draw (l(t) k· | −\ Θ(≥t)) ∼CRT(y(t) ·k + l(t+1) ·k , τ0 PK k2=1πkk2 θ(t−1) k2 ) and (8) (l(t) k1 , . . . , l(t) kK | −\ Θ(≥t)) ∼Mult(l(t) k· , ( πk1 θ(t−1) 1 PK k2=1 πkk2 θ(t−1) k2 , . . . , πkK θ(t−1) K PK k2=1 πkk2 θ(t−1) k2 )). (9) After using equations 8 and 9 for all k = 1, . . . , K, we then set l(t) ·k = PK k1=1l(t) k1k. For the non-steadystate variants, we also set ζ(t) = ln (1 + δ(t) τ0 + ζ(t+1)); for the steady-state variant, we set ζ(t) = ζ∗. Sampling Θ: We sample Θ from its conditional posterior by performing a “forward sampling” pass, starting with θ(1). Conditioned on the values of l(2) ·k , . . . , l(T +1) ·k and ζ(2), . . . , ζ(T +1) obtained via the “backward filtering” pass, we sample forward from t = 1, . . . , T, using the following equations: (θ(1) k | −\ Θ) ∼Gam(y(1) ·k + l(2) ·k + τ0 νk, τ0 + δ(1) + ζ(2) τ0) and (10) (θ(t) k | −\ Θ(≥t)) ∼Gam(y(t) ·k + l(t+1) ·k + τ0 PK k2=1πkk2 θ(t−1) k2 , τ0 + δ(t) + ζ(t+1) τ0). (11) Sampling Π: The alternative model specification, with Θ marginalized out, assumes that (l(t) 1k , . . . , l(t) Kk) ∼Mult(l(t) ·k , (π1k, . . . , πKk)). Therefore, via Dirichlet–multinomial conjugacy, (πk | −\ Θ) ∼Dir(ν1νk + PT t=1l(t) 1k , . . . , ξνk + PT t=1l(t) kk, . . . , νKνk + PT t=1l(t) Kk). (12) Sampling ν and ξ: We use the alternative model specification to obtain closed-form conditional posteriors for νk and ξ. First, we marginalize over πk to obtain a Dirichlet–multinomial distribution. When augmented with a beta-distributed auxiliary variable, the Dirichlet–multinomial distribution is proportional to the negative binomial distribution [26]. We draw such an auxiliary variable, which we use, along with negative binomial augmentation schemes, to derive closed-form conditional posteriors for νk and ξ. We provide these posteriors, along with their derivations, in the supplementary material. We also provide the conditional posteriors for the remaining model parameters—Φ, δ(1), . . . , δ(T ), and β—which we obtain via Dirichlet–multinomial, gamma–Poisson, and gamma–gamma conjugacy. 4 Experiments In this section, we compare the predictive performance of the PGDS to that of the LDS and that of gamma process dynamic Poisson factor analysis (GP-DPFA) [22]. GP-DPFA models a single count in Y as y(t) v ∼Pois(PK k=1 λk φvk θ(t) k ), where each component’s time-step factors evolve as a simple gamma Markov chain, independently of those belonging to the other components: θ(t) k ∼Gam(θ(t−1) k , c(t)). We consider the stationary variants of all three models.2 We used five data sets, and tested each model on two time-series prediction tasks: smoothing—i.e., predicting y(t) v given 1Several software packages contain fast implementations of the Lambert W function. 2We used the pykalman Python library for the LDS and implemented GP-DPFA ourselves. 5 y(1) v , . . . , y(t−1) v , y(t+1) v , . . . , y(T ) v —and forecasting—i.e., predicting y(T +s) v given y(1) v , . . . , y(T ) v for some s ∈{1, 2, . . .} [27]. We provide brief descriptions of the data sets below before reporting results. Global Database of Events, Language, and Tone (GDELT): GDELT is an international relations data set consisting of country-to-country interaction events of the form “country i took action a toward country j at time t,” extracted from news corpora. We created five count matrices, one for each year from 2001 through 2005. We treated directed pairs of countries i→j as features and counted the number of events for each pair during each day. We discarded all pairs with fewer than twenty-five total events, leaving T = 365, around V ≈9, 000, and three to six million events for each matrix. Integrated Crisis Early Warning System (ICEWS): ICEWS is another international relations event data set extracted from news corpora. It is more highly curated than GDELT and contains fewer events. We therefore treated undirected pairs of countries i↔j as features. We created three count matrices, one for 2001–2003, one for 2004–2006, and one for 2007–2009. We counted the number of events for each pair during each three-day time step, and again discarded all pairs with fewer than twenty-five total events, leaving T = 365, around V ≈3, 000, and 1.3 to 1.5 million events for each matrix. State-of-the-Union transcripts (SOTU): The SOTU corpus contains the text of the annual SOTU speech transcripts from 1790 through 2014. We created a single count matrix with one column per year. After discarding stopwords, we were left with T = 225, V = 7, 518, and 656,949 tokens. DBLP conference abstracts (DBLP): DBLP is a database of computer science research papers. We used the subset of this corpus that Acharya et al. used to evaluate GP-DPFA [22]. This subset corresponds to a count matrix with T = 14 columns, V = 1, 771 unique word types, and 13,431 tokens. NIPS corpus (NIPS): The NIPS corpus contains the text of every NIPS conference paper from 1987 to 2003. We created a single count matrix with one column per year. We treated unique word types as features and discarded all stopwords, leaving T = 17, V = 9, 836, and 3.1 million tokens. 1988 1992 1995 1998 2002 0 500 1000 1500 2000 2500 Mar 2009 Jun 2009 Aug 2009 Oct 2009 Dec 2009 0 100 200 300 400 500 600 700 800 900 Israel↔Palestine Russia↔USA China↔USA Iraq↔USA Figure 3: y(t) v over time for the top four features in the NIPS (left) and ICEWS (right) data sets. Experimental design: For each matrix, we created four masks indicating some randomly selected subset of columns to treat as held-out data. For the event count matrices, we held out six (noncontiguous) time steps between t = 2 and t = T −3 to test the models’ smoothing performance, as well as the last two time steps to test their forecasting performance. The other matrices have fewer time steps. For the SOTU matrix, we therefore held out five time steps between t = 2 and t = T −2, as well as t = T. For the NIPS and DBLP matrices, which contain substantially fewer time steps than the SOTU matrix, we held out three time steps between t = 2 and t = T −2, as well as t = T. For each matrix, mask, and model combination, we ran inference four times.3 For the PGDS and GP-DPFA, we performed 6,000 Gibbs sampling iterations, imputing the missing counts from the “smoothing” columns at the same time as sampling the model parameters. We then discarded the first 4,000 samples and retained every hundredth sample thereafter. We used each of these samples to predict the missing counts from the “forecasting” columns. We then averaged the predictions over the samples. For the LDS, we ran EM to learn the model parameters. Then, given these parameter values, we used the Kalman filter and smoother [1] to predict the held-out data. In practice, for all five data sets, V was too large for us to run inference for the LDS, which is O((K + V )3) [2], using all V features. We therefore report results from two independent sets of experiments: one comparing all three models using only the top V = 1, 000 features for each data set, and one comparing the PGDS to just GP-DPFA using all the features. The first set of experiments is generous to the LDS because the Poisson distribution is well approximated by the Gaussian distribution when its mean is large. 3For the PGDS and GP-DPFA we used K = 100. For the PGDS, we set τ0 = 1, γ0 = 50, η0 = ϵ0 = 0.1. We set the hyperparameters of GP-DPFA to the values used by Acharya et al. [22]. For the LDS, we used the default hyperparameters for pykalman, and report results for the best-performing value of K ∈{5, 10, 25, 50}. 6 Table 1: Results for the smoothing (“S”) and forecasting (“F”) tasks. For both error measures, lower values are better. We also report the number of time steps T and the burstiness ˆB of each data set. Mean Relative Error (MRE) Mean Absolute Error (MAE) T ˆB Task PGDS GP-DPFA LDS PGDS GP-DPFA LDS GDELT 365 1.27 S 2.335 ±0.19 2.951 ±0.32 3.493 ±0.53 9.366 ±2.19 9.278 ±2.01 10.098 ±2.39 F 2.173 ±0.41 2.207 ±0.42 2.397 ±0.29 7.002 ±1.43 7.095 ±1.67 7.047 ±1.25 ICEWS 365 1.10 S 0.808 ±0.11 0.877 ±0.12 1.023 ±0.15 2.867 ±0.56 2.872 ±0.56 3.104 ±0.60 F 0.743 ±0.17 0.792 ±0.17 0.937 ±0.31 1.788 ±0.47 1.894 ±0.50 1.973 ±0.62 SOTU 225 1.45 S 0.233 ±0.01 0.238 ±0.01 0.260 ±0.01 0.408 ±0.01 0.414 ±0.01 0.448 ±0.00 F 0.171 ±0.00 0.173 ±0.00 0.225 ±0.01 0.323 ±0.00 0.314 ±0.00 0.370 ±0.00 DBLP 14 1.64 S 0.417 ±0.03 0.422 ±0.05 0.405 ±0.05 0.771 ±0.03 0.782 ±0.06 0.831 ±0.01 F 0.322 ±0.00 0.323 ±0.00 0.369 ±0.06 0.747 ±0.01 0.715 ±0.00 0.943 ±0.07 NIPS 17 0.33 S 0.415 ±0.07 0.392 ±0.07 1.609 ±0.43 29.940 ±2.95 28.138 ±3.08 108.378 ±15.44 F 0.343 ±0.01 0.312 ±0.00 0.642 ±0.14 62.839 ±0.37 52.963 ±0.52 95.495 ±10.52 Results: We used two error measures—mean relative error (MRE) and mean absolute error (MAE)— to compute the models’ smoothing and forecasting scores for each matrix and mask combination. We then averaged these scores over the masks. For the data sets with multiple matrices, we also averaged the scores over the matrices. The two error measures differ as follows: MRE accommodates the scale of the data, while MAE does not. This is because relative error—which we define as |y(t) v −ˆy(t) v | 1+y(t) v , where y(t) v is the true count and ˆy(t) v is the prediction—divides the absolute error by the true count and thus penalizes overpredictions more harshly than underpredictions. MRE is therefore an especially natural choice for data sets that are bursty—i.e., data sets that exhibit short periods of activity that far exceed their mean. Models that are robust to these kinds of overdispersed temporal patterns are less likely to make overpredictions following a burst, and are therefore rewarded accordingly by MRE. In table 1, we report the MRE and MAE scores for the experiments using the top V = 1, 000 features. We also report the average burstiness of each data set. We define the burstiness of feature v in matrix Y to be ˆBv = 1 T −1 PT −1 t=1 |y(t+1) v −y(t) v | ˆµv , where ˆµv = 1 T PT t=1 y(t) v . For each data set, we calculated the burstiness of each feature in each matrix, and then averaged these values to obtain an average burstiness score ˆB. The PGDS outperformed the LDS and GP-DPFA on seven of the ten prediction tasks when we used MRE to measure the models’ performance; when we used MAE, the PGDS outperformed the other models on five of the tasks. In the supplementary material, we also report the results for the experiments comparing the PGDS to GP-DPFA using all the features. The superiority of the PGDS over GP-DPFA is even more pronounced in these results. We hypothesize that the difference between these models is related to the burstiness of the data. For both error measures, the only data set for which GP-DPFA outperformed the PGDS on both tasks was the NIPS data set. This data set has a substantially lower average burstiness score than the other data sets. We provide visual evidence in figure 3, where we display y(t) v over time for the top four features in the NIPS and ICEWS data sets. For the former, the features evolve smoothly; for the latter, they exhibit bursts of activity. Exploratory analysis: We also explored the latent structure inferred by the PGDS. Because its parameters are positive, they are easy to interpret. In figure 1, we depict three components inferred from the NIPS data set. By examining the time-step factors and feature factors for these components, we see that they capture the decline of research on neural networks between 1987 and 2003, as well as the rise of Bayesian methods in machine learning. These patterns match our prior knowledge. In figure 4, we depict the three components with the largest component weights inferred by the PGDS from the 2003 GDELT matrix. The top component is in blue, the second is in green, and the third is in red. For each component, we also list the sixteen features (directed pairs of countries) with the largest feature factors. The top component (blue) is most active in March and April, 2003. Its features involve USA, Iraq (IRQ), Great Britain (GBR), Turkey (TUR), and Iran (IRN), among others. This component corresponds to the 2003 invasion of Iraq. The second component (green) exhibits a noticeable increase in activity immediately after April, 2003. Its top features involve Israel (ISR), Palestine (PSE), USA, and Afghanistan (AFG). The third component exhibits a large burst of activity 7 Jan 2003 Mar 2003 May 2003 Aug 2003 Oct 2003 Dec 2003 1 2 3 4 5 6 Figure 4: The time-step factors for the top three components inferred by the PGDS from the 2003 GDELT matrix. The top component is in blue, the second is in green, and the third is in red. For each component, we also list the features (directed pairs of countries) with the largest feature factors. in August, 2003, but is otherwise inactive. Its top features involve North Korea (PRK), South Korea (KOR), Japan (JPN), China (CHN), Russia (RUS), and USA. This component corresponds to the six-party talks—a series of negotiations between these six countries for the purpose of dismantling North Korea’s nuclear program. The first round of talks occurred during August 27–29, 2003. 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 Figure 5: The latent transition structure inferred by the PGDS from the 2003 GDELT matrix. Top: The component weights for the top ten components, in decreasing order from left to right; two of the weights are greater than one. Bottom: The transition weights in the corresponding subset of the transition matrix. This structure means that all components are likely to transition to the top two components. In figure 5, we also show the component weights for the top ten components, along with the corresponding subset of the transition matrix Π. There are two components with weights greater than one: the components that are depicted in blue and green in figure 4. The transition weights in the corresponding rows of Π are also large, meaning that other components are likely to transition to them. As we mentioned previously, the GDELT data set was extracted from news corpora. Therefore, patterns in the data primarily reflect patterns in media coverage of international affairs. We therefore interpret the latent structure inferred by the PGDS in the following way: in 2003, the media briefly covered various major events, including the six-party talks, before quickly returning to a backdrop of the ongoing Iraq war and Israeli– Palestinian relations. By inferring the kind of transition structure depicted in figure 5, the PGDS is able to model persistent, long-term temporal patterns while accommodating the burstiness often inherent to real-world count data. This ability is what enables the PGDS to achieve superior predictive performance over the LDS and GP-DPFA. 5 Summary We introduced the Poisson–gamma dynamical system (PGDS)—a new Bayesian nonparametric model for sequentially observed multivariate count data. This model supports the expressive transition structure of the linear dynamical system, and naturally handles overdispersed data. We presented a novel MCMC inference algorithm that remains efficient for high-dimensional data sets, advancing recent work on augmentation schemes for inference in negative binomial models. Finally, we used the PGDS to analyze five real-world data sets, demonstrating that it exhibits superior smoothing and forecasting performance over two baseline models and infers highly interpretable latent structure. Acknowledgments We thank David Belanger, Roy Adams, Kostis Gourgoulias, Ben Marlin, Dan Sheldon, and Tim Vieira for many helpful conversations. This work was supported in part by the UMass Amherst CIIR and in part by NSF grants SBE-0965436 and IIS-1320219. Any opinions, findings, conclusions, or recommendations are those of the authors and do not necessarily reflect those of the sponsors. 8 References [1] R. E. Kalman. A new approach to linear filtering and prediction problems. Journal of Basic Engineering, 82(1):35–45, 1960. [2] Z. Ghahramani and S. T. Roweis. Learning nonlinear dynamical systems using an EM algorithm. In Advances in Neural Information Processing Systems, pages 431–437, 1998. [3] S. S. Haykin. Kalman Filtering and Neural Networks. 2001. [4] P. McCullagh and J. A. Nelder. Generalized linear models. 1989. [5] M. G. Bulmer. On fitting the Poisson lognormal distribution to species-abundance data. Biometrics, pages 101–110, 1974. [6] D. M. Blei and J. D. Lafferty. Dynamic topic models. In Proceedings of the 23rd International Conference on Machine Learning, pages 113–120, 2006. [7] L. Charlin, R. Ranganath, J. McInerney, and D. M. Blei. Dynamic Poisson factorization. In Proceedings of the 9th ACM Conference on Recommender Systems, pages 155–162, 2015. [8] J. H. Macke, L. Buesing, J. P. Cunningham, B. M. Yu, K. V. Krishna, and M. Sahani. Empirical models of spiking in neural populations. In Advances in Neural Information Processing Systems, pages 1350–1358, 2011. [9] J. Kleinberg. Bursty and hierarchical structure in streams. Data Mining and Knowledge Discovery, 7(4):373–397, 2003. [10] M. Zhou and L. Carin. Augment-and-conquer negative binomial processes. In Advances in Neural Information Processing Systems, pages 2546–2554, 2012. [11] R. Corless, G. Gonnet, D. E. G. Hare, D. J. Jeffrey, and D. E. Knuth. On the LambertW function. Advances in Computational Mathematics, 5(1):329–359, 1996. [12] J. Canny. GaP: A factor model for discrete data. In Proceedings of the 27th Annual International ACM SIGIR Conference on Research and Development in Information Retrieval, pages 122–129, 2004. [13] A. T. Cemgil. Bayesian inference for nonnegative matrix factorisation models. Computational Intelligence and Neuroscience, 2009. [14] M. Zhou, L. Hannah, D. Dunson, and L. Carin. Beta-negative binomial process and Poisson factor analysis. In Proceedings of the 15th International Conference on Artificial Intelligence and Statistics, 2012. [15] P. Gopalan, J. Hofman, and D. Blei. Scalable recommendation with Poisson factorization. In Proceedings of the 31st Conference on Uncertainty in Artificial Intelligence, 2015. [16] T. S. Ferguson. A Bayesian analysis of some nonparametric problems. The Annals of Statistics, 1(2):209–230, 1973. [17] M. Zhou. Infinite edge partition models for overlapping community detection and link prediction. In Proceedings of the 18th International Conference on Artificial Intelligence and Statistics, pages 1135–1143, 2015. [18] M. Zhou, Y. Cong, and B. Chen. Augmentable gamma belief networks. Journal of Machine Learning Research, 17(163):1–44, 2016. [19] M. E. Basbug and B. Engelhardt. Hierarchical compound Poisson factorization. In Proceedings of the 33rd International Conference on Machine Learning, 2016. [20] R. M. Adelson. Compound Poisson distributions. OR, 17(1):73–75, 1966. [21] M. Zhou and L. Carin. Negative binomial process count and mixture modeling. IEEE Transactions on Pattern Analysis and Machine Intelligence, 37(2):307–320, 2015. [22] A. Acharya, J. Ghosh, and M. Zhou. Nonparametric Bayesian factor analysis for dynamic count matrices. Proceedings of the 18th International Conference on Artificial Intelligence and Statistics, 2015. [23] J. F. C. Kingman. Poisson Processes. Oxford University Press, 1972. [24] D. B. Dunson and A. H. Herring. Bayesian latent variable models for mixed discrete outcomes. Biostatistics, 6(1):11–25, 2005. [25] W. J. Rugh. Linear System Theory. Pearson, 1995. [26] M. Zhou. Nonparametric Bayesian negative binomial factor analysis. arXiv:1604.07464. [27] J. Durbin and S. J. Koopman. Time Series Analysis by State Space Methods. Oxford University Press, 2012. 9
2016
295
6,211
Convergence guarantees for kernel-based quadrature rules in misspecified settings Motonobu Kanagawa∗, Bharath K Sriperumbudur†, Kenji Fukumizu∗ ∗The Institute of Statistical Mathematics, Tokyo 190-8562, Japan †Department of Statistics, Pennsylvania State University, University Park, PA 16802, USA kanagawa@ism.ac.jp, bks18@psu.edu, fukumizu@ism.ac.jp Abstract Kernel-based quadrature rules are becoming important in machine learning and statistics, as they achieve super-√n convergence rates in numerical integration, and thus provide alternatives to Monte Carlo integration in challenging settings where integrands are expensive to evaluate or where integrands are high dimensional. These rules are based on the assumption that the integrand has a certain degree of smoothness, which is expressed as that the integrand belongs to a certain reproducing kernel Hilbert space (RKHS). However, this assumption can be violated in practice (e.g., when the integrand is a black box function), and no general theory has been established for the convergence of kernel quadratures in such misspecified settings. Our contribution is in proving that kernel quadratures can be consistent even when the integrand does not belong to the assumed RKHS, i.e., when the integrand is less smooth than assumed. Specifically, we derive convergence rates that depend on the (unknown) lesser smoothness of the integrand, where the degree of smoothness is expressed via powers of RKHSs or via Sobolev spaces. 1 Introduction Numerical integration, or quadrature, is a fundamental task in the construction of various statistical and machine learning algorithms. For instance, in Bayesian learning, numerical integration is generally required for the computation of marginal likelihood in model selection, and for the marginalization of parameters in fully Bayesian prediction, etc [20]. It also offers flexibility to probabilistic modeling, since, e.g., it enables us to use a prior that is not conjugate with a likelihood function. Let P be a (known) probability distribution on a measurable space X and f be an integrand on X. Suppose that the integral ∫ f(x)dP(x) has no closed form solution. One standard form of numerical integration is to approximate the integral as a weighted sum of function values f(X1), . . . , f(Xn) by appropriately choosing the points X1, . . . , Xn ∈X and weights w1, . . . , wn ∈R: n ∑ i=1 wif(Xi) ≈ ∫ f(x)dP(x). (1) For example, the simplest Monte Carlo method generates the points X1, . . . , Xn as an i.i.d. sample from P and uses equal weights w1 = · · · = wn = 1/n. Convergence rates of such Monte Carlo methods are of the form n−1/2, which can be slow for practical purposes. For instance, in situations where the evaluation of the integrand requires heavy computations, n should be small and Monte Carlo would perform poorly; such situations typically appear in modern scientific and engineering applications, and thus quadratures with faster convergence rates are desirable [18]. One way of achieving faster rates is to exploit one’s prior knowledge or assumption about the integrand (e.g. the degree of smoothness) in the construction of a weighted point set {(wi, Xi)}n i=1. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. Reproducing kernel Hilbert spaces (RKHS) have been successfully used for this purpose, with examples being Quasi Monte Carlo (QMC) methods based on RKHSs [13] and Bayesian quadratures [19]; see e.g. [11, 6] and references therein. We will refer to such methods as kernel-based quadrature rules or simply kernel quadratures in this paper. A kernel quadrature assumes that the integrand f belongs to an RKHS consisting of smooth functions (such as Sobolev spaces), and constructs the weighted points {(wi, Xi)}n i=1 so that the worst case error in that RKHS is small. Then the error rate of the form n−b, b ≥1, which is much faster than the rates of Monte Carlo methods, will be guaranteed with b being a constant representing the degree of smoothness of the RKHS (e.g., the order of differentiability). Because of this nice property, kernel quadratures have been studied extensively in recent years [7, 3, 5, 2, 17] and have started to find applications in machine learning and statistics [23, 14, 12, 6]. However, if the integrand f does not belong to the assumed RKHS (i.e. if f is less smooth than assumed), there is no known theoretical guarantee for fast convergence rate or even the consistency of kernel quadratures. Such misspecification is likely to happen if one does not have the full knowledge of the integrand—such situations typically occur when the integrand is a black box function. As an illustrative example, let us consider the problem of illumination integration in computer graphics (see e.g. Sec. 5.2.4 of [6]). The task is to compute the total amount of light arriving at a camera in a virtual environment. This is solved by numerical integration with integrand f(x) being the intensity of light arriving at the camera from a direction x (angle). The value f(x) is only given by simulation of the environment for each x, so f is a black box function. In such a situation, one’s assumption on the integrand can be misspecified. Establishing convergence guarantees for such misspecified settings has been recognized as an important open problem in the literature [6, Section 6]. Contributions. The main contribution of this paper is in providing general convergence guarantees for kernel-based quadrature rules in misspecified settings. Specifically, we make the following contributions: • In Section 4, we prove that consistency can be guaranteed even when the integrand f does not belong to the assumed RKHS. Specifically, we derive a convergence rate of the form n−θb, where 0 < θ ≤1 is a constant characterizing the (relative) smoothness of the integrand. In other words, the integration error decays at a speed depending on the (unknown) smoothness of the integrand. This guarantee is applicable to kernel quadratures that employ random points. • We apply this result to QMC methods called lattice rules (with randomized points) and the quadrature rule by Bach [2], for the setting where the RKHS is a Korobov space. We show that even when the integrand is less smooth than assumed, the error rate becomes the same as for the case when the (unknown) smoothness is known; namely, we show that these methods are adaptive to the unknown smoothness of the integrand. • In Section 5, we provide guarantees for kernel quadratures with deterministic points, by focusing on specific cases where the RKHS is a Sobolev space W r 2 of order r ∈N (the order of differentiability). We prove that consistency can be guaranteed even if f ∈W s 2 \W r 2 where s ≤r, i.e., the integrand f belongs to a Sobolev space W s 2 of lesser smoothness. We derive a convergence rate of the form n−bs/r, where the ratio s/r determines the relative degree of smoothness. • As an important consequence, we show that if weighted points {(wi, Xi)}m i=1 achieve the optimal rate in W r 2 , then they also achieve the optimal rate in W s 2 . In other words, to achieve the optimal rate for the integrand f belonging to W s 2 , one does not need to know the smoothness s of the integrand; one only needs to know its upper-bound s ≤r. This paper is organized as follows. In Section 2, we describe kernel-based quadrature rules, and formally state the goal and setting of theoretical analysis in Section 3. We present our contributions in Sections 4 and 5. Proofs are collected in the supplementary material. Related work. Our work is close to [17] in spirit, which discusses situations where the true integrand is smoother than assumed (which is complementary to ours) and proposes a control functional approach to make kernel quadratures adaptive to the (unknown) greater smoothness. We also note that there are certain quadratures which are adaptive to less smooth integrands [8, 9, 10]. On the other hand, our aim here is to provide general theoretical guarantees that are applicable to a wide class of kernel-based quadrature rules. 2 Notation. For x ∈Rd, let {x} ∈[0, 1]d be its fractional parts. For a probability distribution P on a measurable space X, let L2(P) be the Hilbert space of square-integrable functions with respect to P. If P is the Lebesgue measure on X ⊂Rd, let L2(X) := L2(P) and further L2 := L2(Rd). Let Cs 0 := Cs 0(Rd) be the set of all functions on Rd that are continuously differentiable up to order s ∈N and vanish at infinity. Given a function f and weighted points {(wi, Xi)}n i=1, Pf := ∫ f(x)dP(x) and Pnf := ∑n i=1 wif(Xi) denote the integral and its numerical approximation, respectively. 2 Kernel-based quadrature rules Suppose that one has prior knowledge on certain properties of the integrand f (e.g. its order of differentiability). A kernel quadrature exploits this knowledge by expressing it as that f belongs to a certain RKHS H that possesses those properties, and then constructing weighted points {(wi, Xi)}n i=1 so that the error of integration is small for every function in the RKHS. More precisely, it pursues the minimax strategy that aims to minimize the worst case error defined by en(P; H) := sup f∈H:∥f∥H≤1 |Pf −Pnf| := sup f∈H:∥f∥H≤1 ∫ f(x)dP(x) − n ∑ i=1 wif(Xi) , (2) where ∥· ∥H denotes the norm of H. The use of RKHS is beneficial (compared to other function spaces), because it results in an analytic expression of the worst case error (2) in terms of the reproducing kernel. Namely, one can explicitly compute (2) in the construction of {(wi, Xi)}n i=1 as a criterion to be minimized. Below we describe this as well as examples of kernel quadratures. 2.1 The worst case error in RKHS Let X be a measurable space and H be an RKHS of functions on X with k : X × X →R as the bounded reproducing kernel. By the reproducing property, it is easy to verify that Pf = ⟨f, mP ⟩H and Pnf = ⟨f, mPn⟩H for all f ∈H, where ⟨·, ·⟩H denotes the inner-product of H, and mP := ∫ k(·, x)dP(x) ∈H, mPn := n ∑ i=1 wik(·, Xi) ∈H. Therefore, the worst case error (2) can be written as the difference between mP and mPn: sup ∥f∥H≤1 |Pf −Pnf| = sup ∥f∥H≤1 ⟨f, mP −mPn⟩H = ∥mP −mPn∥H, (3) where ∥· ∥H denotes the norm of H defined by ∥f∥H = √ ⟨f, f⟩H for f ∈H. From (3), it is easy to see that for every f ∈H, the integration error |Pnf −Pf| is bounded by the worst case error: |Pnf −Pf| ≤∥f∥H∥mP −mPn∥H = ∥f∥Hen(P; H). We refer the reader to [21, 11] for details of these derivations. Using the reproducing property of k, the r.h.s. of (3) can be alternately written as: en(P; H) = v u u t ∫∫ k(x, ˜x)dP(x)dP(˜x) −2 n ∑ i=1 wi ∫ k(x, Xi)dP(x) + n ∑ i=1 n ∑ j=1 wiwjk(Xi, Xj). (4) The integrals in (4) are known in closed form for many pairs of k and P; see e.g. Table 1 of [6]. For instance, if P is the uniform distribution on X = [0, 1]d, and k is the Korobov kernel described below, then ∫ k(y, x)dP(x) = 1 for all y ∈X. To pursue the aforementioned minimax strategy, one can explicitly use the formula (4) to minimize the worst case error (2). Often H is chosen as an RKHS consisting of smooth functions, and the degree of smoothness is what a user specifies; we describe this in the example below. 2.2 Examples of RKHSs: Korobov spaces The setting X = [0, 1]d is standard in the literature on numerical integration; see e.g. [11]. In this setting, Korobov spaces and Sobolev spaces have been widely used as RKHSs.1 We describe the former here; for the latter, see Section 5. 1Korobov spaces are also known as periodic Sobolev spaces in the literature [4, p.318]. 3 Korobov space on [0, 1]. The Korobov space W α Kor([0, 1]) of order α ∈N is an RKHS whose kernel kα is given by kα(x, y) := 1 + (−1)α−1(2π)2α (2α)! B2α({x −y}), (5) where B2α denotes the 2α-th Bernoulli polynomial. W α Kor([0, 1]) consists of periodic functions on [0, 1] whose derivatives up to (α −1)-th are absolutely continuous and the α-th derivative belongs to L2([0, 1]) [16]. Therefore the order α represents the degree of smoothness of functions in W α Kor([0, 1]). Korobov space on [0, 1]d. For d ≥2, the kernel of the Korobov space is given as the product of one-dimensional kernels (5): kα,d(x, y) := kα(x1, y1) · · · kα(xd, yd), x := (x1, . . . , xd)T , y := (y1, . . . , yd)T ∈[0, 1]d. (6) The induced Korobov space W α Kor([0, 1]d) on [0, 1]d is then the tensor product of one-dimensional Korobov spaces: W α Kor([0, 1]d) := W α Kor([0, 1]) ⊗· · · ⊗W α Kor([0, 1]). Therefore it consists of functions having square-integrable mixed partial derivatives up to the order α in each variable. This means that by using the kernel (6) in the computation of (4), one can make an assumption that the integrand f has smoothness of degree α in each variable. In other words, one can incorporate one’s knowledge or belief on f into the construction of weighted points {(wi, Xi)} via the choice of α. 2.3 Examples of kernel-based quadrature rules We briefly describe examples of kernel-based quadrature rules. Quasi Monte Carlo (QMC). These methods typically focus on the setting where X = [0, 1]d with P being the uniform distribution on [0, 1]d, and employ equal weights wi = · · · = wn = 1/n. Popular examples are lattice rules and digital nets/sequences. Points X1, . . . , Xn are selected in a deterministic way so that the worst case error (4) is as small as possible. Then such deterministic points are often randomized to obtain unbiased integral estimators, as we will explain in Section 4.2. For a review of these methods, see [11]. For instance, lattice rules generate X1, . . . , Xn in the following way (for simplicity assume n is prime). Let z ∈{1, . . . , n−1}d be a generator vector. Then the points are defined as Xi = {iz/n} ∈ [0, 1]d for i = 1, . . . , n. Here z is selected so that the resulting worst case error (2) becomes as small as possible. The CBC (Component-By-Component) construction is a fast method that makes use of the formula (4) to achieve this; see Section 5 of [11] and references therein. Lattice rules applied to the Korobov space W α Kor([0, 1]d) can achieve the rate en(P, W α Kor([0, 1]d) = O(n−α+ξ) for the worst case error with ξ > 0 arbitrarily small [11, Theorem 5.12]. Bayesian quadratures. These methods are applicable to general X and P, and employ nonuniform weights. Points X1, . . . , Xn are selected either deterministically or randomly. Given the points being fixed, weights w1, . . . , wn are obtained by minimizing (4), which can be done by solving a linear system of size n. Such methods are called Bayesian quadratures, since the resulting estimate Pnf in this case is exactly the posterior mean of the integral Pf given “observations” {(Xi, f(Xi))}n i=1, with the prior on the integrand f being Gaussian Process with the covariance kernel k. We refer to [6] for these methods. For instance, the algorithm by Bach [2] proceeds as follows, for the case of H being a Korobov space W α Kor([0, 1]d) and P being the uniform distribution on [0, 1]d: (i) Generate points X1, . . . , Xn independently from the uniform distribution on [0, 1]d; (ii) Compute weights w1, . . . , wn by minimizing (4), with the constraint ∑n i=1 w2 i ≤4/n. Bach [2] proved that this procedure gives the error rate en(P, W α Kor([0, 1]d) = O(n−α+ξ) for ξ > 0 arbitrarily small.2 3 Setting and objective of theoretical analysis We now formally state the setting and objective of our theoretical analysis in general form. Let P be a known distribution and H be an RKHS. Our starting point is that weighted points {(wi, Xi)}n i=1 2Note that in [2], the degree of smoothness is expressed in terms of s := αd. 4 are already constructed for each n ∈N by some quadrature rule3, and that these provide consistent approximation of P in terms of the worst case error: en(P; H) = ∥mP −mPn∥H = O(n−b) (n →∞), (7) where b > 0 is some constant. Here we do not specify the quadrature algorithm explicitly, to establish results applicable to a wide class of kernel quadratures simultaneously. Let f be an integrand that is not included in the RKHS: f /∈H. Namely, we consider a misspecified setting. Our aim is to derive convergence rates for the integration error |Pnf −Pf| = n ∑ i=1 wif(Xi) − ∫ f(x)dP(x) based on the assumption (7). This will be done by assuming a certain regularity condition on f, which expresses (unknown) lesser smoothness of f. For example, this is the case when the weighted points are constructed by assuming the Korobov space of order α ∈N, but the integrand f belongs to the Korobov space of order β < α: in this case, f is less smooth than assumed. As mentioned in Section 1, such misspecification is likely to happen if f is a black box function. But misspecification also occurs even when one has the full knowledge of f. As explained in Section 2.1, the kernel k should be chosen so that the integrals in (4) allow analytic solutions w.r.t. P. Namely, the distribution P determines an available class of kernels (e.g. Gaussian kernels for a Gaussian distribution), and therefore the RKHS of a kernel from this class may not contain the integrand of interest. This situation can be seen in application to random Fourier features [23], for example. 4 Analysis 1: General RKHS with random points We first focus on kernel quadratures with random points. To this end, we need to introduce certain assumptions on (i) the construction of weighted points {(wi, Xi)}n i=1 and on (ii) the smoothness of the integrand f; we discuss them in Sections 4.1 and 4.2, respectively. In particular, we introduce the notion of powers of RKHSs [22] in Section 4.2, which enables us to characterize the (relative) smoothness of the integrand. We then state our main result in Section 4.3, and illustrate it with QMC lattice rules (with randomization) and the Bayesian quadrature by Bach [2] in Korobov RKHSs. 4.1 Assumption on random points X1, . . . , Xn Assumption 1. There exists a probability distribution Q on X satisfying the following properties: (i) P has a bounded density function w.r.t. Q; (ii) there is a constant D > 0 independent of n, such that ( E [ 1 n n ∑ i=1 g2(Xi) ])1/2 ≤D∥g∥L2(Q), ∀g ∈L2(Q), (8) where E[·] denotes the expectation w.r.t. the joint distribution of X1, . . . , Xn. Assumption 1 is fairly general, as it does not specify any distribution of points X1, . . . , Xn, but just requires that the expectations over these points satisfy (8) for some distribution Q (also note that it allows the points to be dependent). For instance, let us consider the case where X1, . . . , Xn are independently generated from a user-specified distribution Q; in this case, Q serves as a proposal distribution. Then (8) holds for D = 1 with equality. Examples in this case include the Bayesian quadratures by Bach [2] and Briol et al. [6] with random points. Assumption 1 is also satisfied by QMC methods that apply randomization to deterministic points, which is common in the literature [11, Sections 2.9 and 2.10]. Popular methods for randomization are random shift and scrambling, both of which satisfy Assumption 1 for D = 1 with equality, where Q( = P) is the uniform distribution on X = [0, 1]d. This is because in general, randomization is applied to make an integral estimator unbiased: E[ 1 n ∑n i=1 f(Xi)] = ∫ [0,1]d f(x)dx [11, Section 2.9]. For instance, the random shift is done as follows. Let x1, . . . , xn ∈[0, 1]d be deterministic points generated by a QMC method. Let ∆be a random sample from the uniform distribution on [0, 1]d. Then each Xi is given as Xi := {xi + ∆} ∈[0, 1]d. Therefore E[ 1 n ∑n i=1 g2(Xi)] = ∫ [0,1]d g2(x)dx = ∫ g2(x)dQ(x) for all g ∈L2(Q), so (8) holds for D = 1 with equality. 3Note that here the weighted points should be written as {(w(n) i , X(n) i )}n i=1, since they are constructed depending on the number of points n. However, we just write as {(wi, Xi)}n i=1 for notational simplicity. 5 4.2 Assumption on the integrand via powers of RKHSs To state our assumption on the integrand f, we need to introduce powers of RKHSs [22, Section 4]. Let 0 < θ ≤1 be a constant. First, with the distribution Q in Assumption 1, we require that the kernel satisfies ∫ k(x, x)dQ(x) < ∞. For example, this is always satisfied if the kernel is bounded. We also assume that the support of Q is entire X and that k is continuous. These conditions imply Mercer’s theorem [22, Theorem 3.1 and Lemma 2.3], which guarantees the following expansion of the kernel k: k(x, y) = ∞ ∑ i=1 µiei(x)ei(y), x, y ∈X, (9) where µ1 ≥µ2 ≥· · · > 0 and {ei}∞ i=1 is an orthonormal series in L2(Q); in particular, {µ1/2 i ei}∞ i=1 forms an orthonormal basis of H. Here the convergence of the series in (9) is pointwise. Assume that ∑∞ i=1 µθ i e2 i (x) < ∞holds for all x ∈X. Then the θ-th power of the kernel k is a function kθ : X × X →R defined by kθ(x, y) := ∞ ∑ i=1 µθ i ei(x)ei(y), x, y ∈X. (10) This is again a reproducing kernel [22, Proposition 4.2], and defines an RKHS called the θ-th power of the RKHS H: Hθ = { ∞ ∑ i=1 aiµθ/2 i ei : ∞ ∑ i=1 a2 i < ∞ } . This is an intermediate space between L2(Q) and H, and the constant 0 < θ ≤1 determines how close Hθ is to H. For instance, if θ = 1 we have Hθ = H, and Hθ approaches L2(Q) as θ →+0. Indeed, Hθ is nesting w.r.t. θ: H = H1 ⊂Hθ ⊂Hθ′ ⊂L2(Q), for all 0 < θ′ < θ < 1. (11) In other words, Hθ gets larger as θ decreases. If H is an RKHS consisting of smooth functions, then Hθ contains less smooth functions than those in H; we will show this in the example below. Assumption 2. The integrand f lies in Hθ for some 0 < θ ≤1. We note that Assumption 2 is equivalent to assuming that f belongs to the interpolation space [L2(Q), H]θ,2, or lies in the range of a power of certain integral operator [22, Theorem 4.6]. Powers of Tensor RKHSs. Let us mention the important case where RKHS H is given as the tensor product of individual RKHSs H1, . . . , Hd on the spaces X1, . . . , Xd, i.e., H = H1 ⊗· · ·⊗Hd and X = X1 × · · · × Xd. In this case, if the distribution Q is the product of individual distributions Q1, . . . , Qd on X1, . . . , Xn, it can be easily shown that the power RKHS Hθ is the tensor product of individual power RKHSs Hθ i : Hθ = Hθ 1 ⊗· · · ⊗Hθ d. (12) Examples: Powers of Korobov spaces. Let us consider the Korobov space W α Kor([0, 1]d) with Q being the uniform distribution on [0, 1]d. The Korobov kernel (5) has a Mercer representation kα(x, y) = 1 + ∞ ∑ i=1 1 i2α [ci(x)ci(y) + si(x)si(y)], (13) where ci(x) := √ 2 cos 2πix and si(x) := √ 2 sin 2πix. Note that c0(x) := 1 and {ci, si}∞ i=1 constitute an orthonormal basis of L2([0, 1]). From (10) and (13), the θ-th power of the Korobov kernel kα is given by kθ α(x, y) = 1 + ∞ ∑ i=1 1 i2αθ [ci(x)ci(y) + si(x)si(y)]. If αθ ∈N, this is exactly the kernel kαθ of the Korobov space W αθ Kor([0, 1]) of lower order αθ. In other words, W αθ Kor([0, 1]) is nothing but the θ-power of W α Kor([0, 1]). From this and (12), we can also show that the θ-th power of W α Kor([0, 1]d) is W αθ Kor([0, 1]d) for d ≥2. 6 4.3 Result: Convergence rates for general RKHSs with random points The following result guarantees the consistency of kernel quadratures for integrands satisfying Assumption 2, i.e., f ∈Hθ. Theorem 1. Let {(wi, Xi)}n i=1 be such that E[en(P; H)] = O(n−b) for some b > 0 and E[∑n i=1 w2 i ] = O(n−2c) for some 0 < c ≤1/2, as n →∞. Assume also that {Xi}n i=1 satisfies Assumption 1. Let 0 < θ ≤1 be a constant. Then for any f ∈Hθ, we have E [|Pnf −Pf|] = O(n−θb+(1/2−c)(1−θ)) (n →∞). (14) Remark 1. (a) The expectation in the assumption E[en(P; H)] = O(n−b) is w.r.t. the joint distribution of the weighted points {(wi, Xi)}n i=1. (b) The assumption E[∑n i=1 w2 i ] = O(n−2c) requires that each weight wi decreases as n increases. For instance, if maxi∈{1,...,n} |wi| = O(n−1), we have c = 1/2. For QMC methods, weights are uniform wi = 1/n, so we always have c = 1/2. The quadrature rule by Bach [2] also satisfies c = 1/2; see Section 2.3. (c) Let c = 1/2. Then the rate in (14) becomes O(n−θb), which shows that the integral estimator Pnf is consistent, even when the integrand f does not belong to H (recall H ⊊Hθ for θ < 1; see also (11)). The resulting rate O(n−θb) is determined by 0 < θ ≤1 of the assumption f ∈Hθ, which characterizes the closeness of f to H. (d) When θ = 1 (well-specified case), irrespective of the value of c, the rate in (14) becomes O(n−b), which recovers the rate of the worst case error E[en(P; H)] = O(n−b). Figure 1: Simulation results Examples in Korobov spaces. Let us illustrate Theorem 1 in the following setting described earlier. Let X = [0, 1]d, H = W α Kor([0, 1]d), and P be the uniform distribution on [0, 1]d. Then Hθ = W αθ Kor([0, 1]d), as discussed in Section 4.2. Let us consider the two methods discussed in Section 2.3: (i) the QMC lattice rules with randomization and (ii) the algorithm by Bach [2]. For both the methods, we have c = 1/2, and the distribution Q in Assumption 1 is uniform on [0, 1]d in this setting. As mentioned before, these methods achieve the rate n−α+ξ for arbitrarily small ξ > 0 in the well-specified setting: b = α −ξ in our notation. Then the assumption f ∈Hθ reads f ∈W αθ Kor([0, 1]d) for 0 < θ ≤1. For such an integrand f, we obtain the rate O(n−αθ+ξ) in (14) with arbitrarily small ξ > 0. This is the same rate as for a wellspecified case where W αθ 2 ([0, 1]d) was assumed for the construction of weighted points. Namely, we have shown that these methods are adaptive to the unknown smoothness of the integrand. For the algorithm by Bach [2], we conducted simulation experiments to support this observation, by using code available from http://www.di.ens.fr/~fbach/quadrature.html. The setting is what we have described with d = 1, and weights are obtained without regularization as in [2]. The result is shown in Figure 1, where r (= α) denotes the assumed smoothness, and s (= αθ) is the (unknown) smoothness of an integrand. The straight lines are (asymptotic) upper-bounds in Theorem 1 (slope −s and intercept fitted for n ≥24), and the corresponding solid lines are numerical results (both in log-log scales). Averages over 100 runs are shown. The result indeed shows the adaptability of the quadrature rule by Bach for the less smooth functions (i.e. s = 1, 2, 3). We observed similar results for the QMC lattice rules (reported in Appendix D in the supplement). 5 Analysis 2: Sobolev RKHS with deterministic points In Section 4, we have provided guarantees for methods that employ random points. However, the result does not apply to those with deterministic points, such as (a) QMC methods without randomization, (b) Bayesian quadratures with deterministic points, and (c) kernel herding [7]. We aim here to provide guarantees for quadrature rules with deterministic points. To this end, we focus on the setting where X = Rd and H is a Sobolev space [1]. The Sobolev space W r 2 of order r ∈N is defined by W r 2 := {f ∈L2 : Dαf ∈L2 exists for all |α| ≤r} 7 where α := (α1, . . . , αd) with αi ≥0 is a multi-index with |α| := ∑d i=1 αi, and Dαf is the α-th (weak) derivative of f. Its norm is defined by ∥f∥W r 2 = (∑ |α|≤r ∥Dαf∥2 L2)1/2. For r > d/2, this is an RKHS with the reproducing kernel k being the Matèrn kernel; see Section 4.2.1. of [20] for the definition. Our assumption on the integrand f is that it belongs to a Sobolev space W s 2 of a lower order s ≤r. Note that the order s represents the smoothness of f (the order of differentiability). Therefore the situation s < r means that f is less smooth than assumed; we consider the setting where W r 2 was assumed for the construction of weighted points. Rates under an assumption on weights. The first result in this section is based on the same assumption on weights as in Theorem 1. Theorem 2. Let {(wi, Xi)}n i=1 be such that en(P; W r 2 ) = O(n−b) for some b > 0 and ∑n i=1 w2 i = O(n−2c) for some 0 < c ≤1/2, as n →∞. Then for any f ∈Cs 0 ∩W s 2 with s ≤r, we have |Pnf −Pf| = O(n−bs/r+(1/2−c)(1−s/r)) (n →∞). (15) Remark 2. (a) Let θ := s/r. Then the rate in (15) is rewritten as O(n−θb+(1/2−c)(1−θ)), which matches the rate of Theorem 1. In other words, Theorem 2 provides a deterministic version of Theorem 1 for the special case of Sobolev spaces. (b) Theorem 2 can be applied to quadrature rules with equally-weighted deterministic points, such as QMC methods and kernel herding [7]. For these methods, we have c = 1/2 and so we obtain the rate O(n−sb/r) in (15). The minimax optimal rate in this setting (i.e., c = 1/2) is given by n−b with b = r/d [15]. For these choices of b and c, we obtain a rate of O(n−s/d) in (15), which is exactly the optimal rate in W s 2 . This leads to an important consequence that the optimal rate O(n−s/d) can be achieved for an integrand f ∈W s 2 without knowing the degree of smoothness s; one just needs to know its upper-bound s ≤r. Namely, any methods of optimal rates in Sobolev spaces are adaptive to lesser smoothness. Rates under an assumption on separation radius. Theorems 1 and 2 require the assumption ∑n i=1 w2 i = O(n−2c). However, for some algorithms, the value of c may not be available. For instance, this is the case for Bayesian quadratures that compute the weights without any constraints [6]; see Section 2.3. Here we present a preliminary result that does not rely on the assumption on the weights. To this end, we introduce a quantity called separation radius: qn := min i̸=j ∥Xi −Xj∥. In the result below, we assume that qn does not decrease very quickly as n increases. Let diam(X1, . . . , Xn) denote the diameter of the points. Theorem 3. Let {(wi, Xi)}n i=1 be such that en(P; W r 2 ) = O(n−b) for some b > 0 as n →∞, qn ≥Cn−b/r for some C > 0, and diam(X1, . . . , Xn) ≤1. Then for any f ∈Cs 0 ∩W s 2 with s ≤r, we have |Pnf −Pf| = O(n−bs r ) (n →∞). (16) Consequences similar to those of Theorems 1 and 2 can be drawn for Theorem 3. In particular, the rate in (16) coincides with that of (15) with c = 1/2. The assumption qn ≥Cn−b/r can be verified when points form equally-spaced grids in a compact subset of Rd. In this case, the separation radius satisfies qn ≥Cn−1/d for some C > 0. As above, the optimal rate for this setting is n−b with b = r/d, which implies the separation radius satisfies the assumption as n−b/r = n−1/d. 6 Conclusions Kernel quadratures are powerful tools for numerical integration. However, their convergence guarantees had not been established in situations where integrands are less smooth than assumed, which can happen in various situations in practice. In this paper, we have provided the first known theoretical guarantees for kernel quadratures in such misspecified settings. Acknowledgments We wish to thank the anonymous reviewers for valuable comments. We also thank Chris Oates for fruitful discussions. This work has been supported in part by MEXT Grant-in-Aid for Scientific Research on Innovative Areas (25120012). 8 References [1] R. A. Adams and J. J. F. Fournier. Sobolev Spaces. Academic Press, 2nd edition, 2003. [2] F. Bach. On the equivalence between kernel quadrature rules and random feature expansions. Technical report, HAL-01118276v2, 2015. [3] F. Bach, S. Lacoste-Julien, and G. Obozinski. On the equivalence between herding and conditional gradient algorithms. In Proc. ICML2012, pages 1359–1366, 2012. [4] A. Berlinet and C. Thomas-Agnan. Reproducing kernel Hilbert spaces in probability and statistics. Kluwer Academic Publisher, 2004. [5] F-X. Briol, C. J. Oates, M. Girolami, and M. A. Osborne. Frank-Wolfe Bayesian quadrature: Probabilistic integration with theoretical guarantees. In Adv. NIPS 28, pages 1162–1170, 2015. [6] F-X. Briol, C. J. Oates, M. Girolami, M. A. Osborne, and D. Sejdinovic. Probabilistic integration: A role for statisticians in numerical analysis? arXiv:1512.00933v4 [stat.ML], 2016. [7] Y. Chen, M. Welling, and A. Smola. Supersamples from kernel-herding. In Proc. UAI 2010, pages 109–116, 2010. [8] J. Dick. Explicit constructions of quasi-Monte Carlo rules for the numerical integration of high-dimensional periodic functions. Siam J. Numer. Anal., 45:2141–2176, 2007. [9] J. Dick. Walsh spaces containing smooth functions and quasi–Monte Carlo rules of arbitrary high order. Siam J. Numer. Anal., 46(3):1519–1553, 2008. [10] J. Dick. Higher order scrambled digital nets achieve the optimal rate of the root mean square error for smooth integrands. The Annals of Statistics, 39(3):1372–1398, 2011. [11] J. Dick, F. Y. Kuo, and I. H. Sloan. High dimensional numerical integration - the quasi-Monte Carlo way. Acta Numerica, 22(133-288), 2013. [12] M. Gerber and N. Chopin. Sequential quasi Monte Carlo. Journal of the Royal Statistical Society. Series B. Statistical Methodology, 77(3):509–579, 2015. [13] F. J. Hickernell. A generalized discrepancy and quadrature error bound. Mathematics of Computation of the American Mathematical Society, 67(221):299–322, 1998. [14] S. Lacoste-Julien, F. Lindsten, and F. Bach. Sequential kernel herding: Frank-Wolfe optimization for particle filtering. In Proc. AISTATS 2015, 2015. [15] E. Novak. Deterministic and Stochastic Error Bounds in Numerical Analysis. Springer-Verlag, 1988. [16] E. Novak and H. Wózniakowski. Tractability of Multivariate Problems, Vol. I: Linear Information. EMS, 2008. [17] C. J. Oates and M. Girolami. Control functionals for quasi-Monte Carlo integration. In Proc. AISTATS 2016, 2016. [18] C. J. Oates, M. Girolami, and N. Chopin. Control functionals for Monte Carlo integration. Journal of the Royal Statistical Society. Series B, 2017, to appear. [19] A. O’Hagan. Bayes–Hermite quadrature. Journal of Statistical Planning and Inference, 29:245–260, 1991. [20] E. Rasmussen and C. K. I. Williams. Gaussian Processes for Machine Learning. MIT Press, 2006. [21] B. K. Sriperumbudur, A. Gretton, K. Fukumizu, B. Schölkopf, and G. R.G. Lanckriet. Hilbert space embeddings and metrics on probability measures. JMLR, 11:1517–1561, 2010. [22] I. Steinwart and C. Scovel. Mercer’s theorem on general domains: On the interaction between measures, kernels, and RKHS. Constructive Approximation, 35(363-417), 2012. [23] J. Yang, V. Sindhwani, H. Avron, and M. W. Mahoney. Quasi-Monte Carlo feature maps for shift-invariant kernels. In Proc. ICML 2014, 2014. 9
2016
296
6,212
Maximization of Approximately Submodular Functions Thibaut Horel Harvard University thorel@seas.harvard.edu Yaron Singer Harvard University yaron@seas.harvard.edu Abstract We study the problem of maximizing a function that is approximately submodular under a cardinality constraint. Approximate submodularity implicitly appears in a wide range of applications as in many cases errors in evaluation of a submodular function break submodularity. Say that F is ε-approximately submodular if there exists a submodular function f such that (1−ε)f(S) ≤F(S) ≤(1+ε)f(S) for all subsets S. We are interested in characterizing the query-complexity of maximizing F subject to a cardinality constraint k as a function of the error level ε > 0. We provide both lower and upper bounds: for ε > n−1/2 we show an exponential query-complexity lower bound. In contrast, when ε < 1/k or under a stronger bounded curvature assumption, we give constant approximation algorithms. 1 Introduction In recent years, there has been a surge of interest in machine learning methods that involve discrete optimization. In this realm, the evolving theory of submodular optimization has been a catalyst for progress in extraordinarily varied application areas. Examples include active learning and experimental design [9, 12, 14, 19, 20], sparse reconstruction [1, 6, 7], graph inference [23, 24, 8], video analysis [29], clustering [10], document summarization [21], object detection [27], information retrieval [28], network inference [23, 24], and information diffusion in networks [17]. The power of submodularity as a modeling tool lies in its ability to capture interesting application domains while maintaining provable guarantees for optimization. The guarantees however, apply to the case in which one has access to the exact function to optimize. In many applications, one does not have access to the exact version of the function, but rather some approximate version of it. If the approximate version remains submodular then the theory of submodular optimization clearly applies and modest errors translate to modest loss in quality of approximation. But if the approximate version of the function ceases to be submodular all bets are off. Approximate submodularity. Recall that a function f : 2N →R is submodular if for all S, T ⊆ N, f(S ∪T) + f(S ∩T) ≤f(S) + f(T). We say that a function F : 2N →R is ε-approximately submodular if there exists a submodular function f : 2N →R s.t. for any S ⊆N: (1 −ε)f(S) ≤F(S) ≤(1 + ε)f(S). (1) Unless otherwise stated, all submodular functions f considered are normalized (f(∅) = 0) and monotone (f(S) ≤f(T) for S ⊆T). Approximate submodularity appears in various domains. • Optimization with noisy oracles. In these scenarios, we wish to solve optimization problems where one does not have access to a submodular function but a noisy version of it. An example recently studied in [5] involves maximizing information gain in graphical models; this captures many Bayesian experimental design settings. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. • PMAC learning. In the active area of learning submodular functions initiated by Balcan and Harvey [3], the objective is to approximately learn submodular functions. Roughly speaking, the PMAC-learning framework guarantees that the learned function is a constantfactor approximation of the true submodular function with high probability. Therefore, after learning a submodular function, one obtains an approximately submodular function. • Sketching. Since submodular functions have, in general, exponential-size representation, [2] studied the problem of sketching submodular functions: finding a function with polynomialsize representation approximating a given submodular function. The resulting sketch is an approximately submodular function. Optimization of approximate submodularity. We focus on optimization problems of the form max S : |S|≤k F(S) (2) where F is an ε-approximately submodular function and k ∈N is the cardinality constraint. We say that a set S ⊆N is an α-approximation to the optimal solution of (2) if |S| ≤k and F(S) ≥α max|T |≤k F(T). As is common in submodular optimization, we assume the value query model: optimization algorithms have access to the objective function F in a black-box manner, i.e. they make queries to an oracle which returns, for a queried set S, the value F(S). The querycomplexity of the algorithm is simply the number of queries made to the oracle. An algorithm is called an α-approximation algorithm if for any approximately submodular input F the solution returned by the algorithm is an α-approximately optimal solution. Note that if there exists an αapproximation algorithm for the problem of maximizing an ε-approximate submodular function F, then this algorithm is a α(1−ε) 1+ε -approximation algorithm for the original submodular function f 1. Conversely, if no such algorithm exists, this implies an inapproximability for the original function. Clearly, if a function is 0-approximately submodular then it retains desirable provable guarantees2, and it if it is arbitrarily far from being submodular it can be shown to be trivially inapproximable (e.g. maximize a function which takes value of 1 for a single arbitrary set S ⊆N and 0 elsewhere). The question is therefore: How close should a function be to submodular to retain provable approximation guarantees? In recent work, it was shown that for any constant ε > 0 there exists a class of ε-approximately submodular functions for which no algorithm using fewer than exponentially-many queries has a constant approximation ratio for the canonical problem of maximizing a monotone submodular function under a cardinality constraint [13]. Such an impossibility result suggests two natural relaxations: the first is to make additional assumptions about the structure of errors, such a stochastic error model. This is the direction taken in [13], where the main result shows that when errors are drawn i.i.d. from a wide class of distributions, optimal guarantees are obtainable. The second alternative is to assume the error is subconstant, which is the focus of this paper. 1.1 Overview of the results Our main result is a spoiler: even for ε = 1/n1/2−β for any constant β > 0 and n = |N|, no algorithm can obtain a constant-factor approximation guarantee. More specifically, we show that: • For the general case of monotone submodular functions, for any β > 0, given access to a 1 n1/2−β -approximately submodular function, no algorithm can obtain an approximation ratio better than O(1/nβ) using polynomially many queries (Theorem 3); • For the case of coverage functions we show that for any fixed β > 0 given access to an 1 n1/3−β -approximately submodular function, no algorithm can obtain an approximation ratio strictly better than O(1/nβ) using polynomially many queries (Theorem 4). 1Observe that for an approximately submodular function F, there exists many submodular functions f of which it is an approximation. All such submodular functions f are called representatives of F. The conversion between an approximation guarantee for F and an approximation guarantee for a representative f of F holds for any choice of the representative. 2Specifically, [22] shows that it possible to obtain a (1−1/e) approximation ratio for a cardinality constraint. 2 The above results imply that even in cases where the objective function is arbitrarily close to being submodular as the number n of elements in N grows, reasonable optimization guarantees are unachievable. The second result shows that this is the case even when we aim to optimize coverage functions. Coverage functions are an important class of submodular functions which are used in numerous applications [11, 21, 18]. Approximation guarantees. The inapproximability results follow from two properties of the model: the structure of the function (submodularity), and the size of ε in the definition of approximate submodularity. A natural question is whether one can relax either conditions to obtain positive approximation guarantees. We show that this is indeed the case: • In the general case of monotone submodular functions we show that the greedy algorithm achieves a 1−1/e−O(δ)  approximation ratio when ε = δ k (Theorem 5). Furthermore, this bound is tight: given a 1/k1−β-approximately submodular function, the greedy algorithm no longer provides a constant factor approximation guarantee (Proposition 6). • Since our query-complexity lower bound holds for coverage functions, which already contain a great deal of structure, we relax the structural assumption by considering functions with bounded curvature c; this is a common assumption in applications of submodularity to machine learning and has been used in prior work to obtain theoretical guarantees [15, 16]. Under this assumption, we give an algorithm which achieves an approximation ratio of (1 −c)( 1−ε 1+ε)2 (Proposition 8). We state our positive results for the case of a cardinality constraint of k. Similar results hold for matroids of rank k, the proofs of those can be found in the Appendix. Note that cardinality constraints are a special case of matroid constraints, therefore our lower bounds also apply to matroid constraints. 1.2 Discussion and additional related work Before transitioning to the technical results, we briefly survey error in applications of submodularity and the implications of our results to these applications. First, notice that there is a coupling between approximate submodularity and erroneous evaluations of a submodular function: if one can evaluate a submodular function within (multiplicative) accuracy of 1 ± ε then this is an ε-approximately submodular function. Additive vs multiplicative approximation. The definition of approximate submodularity in (1) uses relative (multiplicative) approximation. We could instead consider absolute (additive) approximation, i.e. require that f(S) −ε ≤F(S) ≤f(S) + ε for all sets S. This definition has been used in the related problem of optimizing approximately convex functions [4, 25], where functions are assumed to have normalized range. For un-normalized functions or functions whose range is unknown, a relative approximation is more informative. When the range is known, specifically if an upper bound B on f(S) is known, an ε/B-approximately submodular function is also an ε-additively approximate submodular function. This implies that our lower bounds and approximation results could equivalently be expressed for additive approximations of normalized functions. Error vs noise. If we interpret Equation (1) in terms of error, we see that no assumption is made on the source of the error yielding the approximately submodular function. In particular, there is no stochastic assumption: the error is deterministic and worst-case. Previous work have considered submodular or combinatorial optimization under random noise. Two models naturally arise: • consistent noise: the approximate function F is such that F(S) = ξSf(S) where ξS is drawn independently for each set S from a distribution D. The key aspect of consistent noise is that the random draws occur only once: querying the same set multiple times always returns the same value. This definition is the one adopted in [13]; a similar notion is called persistent noise in [5]. • inconsistent noise: in this model F(S) is a random variable such that f(S) = E[F(S)]. The noisy oracle can be queried multiple times and each query corresponds to a new independent random draw from the distribution of F(S). This model was considered in [26] in the context of dataset summarization and is also implicitly present in [17] where the objective function is defined as an expectation and has to be estimated via sampling. 3 Formal guarantees for consistent noise have been obtained in [13]. A standard way to approach optimization with inconsistent noise is to estimate the value of each set used by the algorithm to an accuracy ε via independent randomized sampling, where ε is chosen small enough so as to obtain approximation guarantees. Specifically, assuming that the algorithm only makes polynomially many value queries and that the function f is such that F(S) ∈[b, B] for any set S, then a classical application of the Chernoff bound combined with a union bound implies that if the value of each set is estimated by averaging the value of m samples with m = Ω  B log n bε2  , then with high probability the estimated value F(S) of each set used by the algorithm is such that (1 −ε)f(S) ≤F(S) ≤ (1 + ε)f(S). In other words, randomized sampling is used to construct a function which is εapproximately submodular with high probability. Implications of results in this paper. Given the above discussion, our results can be interpreted in the context of noise as providing guarantees on what is a tolerable noise level. In particular, Theorem 5 implies that if a submodular function is estimated using m samples, with m = Ω  Bn2 log n b  , then the Greedy algorithm is a constant approximation algorithm for the problem of maximizing a monotone submodular function under a cardinality constraint. Theorem 3 implies that if m = O  Bn log n b  then the resulting estimation error is within the range where no algorithm can obtain a constant approximation ratio. 2 Query-complexity lower bounds In this section we give query-complexity lower bounds for the problem of maximizing an εapproximately submodular function subject to a cardinality constraint. In Section 2.1, we show an exponential query-complexity lower bound for the case of general submodular functions when ε ≥n−1/2 (Theorem 3). The same lower-bound is then shown to hold even when we restrict ourselves to the case of coverage functions for ε ≥n−1/3 (Theorem 4). A general overview of query-complexity lower bounds. At a high level, the lower bounds are constructed as follows. We define a class of monotone submodular functions F, and draw a function f uniformly at random from F. In addition we define a submodular function g : 2N →R s.t. max|S|≤k f(S) ≥ρ(n) · max|S|≤k g(S), where ρ(n) = o(1) for a particular choice of k < n. We then define the approximately submodular function F: F(S) = g(S), if (1 −ε)f(S) ≤g(S) ≤(1 + ε)f(S) f(S) otherwise Note that by its definition, this function is an ε-approximately submodular function. To show the lower bound, we reduce the problem of proving inapproximability of optimizing an approximately submodular function to the problem of distinguishing between f and g using F. We show that for every algorithm, there exists a function f ∈F s.t. if f is unknown to the algorithm, it cannot distinguish between the case in which the underlying function is f and the case in which the underlying function is g using polynomially-many value queries to F, even when g is known to the algorithm. Since max|S|≤k f(S) ≥ρ(n) max|S|≤k g(S), this implies that no algorithm can obtain an approximation better than ρ(n) using polynomially-many queries; otherwise such an algorithm could be used to distinguish between f and g. 2.1 Monotone submodular functions Constructing a class of hard functions. A natural candidate for a class of functions F and a function g satisfying the properties described in the overview is: f H(S) = |S ∩H| and g(S) = |S|h n for H ⊆N of size h. The reason why g is hard to distinguish from f H is that when H is drawn uniformly at random among sets of size h, f H is close to g with high probability. This follows from an application of the Chernoff bound for negatively associated random variables. Formally, this is stated in Lemma 1 whose proof is given in the Appendix. 4 Lemma 1. Let H ⊆N be a set drawn uniformly among sets of size h, then for any S ⊆N, writing µ = |S|h n , for any ε such that ε2µ > 1: PH  (1 −ε)µ ≤|S ∩H| ≤(1 + ε)µ  ≥1 −2−Ω(ε2µ) Unfortunately this construction fails if the algorithm is allowed to evaluate the approximately submodular function at small sets: for those the concentration of Lemma 1 is not high enough. Our construction instead relies on designing F and g such that when S is “large”, then we can make use of the concentration result of Lemma 1 and when S is “small”, functions in F and g are deterministically close to each other. Specifically, we introduce for H ⊆N of size h: f H(S) = |S ∩H| + min  |S ∩(N \ H)|, α  1 −h n  g(S) = min  |S|, |S|h n + α  1 −h n  (3) The value of the parameters α and h will be set later in the analysis. Observe that when S is small (|S ∩¯H| ≤α(1−h/n) and |S| ≤α) then f H(S) = g(S) = |S|. When S is large, Lemma 1 implies that |S ∩H| is close to |S|h/n and |S ∩(N \ H)| is close to |S|(1 −h/n) with high probability. First note that f H and g are monotone submodular functions. f H is the sum of a monotone additive function and a monotone budget-additive function. The function g can be written g(S) = G(|S|) where G(x) = min(x, xh/n + α(1 −h/n)). G is a non-decreasing concave function (minimum between two non-decreasing linear functions) hence g is monotone submodular. Next, we observe that there is a gap between the maxima of the functions f H and the one of g. When S ≤k, g(S) = |S|h n + α 1 −h n  . The maximum is clearly attained when |S| = k and is upper-bounded by kh n + α. For f H, the maximum is equal to k and is attained when S is a subset of H of size k. So for α ≤k ≤h, we obtain: max |S|≤k g(S) ≤ α k + h n  max |S|≤k f H(S), H ⊆N (4) Indistinguishability. The main challenge is now to prove that f H is close to g with high probability. Formally, we have the following lemma. Lemma 2. For h ≤n 2 , let H be drawn uniformly at random among sets of size h, then for any S: PH  (1 −ε)f H(S) ≤g(S) ≤(1 + ε)f H(S)  ≥1 −2−Ω(ε2αh/n) (5) Proof. For concision we define ¯H := N \ H, the complement of H in N. We consider four cases depending on the cardinality of S and S ∩¯H. Case 1: |S| ≤α and |S ∩¯H| ≤α 1 −h n  . In this case f H(S) = |S ∩H| + |S ∩¯H| = |S| and g(S) = |S|. The two functions are equal and the inequality is immediately satisfied. Case 2: |S| ≤α and |S ∩¯H| ≥α(1 −h n). In this case g(S) = |S| = |S ∩H| + |S ∩¯H| and f H(S) = |S ∩H| + α(1 −h n). By assumption on |S ∩¯H|, we have: (1 −ε)α  1 −h n  ≤|S ∩¯H| For the other side, by assumption on |S ∩¯H|, we have that |S| ≥α(1 −h n) ≥α 2 (since h ≤n 2 ). We can then apply Lemma 1 and obtain: PH  |S ∩¯H| ≤(1 + ε)α  1 −h n  ≥1 −2−Ω(ε2αh/n) Case 3: |S| ≥α and |S ∩¯H| ≥α 1 −h n  . In this case f H(S) = |S ∩H| + α(1 −h n) and g(S) = |S|h n + α(1 −h n). We need to show that: PH  (1 −ε)|S|h n ≤|S ∩H| ≤(1 + ε)|S|h n  ≥1 −2−Ω(ε2αh/n) This is a direct consequence of Lemma 1. 5 Case 4: |S| ≥α and |S ∩¯H| ≤α 1 −h n  . In this case f H(S) = |S ∩H| + |S ∩¯H| and g(S) = |S|h n + α(1 −h n). As in the previous case, we have: PH  (1 −ε)|S|h n ≤|S ∩H| ≤(1 + ε)|S|h n  ≥1 −2−Ω(ε2αh/n) By the assumption on |S ∩¯H|, we also have: |S ∩¯H| ≤α  1 −h n  ≤(1 + ε)α  1 −h n  So we need to show that: PH  (1 −ε)α  1 −h n  ≤|S ∩¯H|  ≥1 −2−Ω(ε2αh/n) and then we will be able to conclude by union bound. This is again a consequence of Lemma 1. Theorem 3. For any 0 < β < 1 2, ε ≥ 1 n1/2−β , and any (possibly randomized) algorithm with query-complexity smaller than 2Ω(nβ/2), there exists an ε-approximately submodular function F such that for the problem of maximizing F under a cardinality constraint, the algorithm achieves an approximation ratio upper-bounded by 2 nβ/2 with probability at least 1 − 1 2Ω(nβ/2) . Proof. We set k = h = n1−β/2 and α = n1−β. Let H be drawn uniformly at random among sets of size h and let f H and g be as in (3). We first define the ε-approximately submodular function F H: F H(S) = g(S) if (1 −ε)f H(S) ≤g(S) ≤(1 + ε)f H(S) f H(S) otherwise It is clear from the definition that this is an ε-approximately submodular function. Consider a deterministic algorithm A and let us denote by S1, . . . , Sm the queries made by the algorithm when given as input the function g (g is 0-approximately submodular, hence it is a valid input to A). Without loss of generality, we can include the set returned by the algorithm in the queries, so Sm denotes the set returned by the algorithm. By (5), for any i ∈[m]: PH[(1 −ε)f H(Si) ≤g(Si) ≤(1 + ε)f H(Si)] ≥1 −2−Ω n β 2  when these events realize, we have F H(Si) = g(Si). By union bound over i, when m < 2Ω n β 2  : PH[∀i, F H(Si) = g(Si)] > 1 −m2−Ω nβ/2 = 1 −2−Ω nβ/2 > 0 This implies the existence of H such that A follows the same query path when given g and F H as inputs. For this H: F H(Sm) = g(Sm) ≤max |S|≤k g(S) ≤ α k + h n  max |S|≤k f H(S) = α k + h n  max |S|≤k F H(S) where the second inequality comes from (4). For our choice of parameters, α k + h n = 2/n β 2 , hence: F H(Sm) ≤ 2 n β 2 max |S|≤k F H(S) Let us now consider the case where the algorithm A is randomized and let us denote AH,R the solution returned by the algorithm when given function F H as input and random bits R. We have: PH,R  F H(AH,R) ≤ 2 nβ/2 max |S|≤k F H(S)  = X r P[R = r]PH  F H(AH,R) ≤ 2 nβ/2 max |S|≤k F H(S)  ≥(1 −2−Ω(n β 2 )) X r P[R = r] = 1 −2−Ω(nβ2) where the equality comes from the analysis of the deterministic case (when the random bits are fixed, the algorithm is deterministic). This implies the existence of H such that: PR  F H(AH,R) ≤ 2 nβ/2 max |S|≤k F H(S)  ≥1 −2−Ω(nβ2) and concludes the proof of the theorem. 6 2.2 Coverage functions In this section, we show that an exponential query-complexity lower bound still holds even in the restricted case where the objective function approximates a coverage function. Recall that by definition of a coverage function, the elements of the ground set N are subsets of a set U called the universe. For a set S = {S1, . . . , Sm} of subsets of U, the value f(S) is given by f(S) = |Sm i=1 Si|. Theorem 4. For any 0 < β < 1 2, ε ≥ 1 n1/3−β , and any (possibly randomized) algorithm with query-complexity smaller than 2Ω(nβ/2), there exists a function F which ε-approximates a coverage function, such that for the problem of maximizing F under a cardinality constraint, the algorithm achieves an approximation ratio upper-bounded by 2 nβ/2 with probability at least 1 − 1 2Ω(nβ/2) . The proof of Theorem 4 has the same structure as the proof of Theorem 3. The main difference is a different choice of class of functions F and function g. The details can be found in the appendix. 3 Approximation algorithms The results from Section 2 can be seen as a strong impossibility result since an exponential querycomplexity lower bound holds even in the specific case of coverage functions which exhibit a lot of structure. Faced with such an impossibility, we analyze two ways to relax the assumptions in order to obtain positive results. One relaxation considers ε-approximate submodularity when ε ≤1 k; in this case we show that the Greedy algorithm achieves a constant approximation ratio (and that ε = 1 k is tight for the Greedy algorithm). The other relaxation considers functions with stronger structural properties, namely, functions with bounded curvature. In this case, we show that a constant approximation ratio can be obtained for any constant ε. 3.1 Greedy algorithm For the general class of monotone submodular functions, the result of [22] shows that a simple greedy algorithm achieves an approximation ratio of 1 −1 e. Running the same algorithm for an ε-approximately submodular function results in a constant approximation ratio when ε ≤1 k. The detailed description of the algorithm can be found in the appendix. Theorem 5. Let F be an ε-approximately submodular function, then the set S returned by the greedy algorithm satisfies: F(S) ≥ 1 1 + 4kε (1−ε)2 1 − 1 −ε 1 + ε 2k  1 −1 k k! max S:|S|≤k F(S) In particular, for k ≥2, any constant 0 ≤δ < 1 and ε = δ k, this approximation ratio is constant and lower-bounded by 1 −1 e −16δ  . Proof. Let us denote by O an optimal solution to maxS:|S|≤K F(S) and by f a submodular representative of F. Let us write S = {e1, . . . , eℓ} the set returned by the greedy algoithm and define Si = {e1, . . . , ei}, then: f(O) ≤f(Si) + X e∈OPT  f(Si ∪{e}) −f(Si)  ≤f(Si) + X e∈O  1 1 −εF(Si ∪{e}) −f(Si)  ≤f(Si) + X e∈O  1 1 −εF(Si+1) −f(Si)  ≤f(Si) + X e∈O 1 + ε 1 −εf(Si+1) −f(Si)  ≤f(Si) + K 1 + ε 1 −εf(Si+1) −f(Si)  where the first inequality uses submodularity, the second uses the definition of approximate submodularity, the third uses the definition of the Algorithm, the fourth uses approximate submodularity again and the last one uses that |O| ≤k. 7 Reordering the terms, and expressing the inequality in terms of F (using the definition of approximate submodularity) gives: F(Si+1) ≥  1 −1 k  1 −ε 1 + ε 2 F(Si) + 1 k 1 −ε 1 + ε 2 F(O) This is an inductive inequality of the form ui+1 ≥aui + b, u0 = 0. Whose solution is ui ≥ b 1−a(1 −ai). For our specific a and b, we obtain: F(S) ≥ 1 1 + 4kε (1−ε)2 1 −  1 −1 k k 1 −ε 1 + ε 2k! F(O) The following proposition shows that ε = 1 k is tight for the greedy algorithm, and that this is the case even for additive functions. The proof can be found in the Appendix. Proposition 6. For any β > 0, there exists an ε-approximately additive function with ε = Ω 1 k1−β  for which the Greedy algorithm has non-constant approximation ratio. Matroid constraint. Theorem 5 can be generalized to the case of matroid constraints. We are now looking at a problem of the form: maxS∈I F(S), where I is the set of independent sets of a matroid. Theorem 7. Let I be the set of independent sets of a matroid of rank k, and let F be an εapproximately submodular function, then if S is the set returned by the greedy algorithm: F(S) ≥1 2 1 −ε 1 + ε  1 1 + kε 1−ε max S∈I f(S) In particular, for k ≥2, any constant 0 ≤δ < 1 and ε = δ k, this approximation ratio is constant and lower-bounded by ( 1 2 −2δ). 3.2 Bounded curvature With an additional assumption on the curvature of the submodular function f, it is possible to obtain a constant approximation ratio for any ε-approximately submodular function with constant ε. Recall that the curvature c of function f : 2N →R is defined by c = 1 −mina∈N fN\{a}(a) f(a) . A consequence of this definition when f is submodular is that for any S ⊆N and a ∈N \ S we have that fS(a) ≥(1 −c)f(a). Proposition 8. For the problem max|S|≤k F(S) where F is an ε-approximately submodular function which approximates a monotone submodular f with curvature c, there exists a polynomial time algorithm which achieves an approximation ratio of (1 −c)( 1−ε 1+ε)2. References [1] F. Bach. Structured sparsity-inducing norms through submodular functions. In NIPS, 2010. [2] A. Badanidiyuru, S. Dobzinski, H. Fu, R. Kleinberg, N. Nisan, and T. Roughgarden. Sketching valuation functions. In SODA, pages 1025–1035. SIAM, 2012. [3] M.-F. Balcan and N. J. Harvey. Learning submodular functions. In Proceedings of the forty-third annual ACM symposium on Theory of computing, pages 793–802. ACM, 2011. [4] A. Belloni, T. Liang, H. Narayanan, and A. Rakhlin. Escaping the local minima via simulated annealing: Optimization of approximately convex functions. In COLT, pages 240–265, 2015. [5] Y. Chen, S. H. Hassani, A. Karbasi, and A. Krause. Sequential information maximization: When is greedy near-optimal? In COLT, pages 338–363, 2015. [6] A. Das, A. Dasgupta, and R. Kumar. Selecting diverse features via spectral relaxation. In NIPS, 2012. 8 [7] A. Das and D. Kempe. Submodular meets spectral: Greedy algorithms for subset selection, sparse approximation and dictionary selection. In ICML, 2011. [8] A. Defazio and T. Caetano. A convex formulation for learning scale-free networks via submodular relaxation. In NIPS, 2012. [9] D. Golovin and A. Krause. Adaptive submodularity: Theory and applications in active learning and stochastic optimization. JAIR, 42:427–486, 2011. [10] R. Gomes and A. Krause. Budgeted nonparametric learning from data streams. In ICML, 2010. [11] C. Guestrin, A. Krause, and A. Singh. Near-optimal sensor placements in Gaussian processes. In International Conference on Machine Learning (ICML), August 2005. [12] A. Guillory and J. Bilmes. Simultaneous learning and covering with adversarial noise. In ICML, 2011. [13] A. Hassidim and Y. Singer. Submodular optimization under noise. CoRR, abs/1601.03095, 2016. [14] S. Hoi, R. Jin, J. Zhu, and M. Lyu. Batch mode active learning and its application to medical image classification. In ICML, 2006. [15] R. K. Iyer and J. A. Bilmes. Submodular optimization with submodular cover and submodular knapsack constraints. In NIPS, pages 2436–2444, 2013. [16] R. K. Iyer, S. Jegelka, and J. A. Bilmes. Curvature and optimal algorithms for learning and minimizing submodular functions. In NIPS, pages 2742–2750, 2013. [17] D. Kempe, J. Kleinberg, and E. Tardos. Maximizing the spread of influence through a social network. In KDD, 2003. [18] A. Krause and C. Guestrin. Near-optimal observation selection using submodular functions. In National Conference on Artificial Intelligence (AAAI), Nectar track, July 2007. [19] A. Krause and C. Guestrin. Nonmyopic active learning of gaussian processes. an exploration– exploitation approach. In ICML, 2007. [20] A. Krause and C. Guestrin. Submodularity and its applications in optimized information gathering. ACM Trans. on Int. Systems and Technology, 2(4), 2011. [21] H. Lin and J. Bilmes. A class of submodular functions for document summarization. In ACL/HLT, 2011. [22] G. L. Nemhauser, L. A. Wolsey, and M. L. Fisher. An analysis of approximations for maximizing submodular set functions—i. Mathematical Programming, 14(1):265–294, 1978. [23] M. G. Rodriguez, J. Leskovec, and A. Krause. Inferring networks of diffusion and influence. ACM TKDD, 5(4), 2011. [24] M. G. Rodriguez and B. Schölkopf. Submodular inference of diffusion networks from multiple trees. In ICML, 2012. [25] Y. Singer and J. Vondrák. Information-theoretic lower bounds for convex optimization with erroneous oracles. In NIPS, pages 3186–3194, 2015. [26] A. Singla, S. Tschiatschek, and A. Krause. Noisy submodular maximization via adaptive sampling with applications to crowdsourced image collection summarization. arXiv preprint arXiv:1511.07211, 2015. [27] H. Song, R. Girshick, S. Jegelka, J. Mairal, Z. Harchaoui, and T. Darrell. On learning to localize objects with minimal supervision. In ICML, 2014. [28] S. Tschiatschek, R. Iyer, H. Wei, and J. Bilmes. Learning mixtures of submodular functions for image collection summarization. In NIPS, 2014. [29] J. Zheng, Z. Jiang, R. Chellappa, and J. Phillips. Submodular attribute selection for action recognition in video. In NIPS, 2014. 9
2016
297
6,213
Causal meets Submodular: Subset Selection with Directed Information Yuxun Zhou Department of EECS UC Berekely yxzhou@berkeley.edu Costas J. Spanos Department of EECS UC Berkeley spanos@berkeley.edu Abstract We study causal subset selection with Directed Information as the measure of prediction causality. Two typical tasks, causal sensor placement and covariate selection, are correspondingly formulated into cardinality constrained directed information maximizations. To attack the NP-hard problems, we show that the first problem is submodular while not necessarily monotonic. And the second one is “nearly” submodular. To substantiate the idea of approximate submodularity, we introduce a novel quantity, namely submodularity index (SmI), for general set functions. Moreover, we show that based on SmI, greedy algorithm has performance guarantee for the maximization of possibly non-monotonic and non-submodular functions, justifying its usage for a much broader class of problems. We evaluate the theoretical results with several case studies, and also illustrate the application of the subset selection to causal structure learning. 1 Introduction A wide variety of research disciplines, including computer science, economic, biology and social science, involve causality analysis of a network of interacting random processes. In particular, many of those tasks are closely related to subset selection. For example, in sensor network applications, with limited budget it is necessary to place sensors at information “sources” that provide the best observability of the system. To better predict a stock under consideration, investors need to select causal covariates from a pool of candidate information streams. We refer to the first type of problems as “causal sensor placement”, and the second one as “causal covariate selection”. To solve the aforementioned problems we firstly need a causality measure for multiple random processes. In literature, there exists two types of causality definitions, one is related with time series prediction (called Granger-type causality) and another with counter-factuals [18]. We focus on Granger-type prediction causality substantiated with Directed Information (DI), a tool from information theory. Recently, a large body of work has successfully employed DI in many research fields, including influence mining in gene networks [14], causal relationship inference in neural spike train recordings [19], and message transmission analysis in social media [23]. Compared to modelbased or testing-based methods such as [2][21], DI is not limited by model assumptions and can naturally capture non-linear and non-stationary dependence among random processes. In addition, it has clear information theoretical interpretation and admits well-established estimation techniques. In this regards, we formulate causal sensor placement and covariate selection into cardinality constrained directed information maximizations problems. We then need an efficient algorithm that makes optimal subset selection. Although subset selection, in general, is not tractable due to its combinatorial nature, the study of greedy heuristics for submodular objectives has shown promising results in both theory and practice. To list a few, following the pioneering work [8] that proves the near optimal 1 −1/e guarantee, [12] [1] investigates the submod30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. ularity of mutual information under Gaussian assumption, and then uses a greedy algorithm for sensor placement. In the context of speech and Nature Language Processing (NLP), the authors of and [13] adopt submodular objectives that encourage small vocabulary subset and broad coverage, and then proceed to maximization with a modified greedy method. In [3], the authors combine insights from spectral theory and submodularity analysis of R2 score, and their result remarkably explains the near optimal performance of forward regression and orthogonal matching pursuit. In this work, we also attack the causal subset selection problem via submodularity analysis. We show that the objective function of causal sensor placement, i.e., DI from selected set to its complement, is submodular, although not monotonic. And the problem of causal covariates selection, i.e., DI from selected set to some target process, is not submodular in general but is “nearly” submodular in particular cases. Since classic results require strictly submodularity and monotonicity which cannot be established for our purpose, we propose a novel measure of the degree of submodularity and show that, the performance guarantee of greedy algorithms can be obtained for possibly non-monotonic and non-submodular functions. Our contributions are: (1) Two important causal subset selection objectives are formulated with directed information and the corresponding submodularity analysis are conducted. (2) The SmI dependent performance bound implies that submodularity is better characterized by a continuous indicator than being used as a “yes or no” property, which extends the application of greedy algorithms to a much broader class of problems. The rest of the paper is organized as follows. In next section, we briefly review the notion of directed information and submodular function. Section 3 is devoted to problem formulation and submodularity analysis. In section 4, we introduce SmI and provides theoretical results on performance guarantee of random and deterministic greedy algorithms. Finally in Section 5, we conduct experiments to justify our theoretical findings and illustrate a causal structure learning application. 2 Preliminary Directed Information Consider two random process Xn and Y n, we use the convention that Xi = {X0, X1, ...Xi}, with t = 0, 1, ..., n as the time index. Directed Information from Xn to Y n is defined in terms of mutual information: I(Xn →Y n) = n X t=1 I(Xt; Yt|Y t−1) (1) which can be viewed as the aggregated dependence between the history of process X and the current value of process Y , given past observations of Y . The above definition captures a natural intuition about causal relationship, i.e., the unique information Xt has on Yt, when the past of Y t−1 is known. With causally conditioned entropy defined by H(Y n||Xn) ≜Pn t=1 H(Yt|Y t−1, Xt), the directed information from Xn to Y n when causally conditioned on the series Zn can be written as I(Xn →Y n||Zn) = H(Y n||Zn) −H(Y n||Xn, Zn) = n X t=1 I(Xt; Yt|Y t−1, Zt) (2) Observe that causally conditioned directed information is expressed as the difference between two causally conditioned entropy, which can be considered as “causal uncertainty reduction”. With this interpretation one is able to relate directed information to Granger Causality. Denote ¯X as the complement of X in a a universal set V , then, Theorem 1 [20] With log loss, I(Xn →Y n|| ¯Xt) is precisely the value of the side information (expected cumulative reduction in loss) that X has, when sequentially predicting Y with the knowledge of ¯X. The predictors are distributions with minimal expected loss. In particular, with linear models directed information is equivalent to Granger causality for jointly Gaussian processes. Submodular Function There are three equivalent definitions of submodular functions, and each of them reveals a distinct character of submodularity, a diminishing return property that universally exists in economics, game theory and network systems. 2 Definition 1 A submodular funciton is a set function f : 2Ω→R, which satisfies one of the three equivalent definitions: (1) For every S, T ⊆Ωwith S ⊆T, and every x ∈Ω\ T, we have that f (S ∪{x}) −f(S) ≥f (T ∪{x}) −f(T) (3) (2) For every S, T ⊆Ω, we have that f(S) + f(T) ≥f(S ∪T) + f(S ∩T) (4) (3) For every S ⊆Ω, and x1, x2 ∈Ω\ S, we have that f (S ∪{x1}) + f (S ∪{x2}) ≥f (S ∪{x1, x2}) + f(S) (5) A set function f is called supermodular if −f is submodular. The first definition is directly related to the diminishing return property. The second definition is better understood with the classic max k-cover problem [4]. The third definition indicates that the contribution of two elements is maximized when they are added individually to the base set. Throughout this paper, we will denote fx(S) ≜f (S ∪x) −f(S) as the “first order derivative” of f at base set S for further analysis. 3 Problem Formulation and Submodularity Analysis In this section, we first formulate two typical subset selection problems into cardinality constrained directed information maximization. Then we address the issues of submodularity and monotonicity in details. All proofs involved in this and the other sections, are given in supplementary material. Causal Sensor Placement and Covariates Selection by Maximizing DI To motivate the first formulation, imagine we are interested in placing sensors to monitor pollution particles in a vast region. Ideally, we would like to put k sensors, which is a given budget, at pollution sources to better predict the particle dynamics for other areas of interest. As such, the placement locations can be obtained by maximizing the directed information from selected location set S to its complement S (in the universal set V that contains all candidate sites). Then this type of “causal sensor placement” problems can be written as argmax S⊆V,|S|≤k I(Sn →Sn) (OPT1) Regarding the causal covariates selection problem, the goal is to choose a subset S from a universal set V , such that S has maximal prediction causality to a (or several) target process Y . To leverage sparsity, the cardinality constraints |S| ≤k is also imposed on the number of selected covariates. Again with directed information, this type of subset selection problems reads argmax S⊆V,|S|≤k I(Sn →Y n) (OPT2) The above two optimizations are hard even in the most reduced cases: Consider a collection of causally independent Gaussian processes, then the above problems are equivalent to the D-optimal design problem, which has been shown to be NP-hard [11]. Unless “P = NP”, it is unlikely to find any polynomial algorithm for the maximization, and a resort to tractable approximations is necessary. Submodularity Analysis of the Two Objectives Fortunately, we can show that the objective function of OPT1, the directed information from selected processes to unselected ones, is submodular. Theorem 2 The objective I(Sn →¯Sn) as a function of S ⊆V is submodular. The problem is that OPT1 is not monotonic for all S, which can be seen since both I(∅→V ) and I(V →∅) are 0 by definition. On the other hand, the deterministic greedy algorithm has guaranteed performance only when the objective function is monotonic up to 2k elements. In literature, several works have been addressing the issue of maximizing non-monotonic submodular function [6][7][17]. In this work we mainly analysis the random greedy technique proposed in [17], which is simpler compared to other alternatives and achieves best-known guarantees. Concerning the second objective OPT2, we make a slight detour and take a look at the property of its “first derivative”. 3 Proposition 1 fx(S) = I(Sn ∪xn →Y n) −I(Sn →Y n) = I(xn →Y n||Sn) Thus, the derivative is the directed information from processes x to Y causally conditioned on S. By the first definition of submodularity, if the derivative is decreasing in S, i.e. if fx(S) ≥fx(T) for any S ⊆T ⊆V and x ⊆V \ T, then the objective I(Sn →Y n) is a submodular function. Intuition may suggest this is true since knowing more (conditioning on a larger set) seems to reduce the dependence (and also the causality) of two phenomena under consideration. However, in general, this conjecture is not correct, and a counterexample could be constructed by having “explaining away” processes. Hence the difficulty encountered for solved OPT2 is that the objective is not submodular. Note that with some extra conditional independence assumptions we can justify its submodularity, Proposition 2 If for any two processes s1, s2 ∈S, we have the conditional independence that (s1t ⊥⊥s2t | Yt), then I(Sn →Y n) is a monotonic submodular function of set S. In practice, the assumption made in the above proposition is hard to check. Yet one may wonder that if the conditional dependence is weak or sparse, possibly a greedy selection still works to some extent because the submodularity is not severely deteriorated. Extending this idea we propose Submodularity Index (SmI), a novel measure of the degree of submodularity for general set functions, and we will provide the performance guarantee of greedy algorithms as a function of SmI. 4 Submodularity Index and Performance Guarantee For the ease of notation, we use f to denote a general set function and treat directed information objectives as special realizations. It’s worth mentioning that in literature, several effort has already been made to characterize approximate submodularity, such as the ε relaxation of definition (3) proposed in [5] for a dictionary selection objective, and the submodular ratio proposed in [3]. Compared to existing works, the SmI suggested in this work (1) is more generally defined for all set functions, (2) does not presume monotonicity, and (3) is more suitable for tasks involving information, influence, and coverage metrics in terms of computational convenience. SmI Definition and its Properties We start by defining the local submodular index for a function f at location A for a candidate set S ϕf(S, A) ≜ X x∈S fx(A) −fS(A) (6) which can be considered as an extension of the third definition (5) of submodularity. In essence, it captures the difference between the sum of individual effect and aggregated effect on the first derivative of the function. Moreover, it has the following property: Proposition 3 For a given submodular function f, the local submodular index ϕf(S, A) is a supermodular function of S. Now we define SmI by minimizing over set variables: Definition 2 For a set function f : 2V →R the submodularity index (SmI) for a location set L and a cardinality k, denoted by λf(L, k), is defined as λf(L, k) ≜ min A⊆L S∩A=∅, |S|≤k ϕf(S, A) (7) Thus, SmI is the smallest possible value of local submodularity indexes subject to |S| ≤k. Note that we implicitly assume |S| ≥2 in the above definition, as in the cases where |S| = {0, 1}, SmI reduces to 0. Besides, the definition of submodularity can be alternatively posed with SmI, Lemma 1 A set function f is submodular if and only if λf(L, k) ≥0, ∀L ⊆V and k. For functions that are already submodular, SmI measures how strong the submodularity is. We call a function super-submodular if its SmI is strictly larger than zero. On the other hand for functions that are not submodular, SmI provides an indicator of how close the function is to submodular. We call a function quasi-submodular if it has a negative but close to zero SmI. 4 Direct computation of SmI by solving (7) is hard. For the purpose of obtaining performance guarantee, however, a lower bound of SmI is sufficient and is much easier to compute. Consider the objective of (OPT1), which is already a submodular function. By using proposition 3, we conclude that its local submodular index is a super-modular function for fixed location set. Hence computing (7) becomes a cardinality constrained supermodular minimization problem for each location set. Besides, the following decomposition is useful to avoid extra work on directed information estimation: Proposition 4 The local submodular index of the function I({•}n →{V \ •}n) can be decomposed as ϕI({•}n→{V \•}n)(Sn, An) = ϕH({V \•}n)(Sn, An) + Pn t=1 ϕH({•}|V t−1)(St, At), where H(•) is the entropy function. The lower bound of SmI for the objective of OPT2 is more involved. With some work on an alternative representation of causally conditioned directed information, we obtain that Lemma 2 For any location sets L ⊆V , cardinality k, and target process set Y , we have λI({•}n→Y n)(L, k) ≥ min W ⊆V |W |≤|L|+k n X t=1  G|L|+k W t, Y t−1 −G|L|+k W t, Y t (8) ≥− max W ⊆V |W |≤|L|+k I(W n →Y n) ≥−I(V n →Y n) (9) where the function Gk(W, Z) ≜P w∈W H(w|Z) −kH(W|Z) is super-modular of W. Since (8) is in fact minimizing (maximizing) the difference of two supermodular (submodular) functions, one can use existing approximate or exact algorithms [10] [16] to compute the lower bound. (9) is often a weak lower bound, although is much easier to compute. Random Greedy Algorithm and Performance Bound with SmI With the introduction of SmI, in this subsection, we analyze the performance of the random greedy algorithm for maximizing non-monotonic, quasi- or super-submodular function in a unified framework. The results broaden the theoretical guarantee for a much richer class of functions. Algorithm 1 Random Greedy for Subset Selection S0 ←φ for i = 1, ..., k do Mi = argmaxMi⊆V \Si−1,|Mi|=k P u∈Mi fu(Si) Draw ui uniformly from Mi Si ←Si−1 ∪{ui} end for The randomized greedy algorithm was recently proposed in [17] [22] for maximizing cardinality constrained non-monotonic submodular functions. Also in [17], a 1/e expected performance bound was provided. The overall procedure is summarized in algorithm 1 for reference. Note that the random greedy algorithm only requires O(k|V |) calls of the function evaluation, making it suitable for large-scale problems. In order to analyze the performance of the algorithm, we start with two lemmas that reveal more properties of SmI. The first lemma shows that the monotonicity of the first derivative of a general set function f could be controlled by its SmI. Lemma 3 Given a set function f : V →R, and the corresponding SmI λf(L, k) defined in (7), and also let set B = A ∪{y1, ..., yM} and x ∈B. For an ordering {j1, ..., jM}, define Bm = A ∪{yj1, ..., yjm}, B0 = A, BM = B, we have fx(A) −fx(B) ≥ max {j1,...,jM} M−1 X m=0 λf(Bm, 2) ≥Mλf(B, 2) (10) Essentially, the above result implies that as long as SmI can be lower bounded by some small negative number, the submodularity (the decreasing derivative property (3) in Definition 1) is not severely degraded. The second lemma provides an SmI dependent bound on the expected value of a function with random arguments. Lemma 4 Let the set function f : V →R be quasi submodular with λf(L, k) ≤0. Also let S(p) a random subset of S, with each element appears in S(p) with probability at most p, then we have E [f(S(p))] ≥(1 −p1)f(∅) + γS,p, with γS,p ≜P|S| i=1(i −1)pλf(Si, 2). 5 Now we present the main theory and provide refined bounds for two different cases when the function is monotonic (but not necessarily submodular) or submodular (but not necessarily monotonic). Theorem 3 For a general (possibly non-monotonic, non-submodular) functions f, let the optimal solution of the cardinality constrained maximization be denoted as S∗, and the solution of random greedy algorithm be Sg then E [f(Sg)] ≥ 1 e + ξf Sg,k E[f (Sg)] ! f(S∗) where ξf Sg,k = λf(Sg, k) + k(k−1) 2 min{λf(Sg, 2), 0}. The role of SmI in determining the performance of the random greedy algorithm is revealed: the bound consist of 1/e ≈0.3679 plus a term as a function of SmI. If SmI = 0, the 1/e bound in previous literature is recovered. For super-submodular functions, as SmI is strictly larger than zero, the theorem provides a stronger guarantee by incorporating SmI. For quasi-submodular functions having negative SmI, although a degraded guarantee is produced, the bound is only slightly deteriorated when SmI is close to zero. In short, the above theorem not only encompasses existing results as special cases, but also suggests that we should view submodularity and monotonicity as a “continuous” property of set functions. Besides, greedy heuristics should not be restricted to the maximization of submodular functions, but can also be applied for “quasi-submodular” functions because a near optimal solution is still achievable theoretically. As such, we can formally define quasi-submodular functions as those having an SmI such that ξf S,k E[f(S)] > −1 e. Corollary 1 For monotonic functions in general, random greedy algorithm achieves E [f(Sg)] ≥  1 −1 e + λ′ f(Sg, k) E [f(Sg)]  f(S∗) and deterministic greedy algorithm also achieves f(Sg) ≥  1 −1 e + λ′ f (Sg,k) f(Sg)  f(S∗), where λ′ f(Sg, k) = λf(Sg, k) if λf(Sg, k) < 0 (1 −1/e)2λf(Sg, k) if λf(Sg, k) ≥0 . We see that in the monotonic case, we get a stronger bound for submodular functions compared to the 1 −1/e ≈0.6321 guarantee. Similarly, for quasi-submodular functions, the guarantee is degraded but not too much if SmD is close to 0. Note that the objective function of OPT2 fits into this category. For submodular but non-monotonic functions, e.g., the objective function of OPT1, we have Corollary 2 For submodular function that are not necessarily monotonic, random greedy algorithm has performance E [f(Sg)] ≥ 1 e + λf(Sg, k) E [f(Sg)]  f(S∗) 5 Experiment and Applications In this section, we conduct experiments to verify the theoretical results, and provide an example that uses subset selection for causal structure learning. Data and Setup The synthesis data is generated with the Bayes network Toolbox (BNT) [15] using dynamic Bayesian network models. Two sets of data, denoted by D1 and D2, are simulated, each containing 15 and 35 processes, respectively. For simplicity, all processes are {0, 1} valued. The processes are created with both simultaneous and historical dependence on each other. The order (memory length) of the historical dependence is set to 3. The MCMC sampling engine is used to draw n = 104 points for both D1 and D2. The stock market dataset, denoted by ST, contains hourly values of 41 stocks and indexes for the years 2014-2015. Note that data imputation is performed to amend a few missing values, and all processes are aligned in time. Moreover, we detrend each time 6 series with a recursive HP-filter [24] to remove long-term daily or monthly seasonalities that are not relevant for hourly analysis. Directed information is estimated with the procedure proposed in [9], which adopts the context tree weighting algorithm as an intermediate step to learn universal probability assignment. Interested readers are referred to [19][20] for other possible estimators. The maximal context tree depth is set to 5, which is sufficient for both the synthesis datasets and the real-world ST dataset. Causal Subset Selection Results Figure 1: Solution and Bounds for OPT1 on D1 Figure 2: Solution and Bounds for OPT2 on ST Firstly, the causal sensor placement problem, OPT1, is solved on data set D1 with the random greedy algorithm. Figure 1 shows the optimal solution by exhaustive search (red-star), random greedy solution (blue-circle), the 1/e reference bound (cyan-triangle), and the bound with SmI (magentadiamond), each for cardinality constraints imposed from k = 2 to k = 8. It is seen that the random greedy solution is close to the true optimum. In terms of computational time, the greedy method finishes in less than five minutes, while the exhaustive search takes about 10 hours on this small-scale problem (|V | = 15). Comparing two bounds in Figure 1, we see that the theoretical guarantee is greatly improved, and a much tighter bound is produced with SmI. The corresponding normalized SmI values, defined by SmI f(Lg), is shown in the first row of Table 1. As a consequence of those strictly positive SmI values and Corollary 2, the guarantees are made greater than 1/e. This observation justifies that the bounds with SmI are better indicators of the performance of the greedy heuristic. Table 1: Normalized submodularity index (NSmI) for OPT1 on D1 and OPT2 on ST at locations of greedy selections. Cardinality is imposed from k = 2 to k = 8. k = 2 3 4 5 6 7 8 normalized SmI for OPT1 0.382 0.284 0.175 0.082 0.141 0.078 0.074 normalized SmI for OPT2 -0.305 0.071 -0.068 -0.029 0.030 0.058 0.092 Secondly, the causal covariates selection problem, OPT2, is solved on ST dataset with the stock XOM used as the target process Y . The results of random greedy, exhaustive search, and performance bound (Corollary 1) are shown in Figure 2, and normalized SmIs are listed in the second row of Table 1. Note that the 1 −1/e reference line (green-triangle) in the figure is only for comparison purpose and is NOT an established bound. We observe that although the objective is not submodular, the random greedy algorithm is still near optimal. As we compare the reference line and the bound calculated with SmI (magenta-diamond), we see that the performance guarantee can be either larger or smaller than 1−1/e, depending on the sign of SmI. By definition, SmI measures the submodularity of a function at a location set. Hence, the SmI computed at each greedy selection captures the “local” submodularity of the function. The central insight gained from this experiment is that, for a function lacking general submodularity, such as the objective function of OPT2, it can be quasi-submodular (SmI ≤0, SmI ≈0) or super-submodular (SmI > 0) at different locations. Accordingly the performance guarantee can be either larger or smaller than 1 −1/e, depending on the values of SmI. Application: Causal Structure Learning The greedy method for subset selection can be used in many situations. Here we briefly illustrate the structure learning application based on covariates selection. As is detailed in the supplementary material and [20], one can show that the causal structure learning problem can be reduces to solving argmaxS⊆V,|S|≤k I(Sn →Xn i ) for each node i ∈V , 7 assuming maximal in degree is bounded by k for all nodes. Since the above problem is exactly the covariate selection considered in this work, we can reconstruct the causal structure for a network of random processes by simply using the greedy heuristic for each node. Figure 3 and Figure 4 illustrate the structure learning results on D1 and D2, respectively. In both two figures, the left subfigure is the ground truth structure, i.e., the dynamic Bayesian networks that are used in the data generation. Note that each node in the figure represents a random process, and an edge from node i to j indicates a causal (including both simultaneous and historical) influence. The subfigure on the right shows the reconstructed causal graph. Comparing two subfigures in Figure 3, we observe that the simple structure learning method performs almost flawlessly. In fact, only the edge 6 →4 is miss detected. On the larger case D2 with 35 processes, the method still works relatively well, correctly reconstructing 82.69% causal relations. Given that only the maximal in degree for all nodes is assumed a priori, these results not only justify the greedy approximation for the subset selection, but also demonstrate its effectiveness in causal structure learning applications. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Original 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Reconstructed Figure 3: Ground truth structure (left) versus Reconstructed causal graph (right), D1 dataset 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 Original 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 Reconstructed Figure 4: Ground truth structure (left) versus Reconstructed causal graph (right), D2 dataset 6 Conclusion Motivated by the problems of source detection and causal covariate selection, we start with two formulations of directed information based subset selection, and then we provide detailed submodularity analysis for both of the objective functions. To extend the greedy heuristics to possibly non-monotonic, approximately submodular functions, we introduce an novel notion, namely submodularity index, to characterize the “degree” of submodularity for general set functions. More importantly, we show that with SmI, the theoretical performance guarantee of greedy heuristic can be naturally extended to a much broader class of problems. We also point out several bounds and techniques that can be used to calculate SmI efficiently for the objectives under consideration. Experimental results on the synthesis and real data sets reaffirmed our theoretical findings, and also demonstrated the effectiveness of solving subset selection for learning causal structures. 7 Acknowledgments This research is funded by the Republic of Singapore’s National Research Foundation through a grant to the Berkeley Education Alliance for Research in Singapore (BEARS) for the Singapore-Berkeley Building Efficiency and Sustainability in the Tropics (SinBerBEST) Program. BEARS has been established by the University of California, Berkeley as a center for intellectual excellence in research and education in Singapore. We also thank the reviews for their helpful suggestions. References [1] A. S. A. Krause and C. Guestrin. Near-optimal sensor placements in gaussian processes: Theory, efficient algorithms and empirical studies. Journal of Machine Learning Research (JMLR), pages 9:235–284, 2008. [2] A. N.-M. Y. L. C. P. J. H. N. A. A. Lozano, H. Li. Spatial-temporal causal modeling for climate change attribution. ACM SIGKDD Conference on Knowledge Discovery and Data Mining (SIGKDD’09), 2009., 2009. 8 [3] D. K. Abhimanyu Das. Submodular meets spectral: Greedy algorithms for subset selection, sparse approximation and dictionary selection. Proc. of ICML 2011, Seattle, WA, 2011. [4] Z. Abrams, A. Goel, and S. Plotkin. Set k-cover algorithms for energy efficient monitoring in wireless sensor networks. In Proceedings of the 3rd international symposium on Information processing in sensor networks, pages 424–432. ACM, 2004. [5] V. Cevher and A. Krause. Greedy dictionary selection for sparse representation. Selected Topics in Signal Processing, IEEE Journal of, 5(5):979–988, 2011. [6] U. Feige, V. S. Mirrokni, and J. Vondrak. Maximizing non-monotone submodular functions. SIAM Journal on Computing, 40(4):1133–1153, 2011. [7] M. Feldman, J. Naor, and R. Schwartz. A unified continuous greedy algorithm for submodular maximization. In Foundations of Computer Science (FOCS), 2011 IEEE 52nd Annual Symposium on, pages 570–579. IEEE, 2011. [8] M. L. F. G. L. Nemhauser, L. A. Wolsey. An analysis of approximations for maximizing submodular set functions. Mathematical Programming, pages Volume 14, Issue 1, pp 265–294, 1978. [9] J. Jiao, H. H. Permuter, L. Zhao, Y.-H. Kim, and T. Weissman. Universal estimation of directed information. Information Theory, IEEE Transactions on, 59(10):6220–6242, 2013. [10] Y. Kawahara and T. Washio. Prismatic algorithm for discrete dc programming problem. In Advances in Neural Information Processing Systems, pages 2106–2114, 2011. [11] C.-W. Ko, J. Lee, and M. Queyranne. An exact algorithm for maximum entropy sampling. Operations Research, 43(4):684–691, 1995. [12] A. Krause and Guestrin. Near-optimal value of information in graphical models. UAI, 2005. [13] H. Lin and J. Bilmes. A class of submodular functions for document summarization. ACL/HLT, 2011. [14] P. Mathai, N. C. Martins, and B. Shapiro. On the detection of gene network interconnections using directed mutual information. In Information Theory and Applications Workshop, 2007, pages 274–283. IEEE, 2007. [15] K. Murphy et al. The bayes net toolbox for matlab. Computing science and statistics, 33(2):1024–1034, 2001. [16] M. Narasimhan and J. A. Bilmes. A submodular-supermodular procedure with applications to discriminative structure learning. arXiv preprint arXiv:1207.1404, 2012. [17] J. S. N. Niv Buchbinder, Moran Feldman and R. Schwartz. Submodular maximization with cardinality constraints. ACM-SIAM Symposium on Discrete Algorithms (SODA), 2014. [18] J. Pearl. Causality: Models, Reasoning and Inference (Second Edition). Cambridge university press, 2009. [19] C. J. Quinn, T. P. Coleman, N. Kiyavash, and N. G. Hatsopoulos. Estimating the directed information to infer causal relationships in ensemble neural spike train recordings. Journal of computational neuroscience, 30(1):17–44, 2011. [20] C. J. Quinn, N. Kiyavash, and T. P. Coleman. Directed information graphs. Information Theory, IEEE Transactions on, 61(12):6887–6909, 2015. [21] D. V. B. P. R. Sheehan, N. A. and M. D. Tobin. Mendelian randomisation and causal inference in observational epidemiology. PLoS medicine., 2008. [22] V. S. M. Uriel Feige and J. Vondrak. Maximizing non-monotone submodular functions. SIAM Journal on Computing, page 40(4):1133–1153, 2011. [23] G. Ver Steeg and A. Galstyan. Information-theoretic measures of influence based on content dynamics. In Proceedings of the sixth ACM international conference on Web search and data mining, pages 3–12. ACM, 2013. [24] Y. Zhou, Z. Kang, L. Zhang, and C. Spanos. Causal analysis for non-stationary time series in sensor-rich smart buildings. In Automation Science and Engineering (CASE), 2013 IEEE International Conference on, pages 593–598. IEEE, 2013. 9
2016
298
6,214
Linear Feature Encoding for Reinforcement Learning Zhao Song, Ronald Parr†, Xuejun Liao, Lawrence Carin Department of Electrical and Computer Engineering † Department of Computer Science Duke University, Durham, NC 27708, USA Abstract Feature construction is of vital importance in reinforcement learning, as the quality of a value function or policy is largely determined by the corresponding features. The recent successes of deep reinforcement learning (RL) only increase the importance of understanding feature construction. Typical deep RL approaches use a linear output layer, which means that deep RL can be interpreted as a feature construction/encoding network followed by linear value function approximation. This paper develops and evaluates a theory of linear feature encoding. We extend theoretical results on feature quality for linear value function approximation from the uncontrolled case to the controlled case. We then develop a supervised linear feature encoding method that is motivated by insights from linear value function approximation theory, as well as empirical successes from deep RL. The resulting encoder is a surprisingly effective method for linear value function approximation using raw images as inputs. 1 Introduction Feature construction has been and remains an important topic for reinforcement learning. One of the earliest, high profile successes of reinforcement learning, TD-gammon [1], demonstrated a huge performance improvement when expert features were used instead of the raw state, and recent years have seen a great deal of practical and theoretical work on understanding feature selection and generation for linear value function approximation [2–5]. More recent practical advances in deep reinforcement learning have initiated a new wave of interest in the combination of neural networks and reinforcement learning. For example, Mnih et al. [6] described a reinforcement learning (RL) system, referred to as Deep Q-Networks (DQN), which learned to play a large number of Atari video games as well as a good human player. Despite these successes and, arguably because of them, a great deal of work remains to be done in understanding the role of features in RL. It is common in deep RL methods to have a linear output layer. This means that there is potential to apply the insights gained from years of work in linear value function approximation to these networks, potentially giving insight to practitioners and improving the interpretability of the results. For example, the layers preceding the output layer could be interpreted as feature extractors or encoders for linear value function approximation. As an example of the connection between practical neural network techniques and linear value function approximation theory, we note that Oh et al. [7] introduced spatio-temporal prediction architectures that trained an action-conditional encoder to predict next states, leading to improved performance on Atari games. Oh et al. cited examples of next state prediction as a technique used in neural networks in prior work dating back several decades, though this approach is also suggested by more recent linear value function approximation theory [4]. In an effort to extend previous theory in a direction that would be more useful for linear value function approximation and, hopefully, lead to greater insights into deep RL, we generalize previous work 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. on analyzing features for uncontrolled linear value function approximation [4] to the controlled case. We then build on this result to provide a set of sufficient conditions which guarantee that encoded features will result in good value function approximation. Although inspired by deep RL, our results (aside from one negative one in Section 3.2 ) apply most directly to the linear case, which has been empirically explored in Liang et al. [8]. This implies the use of a rich, original (raw) feature space, such as sequences of images from a video game without persistent, hidden state. The role of feature encoding in such cases is to find a lower dimensional representation that is suitable for linear value function approximation. Feature encoding is still needed in such cases because the raw state representation is so large that it is impractical to use directly. Our approach works by defining an encoder and a decoder that use a lower dimensional representation to encode and predict both reward and next state. Our results differ from previous results [4] in linear value function approximation theory that provided sufficient conditions for good approximation. Specifically, our results span two different representations, a large, raw state representation and a reduced one. We propose an efficient coordinate descent algorithm to learn parameters for the encoder and decoder. To demonstrate the effectiveness of this approach, we consider the challenging (for linear techniques) problem of learning features from raw images in pendulum balancing and blackjack. Surprisingly, we are able to discover good features and learn value functions in these domains using just linear encoding and linear value function approximation. 2 Framework and Notation Markov Decision Processes (MDPs) can be represented as a tuple ⟨S, A, R, P, γ⟩, where S = {s1, s2, . . . , sn} is the state set, A = {a1, a2, . . . , am} is the action set, R ∈Rnm×1 represents the reward function whose element R(si, aj) denotes the expected immediate reward when taking action aj in state si, P ∈Rnm×n denotes the transition probabilities of underlying states whose element P  (si, a), sj  is the probability of transiting from state si to state sj when taking an action a, and γ ∈[0, 1) is the discount factor for the future reward. The policy π in an MDP can be represented in terms of the probability of taking action a when in state s, i.e., π(a|s) ∈[0, 1] and P a π(a|s) = 1. Given a policy π, we define P π ∈Rnm×nm as the transition probability for the state-action pairs, where P π(s′, a′|s, a) = P  (s, a), s′ π(a′|s′). For any policy π, its Q-function is defined over the state-action pairs, where Qπ(s, a) represents the expected total γ−discounted rewards when taking action a in state s and following π afterwards. For the state-action pair (s, a), the Q−function satisfies the following Bellman equation: Qπs, a  = R(s, a) + h γ X s′,a′ P π(s′, a′|s, a) Qπs′, a′i (1) 2.1 The Bellman operator We define the Bellman operator T π on the Q−functions as (T πQ)(s, a) = R(s, a) + h γ X s′,a′ P π(s′, a′|s, a) Q s′, a′i . Qπ is known to be a fixed point of T π, i.e., T πQπ = Qπ. Of particular interest in this paper is the Bellman error for an approximated Q-function to Qπ, specifically BE( bQπ) = T π bQπ −bQπ. When the Bellman error is 0, the Q-function is at the fixed point. Otherwise, we have [9]: ∥bQπ −Qπ∥∞≤∥bQπ −T π bQπ∥∞/ (1 −γ), where ∥x∥∞refers to the ℓ∞norm of a vector x. 2.2 Linear Approximation When the Q-function cannot be represented exactly, we can approximate it with a linear function as bQπ(s, a) = Φwπ Φ, with Φ = [Φ(s1, a1) . . . Φ(sn, am)]T ∈Rnm×km, Φ(si, aj) ∈Rkm×1 is a feature vector for state si and action aj, superscript T represents matrix transpose, and wπ Φ ∈Rkm×1 is the weight vector. 2 Given the features Φ, the linear fixed point methods [10–12] aim to estimate wπ Φ, by solving the following fixed-point equation: Φwπ Φ = Π(R + γP πΦwπ Φ) (2) where Π = Φ(ΦT Φ)−1ΦT is the orthogonal ℓ2 projector on span(Φ). Solving (2) leads to the following linear fixed-point solution: wπ Φ = (ΦT Φ −γΦT P πΦ)−1 ΦT R. 2.3 Feature Selection/Construction There has been great interest in recent years in automating feature selection or construction for reinforcement learning. Research in this area has typically focused on using a linear value function approximation method with a feature selection wrapper. Parr et al. [2] proposed using the Bellman error to generate new features, but this approach did not scale well in practice. Mahadevan and Maggioni [3] explored a feature generation approach based upon the Laplacian of a connectivity graph of the MDP. This approach has many desirable features, though it did not connect directly to the optimization problem implied by the MDP and could produce worthless features in pathological cases [4]. Geramifard et al. [13] and Farahmand and Precup [14] consider feature construction where features are built up through composition of base or atomic features. Such approaches are reminiscent of classical approaches to features construction. They can be useful, but they can also be myopic if the needed features are not reachable through chains of simpler features where each step along the chain is a demonstrable improvement. Feature selection solves a somewhat different problem from feature construction. Feature selection assumes that a reasonable set of candidate features are presented to the learner, and the learner’s task is to find the good ones from a potentially large set of mostly worthless or redundant ones. LASSO [15] and Orthogonal Matching Pursuit (OMP) [16] are methods of feature selection for regression that have been applied to reinforcement learning [17, 5, 18, 19]. In practice, these approaches do require that good features are present within the larger set, so they do not address the question of how to generate good features in the first place. 3 Theory for Feature Encoding Previous work demonstrated an equivalence between linear value function approximation and linear model approximation [20, 21, 4], as well as the relationship between errors in the linear model and the Bellman error for the linear fixed point [4]. Specifically, low error in the linear model could imply low Bellman error in the linear fixed point approximation. These results were for the uncontrolled case. A natural extension of these results would be to construct features for action-conditional linear models, one for each action, and use those features across multiple policies, i.e., through several iterations of policy iteration. Anecdotally, this approach seemed to work well in some cases, but there were no theoretical results to justify it. The following example demonstrates that features which are sufficient for perfect linear action models and reward models, may not suffice for perfect linear value function approximation. Example 1. Consider an MDP with a single feature φ(x) = x, two actions that have no effect, p(x|x, a1) = 1.0 and p(x|x, a2) = 1.0, and with R(x, a1) = x and R(x, a2) = −x. The single feature φ is sufficient to construct a linear predictor of the expected next state and reward. However, the value function is not linear in φ since V ∗(x) = |x| / (1 −γ). The significance of this example is that existing theory on the connection between linear models and linear features does not provide sufficient conditions on the quality of the features for model approximation that would ensure good value function approximation for all policies. Existing theory also does not extend to provide a connection between the model error for a set of features and the Bellman error of a Q-function based on these features. To make this connection, the features must be thought of as predicting not only expected next features, but expected next feature-action combinations. Below, we extend the results of Parr et al. [4] to Q-functions and linear state-action models. 3 The linear model Similar to Parr et al. [4], we approximate the reward R and the expected policyconditional next feature P πΦ in the controlled case, using the following linear model: ˆR = ΦrΦ = Φ(ΦT Φ)−1ΦT R (3a) [ P πΦ = ΦP π Φ = Φ(ΦT Φ)−1ΦT P πΦ. (3b) Since bQπ = Φw for some w, the fixed-point equation in (1) becomes Φw = ΦrΦ + γΦP π Φw (4a) w = (I −γP π Φ)−1 rΦ (4b) Lemma 2. For any MDP M with features Φ and policy π represented as the fixed point of the approximate Q−function, the linear-model solution and the linear fixed-point solution are the same. Proof: See Supplemental Materials. To analyze the error in the controlled case, we define the Bellman error for the state-value function, given a policy π as BE bQπ(s, a)  = R(s, a) + h γ X s′,a′ P π(s′, a′|s, a) bQπs′, a′i −bQπ(s, a). As a counterpart to Parr et al. [4], we introduce the following reward error and policy-conditional per-feature error, in the controlled case as ∆R = R −ˆR = R −ΦrΦ (5a) ∆π Φ = P πΦ −[ PΦπ = P πΦ −ΦP π Φ. (5b) Theorem 3. For any MDP M with feature Φ, and policy π represented as the fixed point of the approximate Q−function, the Bellman error can be represented as BE bQπ = ∆R + γ∆π Φwπ Φ. Proof: See Supplemental Materials. Theorem 3 suggests a sufficient condition for a good set of features: If the model prediction error ∆π Φ, and reward prediction error ∆R are low, then the Bellman error must also be low. Previous work did not give an in-depth understanding of how to construct such features. In Parr et al. [2], the Bellman error is defined only on the training data. Since it is orthogonal to the span of the existing features, there is no convenient way to approximate it, and the extension to off-sample states is not obvious. They used locally weighted regression with limited success, but the process was slow and prone to the usual perils of non-parametric approximators, such as high sensitivity to the distance function used. One might hope to minimize (5a) and (5b) directly, perhaps using sampled states and next states, but this is not a straightforward optimization problem to solve in general, because the search space for Φ is the space of functions and because Φ appears inconveniently on both sides of 5(b) making it difficult rearrange terms to solve for Φ as an optimization problem with a fixed target. Thus, without additional assumptions about how the states are initially encoded and what space of features will be searched, it is challenging to apply Theorem 3 directly. Our solution to this difficulty is to apply the theorem in a somewhat indirect manner: First we assume that the input is a rich, raw feature set (e.g., images) and that the primary challenge is reducing the size of the feature set rather than constructing more elaborate features. Next, we restrict our search space for Φ to the space of linear encodings of these raw features. Finally, we require that these encoded features are predictive of next raw features rather than next encoded features. This approach differs from what Theorem 3 requires but it results in an easier optimization problem and, as shown below, we are able to use Theorem 3 to show that this alternative condition is sufficient to represent the true value function. We now present a theory of predictively optimal feature encoding. We refer to the features that ultimately are used by a linear value function approximation step using the familiar Φ notation, and we refer to the inputs before feature encoding as the raw features, A. For n samples and l raw features, we can think of A as an nm × lm matrix. For every row in A, only the block corresponding to the action taken is non-zero. The raw features are operated on by an encoder: 4 Definition 4. The encoder, Eπ (or Eπ in the linear case) is a transformation Eπ(A) = Φ. We use the notation Eπ because we think of it as encoding the raw state. When the encoder is linear, Eπ = Eπ, where Eπ is an lm × km matrix that right multiplies A, AEπ = Φ. We want to encode a reduced size representation of the raw features sufficient to predict the next expected reward and raw features because, as proven below, doing so is a sufficient (though not necessary) condition for good linear value function approximation. Prediction of next raw feature and rewards is done via a decoder, which is a matrix in this paper, but could be non-linear in general: Definition 5. The decoder, D, is a km × (lm + 1) matrix predicting [P πA, R] from Eπ(A). This approach is distinct from the work of Parr et al. [4] for several reasons. We study a set of conditions on a reduced size feature set and study the relationship between the reduced feature set and the original features, and we provide an algorithm in the next section for constructing these features. Definition 6. Φ = Eπ(A) is predictively optimal with respect to A and π if there exists a Dπ such that Eπ(A)Dπ = [P πA, R]. 3.1 Linear Encoder and Linear Decoder In the linear case, a predictively optimal set of features satisfies: AEπDπ = AEπ[Ds π, Dr π] = [P πA, R] (6) where Ds π and Dr π represent the first lm columns and the last column of Dπ, respectively. Theorem 7. For any MDP M with predictively optimal Φ = AEπ for policy π, if the linear fixed point for Φ is bQπ, BE( bQπ) = 0. Proof: See Supplemental Materials. 3.2 Non-linear Encoder and Linear Decoder One might expect that the results above generalize easily to the case where a more powerful encoder is used. This could correspond, for example, to a deep network with a linear output layer used for value function approximation. Surprisingly, the generalization is not straightforward: Theorem 8. The existence of a non-linear encoder E and linear decoder D such that E(A)D = [P πA, R] is not sufficient to ensure predictive optimality of Φ = E(A). Proof: See Supplemental Materials. This negative result doesn’t shut the door on combining non-linear encoders with linear decoders. Rather, it indicates that additional conditions beyond those needed in the linear case are required to ensure optimal encoding. For example, requiring that the encoded features lie in an invariant subspace of P π [4] would be a sufficient condition (though of questionable practicality). 4 Iterative Learning of Policy and Encoder In practice we do not have access to P π, but do have access to the raw feature representation of sampled states and sampled next states. To train the encoder Eπ and decoder Dπ, we sample states and next states from a data collection policy. When exploration is not the key challenge, this can be done with a single data collection run using a policy that randomly selects actions (as is often done with LSPI [22]). For larger problems, it may be desirable to collect additional samples as the policy changes. These sampled states and next states are represented by matrices ˜A and A′, respectively. Theorem 7 suggests that given a policy π, zero Bellman error can be achieved if features are encoded appropriately. Subsequently, the obtained features and resulting Q-functions can be used to update the policy, with an algorithm such as LSPI. In a manner similar to the policy update in LSPI, the non-zero blocks in A′ are changed accordingly after a new policy is learned. With the updated A′, we re-learn the encoder and then repeat the process, as summarized in Algorithm 1. It may be desirable to update the policy several times while estimating bQπ since the encoded features may still be useful if the policy has not changed much. Termination conditions for this algorithm are typical approximate policy iteration termination conditions. 4.1 Learning Algorithm for Encoder 5 Algorithm 1 Iterative Learning of Encoder and Policy while Termination Conditions Not Satisfied do Learn the encoder Eπ and decoder Dπ Estimate bQπ Update the next raw state A′, by changing the position of non-zero blocks according to the greedy policy for bQπ. end while In our implementation, the encoder Eπ and decoder Dπ are jointly learned using Algorithm 2, which seeks to minimize ∥˜AEπDπ −[A′, R]∥F by coordinate descent [23], where ∥X∥F represents the Frobenius norm of a matrix X. Note that ˜A can be constructed as a block diagonal matrix, where each block corresponds to the samples from each action. Subsequently, the pseudoinverse of ˜A in Algorithm 2 can be efficiently computed, by operating on the pseudoinverse of each block in ˜A. Algorithm 2 alternatively updates Eπ and Dπ until one of the following conditions is met: (1) the number of iterations reaches the maximally allowed one; (2) the residual ∥˜ AEπDπ−[A′,R]∥F ∥[A′,R]∥F is below a threshold; (3) the current residual is greater than the previous residual. For regularization, we use the truncated singular value decomposition (SVD) [24] when taking the pseudo-inverses of ˜A to discard all but the top k singular vectors in each block of ˜A. Algorithm 2 Linear Feature Discovery LINEARENCODERFEATURES ( ˜A, A′, R, k ) Dπ ←rand(km, lm + 1) while Convergence Conditions Not Satisfied do Eπ ←˜A†[A′, R]D† π Dπ ←( ˜AEπ)†[A′, R] end while return Eπ See text for termination conditions. rand represents samples from uniform [0, 1]. † is the (truncated) Moore-Penrose pseudoinverse. Algorithm 2 is based on a linear encoder and a linear decoder. Consequently, one may notice that the value function is also linear in the domain of the raw features, i.e., the value function can be represented as bQπ = ˜A Eπ w = ˜Aw′ with w′ = Eπw. One may wonder, why it is not better to solve for w′ directly with regularization on w′? Although it is impractical to do this using batch linear value function approximation methods, due to the size of the feature matrix, one might argue that on-line approaches such as deep RL techniques approximate this approach by stochastic gradient descent. To the extent this characterization is accurate, it only increases the importance of having a clear understanding of feature encoding as an important sub-problem, since this is the natural interpretation of everything up to the final layer in such networks and is even an explicit objective in some cases [7]. 5 Experiments The goal of our experiments is to show that the model of and algorithms for feature encoding presented above are practical and effective. The use of our encoder allows us to learn good policies using linear value function approximation on raw images, something that is not generally perceived to be easy to do. These experiments should be viewed as validating this approach to feature encoding, but not competing with deep RL methods, which are non-linear and use far greater computational resources. We implement our proposed linear encoder-decoder model and, for comparison, the random projection model in Ghavamzadeh et al. [25]. We tested them on the Inverted Pendulum and Blackjack [26], two popular benchmark domains in RL. Our test framework creates raw features using images, where the elements in the non-zero block of ˜A correspond to an image that has been converted to vector by concatenating the rows of the image. For each problem, we run Algorithm 1 50 times independently to account for the randomness in the training data. Our training data are formed by running a simulation for the desired number of steps and choosing actions at random. For the encoder, the number of features k is selected over the validation set to achieve the best performance. All code is written in MATLAB and tested on a machine with 3.1GHz CPU and 8GB RAM. Our test results show that Algorithm 1 cost at most half an hour to run, for the inverted pendulum and blackjack problems. To verify that the encoder is doing something interesting, rather than simply picking features from ˜A, we also tried a greedy, sparse reinforcement learning algorithm, OMP-TD [5] using ˜A as the candidate feature set. Our results, however, showed that OMP-TD’s performance was much worse than the approach using linear encoder. We skip further details on OMP-TD’s performance for conciseness. 6 5.1 Inverted Pendulum We used a version of the inverted pendulum adapted from Lagoudakis and Parr [22], a continuous control problem with 3 discrete actions, left, right, or nothing, corresponding to the force applied to a cart on an infinite rail upon which an inverted pendulum is mounted. The true state is described by two continuous variables, the angle and angular velocity of the pendulum. For the version of the problem used here, there is a reward of 0 for each time step the pendulum is balanced, and a penalty of −1 for allowing the pendulum to fall, after which the system enters an absorbing state with value 0. The discount factor is set to be 0.95. For the training data, we collected a desired number of trajectories with starting angle and angular velocity sampled uniformly on [−0.2, 0.2]. These trajectories were truncated after 100 steps if the pendulum had not already fallen. Algorithm 2 did not see the angle or angular velocity. Instead, the algorithm was given two successive, rendered, grayscale images of the pendulum. Each image has 35 × 52 pixels and hence the raw state is a 35 × 52 × 2 = 3640 dimensional vector. To ensure that these two images are a Markovian representation of the state, it was necessary to modify the simulator. The original simulator integrated the effects of gravity and the force applied over the time step of the simulator. This made the simulation more accurate, but has the consequence that the change in angle between two successive time steps could differ from the angular velocity. We forced the angular velocity to match the change in angle per time step, thereby making the two successive images a Markovian state. We compare the linear encoder with the features using radial basis functions (RBFs) in Lagoudakis and Parr [22], and the random projection in Ghavamzadeh et al. [25]. The learned policy was then evaluated 100 times to obtain the average number of balancing steps. For each episode, a maximum of 3000 steps is allowed to run. If a run achieves this maximum number, we claim it as a success and count it when computing the probability of success. We used k = 50 features for both linear encoder and random projection. 200 400 600 800 1000 Number of training episodes 0 500 1000 1500 2000 2500 3000 Steps Encoder-2 Encoder-1 RBF Random Projection (a) 200 400 600 800 1000 Number of training episodes 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Probability of success Encoder-2 Encoder-1 RBF Random Projection (b) Figure 1: (a) Number of balancing steps and (b) prob. of success, vs. number of training episodes. Figure 1 shows the results with means and 95% confidence intervals, given different numbers of training episodes, where Encoder−τ corresponds to the version of Algorithm 1 with τ changes in the encoder. We observe that for most of the points, our proposed encoder achieves better performance than RBFs and random projections, in terms of both balancing steps and the probability of success. This is a remarkable result because the RBFs had access to the underlying state, while the encoder was forced to discover an underlying state representation based upon the images. Moreover, Encoder−2 achieves slightly better performance than Encoder−1 in most of the testing points. We also notice that further increasing τ did not bring any obvious improvement, based on our test. 5.2 Blackjack There are 203 states in this problem, so we can solve directly for the optimal value V ∗and the optimal policy π∗explicitly. The states from 1-200 in this problem can be completely described by the information from the ace status (usable or not), player’s current sum (12-21), and dealer’s one showing card (A-10). The terminal states 201- 203 correspond to win, lose, and draw, respectively. We set k = 203 features for the linear encoder. To represent raw states for the encoder, we use three concatenated sampled MNIST digitsand hence a raw state is a 28 × 28 × 3 = 2352 dimensional vector. Two examples of such raw states are shown in Figure 2. Note that three terminal states are represented by “300”, “400”, and “500”, respectively. 7 The training data are formed by executing the random policy with the desired number of episodes. Our evaluation metrics for a policy represented by the value V and the corresponding action a are Relative value error = ∥V −V ∗∥2 / ∥V ∗∥2, Action error = ∥a −a∗∥0. We compare the features discovered by the linear encoder and random projection against indicator functions on the true state, since such indicator features should be the gold standard. (a) (b) Figure 2: Two examples of the blackjack state rendered as three MNIST digits. We can make the encoder and random projection’s tasks more challenging by adding noise to the raw state. Although it is not guaranteed in general (Example 1), it suffices to learn a single encoder that persisted across policies for this problem, so we report results for a single set of encoded features. We denote the algorithms using linear encoder as Encoder-Image-κ and the algorithms using random projection as Random-Image-κ, where κ is the number of possible images used for each digit. For example κ = 10 means that the image for each digit is randomly selected from the first 10 images in the MNIST training dataset. Number of training episodes 2000 4000 6000 8000 10000 Relative value error 0.2 0.4 0.6 0.8 1 1.2 Random-Image-10 Encoder-Image-10 Random-Image-1 Encoder-Image-1 Indicator (a) Number of training episodes 2000 4000 6000 8000 10000 Action error 20 25 30 35 40 45 50 55 60 65 70 75 Random-Image-10 Encoder-Image-10 Random-Image-1 Encoder-Image-1 Indicator (b) Figure 3: (a) Relative value error and (b) action error, as functions of the number of training episodes. An additional plot for the actual return is provided in Supplemental Materials. Figure 3 shows the surprising result that Encoder-Image-1 and Random-Image-1 achieve superior performance to indicator functions on the true state when the number of training episodes is less than or equal to 6000. In this case, the encoded state representation wound up having less than 203 effective parameters because the SVD in the pseudoinverse found lower dimensional structure that explained most of the variation and discarded the rest as noise because the singular values were below threshold. This put the encoder in the favorable side of the bias-variance trade off when training data were scarce. When the number of training episodes becomes larger, the indicator function outperforms the linear encoder, which is consistent with its asymptotically optimal property. Furthermore, the performance of the encoder becomes worse as κ is larger. This matches our expectation that a larger κ means that a state would be mapped to more possible digits and thus extracting features for the same state becomes more difficult. Finally, we notice that our proposed encoder is more robust to noise, when compared with random projection: Encoder-Image-10 outperforms Random-Image-10 with remarkable margins, measured in both relative value error and action error. 6 Conclusions and Future Work We provide a theory of feature encoding for reinforcement learning that provides guidance on how to reduce a rich, raw state to a lower-dimensional representation suitable for linear value function approximation. Our results are most compelling in the linear case, where we provide a framework and algorithm that enables linear value function approximation using a linear encoding of raw images. Although our framework aligns with practice for deep learning [7], our results indicate that future work is needed to elucidate the additional conditions that are needed to extend theory to guarantee good performance in the non-linear case. Acknowledgements We thank the anonymous reviewers for their helpful comments and suggestions. This research was supported in part by ARO, DARPA, DOE, NGA, ONR and NSF. 8 References [1] G. Tesauro, “TD-Gammon, a self-teaching backgammon program, achieves master-level play,” Neural Computation, 1994. [2] R. Parr, C. Painter-Wakefield, L. Li, and M. Littman, “Analyzing feature generation for value-function approximation,” in ICML, 2007. [3] S. Mahadevan and M. Maggioni, “Proto-value functions: A Laplacian framework for learning representation and control in Markov decision processes,” JMLR, 2007. [4] R. Parr, L. Li, G. Taylor, C. Painter-Wakefield, and M. L. Littman, “An analysis of linear models, linear value-function approximation, and feature selection for reinforcement learning,” in ICML, 2008. [5] C. Painter-wakefield and R. Parr, “Greedy algorithms for sparse reinforcement learning,” in ICML, 2012. [6] V. Mnih et al., “Human-level control through deep reinforcement learning,” Nature, 2015. [7] J. Oh, X. Guo, H. Lee, R. L. Lewis, and S. Singh, “Action-conditional video prediction using deep networks in Atari games,” in NIPS, 2015. [8] Y. Liang, M. C. Machado, E. Talvitie, and M. Bowling, “State of the art control of Atari games using shallow reinforcement learning,” in AAMAS, 2016. [9] R. J. Williams and L. C. Baird III, “Tight performance bounds on greedy policies based on imperfect value functions,” Northeastern University, Tech. Rep., 1993. [10] R. S. Sutton, “Learning to predict by the method of temporal differences,” Machine Learning, 1988. [11] S. Bradtke and A. Barto, “Linear least-squares algorithms for temporal difference learning,” Machine learning, 1996. [12] H. Yu and D. P. Bertsekas, “Convergence results for some temporal difference methods based on least squares,” IEEE TAC, 2009. [13] A. Geramifard, T. J. Walsh, N. Roy, and J. How, “Batch iFDD: A scalable matching pursuit algorithm for solving MDPs,” in UAI, 2013. [14] A. M. Farahmand and D. Precup, “Value pursuit iteration,” in NIPS, 2012. [15] R. Tibshirani, “Regression shrinkage and selection via the Lasso,” JRSSB, 1996. [16] S. G. Mallat and Z. Zhang, “Matching pursuits with time-frequency dictionaries,” IEEE TSP, 1993. [17] J. Z. Kolter and A. Y. Ng, “Regularization and feature selection in least-squares temporal difference learning,” in ICML, 2009. [18] M. Petrik, G. Taylor, R. Parr, and S. Zilberstein, “Feature selection using regularization in approximate linear programs for Markov decision processes,” in ICML, 2010. [19] J. Johns, C. Painter-Wakefield, and R. Parr, “Linear complementarity for regularized policy evaluation and improvement,” in NIPS, 2010. [20] R. Schoknecht, “Optimality of reinforcement learning algorithms with linear function approximation,” in NIPS, 2002. [21] R. S. Sutton, C. Szepesvári, A. Geramifard, and M. H. Bowling, “Dyna-style planning with linear function approximation and prioritized sweeping,” in UAI, 2008. [22] M. Lagoudakis and R. Parr, “Least-squares policy iteration,” JMLR, 2003. [23] S. Boyd and L. Vandenberghe, Convex Optimization. Cambridge University Press, 2004. [24] P. C. Hansen, “The truncated SVD as a method for regularization,” BIT Numerical Mathematics, 1987. [25] M. Ghavamzadeh, A. Lazaric, O. Maillard, and R. Munos, “LSTD with random projections,” in NIPS, 2010. [26] R. S. Sutton and A. G. Barto, Reinforcement Learning: An Introduction. The MIT Press, 1998. 9
2016
299
6,215
Tagger: Deep Unsupervised Perceptual Grouping Klaus Greff*, Antti Rasmus, Mathias Berglund, Tele Hotloo Hao, Jürgen Schmidhuber*, Harri Valpola The Curious AI Company {antti,mathias,hotloo,harri}@cai.fi *IDSIA {klaus,juergen}@idsia.ch Abstract We present a framework for efficient perceptual inference that explicitly reasons about the segmentation of its inputs and features. Rather than being trained for any specific segmentation, our framework learns the grouping process in an unsupervised manner or alongside any supervised task. We enable a neural network to group the representations of different objects in an iterative manner through a differentiable mechanism. We achieve very fast convergence by allowing the system to amortize the joint iterative inference of the groupings and their representations. In contrast to many other recently proposed methods for addressing multi-object scenes, our system does not assume the inputs to be images and can therefore directly handle other modalities. We evaluate our method on multi-digit classification of very cluttered images that require texture segmentation. Remarkably our method achieves improved classification performance over convolutional networks despite being fully connected, by making use of the grouping mechanism. Furthermore, we observe that our system greatly improves upon the semi-supervised result of a baseline Ladder network on our dataset. These results are evidence that grouping is a powerful tool that can help to improve sample efficiency. 1 Introduction Figure 1: An example of perceptual grouping for vision. Humans naturally perceive the world as being structured into different objects, their properties and relation to each other. This phenomenon which we refer to as perceptual grouping is also known as amodal perception in psychology. It occurs effortlessly and includes a segmentation of the visual input, such as that shown in in Figure 1. This grouping also applies analogously to other modalities, for example in solving the cocktail party problem (audio) or when separating the sensation of a grasped object from the sensation of fingers touching each other (tactile). Even more abstract features such as object class, color, position, and velocity are naturally grouped together with the inputs to form coherent objects. This rich structure is crucial for many real-world tasks such as manipulating objects or driving a car, where awareness of different objects and their features is required. In this paper, we introduce a framework for learning efficient iterative inference of such perceptual grouping which we call iTerative Amortized Grouping (TAG). This framework entails a mechanism for iteratively splitting the inputs and internal representations into several different groups. We make no assumptions about the structure of this segmentation and rather train the model end-to-end to discover which are the relevant features and how to perform the splitting. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. PARAMETRIC MAPPING PARAMETRIC MAPPING PARAMETRIC MAPPING PARAMETRIC MAPPING q1(x) iteration 1 iteration 2 iteration 3 q1(x) q1(x|g) q2(x) q3(x) ˜x ˜x x x z0 m1 z1 m2 m0 z2 m3 z3 L(m0) δz0 δz1 δzi-1 mi mi-1 zi-1 zi δz2 L(mi-1) L(m1) L(m2) Figure 2: Left: Three iterations of the TAG system which learns by denoising its input using several groups (shown in color). Right: Detailed view of a single iteration on the TextureMNIST1 dataset. Please refer to the supplementary material for further details. By using an auxiliary denoising task we train the system to directly amortize the posterior inference of the object features and their grouping. Because our framework does not make any assumptions about the structure of the data, it is completely domain agnostic and applicable to any type of data. The TAG framework works completely unsupervised, but can also be combined with supervised learning for classification or segmentation. 2 Iterative Amortized Grouping (TAG)1 Grouping. Our goal is to enable neural networks to split inputs and internal representations into coherent groups. We define a group to be a collection of inputs and internal representations that are processed together, but (largely) independent of each other. By processing each group separately the network can make use of invariant distributed features without the risk of interference and ambiguities, which might arise when processing everything in one clump. We make no assumptions about the correspondence between objects and groups. If the network can process several objects in one group without unwanted interference, then the network is free to do so. The “correct” grouping is often dynamic, ambiguous and task dependent. So rather than training it as a separate task, we allow the network to split the processing of the inputs, and let it learn how to best use this ability for any given problem. To make the task of instance segmentation easy, we keep the groups symmetric in the sense that each group is processed by the same underlying model. Amortized Iterative Inference. We want our model to reason not only about the group assignments but also about the representation of each group. This amounts to inference over two sets of variables: the latent group assignments and the individual group representations; A formulation very similar to mixture models for which exact inference is typically intractable. For these models it is a common approach to approximate the inference in an iterative manner by alternating between (re-)estimation of these two sets (e.g., EM-like methods [4]). The intuition is that given the grouping, inferring the object features becomes easy, and vice versa. We employ a similar strategy by allowing our network to iteratively refine its estimates of the group assignments as well as the object representations. Rather than deriving and then running an inference algorithm, we train a parametric mapping to arrive at the end result of inference as efficiently as possible [9]. This is known as amortized inference [31], and it is used, for instance, in variational autoencoders where the encoder learns to amortize the posterior inference required by the generative model represented by the decoder. Here we instead apply the framework of denoising autoencoders [6, 15, 34] which are trained to reconstruct original inputs x from corrupted versions ˜x. This encourages the network to implement useful amortized posterior inference without ever having to specify or even know the underlying generative model whose inference is implicitly learned. 1Note: This section only provides a short and high-level overview of the TAG framework and Tagger. For a more detailed description please refer to the supplementary material or the extended version of this paper: https://arxiv.org/abs/1606.06724 2 Data: x, K, T, σ, v, Wh, Wu, Θ Result: zT , mT , C begin Initialization: ˜x ←x + N(0, σ2I); m0 ←softmax(N(0, I)); z0 ←E[x]; end for i = 0 . . . T −1 do for k = 1 . . . K do ˜zk ←N(˜x; zi k, (v + σ2)I); δzi k ←(˜x −zi k)mi k˜zk; L(mi k) ← ˜zk P h ˜zh ; hi k ←f(Wh  zi k, mi k, δzi k, L(mi k)  ); [zi+1 k , mi+1 k ] ←WuLadder(hi k, Θ); end mi+1 ←softmax(mi+1); qi+1(x) ←PK k=1 N(x; zi+1 k , vI)mi+1; end C ←−PT i=1 log qi(x); Algorithm 1: Pseudocode for running Tagger on a single real-valued example x. For details and a binaryinput version please refer to supplementary material. Figure 3: An example of how Tagger would use a 3-layer-deep Ladder Network as its parametric mapping to perform its iteration i + 1. Note the optional class prediction output yi g for classification tasks. See supplementary material for details. Putting it together. By using the negative log likelihood C(x) = −P i log qi(x) as a cost function, we train our system to compute an approximation qi(x) of the true denoising posterior p(x|˜x) at each iteration i. An overview of the whole system is given in Figure 2. For each input element xj we introduce K latent binary variables gk,j that take a value of 1 if this element is generated by group k. This way inference is split into K groups, and we can write the approximate posterior in vector notation as follows: qi(x) = X k qi(x|gk)qi(gk) = X k N(x; zi k, vI)mi k , (1) where we model the group reconstruction qi(x|gk) as a Gaussian with mean zi k and variance v, and the group assignment posterior qi(gk) as a categorical distribution mk. The trainable part of the TAG framework is given by a parametric mapping that operates independently on each group k and is used to compute both zi k and mi k (which is afterwards normalized using an elementwise softmax over the groups). This parametric mapping is usually implemented by a neural network and the whole system is trained end-to-end using standard backpropagation through time. The input to the network for the next iteration consists of the vectors zi k and mi k along with two additional quantities: The remaining modelling error δzi k and the group assignment likelihood ratio L(mi k) which carry information about how the estimates can be improved: δzi k ∝∂C(˜x) ∂zi k and L(mi k) ∝ qi(˜x|gk) P h qi(˜x|gh) Note that they are derived from the corrupted input ˜x, to make sure we don’t leak information about the clean input x into the system. Tagger. For this paper we chose the Ladder network [19] as the parametric mapping because its structure reflects the computations required for posterior inference in hierarchical latent variable models. This means that the network should be well equipped to handle the hierarchical structure one might expect to find in many domains. We call this Ladder network wrapped in the TAG framework Tagger. This is illustrated in Figure 3 and the corresponding pseudocode can be found in Algorithm 1. 3 3 Experiments and results We explore the properties and evaluate the performance of Tagger both in fully unsupervised settings and in semi-supervised tasks in two datasets2. Although both datasets consist of images and grouping is intuitively similar to image segmentation, there is no prior in the Tagger model for images: our results (unlike the ConvNet baseline) generalize even if we permute all the pixels . Shapes. We use the simple Shapes dataset [21] to examine the basic properties of our system. It consists of 60,000 (train) + 10,000 (test) binary images of size 20x20. Each image contains three randomly chosen shapes (△, ▽, or □) composed together at random positions with possible overlap. Textured MNIST. We generated a two-object supervised dataset (TextureMNIST2) by sequentially stacking two textured 28x28 MNIST-digits, shifted two pixels left and up, and right and down, respectively, on top of a background texture. The textures for the digits and background are different randomly shifted samples from a bank of 20 sinusoidal textures with different frequencies and orientations. Some examples from this dataset are presented in the column of Figure 4b. We use a 50k training set, 10k validation set, and 10k test set to report the results. We also use a textured single-digit version (TextureMNIST1) without a shift to isolate the impact of texturing from multiple objects. 3.1 Training and evaluation We train Tagger in an unsupervised manner by only showing the network the raw input example x, not ground truth masks or any class labels, using 4 groups and 3 iterations. We average the cost over iterations and use ADAM [14] for optimization. On the Shapes dataset we trained for 100 epochs with a bit-flip probability of 0.2, and on the TextureMNIST dataset for 200 epochs with a corruption-noise standard deviation of 0.2. The models reported in this paper took approximately 3 and 11 hours in wall clock time on a single Nvidia Titan X GPU for Shapes and TextureMNIST2 datasets respectively. We evaluate the trained models using two metrics: First, the denoising cost on the validation set, and second we evaluate the segmentation into objects using the adjusted mutual information (AMI) score [35] and ignore the background and overlap regions in the Shapes dataset (consistent with Greff et al. [8]). Evaluations of the AMI score and classification results in semi-supervised tasks were performed using uncorrupted input. The system has no restrictions regarding the number of groups and iterations used for training and evaluation. The results improved in terms of both denoising cost and AMI score when iterating further, so we used 5 iterations for testing. Even if the system was trained with 4 groups and 3 shapes per training example, we could test the evaluation with, for example, 2 groups and 3 shapes, or 4 groups and 4 shapes. 3.2 Unsupervised Perceptual Grouping Table 1 shows the median performance of Tagger on the Shapes dataset over 20 seeds. Tagger is able to achieve very fast convergences, as shown in Table 1a. Through iterations, the network improves its denoising performances by grouping different objects into different groups. Comparing to Greff et al. [8], Tagger performs significantly better in terms of AMI score (see Table 1b). We found that for this dataset using LayerNorm [1] instead of BatchNorm [13] greatly improves the results as seen in Table 1. Figure 4a and Figure 4b qualitatively show the learned unsupervised groupings for the Shapes and textured MNIST datasets. Tagger uses its TAG mechanism slightly differently for the two datasets. For Shapes, zg represents filled-in objects and masks mg show which part of the object is actually visible. For textured MNIST, zg represents the textures while masks mg capture texture segments. In the case of the same digit or two identical shapes, Tagger can segment them into separate groups, and hence, performs instance segmentation. We used 4 groups for training even though there are only 3 objects in the Shapes dataset and 3 segments in the TexturedMNIST2 dataset. The excess group is left empty by the trained system but its presence seems to speed up the learning process. 2The datasets and a Theano [33] reference implementation of Tagger are available at http://github.com/ CuriousAI/tagger 4 reconst: i = 0 i = 1 i = 2 i = 3 i = 4 i = 5 z0 m0 z1 m1 z2 m2 z3 m3 1: 00 1: 00 1: 00 1: 00 1: 00 0: 85 0: 60 A B original C reconst: (a) Results for Shapes dataset. Left column: 7 examples from the test set along with their resulting groupings in descending AMI score order and 3 hand-picked examples (A, B, and C) to demonstrate generalization. A: Testing 2-group model on 3 object data. B: Testing a 4-group model trained with 3-object data on 4 objects. C: Testing 4-group model trained with 3-object data on 2 objects. Right column: Illustration of the inference process over iterations for four color-coded groups; mk and zk. reconst: i = 0 i = 1 i = 2 i = 3 i = 4 i = 5 Pred: : 0 Class z0 Pred: : no class m0 Pred: : 2 z1 Pred: : no class m1 z2 m2 z3 m3 0: 95 0: 92 0: 90 0: 89 0: 87 0: 86 0: 85 D E1 original E2 reconst: (b) Results for the TextureMNIST2 dataset. Left column: 7 examples from the test set along with their resulting groupings in descending AMI score order and 3 hand-picked examples (D, E1, E2). D: An example from the TextureMNIST1 dataset. E1-2: A hand-picked example from TextureMNIST2. E1 demonstrates typical inference, and E2 demonstrates how the system is able to estimate the input when a certain group (topmost digit 4) is removed. Right column: Illustration of the inference process over iterations for four color-coded groups; mk and zk. 5 Iter 1 Iter 2 Iter 3 Iter 4 Iter 5 Denoising cost 0.094 0.068 0.063 0.063 0.063 AMI 0.58 0.73 0.77 0.79 0.79 Denoising cost* 0.100 0.069 0.057 0.054 0.054 AMI* 0.70 0.90 0.95 0.96 0.97 (a) Convergence of Tagger over iterative inference AMI RC [8] 0.61 ± 0.005 Tagger 0.79 ± 0.034 Tagger* 0.97 ± 0.009 (b) Method comparison Table 1: Table (a) shows how quickly the algorithm evaluation converges over inference iterations with the Shapes dataset. Table (b) compares segmentation quality to previous work on the Shapes dataset. The AMI score is defined in the range from 0 (guessing) to 1 (perfect match). The results with a star (*) are using LayerNorm [1] instead of BatchNorm. The hand-picked examples A-C in Figure 4a illustrate the robustness of the system when the number of objects changes in the evaluation dataset or when evaluation is performed using fewer groups. Example E is particularly interesting; E2 demonstrates how we can remove the topmost digit from the normal evaluated scene E1 and let the system fill in digit below and the background. We do this by setting the corresponding group assignment probabilities mg to a large negative number just before the final softmax over groups in the last iteration. To solve the textured two-digit MNIST task, the system has to combine texture cues with high-level shape information. The system first infers the background texture and mask which are finalized on the first iteration. Then the second iteration typically fixes the texture used for topmost digit, while subsequent iterations clarify the occluded digit and its texture. This demonstrates the need for iterative inference of the grouping. 3.3 Classification To investigate the role of grouping for the task of classification, we evaluate Tagger against four baseline models on the textured MNIST task. As our first baseline we use a fully connected network (FC) with ReLU activations and BatchNorm [13] after each layer. Our second baseline is a ConvNet (Conv) based on Model C from [30], which has close to state-of-the-art results on CIFAR-10. We removed dropout, added BatchNorm after each layer and replaced the final pooling by a fully connected layer to improve its performance for the task. Furthermore, we compare with a fully connected Ladder [19] (FC Ladder) network. All models use a softmax output and are trained with 50,000 samples to minimize the categorical cross entropy error. In case there are two different digits in the image (most examples in the TextureMNIST2 dataset), the target is p = 0.5 for both classes. We evaluate the models based on classification errors, which we compute based on the two highest predicted classes (top 2) for the two-digit case. For Tagger, we first train the system in an unsupervised phase for 150 epochs and then add two fresh randomly initialized layers on top and continue training the entire system end to end using the sum of unsupervised and supervised cost terms for 50 epochs. Furthermore, the topmost layer has a per-group softmax activation that includes an added ’no class’ neuron for groups that do not contain any digit. The final classification is then performed by summing the softmax output over all groups for the true 10 classes and renormalizing it. As shown in Table 2, Tagger performs significantly better than all the fully connected baseline models on both variants, but the improvement is more pronounced for the two-digit case. This result is expected because for cases with multi-object overlap, grouping becomes more important. Moreover, it confirms the hypothesis that grouping can help classification and is particularly beneficial for complex inputs. Remarkably, Tagger is on par with the convolutional baseline for the TexturedMNIST1 dataset and even outperforms it in the two-digit case, despite being fully connected itself. We hypothesize that one reason for this result is that grouping allows for the construction of efficient invariant features already in the low layers without losing information about the assignment of features to objects. Convolutional networks solve this problem to some degree by grouping features locally through the use of receptive fields, but that strategy is expensive and can break down in cases of heavy overlap. 6 Dataset Method Error 50k Error 1k Model details TextureMNIST1 FC MLP 31.1 ± 2.2 89.0 ± 0.2 2000-2000-2000 / 1000-1000 chance level: 90% FC Ladder 7.2 ± 0.1 30.5 ± 0.5 3000-2000-1000-500-250 FC Tagger (ours) 4.0 ± 0.3 10.5 ± 0.9 3000-2000-1000-500-250 ConvNet 3.9 ± 0.3 52.4 ± 5.3 based on Model C [30] TextureMNIST2 FC MLP 55.2 ± 1.0 79.4 ± 0.3 2000-2000-2000 / 1000-1000 chance level: 80% FC Ladder 41.1 ± 0.2 68.5 ± 0.2 3000-2000-1000-500-250 FC Tagger (ours) 7.9 ± 0.3 24.9 ± 1.8 3000-2000-1000-500-250 ConvNet 12.6 ± 0.4 79.1 ± 0.8 based on Model C [30] Table 2: Test-set classification errors in % for both textured MNIST datasets. We report mean and sample standard deviation over 5 runs. FC = Fully Connected, MLP = Multi Layer Perceptron. 3.4 Semi-Supervised Learning The TAG framework does not rely on labels and is therefore directly usable in a semi-supervised context. For semi-supervised learning, the Ladder [19] is arguably one of the strongest baselines with SOTA results on 1,000 MNIST and 60,000 permutation invariant MNIST classification. We follow the common practice of using 1,000 labeled samples and 49,000 unlabeled samples for training Tagger and the Ladder baselines. For completeness, we also report results of the convolutional (ConvNet) and fully-connected (FC) baselines trained fully supervised on only 1,000 samples. From Table 2, it is obvious that all the fully supervised methods fail on this task with 1,000 labels. The best baseline result is achieved by the FC Ladder, which reaches 30.5 % error for one digit but 68.5 % for TextureMNIST2. For both datasets, Tagger achieves by far the lowest error rates: 10.5 % and 24.9 %, respectively. Again, this difference is amplified for the two-digit case, where Tagger with 1,000 labels even outperforms the Ladder baseline with all 50k labels. This result matches our intuition that grouping can often segment even objects of an unknown class and thus help select the relevant features for learning. This is particularly important in semi-supervised learning where the inability to self-classify unlabeled samples can mean that the network fails to learn from them at all. To put these results in context, we performed informal tests with five human subjects. The subjects improved significantly over training for a few days but there were also significant individual differences. The task turned out to be quite difficult and strenuous, with the best performing subjects scoring around 10 % error for TextureMNIST1 and 30 % error for TextureMNIST2. 4 Related work Attention models have recently become very popular, and similar to perceptual grouping they help in dealing with complex structured inputs. These approaches are not, however, mutually exclusive and can benefit from each other. Overt attention models [28, 5] control a window (fovea) to focus on relevant parts of the inputs. Two of their limitations are that they are mostly tailored to the visual domain and are usually only suited to objects that are roughly the same shape as the window. But their ability to limit the field of view can help to reduce the complexity of the target problem and thus also help segmentation. Soft attention mechanisms [26, 3, 40] on the other hand use some form of top-down feedback to suppress inputs that are irrelevant for a given task. These mechanisms have recently gained popularity, first in machine translation [2] and then for many other problems such as image caption generation [39]. Because they re-weigh all the inputs based on their relevance, they could benefit from a perceptual grouping process that can refine the precise boundaries of attention. Our work is primarily built upon a line of research based on the concept that the brain uses synchronization of neuronal firing to bind object representations together. This view was introduced by [37] and has inspired many early works on oscillations in neural networks (see the survey [36] for a summary). Simulating the oscillations explicitly is costly and does not mesh well with modern neural network architectures (but see [17]). Rather, complex values have been used to model oscillating activations using the phase as soft tags for synchronization [18, 20]. In our model, we further abstract them by using discretized synchronization slots (our groups). It is most similar to the models of Wersing et al. [38], Hyvärinen & Perkiö [12] and Greff et al. [8]. However, our work is the first to combine this with denoising autoencoders in an end-to-end trainable fashion. 7 Another closely related line of research [23, 22] has focused on multi-causal modeling of the inputs. Many of the works in that area [16, 32, 29, 11] build upon Restricted Boltzmann Machines. Each input is modeled as a mixture model with a separate latent variable for each object. Because exact inference is intractable, these models approximate the posterior with some form of expectation maximization [4] or sampling procedure. Our assumptions are very similar to these approaches, but we allow the model to learn the amortized inference directly (more in line with Goodfellow et al. [7]). Since recurrent neural networks (RNNs) are general purpose computers, they can in principle implement arbitrary computable types of temporary variable binding [25, 26], unsupervised segmentation [24], and internal [26] and external attention [28]. For example, an RNN with fast weights [26] can rapidly associate or bind the patterns to which the RNN currently attends. Similar approaches even allow for metalearning [27], that is, learning a learning algorithm. Hochreiter et al. [10], for example, learned fast online learning algorithms for the class of all quadratic functions of two variables. Unsupervised segmentation could therefore in principle be learned by any RNN as a by-product of data compression or any other given task. That does not, however, imply that every RNN will, through learning, easily discover and implement this tool. From that perspective, TAG can be seen as a way of helping an RNN to quickly learn and efficiently implement a grouping mechanism. 5 Conclusion In this paper, we have argued that the ability to group input elements and internal representations is a powerful tool that can improve a system’s ability to handle complex multi-object inputs. We have introduced the TAG framework, which enables a network to directly learn the grouping and the corresponding amortized iterative inference in a unsupervised manner. The resulting iterative inference is very efficient and converges within five iterations. We have demonstrated the benefits of this mechanism for a heavily cluttered classification task, in which our fully connected Tagger even significantly outperformed a state-of-the-art convolutional network. More impressively, we have shown that our mechanism can greatly improve semi-supervised learning, exceeding conventional Ladder networks by a large margin. Our method makes minimal assumptions about the data and can be applied to any modality. With TAG, we have barely scratched the surface of a comprehensive integrated grouping mechanism, but we already see significant advantages. We believe grouping to be crucial to human perception and are convinced that it will help to scale neural networks to even more complex tasks in the future. Acknowledgments The authors wish to acknowledge useful discussions with Theofanis Karaletsos, Jaakko Särelä, Tapani Raiko, and Søren Kaae Sønderby. And further acknowledge Rinu Boney, Timo Haanpää and the rest of the Curious AI Company team for their support, computational infrastructure, and human testing. This research was supported by the EU project “INPUT” (H2020-ICT-2015 grant no. 687795). References [1] Ba, J. L., Kiros, J. R., and Hinton, G. E. Layer normalization. arXiv:1607.06450 [cs, stat], July 2016. [2] Bahdanau, D., Cho, K., and Bengio, Y. Neural machine translation by jointly learning to align and translate. arXiv preprint arXiv:1409.0473, 2014. [3] Deco, G. Biased competition mechanisms for visual attention in a multimodular neurodynamical system. In Emergent Neural Computational Architectures Based on Neuroscience, pp. 114–126. Springer, 2001. [4] Dempster, A. P., Laird, N. M., and Rubin, D. B. Maximum likelihood from incomplete data via the EM algorithm. Journal of the royal statistical society., pp. 1–38, 1977. [5] Eslami, S. M., Heess, N., Weber, T., Tassa, Y., Kavukcuoglu, Y., and Hinton, G. E. Attend, infer, repeat: Fast scene understanding with generative models. preprint arXiv:1603.08575, 2016. [6] Gallinari, P., LeCun, Y., Thiria, S., and Fogelman-Soulie, F. Mémoires associatives distribuées: Une comparaison (distributed associative memories: A comparison). In Cesta-Afcet, 1987. [7] Goodfellow, I. J., Bulatov, Y., Ibarz, J., Arnoud, S., and Shet, V. Multi-digit number recognition from street view imagery using deep convolutional neural networks. arXiv preprint arXiv:1312.6082, 2013. [8] Greff, K., Srivastava, R. K., and Schmidhuber, J. Binding via reconstruction clustering. arXiv:1511.06418 [cs], November 2015. [9] Gregor, K. and LeCun, Y. Learning fast approximations of sparse coding. In Proceedings of the 27th International Conference on Machine Learning (ICML-10), pp. 399–406, 2010. 8 [10] Hochreiter, S., Younger, A. S., and Conwell, P. R. Learning to learn using gradient descent. In Proc. International Conference on Artificial Neural Networks, pp. 87–94. Springer, 2001. [11] Huang, J. and Murphy, K. Efficient inference in occlusion-aware generative models of images. arXiv preprint arXiv:1511.06362, 2015. [12] Hyvärinen, A. and Perkiö, J. Learning to segment any random vector. In The 2006 IEEE International Joint Conference on Neural Network Proceedings, pp. 4167–4172. IEEE, 2006. [13] Ioffe, S. and Szegedy, C. Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167, 2015. [14] Kingma, D. and Ba, J. Adam: A method for stochastic optimization. CBLS, 2015. [15] Le Cun, Y. Modèles Connexionnistes de L’apprentissage. PhD thesis, Paris 6, 1987. [16] Le Roux, N., Heess, N., Shotton, J., and Winn, J. Learning a generative model of images by factoring appearance and shape. Neural Computation, 23(3):593–650, 2011. [17] Meier, M., Haschke, R., and Ritter, H. J. Perceptual grouping through competition in coupled oscillator networks. Neurocomputing, 141:76–83, 2014. [18] Rao, R. A., Cecchi, G., Peck, C. C., and Kozloski, J. R. Unsupervised segmentation with dynamical units. Neural Networks, IEEE Transactions on, 19(1):168–182, 2008. [19] Rasmus, A., Berglund, M., Honkala, M., Valpola, H., and Raiko, T. Semi-supervised learning with ladder networks. In NIPS, pp. 3532–3540, 2015. [20] Reichert, D. P. and Serre, T. Neuronal synchrony in complex-valued deep networks. arXiv:1312.6115 [cs, q-bio, stat], December 2013. [21] Reichert, D. P., Series, P, and Storkey, A. J. A hierarchical generative model of recurrent object-based attention in the visual cortex. In ICANN, pp. 18–25. Springer, 2011. [22] Ross, D. A. and Zemel, R. S. Learning parts-based representations of data. The Journal of Machine Learning Research, 7:2369–2397, 2006. [23] Saund, E. A multiple cause mixture model for unsupervised learning. Neural Computation, 7(1):51–71, 1995. [24] Schmidhuber, J. Learning complex, extended sequences using the principle of history compression. Neural Computation, 4(2):234–242, 1992. [25] Schmidhuber, J. Learning to control fast-weight memories: An alternative to dynamic recurrent networks. Neural Computation, 4(1):131–139, 1992. [26] Schmidhuber, J. Reducing the ratio between learning complexity and number of time varying variables in fully recurrent nets. In ICANN’93, pp. 460–463. Springer, 1993. [27] Schmidhuber, J. A ‘self-referential’ weight matrix. In ICANN’93, pp. 446–450. Springer, 1993. [28] Schmidhuber, J. and Huber, R. Learning to generate artificial fovea trajectories for target detection. International Journal of Neural Systems, 2(01n02):125–134, 1991. [29] Sohn, K., Zhou, G., Lee, C., and Lee, H. Learning and selecting features jointly with point-wise gated Boltzmann machines. In Proceedings of The 30th International Conference on Machine Learning, pp. 217–225, 2013. [30] Springenberg, J. T., Dosovitskiy, A., Brox, T., and Riedmiller, M. Striving for simplicity: The all convolutional net. arXiv preprint arXiv:1412.6806, 2014. [31] Srikumar, V., Kundu, G., and Roth, D. On amortizing inference cost for structured prediction. In EMNLPCoNLL ’12, pp. 1114–1124, Stroudsburg, PA, USA, 2012. Association for Computational Linguistics. [32] Tang, Y., Salakhutdinov, R., and Hinton, G. Robust boltzmann machines for recognition and denoising. In Computer Vision and Pattern Recognition (CVPR), 2012 IEEE Conference on, pp. 2264–2271. IEEE, 2012. [33] Team, The Theano Development. Theano: A Python framework for fast computation of mathematical expressions. arXiv:1605.02688 [cs], May 2016. [34] Vincent, P., Larochelle, H., Bengio, Y., and Manzagol, P. A. Extracting and composing robust features with denoising autoencoders. In ICML, pp. 1096–1103. ACM, 2008. [35] Vinh, N. X., Epps, J., and Bailey, J. Information theoretic measures for clusterings comparison: Variants, properties, normalization and correction for chance. JMLR, 11:2837–2854, 2010. [36] von der Malsburg, C. Binding in models of perception and brain function. Current opinion in neurobiology, 5(4):520–526, 1995. [37] von der Malsburg, Christoph. The Correlation Theory of Brain Function. Departmental technical report, MPI, 1981. [38] Wersing, H., Steil, J. J., and Ritter, H. A competitive-layer model for feature binding and sensory segmentation. Neural Computation, 13(2):357–387, 2001. [39] Xu, K., Ba, J., Kiros, R., Courville, A., Salakhutdinov, R., Zemel, R., and Bengio, Y. Show, attend and tell: Neural image caption generation with visual attention. arXiv preprint arXiv:1502.03044, 2015. [40] Yli-Krekola, A., Särelä, J., and Valpola, H. Selective attention improves learning. In Artificial Neural Networks–ICANN 2009, pp. 285–294. Springer, 2009. 9
2016
3
6,216
Threshold Bandit, With and Without Censored Feedback Jacob Abernethy Department of Computer Science University of Michigan Ann Arbor, MI 48109 jabernet@umich.edu Kareem Amin Department of Computer Science University of Michigan Ann Arbor, MI 48109 amkareem@umich.edu Ruihao Zhu AeroAstro&CSAIL MIT Cambridge, MA 02139 rzhu@mit.edu Abstract We consider the Threshold Bandit setting, a variant of the classical multi-armed bandit problem in which the reward on each round depends on a piece of side information known as a threshold value. The learner selects one of K actions (arms), this action generates a random sample from a fixed distribution, and the action then receives a unit payoff in the event that this sample exceeds the threshold value. We consider two versions of this problem, the uncensored and censored case, that determine whether the sample is always observed or only when the threshold is not met. Using new tools to understand the popular UCB algorithm, we show that the uncensored case is essentially no more difficult than the classical multi-armed bandit setting. Finally we show that the censored case exhibits more challenges, but we give guarantees in the event that the sequence of threshold values is generated optimistically. 1 Introduction The classical Multi-armed Bandit (MAB) problem provides a framework to reason about sequential decision settings, but specifically where the learner’s chosen decision is intimately tied to information content received as feedback. MAB problems have generated much interest in the Machine Learning research literature in recent years, particularly as a result of the changing nature in which learning and estimation algorithms are employed in practice. More and more we encounter scenarios in which the procedure used to make and exploit algorithmic predictions is exactly the same procedure used to capture new data to improve prediction performance. In other words it is increasingly harder to view training and testing as distinct entities. MAB problems generally involve repeatedly making a choice between one of a finite (or even infinite) set of actions, and these actions have historically been referred to as arms of the bandit. If we “pull” arm i at round t, then we receive a reward Rt i 2 [0,1] which is frequently assumed to be a stochastic quantity that is drawn according to distribution Di. Typically we assume that Di are heterogeneous across the arms i, whereas we assume the samples {Rt i}t=1,...,T are independently and identically distributed according to the fixed Di across all times t.1 Of course, were the learner to have full knowledge of the distributions Di from the outset, she would presumably choose to pull the arm whose expected reward µi is highest. With that in mind, we tend to consider the (expected) regret of the learner, defined to be the (expected) reward of the best arm minus the (expected) reward of the actual arms selected by the learner. Early work on MAB problems (Robbins, 1952; Lai and Robbins, 1985; Gittins et al., 2011) tended to be more focused on asymptotic guarantees, whereas more recent work (Auer et al., 2002; Auer, 2003) 1Note that in much of our notation we use superscript t to denote the time period rather than as an exponent. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. has been directed towards a more “finite time” approach in which we can bound regret for fixed time horizons T. One of the best-known and well-studied techniques is known as the Upper Confidence Bound (UCB) algorithm (Auer et al., 2002; Auer and Ortner, 2010). The magic of UCB relies on a very intuitive policy framework, that a learner should select decisions by maximizing over rewards estimated from previous data but only after biasing each estimate according to its uncertainty. Simply put, one should choose the arm that maximizes the “mean plus confidence interval,” hence the name Upper Confidence Bound. In the present paper we focus on the Threshold Bandit setting, described as follows. On each round t, a piece of side information is given to the learner in the form of a real number ct, the learner must then choose arm i out of K arms, and this arm produces a value Xt i drawn from a survival distribution with survival function Fi(x) = Pr(Xt i ≥x). The reward to the learner is not Xt i itself but is instead the binary value Rt i = I[Xt i ≥ct]; that is, we receive a unit reward when the sample Xt i exceeds the threshold value ct, and otherwise we receive no reward. For a fixed value of ct, each arm i has expected payoff E[Rt i] = Fi(ct). Notice, crucially, that the arm with the greatest expected payoff can vary significantly across different threshold values. This abstract model has a number of very natural applications: 1. Packet Delivery with Deadlines: FedEx receives a stream of packages that need to be shipped from source to destination, and each package is supplied with a delivery deadline. The goal of the FedEx routing system is to select a transportation route (via air or road or ship, etc.) that has the highest probability of on-time arrival. Of course some transportation schemes are often faster (e.g. air travel) but have higher volatility (e.g. due to poor weather). 2. Supplier Selection: Customers approach a manufacturing firm to produce a product with specific quality demands. The firm must approach one of several suppliers to contract out the work, but the firm is uncertain as to the capabilities and variabilities of the products each supplier produces. 3. Dark Pool Brokerage: A financial brokerage firm is asked to buy or sell various sized bundles of shares, and the brokerage aims to offload the transactions onto one of many dark pools, i.e. financial exchanges that match buyers and sellers in a confidential manner (Ganchev et al., 2010; Amin et al., 2012; Agarwal et al., 2010). A standard dark pool mechanism will simply execute the transaction if there is suitable liquidity, or will reject the transaction when no match is made. Of course the brokerage gets paid on commission, and simply wants to choose the pool that has the highest probability of completion. What distinguishes the Threshold Bandit problem from the standard stochastic multi-armed bandit setting are two main features: 1. The regret of the learner will be measured in comparison to the best policy rather than to simply the best arm. Note that the optimal offline policy may incorporate the threshold value ct before selecting an arm I t. 2. Whereas the standard stochastic bandit setting assumes that we observe the reward Rt It of the chosen arm I t, in the Threshold Bandit setting we consider two types of feedback. (a) Uncensored Feedback: After playing arm I t, the learner observes the sample Xt It regardless of the threshold value ct. This is a natural model for the FedEx routing problem above, wherein one learns the travel time of a package regardless of the deadline having been met. (b) Censored Feedback: After playing I t, the learner observes a null value when Xt It ≥ct, and otherwise observes Xt It. This is a natural model for the Supplier Selection problem above, as we would only learn the product’s quality value when the customer rejects what is received from the supplier. In the present paper we present roughly three primary results. First, we provide a new perspective on the classical UCB algorithm, giving an alternative proof that relies on an interesting potential function argument; we believe this technique may be of independent interest. Second, we analyze the Threshold Bandit setting when given uncensored feedback, and we give a novel algorithm called DKWUCB based on the Dvoretzky-Kiefer-Wolfowitz inequality (Dvoretzky et al., 1956). We show, somewhat surprisingly, that with uncensored feedback the regret bound is no worse than the standard 2 stochastic MAB setting, suggesting that despite the much richer policy class one has nearly the same learning challenge. Finally, we consider learning in the censored feedback setting, and propose an algorithm KMUCB, akin to the Kaplan-Meier estimator (Kaplan and Meier, 1958). Learning with censored feedback is indeed more difficult, as the performance can depend significantly on the order of the threshold values. In the worst case, when threshold values are chosen in an adversarial order, the cost of learning scales with the number of unique threshold values, whereas one can perform significantly better under certain constraints on optimistic assumptions on the order or even a random order. 2 A New Perspective on UCB Before focusing on the Threshold Bandit problem, let us turn our attention to the classical stochastic MAB setting and give another look at the UCB algorithm. We will now provide a modified proof of the regret bound of UCB that relies on a potential function. Potential arguments have proved quite popular in studying adversarial bandit problems (Auer et al., 2003; Audibert and Bubeck, 2009; Abernethy et al., 2012; Neu and Bartók, 2013; Abernethy et al., 2015), but have received less use in the stochastic setting. This potential trick is the basis for forthcoming results on the Threshold Bandit. Let Di be a distribution on the reward Rt i, with support on [0,1]. We imagine the rewards R1 i ,...,RT i i.i.d. ⇠Di, whose mean E[Rt i] = µi. A bandit algorithm is simply a procedure that chooses a random arm/action I t on round t as a function of the set of past observed (action, reward) pairs, (I 1,R1 I 1),...,(I t−1,Rt−1 It−1). Finally, let Nt i := Ât−1 t=1 I[I t = i] and define the empirical mean estimator at time t to be ˆµt i := Ât−1 t=1 I[I t=i]Rt It Nt i . We assume we are given a particular deviation bound which provides the following guarantee, Pr ! |µi −ˆµt i| > e "" Nt i ≥N # f(N,e), where f(·) is some function, continuous in e and monotonically decreasing in both parameters, that controls the probability of a large deviation. While UCB relies specifically on the Hoeffding-Azuma inequality (Cesa-Bianchi and Lugosi, 2006), for now we leave the deviation bound in generic form. This will be useful in following sections. Given f(·,·), what is of interest to our present work is a pair of functions that allow us to convert between values of e and N in order to guarantee that f(N,e) d for a given d > 0. To this end define ](e,d) := min{N : f(N,e/2) d}, V(N,d) := ⇢ inf{e : f(N,e) d} if N > 0; 1 otherwise, We will often omit the d in the argument to ](·),V(·). Note the key property that V(N,d) e/2 for any N ≥](e,d). We can now define our variant of the UCB algorithm for a fixed choice of d > 0. UCB Algorithm: on round t play I t = argmax i % ˆµt i +V(Nt i ,d) (1) We will make the simplifying assumption that the largest µi is unique and, without loss of generality, let us assume that the coordinates are permuted in order that µ1 is the largest mean reward. Furthermore, define Di := µ1 −µi for i = 2,...,K. A central piece of the analysis relies on the following potential function, which depends on the current number of plays of each arm i = 2,...,K. F(Nt 2,...,Nt K) := 2 K  i=2 Nt i −1  N=0 V(N,d) (2) Lemma 1. The expected regret of UCB is bounded as E[RegretT(UCB)] E[F(NT+1 2 ,...,NT+1 K )]+O(Td) 3 Proof. The (random) additional regret suffered on round t of UCB is exactly µ1 −µIt. By virtue of our given deviation bound, we know that µ1 ˆµt 1 +V(Nt 1,d) and ˆµt It µIt +V(Nt It,d), each w.p. > 1−d. (3) Also, let xt be the indicator variable that one of the above two inequalities fails to hold. Of course we chose V(·) in order that E[xt] 2d via a simple union bound. Note that, by virtue of using the UCB selection rule for I t, it is clear that we have ˆµt 1 +V(Nt 1,d) ˆµt It +V(Nt It,d) (4) If we combine Equations 3 and 4, and consider the event that xt = 0, then we obtain µ1 ˆµt 1 +V(Nt 1,d) ˆµt It +V(Nt It,d) µIt +2V(Nt It,d). Even in the event that xt = 1 we have that µ1 −µIt 1. Hence, it follows immediately that µ1 −µIt  2V(Nt It,d)+xt. Finally, we observe that the potential function was chosen so that F(Nt+1 2 ,...,Nt+1 K ) − F(Nt 2,...,Nt K) = 2V(Nt It,d). Recalling that F(0,...,0) = 0, a simple telescoping argument gives that E[RegretT(UCB)] E " F(NT+1 2 ,...,NT+1 K )+ T  t=1 xt # = E[F(NT+1 2 ,...,NT+1 K )]+2Td. The final piece we need to establish is that the number of pulls Nt i of arm i, for i = 2,...,K, is unlikely to exceed ](Di,d). This result uses some more standard techniques from the original UCB analysis (Auer et al., 2002), and we defer it to the appendix. Lemma 2. For any T > 0 we have E[F(NT+1 2 ,...,NT+1 K )] F(](D2,d),...,](DK,d))+O(T 2d). We are now able to combine the above results for the final bound. Theorem 1. If we set d = T −2/2, the expected regret of UCB is bounded as E[RegretT(UCB)] 8 K  i=2 log(T) Di +O(1). Proof. Note that a very standard deviation bound that holds for all distributions supported on [0,1] is the Hoeffding-Azuma inequality (Cesa-Bianchi and Lugosi, 2006), where the bound is given by f(N,e) = 2exp(−2Ne2). Utilizing Hoeffding-Azuma we have ](e,d) = l 2log2/d e2 m and V(N,d) = q log(2/d) 2N for N > 0. If we utilize the fact that ÂY y=1 1 py 2 p Y, then we see that F(](D2,d),...,](DK,d)) = 2 K  i=2 ](Di,d)  N=0 V(N,d) = 2 K  i=2 2 r log(2/d)](Di,d) 2 = 4 K  i=2 log(2/d) Di . Combining the Lemma 1 and Lemma 2, setting d = T −2/2, we conclude the theorem. 3 The Threshold Bandits Model In the preceding, we described a potential-based proof for the UCB algorithm in the classic stochastic bandit problem. We now return to the Threshold Bandit setting, our problem of interest. A K-armed Threshold Bandit problem is defined by random variables Xt i and a sequence of threshold values ct for 1 i K and 1 t T, where i is the index for arms. Successive pulling of arm i generates the values X1 i ,X2 i ,...,XT i , which are drawn i.i.d. from an unknown distribution. The threshold values c1,c2,...,cT are drawn from M = {1,2,...,m} (according to rules specified later). The threshold value ct is observed at the beginning of round t, and the learner follows a policy P to choose the arm to play based on its past selections and previously observed feedbacks. Suppose the arm pulled at round t is I t, the observed reward is then Rt It = I[Xt It ≥ct]; that is, we receive a unit reward when the sample Xt It exceeds the threshold value ct, and otherwise we receive no reward. We distinguish two different types of feedback. 4 1. Uncensored Feedback: After playing arm I t, the learner observes the sample Xt It regardless of the threshold value ct. 2. Censored Feedback: After playing I t, the learner observes2 ⇢/0 if Xt It ≥ct, Xt It otherwise . In this case, we refer to the threshold value as a censor value. Let Fi(x) denote the survival function of the distribution on arm i. That is, Fi(x) = Pr(Xt i ≥x). We measure regret against the optimal policy with full knowledge of F1,...,Fn i.e., RegretT(P) = E " T  t=1 ✓ max i2[n] Rt i −Rt It ◆# = E " T  t=1 ✓ max i2[n] I ! Xt i ≥ct# −I ! Xt It ≥ct#◆# . Notice that for a fixed value of ct, each arm i has expected payoff E[Rt i] = Fi(ct), the regret can also be written as RegretT(P) = E ⇥ ÂT t=1 ! maxi2[n] Fi (ct)−FIt (ct) #⇤ . Our goal is to design a policy that minimizes the regret. 4 DKWUCB: Dvoretzky-Kiefer-Wolfowitz Inequality based Upper Confidence Bound algorithm In this section, we study the uncensored feedback setting in which the value Xt It is always observed regardless of ct. We assume that the largest Fi( j) is unique for all j 2 M, and define i⇤(j) = argmaxi Fi( j),Di( j) = Fi⇤(j)( j)−Fi(j) for all i = 1,2,...,K and j 2 M. Under this setting, the algorithm will use the empirical distribution as an estimate for the true distribution. Specifically, we want to estimate the true survival function Fi via: ˆFt i (j) = Ât−1 t=1 I[Xt I t ≥j,I t = i] Nt i 8j 2 M (5) The key tool in our analysis is a deviation bound on the empirical CDF of a distribution, and we note that this bound holds uniformly over the support of the distribution. The Dvoretzky-KieferWolfowitz (DKW) inequality (Dvoretzky et al., 1956) allows us to bound the error on ˆFt i ( j) : Lemma 3. At a time t, let ˆFt i be the empirical distribution function of Fi as given in equation 5. The probability that the maximum of the difference between ˆFt i and Fi over all j 2 M is at least e is less than 2exp ! −2e2Nt i # , i.e., Pr ! sup j2M | ˆFt i (j)−Fi( j)| ≥e "" Nt i ≥N # 2exp ! −2e2N # . The proof of the lemma can be found in Dvoretzky et al. (1956). The key insight is that the estimate ˆFi converges to Fi point-wise at the same rate as the Hoeffding-Asumza inequality. That is, one does not pay an additional M factor from applying a union bound. The fact that we have uniform convergence of the CDF with the same rate as the Hoeffding-Azuma inequality allows us to immediately apply the potential function argument from Section 2. In particular, we define f(N,e) = 2exp ! −2e2N # , as well as the pair of functions ](e,d) and V(N,d) exactly the same as the previous section, i.e., ](e,d) := ⇠2log2/d e2 ⇡ , V(N,d) := ( q log(2/d) 2N if N > 0; 1 otherwise. We are now ready to define our DKWUCB algorithm for a fixed choice of parameter d > 0 to solve the problem. DKWUCB Algorithm: on round t play I t argmax i % ˆFt i (ct)+V(Nt i ,d) . (6) 2Existing literature often refers to this as right-censoring. With right-censored feedback, samples from playing arms at high threshold values can inform decisions at low threshold values but not vice versa. 5 To analyze DKWUCB, we use a slight variant of the potential function defined in Section 2. Let i⇤( j) = argmaxi Fi( j) denote the optimal arm for threshold value j, and ˜Nt i denote the number of rounds arm i is pulled when it is not optimal, ˜Nt i = Ât−1 t=1 I[I t = i,I t 6= i⇤(ct)]. Notice that ˜Nt i Nt i . Define the potential function as: F( ˜Nt 1,..., ˜Nt K) := 2 K  i=1 ˜Nt i −1  N=0 V(N,d) (7) Theorem 2. Setting d = T −2/2, the expected regret of DKWUCB is bounded as E[RegretT(DKWUCB)] 8 K  i=1 logT minj2M Di(j) +O(1), We defer the proof of this theorem to the appendix. We pause now to comment on some of the strengths of this type of analysis. At a high-level, the typical analysis to the UCB algorithm for the standard multi-armed bandit problem (Auer et al., 2002) is the following: (1) at some finite time T, the number of pulls of a bad arm i is O ⇣ log(T) D2 i ⌘ with high probability, and (2) the regret suffered by any such pull is O(Di). The contribution of arm i to total regret is therefore O ⇣ log(T) Di ⌘ . In contrast, we analyzed the UCB algorithm in Section 2 by observing that the expected regret suffered on round t is bounded by the difference between the empirical mean estimator and the true mean for the payoff of arm It. Of course by design this quantity is almost certainly (w.p. at least 1−d) less than V(Nt It). The potential function F(·,...,·) tracks the accumulation of these values V(Nt i ) for each arm i, and the final regret bound is a consequence of the summation properties of V,] for the particular estimator being used. While these two approaches lead to the same bound in the standard multi-armed bandit problem, the potential function approach bears fruit in the Threshold Bandit setting. Because the uniform convergence rate promised by the DKW inequality matches that of the Hoeffding-Azume inequality, Theorem 2 should not be surprising; the ith arm’s contribution to DKWUCB’s regret should be idenitical to UCB, but with the suboptimality gap now equal to minj Di(j). However, following the program for the standard analysis of UCB, one would naively argue that arm i is incorrectly pulled O ⇣ log(T) (min j2M Di( j))2 ⌘ times. These pulls might come in the face of any number of threshold values ct, suffering as much as max j2M Di( j) regret, yielding a bound of O ⇣max j2M Di(j)log(T) (min j2M Di( j))2 ⌘ on the ith arm’s regret contribution, which is a factor O ⇣max j Di(j) min j Di(j) ⌘ worse than the derived result. By tracking the convergence of the underlying estimator, we circumvent this problem entirely. 5 KMUCB: Kaplan-Meier based Upper Confidence Bound Algorithm We now turn to the censored feedback setting, in which the feedback of pulling arm I t is observed only when Xt It is less than ct. For ease of presentation, we assume that the largest Fi(j) is unique for all j 2 M, and define i⇤( j) = argmaxi Fi( j),Di( j) = Fi⇤(j)( j)−Fi( j) for all i = 1,2,...,K and j 2 M. One prevalent non-parametric estimator for censored data is the Kaplan-Meier maximum likelihood estimator Kaplan and Meier (1958); Peterson (1983). Most of existing works have studied the uniform error bound of Kaplan-Meier estimator in the case that the threshold values are drawn i.i.d. from a known distribution Foldes and Rejto (1981) or asymptotic error bound for the non-i.i.d. case Huh et al. (2009). The only known uniform error bound of Kaplan-Meier estimator is proposed in Ganchev et al. (2010). Noting that for a given threshold value, all the feedbacks from larger threshold values are useful, we propose a new estimator with tighter uniform error bound based on the Kaplan-Meier estimator as following: ˆFt i = Dt i( j) Nt i ( j) (8) 6 where Dt i( j) and Nt i ( j) is defined as follows At := min{Xt It,ct}, Dt i( j) := t−1  t=1 I[At ≥j,I t = i], Nt i ( j) := t−1  t=1 I[ct ≥j,I t = i]. We first present an error bound for the modified Kaplan-Meier estimate of Fi( j) : Lemma 4. At time t, let ˆFt i be the modified Kaplan-Meier estimate of Fi as given in equation 8. For any j 2 M, the probability that the difference between ˆFt i ( j) and Fi(j) is at least e is less than 2exp ⇣ −e2Nt i (j) 2 ⌘ , i.e., Pr ! | ˆFt i (j)−Fi( j)| ≥e # 2exp ✓ −e2Nt i (j) 2 ◆ . We defer the proof of this lemma to the appendix. Different to the stochastic uncensored MAB setting, we show that the cost of learning with censored feedback depends significantly on the order of the threshold values. To illustrate this point, we first show a comparison between the regret of adversarial setting and optimistic setting. In the adversarial setting, the threshold values are chosen to arrive in a non-decreasing order 1,1,...,1,2,...,2,3,...,m, the problem becomes playing m independent copies of bandits, and the regret scales with m; while in the optimistic setting, the threshold values are chosen to arrive in a non-increasing order m,m,...,m,m −1,...,m −1,...,1,...,1, which means the learner can make full use of the samples, and can thus perform significantly better. Afterwards, we show that if the order of the threshold values is close to uniformly random, the regret only scales with logm. 5.1 Adversarial vs. Optimistic Setting For the simplicity of presentation, we assume that in both settings, the time horizon could be divided in to m stages, each with length bT/mc.. In the adversarial setting, threshold value j comes during stage j; while in the optimistic setting threshold value m−j +1 comes during stage j. For the adversarial setting, due to the censored feedback structure, only the samples observed within the same stage can help to inform decision making. From the perspective of the learner, this is equivalent to facing m independent copies of stochastic MAB problems, and thus, the regret scales with m. Making use of the lower bound of stochastic MAB problems Lai and Robbins (1985), we can conclude the following theorem. Theorem 3. If the threshold values arrive according to the adversarial order specified above, no learning algorithm can achive a regret bound better than Âm j=1 ÂK i=1 log(T/m) KL(B(Fi(j)||B(Fi⇤( j)( j))), where KL(·||·) is the Kullback-Leibler divergence Lai and Robbins (1985) and B(·) is the probability distribution function of Bernoulli distribution. For the optimistic setting, although the feedbacks are right censored, we note that every sample observed in the previous rounds are useful in later rounds. This is because the threshold values arrive in non-increasing order. Therefore, we can reduce the optimistic setting to the Threshold Bandit problem with uncensored feedback, and use the DKWUCB proposed in Section 4 to solve it. More specifically, we can set f(N,e) := 2exp(−e2N/2), ](e,d) := ⇠8log2/d e2 ⇡ , V(N,d) := ( q 2log(2/d) N if N ≥1; 1 otherwise. , and on every round, the learner plays the same strategy as DKWUCB. We call this strategy OPTIM. Following the same procedure in Section 4, we can provide a regret for OPTIM. Theorem 4. Let d = T −2/2 and assume T ≥mK. The regret of the optimistic setting satisfies E[RegretT(OPTIM )] 32 K  i=1 logT minj2M Di(j) +O(1). 7 5.2 Cyclic Permutation Setting In this subsection, we show that if the order of threshold values is close to uniformly random, we can perform significantly better than the adversarial setting. To be precise, we assume that the threshold values are a cyclic permutation order of 1,2,...,m. We define the set M = {ckm,ckm+1,...,ck(m+1)−1} for any non-negative integer k T/m. We are now ready to present KMUCB, which is a modified Kaplan-Meier-based UCB algorithm. KMUCB divides the time horizon into epochs of length Km and, for each epoch, pulls each arm once for each threshold value. KMUCB then performs an “arm elimination” process, and once all but one arm has been eliminated, it proceeds to pull the single remaining arm for the given threshold value. KMUCB’s estimation procedure leverages information across threshold values, where observations from higher thresholds are utilized to estimate mean payoffs for lower thresholds; information does not flow in the other direction, however, as a result of the censoring assumption. Specifically, for a given threshold index j, KMUCB tracks the arm elimination process as follows: for any threshold values below j, KMUCB believes that we have determined the best arm, and plays that arm constantly. For threshold values greater than or equal to j, KMUCB explores all arms uniformly. Note that by uniform exploration over all arms for threshold value j, all sub-optimal arms can be detected with probability at least 1−O ! 1 T # after O ✓ logT (m−j+1)mini2[K] D2 i (j) ◆ epochs. KMUCB then removes all the sub-optimal arms for threshold value j, and increments j by 1. Denoting the last time unit of epoch k as tk = kKm, the detailed description of KMUCB is shown in Algorithm 1. Algorithm 1 KMUCB 1: Input: A set of arms 1,2,...,K. 2: Initialization: Lj [K] 8j 2 M,k 1, j 1 3: for epoch k = 1,2,...,T/Km do 4: count[j0] 0 8 j0 2 M 5: for t from (tk−1 +1) to tk do 6: Observe ct = j0 and set count[j0] count[j0]+1 7: if j0 < j then 8: I t index of the single arm remaining in Lj0 9: else 10: I t count[j0]. 11: end if 12: end for 13: if j m and maxi02[K] ˆFtk i0 ( j)−ˆFtk i ( j) ≥ q 16log(Tk) (m−j+1)k 8i 2 Lj \{argmaxi02[K] ˆFtk i0 (j)} then 14: Lj ( argmax i02[K] ˆFtk i0 ( j) ) , j j +1 15: end if 16: end for Theorem 5. The expected regret of KMUCB is bounded as K  i=1 logm128max j2M Di( j)logT mini2[K], j2M D2 i ( j) +O(1). We defer the proof of this theorem to the appendix. We note two directions of future research. First, we believe the above bound can likely be made stronger by either improving upon the minimization in the denominator or the maximization in the numerator. Second, we believe the “cyclic permutation” assumption can be weakened to “uniformly randomly sequence of thresholds,” but we were unable to make progress in this direction. We welcome further investigation along these lines. 8 References Jacob Abernethy, Elad Hazan, and Alexander Rakhlin. 2012. Interior-point methods for fullinformation and bandit online learning. IEEE Transactions on Information Theory 58, 7 (2012), 4164–4175. Jacob D Abernethy, Chansoo Lee, and Ambuj Tewari. 2015. Fighting Bandits with a New Kind of Smoothness. In Advances in Neural Information Processing Systems. 2188–2196. Alekh Agarwal, Peter L Bartlett, and Max Dama. 2010. Optimal Allocation Strategies for the Dark Pool Problem. In International Conference on Artificial Intelligence and Statistics. 9–16. Kareem Amin, Michael Kearns, Peter Key, and Anton Schwaighofer. 2012. Budget optimization for sponsored search: Censored learning in mdps. arXiv preprint arXiv:1210.4847 (2012). Jean-Yves Audibert and Sébastien Bubeck. 2009. Minimax policies for adversarial and stochastic bandits. In COLT. 217–226. Peter Auer. 2003. Using confidence bounds for exploitation-exploration trade-offs. The Journal of Machine Learning Research 3 (2003), 397–422. Peter Auer, Nicolo Cesa-Bianchi, and Paul Fischer. 2002. Finite-time analysis of the multiarmed bandit problem. Machine learning 47, 2-3 (2002), 235–256. Peter Auer, Nicolò Cesa-Bianchi, Yoav Freund, and Robert E. Schapire. 2003. The Nonstochastic Multiarmed Bandit Problem. SIAM Journal of Computuataion 32, 1 (2003), 48–77. Peter Auer and Ronald Ortner. 2010. UCB revisited: Improved regret bounds for the stochastic multi-armed bandit problem. Periodica Mathematica Hungarica 61, 1-2 (2010), 55–65. Nicolò Cesa-Bianchi and Gábor Lugosi. 2006. Prediction, Learning, and Games. Cambridge University Press. A. Dvoretzky, J. Kiefer, and J. Wolfowitz. 1956. Asymptotic Minimax Character of the Sample Distribution Function and of the Classical Multinomial Estimator. In Annals of Mathematical Statistics. A. Foldes and L. Rejto. 1981. Strong uniform consistency for nonparametric survival curve estimators from randomly censored data. In The Annals of Statistics. 9(1):122?129. Kuzman Ganchev, Michael Kearns, Yuriy Nevmyvaka, and Jennifer Wortman Vaughan. 2010. Censored Exploration and the Dark Pool Problem. In UAI. John Gittins, Kevin Glazebrook, and Richard Weber. 2011. Multi-armed bandit allocation indices. John Wiley & Sons. W. T. Huh, R. Levi, P. Rusmevichientong, and J. Orlin. 2009. Adaptive data-driven inventory control policies based on Kaplan-Meier estimator. In http://legacy.orie.cornell.edu/ paatrus/ psfiles/kmmyopic.pdf. E. L. Kaplan and P. Meier. 1958. Nonparametric Estimation from Incomplete Observations. In JASA. T. L. Lai and Herbert Robbins. 1985. Asymptotically efficient adaptive allocation rules. Advances in Applied Mathematics 6 (1985), 4–22. Gergely Neu and Gábor Bartók. 2013. An efficient algorithm for learning with semi-bandit feedback. In Algorithmic Learning Theory. Springer, 234–248. A. V. Peterson. 1983. Kaplan-Meier estimator. In Encyclopedia of Statistical Sciences. Herbert Robbins. 1952. Some aspects of the sequential design of experiments. Bull. Amer. Math. Soc. 58, 5 (1952), 527–535. 9
2016
30
6,217
Mixed Linear Regression with Multiple Components Kai Zhong 1 Prateek Jain 2 Inderjit S. Dhillon 3 1,3 University of Texas at Austin 2 Microsoft Research India 1 zhongkai@ices.utexas.edu, 2 prajain@microsoft.com 3 inderjit@cs.utexas.edu Abstract In this paper, we study the mixed linear regression (MLR) problem, where the goal is to recover multiple underlying linear models from their unlabeled linear measurements. We propose a non-convex objective function which we show is locally strongly convex in the neighborhood of the ground truth. We use a tensor method for initialization so that the initial models are in the local strong convexity region. We then employ general convex optimization algorithms to minimize the objective function. To the best of our knowledge, our approach provides first exact recovery guarantees for the MLR problem with K ≥2 components. Moreover, our method has near-optimal computational complexity eO(Nd) as well as near-optimal sample complexity eO(d) for constant K. Furthermore, we show that our nonconvex formulation can be extended to solving the subspace clustering problem as well. In particular, when initialized within a small constant distance to the true subspaces, our method converges to the global optima (and recovers true subspaces) in time linear in the number of points. Furthermore, our empirical results indicate that even with random initialization, our approach converges to the global optima in linear time, providing speed-up of up to two orders of magnitude. 1 Introduction The mixed linear regression (MLR) [7, 9, 29] models each observation as being generated from one of the K unknown linear models; the identity of the generating model for each data point is also unknown. MLR is a popular technique for capturing non-linear measurements while still keeping the models simple and computationally efficient. Several widely-used variants of linear regression, such as piecewise linear regression [14, 28] and locally linear regression [8], can be viewed as special cases of MLR. MLR has also been applied in time-series analysis [6], trajectory clustering [15], health care analysis [11] and phase retrieval [4]. See [27] for more applications. In general, MLR is NP-hard [29] with the hardness arising due to lack of information about the model labels (model from which a point is generated) as well as the model parameters. However, under certain statistical assumptions, several recent works have provided poly-time algorithms for solving MLR [2, 4, 9, 29]. But most of the existing recovery gurantees are restricted either to mixtures with K = 2 components [4, 9, 29] or require poly(1/✏) samples/time to achieve ✏-approximate solution [7, 24] (analysis of [29] for two components can obtain ✏approximate solution in log(1/✏) samples). Hence, solving the MLR problem with K ≥2 mixtures while using near-optimal number of samples and computational time is still an open question. In this paper, we resolve the above question under standard statistical assumptions for constant many mixture components K. To this end, we propose the following smooth objective function as a 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. surrogate to solve MLR: f(w1, w2, · · · , wK) := n X i=1 ⇧K k=1(yi −xT i wk)2, (1) where {(xi, yi) 2 Rd+1}i=1,2,··· ,N are the data points and {wk}k=1,2,··· ,K are the model parameters. The intuition for this objective is that the objective value is zero when {wk}k=1,2,··· ,K is the global optima and y’s do not contain any noise. Furthermore, the objective function is smooth and hence less prone to getting stuck in arbitrary saddle points or oscillating between two points. The standard EM [29] algorithm instead makes a “sharp” selection of mixture component and hence the algorithm is more likely to oscillate or get stuck. This intuition is reflected in Figure 1 (d) which shows that with random initialization, EM algorithm routinely gets stuck at poor solutions, while our proposed method based on the above objective still converges to the global optima. Unfortunately, the above objective function is non-convex and is in general prone to poor saddle points, local minima. However under certain standard assumptions, we show that the objective is locally strongly convex (Theorem 1) in a small basin of attraction near the optimal solution. Moreover, the objective function is smooth. Hence, we can use gradient descent method to achieve linear rate of convergence to the global optima. But, we will need to initialize the optimization algorithm with an iterate which lies in a small ball around the optima. To this end, we modify the tensor method in [2, 7] to obtain a “good” initialization point. Typically, tensor methods require computation of third and higher order moments which leads to significantly worse sample complexity in terms of data dimensionality d. However, for the special case of MLR, we provide a small modification of the standard tensor method that achieves nearly optimal sample and time complexity bounds for constant K (see Theorem 3) . More concretely, our approach requires ˜O(d(K log d)K) many samples and requires ˜O(Nd) computational time; note the exponential dependence on K. Also for constant K, the method has nearly optimal sample and time complexity. Subspace clustering: MLR can be viewed as a special case of subspace clustering (SC), since each regressor-response pair lies in the subspace determined by this pair’s model parameters. However, solving MLR using SC approaches is intractable because the dimension of each subspace is only one less than the ambient dimension, which will easily violate the conditions for the recovery guarantees of most methods (see e.g. Table 1 in [23] for the conditions of different methods). Nonetheless, our objective for MLR easily extends to the subspace clustering problem. That is, given data points {zi 2 Rd}i=1,2,··· ,N, the goal is to minimize the following objective w.r.t. K subspaces (each of dimension at most r): min Uk2Od⇥r,k=1,2,··· ,K f(U1, U2, · · · , UK) = N X i=1 ⇧K k=1 ⌦ Id −UkU T k , zizT i ↵ . (2) Uk denotes the basis spanned by k-th estimated subspace and Od⇥r ⇢Rd⇥r denotes the set of orthonormal matrices, i.e., U T U = I if U 2 Od⇥r. We propose a power-method style algorithm to alternately optimize (2) w.r.t {Uk}k=1,2,··· ,K, which takes only O(rdN) time compared with O(dN 2) for the state-of-the-art methods, e.g. [13, 22, 23]. Although EM with power method [4] shares the same computational complexity as ours, there is no convergence guarantee for EM to the best of our knowledge. In contrast, we provide local convergence guarantee for our method. That is, if N = ˜O(rKK) and if data satisfies certain standard assumptions, then starting from an initial point {Uk}k=1,··· ,K that lies in a small ball of constant radius around the globally optimal solution, our method converges super-linearly to the globally optimal solution. Unfortunately, our existing analyses do not provide global convergence guarantee and we leave it as a topic for future work. Interestingly, our empirical results indicated that even with randomly initialized {Uk}k=1,··· ,K, our method is able to recover the true subspace exactly using nearly O(rK) samples. We summarize our contributions below: (1) MLR: We propose a non-convex continuous objective function for solving the mixed linear regression problem. To the best of our knowledge, our algorithm is the first work that can handle K ≥ 2 components with global convergence guarantee in the noiseless case (Theorem 4). Our algorithm has near-optimal linear (in d) sample complexity and near-optimal computational complexity; however, our sample complexity dependence on K is exponential. 2 (2) Subspace Clustering: We extend our objective function to subspace clustering, which can be optimized efficiently in O(rdN) time compared with O(dN 2) for state-of-the-art methods. We also provide a small basin of attraction in which our iterates converge to the global optima at super-linear rate (Theorem 5). 2 Related Work Mixed Linear Regression: EM algorithm without careful initialization is only guaranteed to have local convergence [4, 21, 29]. [29] proposed a grid search method for initialization. However, it is limited to the two-component case and seems non-trivial to extend to multiple components. It is known that exact minimization for each step of EM is not scalable due to the O(d2N + d3) complexity. Alternatively, we can use EM with gradient update, whose local convergence is also guaranteed by [4] but only in the two-symmetric-component case, i.e., when w2 = −w1. Tensor Methods for MLR were studied by [7, 24]. [24] approximated the third-order moment directly from samples with Gaussian distribution, while [7] learned the third-order moment from a low-rank linear regression problem. Tensor methods can obtain the model parameters to any precision ✏but requires 1/✏2 time/samples. Also, tensor methods can handle multiple components but suffer from high sample complexity and high computational complexity. For example, the sample complexity required by [7] and [24] is O(d6) and O(d3) respectively. On the other hand, the computational burden mainly comes from the operation on tensor, which costs at least O(d3) for a very simple tensor evaluation. [7] also suffers from the slow nuclear norm minimization when estimating the second and third order moments. In contrast, we use tensor method only for initialization, i.e., we require ✏to be a certain constant. Moreover, with a simple trick, we can ensure that the sample and time complexity of our initialization step is only linear in d and N. Convex Formulation. Another approach to guarantee the recovery of the parameters is to relax the non-convex problem to convex problem. [9] proposed a convex formulation of MLR with two components. The authors provide upper bounds on the recovery errors in the noisy case and show their algorithm is information-theoretically optimal. However, the convex formulation needs to solve a nuclear norm function under linear constraints, which leads to high computational cost. The extension from two components to multiple components for this formulation is also not straightforward. Subspace Clustering: Subspace clustering [13, 17, 22, 23] is an important data clustering problem arising in many research areas. The most popular subspace clustering algorithms, such as [13, 17, 23], are based on a two-stage algorithm – first finding a neighborhood for each data point and then clustering the points given the neighborhood. The first stage usually takes at least O(dN 2) time, which is prohibitive when N is large. On the other hand, several methods such as K-subspaces clustering [18], K-SVD [1] and online subspace clustering [25] do have linear time complexity O(rdN) per iteration, however, there are no global or local convergence guarantees. In contrast, we show locally superlinear convergence result for an algorithm with computational complexity O(rdN). Our empirical results indicate that random initialization is also sufficient to get to the global optima; we leave further investigation of such an algorithm for future work. 3 Mixed Linear Regression with Multiple Components In this paper, we assume the dataset {(xi, yi) 2 Rd+1}i=1,2,··· ,N is generated by, zi ⇠multinomial(p), xi ⇠N(0, Id), yi = xT i w⇤ zi, (3) where p is the proportion of different components satisfying pT 1 = 1, {w⇤ k 2 Rd}k=1,2,··· ,K are the ground truth parameters. The goal is to recover {w⇤ k}k=1,2,··· ,K from the dataset. Our analysis is based on noiseless cases but we illustrate the empirical performance of our algorithm for the noisy cases, where yi = xT i w⇤ zi + ei for some noise ei (see Figure 1). Notation. We use [N] to denote the set {1, 2, · · · , N} and Sk ⇢[N] to denote the index set of the samples that come from k-th component. Define pmin := mink2[K]{pk}, pmax := maxk2[K]{pk}. Define ∆wj := wj −w⇤ j and ∆w⇤ kj := w⇤ k −w⇤ j . Define ∆min := minj6=k{k∆w⇤ jkk} and 3 ∆max := maxj6=k{k∆w⇤ jkk}. We assume ∆min ∆max is independent of the dimension d. Define w := [w1; w2; · · · ; wK] 2 RKd. We denote w(t) as the parameters at t-th iteration and w(0) as the initial parameters. For simplicity, we assume there are pkN samples from the k-th model in any random subset of N samples. We use EJXK to denote the expectation of a random variable X. Let T 2 Rd⇥d⇥d be a tensor and Tijk be the i, j, k-th entry of T. We say a tensor is supersymmetric if Tijk is invariant under any permutation of i, j, k. We also use the same notation T to denote the multi-array map from three matrices, A, B, C 2 Rd⇥r, to a new tensor: [T(A, B, C)]i,j,k = P p,q,l TpqlApiBqjClk. We say a tensor T is rank-one if T = a ⌦b ⌦c, where Tijk = aibjck. We use kAk denote the spectral norm of the matrix A and σi(A) to denote the i-th largest singular value of A. For tensors, we use kTkop to denote the operator norm for a supersymmetric tensor T, kTkop := maxkak=1 |T(a, a, a)|. We use T(1) 2 Rd⇥d2 to denote the matricizing of T in the first order, i.e., [T(1)]i,(j−1)d+k = Tijk. Throughout the paper, we use eO(d) to denote O(d ⇥polylog(d)). We assume K is a constant in general. However, if some numbers depend on KK, we will explicitly present it in the big O notation. For simplicity, we just include higher-order terms of K and ignore lower-order terms, e.g., O((2K)2K) may be replaced by O(KK). 3.1 Local Strong Convexity In this section, we analyze the Hessian of objective (1). Theorem 1 (Local Positive Definiteness). Let {xi, yi}i=1,2,··· ,N be sampled from the MLR model (3). Let {wk}k=1,2,··· ,K be independent of the samples and lie in the neighborhood of the optimal solution, i.e., k∆wkk := kwk −w⇤ kk cm∆min, 8k 2 [K], (4) where cm = O(pmin(3K)−K(∆min/∆max)2K−2), ∆min = minj6=k{kw⇤ j −w⇤ kk} and ∆max = maxj6=k{kw⇤ j −w⇤ kk}. Let P ≥1 be a constant. Then if N ≥O((PK)Kd logK+2(d)), w.p. 1 −O(Kd−P ), we have, 1 8pminN∆2K−2 min I ⪯r2f(w + δw) ⪯10N(3K)K∆2K−2 max I, (5) for any δw := [δw1; δw2; · · · ; δwK] satisfying kδwkk  cf∆min, where cf = O(pmin(3K)−Kd−K+1(∆min/∆max)2K−2). The above theorem shows the Hessians of a small neighborhood around a fixed {wk}k=1,2,··· ,K, which is close enough to the optimum, are positive definiteness (PD). The conditions on {wk}k=1,··· ,K and {δwk}k=1,··· ,K are different. {wk}k=1,··· ,K are required to be independent of samples and in a ball of radius cm∆min centered at the optimal solution. On the other hand, {δwk}k=1,2,··· ,K can be dependent on the samples but are required to be in a smaller ball of radius cf∆min. The conditions are natural as if ∆min is very small then distinguishing between w⇤ k and w⇤ k0 is not possible and hence Hessians will not be PD w.r.t both the components. To prove the theorem, we decompose the Hessian of Eq. (1) into multiple blocks, (rf)jl = @2f @wj@wl 2 Rd⇥d. When wk ! w⇤ k for all k 2 [K], the diagonal blocks of the Hessian will be strictly positive definite. At the same time, the off-diagonal blocks will be close to zeros. The blocks are approximated by the samples using matrix Bernstein inequality. The detailed proof can be found in Appendix A.2. Traditional analysis of optimization methods on strongly convex functions, such as gradient descent, requires the Hessians of all the parameters are PD. Theorem 1 implies that when wk = w⇤ k for all k = 1, 2, · · · , K, a small basin of attraction around the optimum is strongly convex as formally stated in the following corollary. Corollary 1 (Strong Convexity near the Optimum). Let {xi, yi}i=1,2,··· ,N be sampled from the MLR model (3). Let {wk}k=1,2,··· ,K lie in the neighborhood of the optimal solution, i.e., kwk −w⇤ kk cf∆min, 8k 2 [K], (6) where cf = O(pmin(3K)−Kd−K+1(∆min/∆max)2K−2). Then, for any constant P ≥1, if N ≥ O((PK)Kd logK+2(d)), w.p. 1 −O(Kd−P ), the objective function f(w1, w2, · · · , wK) in Eq. (1) is strongly convex. In particular, w.p. 1 −O(Kd−P ), for all w satisfying Eq. (6), 1 8pminN∆2K−2 min I ⪯r2f(w) ⪯10N(3K)K∆2K−2 max I. (7) 4 The strong convexity of Corollary 1 only holds in the basin of attraction near the optimum that has diameter in the order of O(d−K+1), which is too small to be achieved by our initialization method (in Sec. 3.2) using ˜O(d) samples. Next, we show by a simple construction, the linear convergence of gradient descent (GD) with resampling is still guaranteed when the solution is initialized in a much larger neighborhood. Theorem 2 (Convergence of Gradient Descent). Let {xi, yi}i=1,2,··· ,N be sampled from the MLR model (3). Let {wk}k=1,2,··· ,K be independent of the samples and lie in the neighborhood of the optimal solution, defined in Eq. (4). One iteration of gradient descent can be described as, w+ = w −⌘rf(w), where ⌘= 1/(10N(3K)K∆2K−2 max ). Then, if N ≥O(KKd logK+2(d)), w.p. 1 −O(Kd−2), kw+ −w⇤k2 (1 − pmin∆2K−2 min 80(3K)K∆2K−2 max )kw −w⇤k2 (8) Remark. The linear convergence Eq. (8) requires the resampling of the data points for each iteration. In Sec. 3.3, we combine Corollary 1, which doesn’t require resampling when the iterate is sufficiently close to the optimum, to show that there exists an algorithm using a finite number of samples to achieve any solution precision. To prove Theorem 2, we prove the PD properties on a line between a current iterate and the optimum by constructing a set of anchor points and then apply traditional analysis for the linear convergence of gradient descent. The detailed proof can be found in Appendix A.3. 3.2 Initialization via Tensor method In this section, we propose a tensor method to initialize the parameters. We define the second-order moment M2 := E q y2(x ⌦x −I) y and the third-order moments, M3 := E q y3x ⌦x ⌦x y − P j2[d] E q y3(ej ⌦x ⌦ej + ej ⌦ej ⌦x + x ⌦ej ⌦ej) y . According to Lemma 6 in [24], M2 = P k=[K] 2pkw⇤ k ⌦w⇤ k and M3 = P k=[K] 6pkw⇤ k ⌦w⇤ k ⌦w⇤ k. Therefore by calculating the eigendecomposition of the estimated moments, we are able to recover the parameters to any precision provided enough samples. Theorem 8 of [24] needs O(d3) sample complexity to obtain the model parameters with certain precision. Such high sample complexity comes from the tensor concentration bound. However, we find the problem of tensor eigendecomposition in MLR can be reduced to RK⇥K⇥K space such that the sample complexity and computational complexity are O(poly(K)). Our method is similar to the whitening process in [7, 19]. However, [7] needs O(d6) sample complexity due to the nuclear-norm minimization problem, while ours requires only eO(d). For this sample complexity, we need assume the following, Assumption 1. The following quantities, σK(M2), kM2k, kM3k2/3 op , P k2[K] pkkw⇤ kk2 and (P k2[K] pkkw⇤ kk3)2/3, have the same order of d, i.e., the ratios between any two of them are independent of d. The above assumption holds when {w⇤ k}k=1,2,··· ,K are orthonormal to each other. We formally present the tensor method in Algorithm 1 and its theoretical guarantee in Theorem 3. Theorem 3. Under Assumption 1, if |⌦| ≥O(d log2(d)+log4(d)), then w.p. 1−O(d−2), Algorithm 1 will output {w(0) k }K k=1 that satisfies, kw(0) k −w⇤ kk cm∆min, 8k 2 [K] which falls in the locally PD region, Eq. (4), in Theorem 1. The proof can be found in Appendix B.2. Forming ˆ M2 explicitly will cost O(Nd2) time, which is expensive when d is large. We can compute each step of the power method without explicitly forming ˆ M2. In particular, we alternately compute ˆY (t+1) = P i2⌦M2 y2 i (xi(xT i Y (t)) −Y (t)) and let Y (t+1) = QR( ˆY (t+1)). Now each power method iteration only needs O(KNd) time. Furthermore, the number of iterations needed will be a constant, since power method has linear convergence rate and we don’t need very accurate solution. For the proof of this claim, we refer 5 Algorithm 1 Initialization for MLR via Tensor Method Input: {xi, yi}i2⌦ Output: {w(0) k }K k=1 1: Partition the dataset ⌦into ⌦= ⌦M2[⌦2[⌦3 with |⌦M2| = O(d log2(d)), |⌦2| = O(d log2(d)) and |⌦3| = O(log4(d)) 2: Compute the approximate top-K eigenvectors, Y 2 Rd⇥K, of the second-order moment, ˆ M2 := 1 |⌦M2| P i2⌦M2 y2 i (xi ⌦xi −I), by the power method. 3: Compute ˆR2 = 1 2|⌦2| P i2⌦2 y2 i (Y T xi ⌦Y T xi −I). 4: Compute the whitening matrix ˆW 2 RK⇥K of ˆR2, i.e., ˆW = ˆU2ˆ⇤−1/2 2 ˆU T 2 , where ˆR2 = ˆU2ˆ⇤2 ˆU T 2 is the eigendecomposition of ˆR2. 5: Compute ˆR3 = 1 6|⌦3| P i2⌦3 y3 i (ri ⌦ri ⌦ri −P j2[K] ej ⌦ri ⌦ej −P j2[K] ej ⌦ej ⌦ri − P j2[K] ri ⌦ej ⌦ej), where ri = Y T xi for all i 2 ⌦3. 6: Compute the eigenvalues {ˆak}K k=1 and the eigenvectors {ˆvk}K k=1 of the whitened tensor ˆR3( ˆW, ˆW, ˆW) 2 RK⇥K⇥K by using the robust tensor power method [2]. 7: Return the estimation of the models, w(0) k = Y ( ˆW T )†(ˆak ˆvk) to the proof of Lemma 10 in Appendix B. Next we compute ˆR2 using O(KNd) and compute ˆW in O(K3) time. Computing ˆR3 takes O(KNd + K3N) time. The robust tensor power method takes O(poly(K)polylog(d)) time. In summary, the computational complexity for the initialization is O(KdN + K3N + poly(K)polylog(d)) = eO(dN). 3.3 Global Convergence Algorithm We are now ready to show the complete algorithm, Algorithm 2, that has global convergence guarantee. We use f⌦(w) to denote the objective function Eq. (1) generated from a subset of the dataset ⌦, i.e.,f⌦(w) = P i2⌦⇧K k=1(yi −xT i wk)2. Theorem 4 (Global Convergence Guarantee). Let {xi, yi}i=1,2,··· ,N be sampled from the MLR model (3) with N ≥O(d(K log(d))2K+3). Let the step size ⌘be smaller than a positive constant. Then given any precision ✏> 0, after T = O(log(d/✏)) iterations, w.p. 1 −O(Kd−2 log(d)), the output of Algorithm 2 satisfies kw(T ) −w⇤k ✏∆min. The detailed proof is in Appendix B.3. The computational complexity required by our algorithm is near-optimal: (a) tensor method (Algorithm 1) is carefully employed such that only O(dN) computation is needed; (b) gradient descent with resampling is conducted in log(d) iterations to push the iterate to the next phase; (c) gradient descent without resampling is finally executed to achieve any precision with log(1/✏) iterations. Therefore the total computational complexity is O(dN log(d/✏)). As shown in the theorem, our algorithm can achieve any precision ✏> 0 without any sample complexity dependency on ✏. This follows from Corollary 1 that shows local strong convexity of objective (1) with a fixed set of samples. By contrast, tensor method [7, 24] requires O(1/✏2) samples and EM algorithm requires O(log(1/✏)) samples[4, 29]. 4 Subspace Clustering (SC) The mixed linear regression problem can be viewed as clustering N (d + 1)-dimensional data points, zi = [xi, yi]T , into one of the K subspaces, {z : [w⇤ k, −1]T z = 0} for k 2 [K]. Assume we have data points {zi}i=1,2,··· ,N sampled from the following model, ai ⇠multinomial(p), si ⇠N(0, Ir), zi = U ⇤ aisi, (9) where p is the proportion of samples from different subspaces and satisfies pT 1 = 1 and {U ⇤ k}k=1,2,··· ,K are the bases of the ground truth subspaces. We can solve Eq. (2) by alternately minimizing over Uk when fixing the others, which is equivalent to finding the top-r eigenvectors 6 of PN i=1 ↵k i zizT i , where ↵k i = ⇧j6=k ⌦ Id −UjU T j , zizT i ↵ . When the dimension is high, it is very expensive to compute the exact top-r eigenvectors. A more efficient way is to use one iteration of the power method (aka subspace iteration), which only takes O(KdN) computational time per iteration. We present our algorithm in Algorithm 3. We show Algorithm 3 will converge to the ground truth when the initial subspaces are sufficiently close to the underlying subspaces. Define D( ˆU, ˆV ) := 1 p 2kUU T −V V T kF for some ˆU, ˆV 2 Rd⇥r, where U, V are orthogonal bases of Span( ˆU), Span( ˆV ) respectively. Define Dmax := maxj6=q D(U ⇤ q , U ⇤ j ), Dmin := minj6=q D(U ⇤ q , U ⇤ j ). Theorem 5. Let {zi}i=1,2,··· ,N be sampled from subspace clustering model (9). If N ≥ O(r(K log(r))2K+2) and the initial parameters {U 0 k}k2[K] satisfy max k {D(U ⇤ k, U 0 k)} csDmin, (10) where cs = O(pmin/pmax(3K)−K(Dmin/Dmax)2K−3), then w.p. 1 −O(Kr−2), the sequence {U t 1, U t 2, · · · , U t K}t=1,2,··· generated by Algorithm 3 converges to the ground truth superlinearly. In particular, for ∆t := maxk{D(U ⇤ k, U t k)}, ∆t+1 ∆2 t/(2csDmin) 1 2∆t. We refer to Appendix C.2 for the proof. Compared to other methods, our sample complexity only depends on the dimension of each subspace linearly. We refer to Table 1 in [23] for a comparison of conditions for different methods. Note that if Dmin/Dmax is independent of r or d, then the initialization radius cs is a constant. However, initialization within the required distance to the optima is still an open question; tensor methods do not apply in this case. Interestingly, our experiments seem to suggest that our proposed method converges to the global optima (in the setting considered in the above theorem). Algorithm 2 Gradient Descent for MLR Input: {xi, yi}i=1,2,··· ,N, step size ⌘. Output: w 1: Partition the dataset into {⌦(t)}t=0,1,··· ,T0+1 2: Initialize w(0) by Algorithm 1 with ⌦(0) 3: for t = 1, 2, · · · , T0 do 4: w(t) = w(t−1) −⌘rf⌦(t)(w(t−1)) 5: for t = T0 + 1, T0 + 2, · · · , T0 + T1 do 6: w(t) = w(t−1) −⌘rf⌦(T0+1)(w(t−1)) Algorithm 3 Power Method for SC Input: data points {zi}i=1,2,··· ,N Output: {Uk}k2[K] 1: Some initialization, {U 0 k}k2[K]. 2: Partition the data into {⌦(t)}t=0,1,2,··· ,T . 3: for t = 0, 1, 2, · · · , T do 4: ↵i = ⇧K j=1 ⌦ Id −U t jU tT j , zizT i ↵ , i 2 ⌦(t) 5: for k = 1, 2, · · · , K do 6: ↵k i = ↵i/ ⌦ Id −U t kU tT k , zizT i ↵ 7: U t+1 k QR(P i2⌦(t) ↵k i zizT i U t k) 5 Numerical Experiments 5.1 Mixed Linear Regression In this section, we use synthetic data to show the properties of our algorithm that minimizes Eq. (1), which we call LOSCO (LOcally Strongly Convex Objective). We generate data points and parameters from standard normal distribution. We set K = 3 and pk = 1 3 for all k 2 [K]. The error is defined as ✏(t) = min⇡2Perm([K]){maxk2[K] kw(t) ⇡(k) −w⇤ kk/kw⇤ kk}, where Perm([K]) is the set of all the permutation functions on the set [K]. The errors reported in the paper are averaged over 10 trials. In our experiments, we find there is no difference whether doing resampling or not. Hence, for simplicity, we use the original dataset for all the processes. We set both of two parameters in the robust tensor power method (denoted as N and L in Algorithm 1 in [2]) to be 100. The experiments are conducted in Matlab. After the initialization, we use alternating minimization (i.e., block coordinate descent) to exactly minimize the objective over wk for k = 1, 2, · · · , K cyclicly. Fig. 1(a) shows the recovery rate for different dimensions and different samples. We call the result of a trial is a successful recovery if ✏(t) < 10−6 for some t < 100. The recovery rate is the proportion of 7 0 200 400 600 800 1000 d 0 2000 4000 6000 8000 10000 N -10 -5 0 log(σ) -15 -10 -5 0 log(ϵ) N=6000 N=60000 N=600000 0 0.5 1 1.5 time(s) -30 -20 -10 0 log(err) LOSCO-ALT-tensor EM-tensor LOSCO-ALT-random EM-random 0 100 200 300 400 time(s) -30 -20 -10 0 log(err) LOSCO-ALT-tensor EM-tensor LOSCO-ALT-random EM-random (a) Sample complexity (b) Noisy case (c) d = 100, N = 6k (d) d = 1k, N = 60k Figure 1: (a),(b): Empirical performance of our method. (c), (d): performance of our methods vs EM method. Our method with random initialization is signficantly better than EM with random initialization. Performance of the two methods is comparable when initialized with tensor method. 10 trials with successful recovery. As shown in the figure, the sample complexity for exact recovery is nearly linear to d. Fig. 1(b) shows the behavior of our algorithm in the noisy case. The noise is drawn from ei 2 N(0, σ2), i.i.d., and d is fixed as 100. As we can see from the figure, the solution error is almost proportional to the noise deviation. Comparing among different N’s, the solution error decreases when N increases, so it seems consistent in presence of unbiased noise. We also illustrate the performance of our tensor initialization method in Fig. 2(a) in Appendix D. We next compare with EM algorithm [29], where we alternately assign labels to points and exactly solve each model parameter according to the labels. EM has been shown to be very sensitive to the initialization [29]. The grid search initialization method proposed in [29] is not feasible here, because it only handles two components with a same magnitude. Therefore, we use random initialization and tensor initialization for EM. We compare our method with EM on convergence speed under different dimensions and different initialization methods. We use exact alternating minimization (LOSCO-ALT) to optimize our objective (1), which has similar computational complexity as EM. Fig. 1(c)(d) shows our method is competitive with EM on computational time, when it converges to the optima. In the case of (d), EM with random initialization doesn’t converge to the optima, while our method still converges. In Appendix D, we will show some more experimental results. Table 1: Time (sec.) comparison for different subspace clustering methods N/K SSC SSC-OMP LRR TSC NSN+spectral NSN+GSR PSC 200 22.08 31.83 4.01 2.76 3.28 5.90 0.41 400 152.61 60.74 11.18 8.45 11.51 15.90 0.32 600 442.29 99.63 33.36 30.09 36.04 33.26 0.60 800 918.94 159.91 79.06 75.69 85.92 54.46 0.73 1000 1738.82 258.39 154.89 151.64 166.70 83.96 0.76 5.2 Subspace Clustering In this section, we compare our subspace clustering method, which we call PSC (Power method for Subspace Clustering), with state-of-the-art methods, SSC [13], SSC-OMP [12], LRR [22], TSC [17], NSN+spectral [23] and NSN+GSR [23] on computational time. We fix K = 5, r = 30 and d = 50. The ground truth U ⇤ k is generated from Gaussian matrices. Each data point is a normalized Gaussian vector in their own subspace. Set pk = 1/K. The initial subspace estimation is generated by orthonormlizing Gaussian matrices. The stopping criterion for our algorithm is that every point is clustered correctly, i.e., the clustering error (CE) (defined in [23]) is zero. We use publicly available codes for all the other methods (see [23] for the links). As we shown from Table 1, our method is much faster than all other methods especially when N is large. Almost all CE’s corresponding to the results in Table 1 are very small, which are listed in Appendix D. We also illustrate CE’s of our method for different N, d and r when fixing K = 5 in Fig. 6 of Appendix D, from which we see whatever the ambient dimension d is, the clusters will be exactly recovered when N is proportional to r. Acknowledgement: This research was supported by NSF grants CCF-1320746, IIS-1546459 and CCF-1564000. 8 References [1] Amir Adler, Michael Elad, and Yacov Hel-Or. Linear-time subspace clustering via bipartite graph modeling. IEEE transactions on neural networks and learning systems, 26(10):2234–2246, 2015. [2] Animashree Anandkumar, Rong Ge, Daniel Hsu, Sham M Kakade, and Matus Telgarsky. Tensor decompositions for learning latent variable models. JMLR, 15:2773–2832, 2014. [3] Peter Arbenz, Daniel Kressner, and D-MATH ETH Zürich. Lecture notes on solving large scale eigenvalue problems. http://people.inf.ethz.ch/arbenz/ewp/Lnotes/lsevp2010.pdf. [4] Sivaraman Balakrishnan, Martin J Wainwright, and Bin Yu. Statistical guarantees for the em algorithm: From population to sample-based analysis. Annals of Statistics, 2015. [5] Emmanuel J. Candès and Benjamin Recht. Exact matrix completion via convex optimization. Foundations of Computational Mathematics, 9(6):717–772, December 2009. [6] Alexandre X Carvalho and Martin A Tanner. Mixtures-of-experts of autoregressive time series: asymptotic normality and model specification. Neural Networks, 16(1):39–56, 2005. [7] Arun T. Chaganty and Percy Liang. Spectral experts for estimating mixtures of linear regressions. In ICML, pages 1040–1048, 2013. [8] Xiujuan Chai, Shiguang Shan, Xilin Chen, and Wen Gao. Locally linear regression for pose-invariant face recognition. Image Processing, 16(7):1716–1725, 2007. [9] Yudong Chen, Xinyang Yi, and Constantine Caramanis. A convex formulation for mixed regression with two components: Minimax optimal rates. COLT, 2014. [10] Chandler Davis and William Morton Kahan. The rotation of eigenvectors by a perturbation. iii. SIAM Journal on Numerical Analysis, 7(1):1–46, 1970. [11] P. Deb and A. M. Holmes. Estimates of use and costs of behavioural health care: a comparison of standard and finite mixture models. Health economics, 9(6):475–489, 2000. [12] Eva L Dyer, Aswin C Sankaranarayanan, and Richard G Baraniuk. Greedy feature selection for subspace clustering. The Journal of Machine Learning Research, 14(1):2487–2517, 2013. [13] Ehsan Elhamifar and René Vidal. Sparse subspace clustering. In CVPR, pages 2790–2797, 2009. [14] Giancarlo Ferrari-Trecate and Marco Muselli. A new learning method for piecewise linear regression. In Artificial Neural Networks—ICANN 2002, pages 444–449. Springer, 2002. [15] Scott Gaffney and Padhraic Smyth. Trajectory clustering with mixtures of regression models. In KDD. ACM, 1999. [16] Jihun Hamm and Daniel D Lee. Grassmann discriminant analysis: a unifying view on subspace-based learning. In ICML, pages 376–383. ACM, 2008. [17] Reinhard Heckel and Helmut Bolcskei. Subspace clustering via thresholding and spectral clustering. In Acoustics, Speech and Signal Processing, pages 3263–3267. IEEE, 2013. [18] Jeffrey Ho, Ming-Husang Yang, Jongwoo Lim, Kuang-Chih Lee, and David Kriegman. Clustering appearances of objects under varying illumination conditions. In CVPR, volume 1, pages I–11. IEEE, 2003. [19] Daniel Hsu and Sham M Kakade. Learning mixtures of spherical gaussians: moment methods and spectral decompositions. In ITCS, pages 11–20. ACM, 2013. [20] Daniel Hsu, Sham M Kakade, and Tong Zhang. A tail inequality for quadratic forms of subgaussian random vectors. Electronic Communications in Probability, 17(52):1–6, 2012. [21] Abbas Khalili and Jiahua Chen. Variable selection in finite mixture of regression models. Journal of the american Statistical association, 2012. [22] Guangcan Liu, Zhouchen Lin, and Yong Yu. Robust subspace segmentation by low-rank representation. In ICML, pages 663–670, 2010. [23] Dohyung Park, Constantine Caramanis, and Sujay Sanghavi. Greedy subspace clustering. In NIPS, pages 2753–2761, 2014. [24] Hanie Sedghi and Anima Anandkumar. Provable tensor methods for learning mixtures of generalized linear models. arXiv preprint arXiv:1412.3046, 2014. [25] Jie Shen, Ping Li, and Huan Xu. Online low-rank subspace clustering by basis dictionary pursuit. In ICML, 2016. [26] Joel A. Tropp. User-friendly tail bounds for sums of random matrices. Foundations of Computational Mathematics, 12(4):389–434, 2012. [27] Kert Viele and Barbara Tong. Modeling with mixtures of linear regressions. Statistics and Computing, 12(4):315–330, 2002. [28] Elisabeth Vieth. Fitting piecewise linear regression functions to biological responses. Journal of applied physiology, 67(1):390–396, 1989. [29] Xinyang Yi, Constantine Caramanis, and Sujay Sanghavi. Alternating minimization for mixed linear regression. In ICML, pages 613–621, 2014. 9
2016
300
6,218
Unsupervised Learning of Spoken Language with Visual Context David Harwath, Antonio Torralba, and James R. Glass Computer Science and Artificial Intelligence Laboratory Massachusetts Institute of Technology Cambridge, MA 02115 {dharwath, torralba, jrg}@csail.mit.edu Abstract Humans learn to speak before they can read or write, so why can’t computers do the same? In this paper, we present a deep neural network model capable of rudimentary spoken language acquisition using untranscribed audio training data, whose only supervision comes in the form of contextually relevant visual images. We describe the collection of our data comprised of over 120,000 spoken audio captions for the Places image dataset and evaluate our model on an image search and annotation task. We also provide some visualizations which suggest that our model is learning to recognize meaningful words within the caption spectrograms. 1 Introduction 1.1 Problem Statement Conventional automatic speech recognition (ASR) is performed by highly supervised systems which utilize large amounts of training data and expert knowledge. These resources take the form of audio with parallel transcriptions for training acoustic models, collections of text for training language models, and linguist-crafted lexicons mapping words to their pronunciations. The cost of accumulating these resources is immense, so it is no surprise that very few of the more than 7,000 languages spoken across the world [1] support ASR (at the time of writing the Google Speech API supports approximately 80). This highly supervised paradigm is not the only perspective on speech processing. Glass [2] defines a spectrum of learning scenarios for speech and language systems. Highly supervised approaches place less burden on the machine learning algorithms and more on human annotators. With less annotation comes more learning difficulty, but more flexibility. At the extreme end of the spectrum, a machine would need to make do with only sensory-level inputs, the same way that humans do. It would need to infer the set of acoustic phonetic units, the subword structures such as syllables and morphs, the lexical dictionaries of words and their pronunciations, as well as higher level information about the syntactic and semantic elements of the language. While such a machine does not exist today, there has been a significant amount of research in the speech community in recent years working towards this goal. Sensor-based learning would allow a machine to acquire language by observation and interaction, and could be applied to any language universally. In this paper, we investigate novel neural network architectures for the purpose of learning high-level semantic concepts across both audio and visual modalities. Contextually correlated streams of sensor data from multiple modalities - in this case a visual image accompanied by a spoken audio caption describing that image - are used to train networks capable of discovering patterns using otherwise unlabelled training data. For example, these networks are able to pick out instances of the spoken word “water" from within continuous speech signals and associate them with images containing bodies of water. The networks learn these associations directly from the data, without the use of conventional speech recognition, text transcriptions, or any expert linguistic knowledge whatsoever. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. This represents a new direction in training neural networks that is a step closer to human learning, where the brain must utilize parallel sensory input to reason about its environment. 1.2 Previous Work In recent years, there has been much work in the speech community towards developing completely unsupervised techniques that can learn the elements of a language solely from untranscribed audio data. A seminal paper in this sub-field [3] introduced Segmental Dynamic Time Warping (S-DTW), which enabled the discovery of repetitions of the same word-like units in an untranscribed audio stream. Many works followed this, some focusing on improving the computational complexity of the algorithm [4; 5], and others on applications [6; 7; 8; 9]. Other approaches have focused on inferring the lexicon of a language from strings of phonemes [10; 11], as well as inferring phone-like and higher level units directly from the speech audio itself [12; 13]. Completely separately, multimodal modeling of images and text has been an extremely popular pursuit in the machine learning field during the past decade, with many approaches focusing on accurately annotating objects and regions within images. For example, Barnard et al. [14] relied on pre-segmented and labelled images to estimate joint distributions over words and objects, while Socher [15] learned a latent meaning space covering images and words learned on non-parallel data. Other work has focused on natural language caption generation. While a large number of papers have been published on this subject, recent efforts using recurrent deep neural networks [16; 17] have generated much interest in the field. In [16], Karpathy uses a refined version of the alignment model presented in [18] to produce training exemplars for a caption-generating RNN language model that can be conditioned on visual features. Through the alignment process, a semantic embedding space containing both images and words is learned. Other works have also attempted to learn multimodal semantic embedding spaces, such as Frome et al. [19] who trained separate deep neural networks for language modeling as well as visual object classification. They then embedded the object classes into a dense word vector space with the neural network language model, and fine-tuned the visual object network to predict the embedding vectors of the words corresponding to the object classes. Fang et al. [20] also constructed a model which learned a DNN-based multimodal similarity function between images and text for the purpose of generating captions. The work most similar to ours is Harwath and Glass [21], in which the authors attempted to associate individual words from read spoken captions to relevant regions in images. While the authors did not employ ASR to first transcribe the speech, they did use the oracle word boundaries to segment the audio caption and used a CNN to embed each word into a high dimensional space. This CNN was pretrained to perform supervised isolated word classification on a separate dataset. Additionally, the authors used an off-the-shelf RCNN object detection network [22] to segment the image into regions as well as provide embedding vectors for each region. A neural network alignment model matched the words to regions, and the resulting network was used to perform image search and annotation. In this paper, we eschew the RCNN object detection, the oracle audio caption segmentation, and the pretrained audio CNN. Instead, we present a network which is able to take as input the raw audio signal of the spoken caption and compute a similarity score against the entire image frame. The network discovers semantically meaningful words and phrases directly from the audio waveform, and is able to reliably localize them within captions. We use our network to perform image search and annotation on a new dataset of free form spoken audio captions for the Places205 dataset [23]. 2 Data Collection Recent work on natural language image caption generation [17; 18] have used training data comprised of parallel images and human generated text captions. There are several widely used image captioning datasets such as Flickr8k [24], Flickr30k [25], and MSCOCO [26], but the captions for these datasets are in text form. Since we desire spontaneously spoken audio captions, we collected a new corpus of captions for the Places205 dataset [23]. Places205 contains over 2.5 million images categorized into 205 different scene classes, providing a rich variety of object types in many different contexts. To collect audio captions, we turned to Amazon’s Mechanical Turk, an online service which allows requesters to post “Human Intelligence Tasks,” or HITs, which anonymous workers can then complete for a small monetary compensation. We use a modified version of the Spoke JavaScript framework [27] as the basis of our audio collection HIT. Spoke is a flexible framework for creating speech2 enabled websites, acting as a wrapper around the HTML5 getUserMedia API while also supporting streaming audio from the client to a backend server via the Socket.io library. The Spoke client-side framework also includes an interface to Google’s SpeechRecognition service, which can be used to provide near-instantaneous feedback to the Turker. In our Mechanical Turk collection interface, four randomly selected images are shown to the user, and a start/stop record button is paired with each image. The user is instructed to record a free-form spoken caption for each image, describing the salient objects in the scene. The backend sends the audio off to the Google speech recognition service, which returns a text hypothesis of the words spoken. Because we do not have a ground truth transcription to check against, we use the number of recognized words as a means of quality control. If the Google recognizer was able to recognize at least eight words, we accept the caption. If not, the Turker is notified in real-time that their caption cannot be accepted, and is given the option to re-record their caption. Each HIT cannot be submitted until all 4 captions have been successfully recorded. We paid the Turkers $0.03 per caption, and have to date collected approximately 120,000 captions from 1,163 unique turkers, equally sampled across the 205 Places scene categories. We plan to make our dataset publicly available in the near future. For the experiments in this paper, we split a subset of our captions into a 114,000 utterance training set, a 2,400 utterance development set, and a 2,400 utterance testing set, covering a 27,891 word vocabulary (as specified by the Google ASR). The average caption duration was 9.5 seconds, and contained an average of 21.9 words. All the sets were randomly sampled, so many of the same speakers will appear in all three sets. We do not have ground truth text transcriptions for analysis purposes, so we use the Google speech recognition hypotheses as a proxy. Given the difficult nature of our data, these hypothesis are by no means error free. To get an idea of the error rates offered by the Google recognizer, we manually transcribed 100 randomly selected captions and found that the Google transcriptions had an estimated word error rate of 23.17%, indicating that the transcriptions are somewhat erroneous but generally reliable. To estimate the word start and end times for our analysis figures, we used Kaldi [28] to train a speech recognizer using the standard Wall Street Journal recipe, which was then used to force align the caption audio to the transcripts. 3 Multimodal Modeling of Images and Speech 3.1 Data Preprocessing To preprocess our images we rely on the off-the-shelf VGG 16 layer network [29] pretrained on the ImageNet ILSVRC 2014 task. The mean pixel value for the VGG network is first subtracted from each image, and then we take the center 224 by 224 crop and feed it forward through the network. We discard the classification layer and take the 4096-dimensional activations of the penultimate layer to represent the input image features. We use a log mel-filterbank spectrogram to represent the spoken audio caption associated with each image. Generating the spectrogram transforms the 1-dimensional waveform into a 2-dimensional signal with both frequency and time information. We use a 25 millisecond window size and a 10 millisecond shift between consecutive frames, specifying 40 filters for the mel-scale filterbank. In order to take advantage of the additional computational efficiency offered by performing gradient computation across batched input, we force every caption spectrogram to have the same size. We do this by fixing the spectrogram size at L frames (1024 to 2048 in our experiments, respectively corresponding to approximately 10 and 20 seconds of audio). We truncate any captions longer than L, and zero pad any shorter captions; approximately 66% of our captions were found to be 10 seconds or shorter, while 97% were under 20 seconds. It is important that the zero padding take place after any mean subtraction from the spectrograms, lest the padding bias the mean. 3.2 Multimodal Network Description In its simplest sense, our model is designed to calculate a similarity score for any given image and caption pair, where the score should be high if the caption is relevant to the image and low otherwise. It is similar in spirit to previously published models which attempt to learn a similarity measure within one modality such as [30], but our model spans across multiple modalities. The specific architecture we use is illustrated in Figure 1. Essentially, we use a two branched network, with one branch devoted to modeling the image and the other devoted to modeling the spectrogram of the audio caption. The final layer of each branch outputs a vector of activations, and the dot product of 3 Figure 1: The architecture of our audio/visual neural network with the embedding dimension denoted by d and the caption length by L. Separate branches of the network model the image and the audio spectrogram, and are subsequently tied together at the top level with a dot product node which calculates a similarity score for any given image and audio caption pair. these vectors is taken to represent the similarity between the image and the caption. As described in Section 3.1, the VGG 16 layer network effectively forms the bulk of the image branch, but we need to have a means of mapping the 4096-dimensional VGG embeddings into the multimodal embedding space that the images and audio will share. For this purpose we employ a simple linear transform. The audio branch of our network is convolutional in nature and treats the spectrogram as a 1-channel image. However, our spectrograms have a few interesting properties that differentiate them from images. While it is easy to imagine how visual objects in images can be translated along both the vertical and horizontal axes, the same is not quite true for words in spectrograms. A time delay manifests itself as a translation in the temporal (horizontal) direction, but a fixed pitch will always be mapped to the same frequency bin on the vertical axis. The same phone pronounced by two different speakers will not necessarily contain energy at exactly the same frequencies, but the physics is more complex than simply shifting the entire phone up and down the frequency axis. Following the example of [21], we size the filters of the first layer of the network to capture the entire 40-dimensional frequency axis over a context window of 5 frames, or approximately 50 milliseconds. This means that the vertical dimension is effectively collapsed out in the first layer, and so subsequent layers are only convolutional in the temporal dimension. After the final layer, we pool across the entire caption in the temporal dimension (using either mean or max pooling), and then apply L2 normalization to the caption embedding before computing the similarity score. 3.3 Training Procedure By taking the dot product of an image embedding vector with an audio caption embedding vector, we obtain a similarity score S. We want this score to be high for ground-truth pairs, and low otherwise. We train with stochastic gradient descent using an objective function which compares the similarity scores between matched image/caption pairs and mismatched pairs. Each minibatch consists of B ground truth pairs, each of which is paired with one impostor image and one impostor caption randomly sampled from the same minibatch. Let Sp j denote the similarity score between the jth ground truth pair, Sc j be the score between the original image and the impostor caption, and Si j be the score between the original caption and the impostor image. The loss for the minibatch as a function 4 Figure 2: Examples of ground truth image/caption pairs along with the time-dependent similarity profile showing which regions of the spectrogram the model believes are highly relevant to the image. Overlaid on the similarity curve is the recognition text of the speech, along with vertical lines to denote word boundaries. Note that the neural network model had no access to these (or any) transcriptions during the training or testing phases. of the network parameters θ is defined as: L(θ) = B X j=1 max(0, Sc j −Sp j + 1) + max(0, Si j −Sp j + 1) (1) This loss function was encourages the model to assign a higher similarity score to a ground truth image/caption pair than a mismatched pair by a margin of 1. In [18] the authors used a similar objective function to align images with text captions, but every single mismatched pair of images and captions within a minibatch was considered. Here, we only sample two negative training examples for each positive training example. In practice, we set our minibatch size to 128, used a constant momentum of 0.9, and ran SGD training for 50 epochs. Learning rates took a bit of tuning to get right. In the end, we settled on an initial value of 1e-5, and employed a schedule which decreased the learning rate by a factor between 2 and 5 every 5 to 10 epochs. 4 Experiments and Analysis 4.1 Image Query and Annotation To objectively evaluate our models, we adopt an image search and annotation task similar to the one used by [18; 21; 31]. We subsample a validation set of 1,000 image/caption pairs from the testing set described in Section 2. To perform image search given a caption, we keep the caption fixed and use our model to compute the similarity score between the caption and each of the 1,000 images in the validation set. Image annotation works similarly, but instead the image is kept fixed and the network is tasked with finding the caption which best fits the image. Some example search and annotation results are displayed in Figures 3 and 4, and we report recall scores for the top 1, 5, and 10 hits in Table 1. We experimented with many different variations on our model architecture, including varying the number of hidden units, number of layers, filter sizes, embedding dimension, and embedding normalization schemes. We found that an embedding dimension of d = 1024 worked well, and that normalizing the caption embeddings prior to the similarity score computation helped. When only the acoustic embedding vectors were L2 normalized, we saw a consistent increase in performance. However, when the image embeddings were also L2 normalized (equivalent to replacing the dot product similarity with a cosine similarity), the recall scores suffered. In Table 1, we show the impact of various truncation lengths for the audio captions, as well as using a mean or max pooling scheme 5 Figure 3: Example search results from our system. Shown on the top is the spectrogram of the query caption, along with its speech recognition hypothesis text. Below each caption are its five highest scoring images from the test set. Figure 4: Example annotation results from our system. Shown on the left is the query image, and on the right are the Google speech recognition hypotheses of the five highest scoring audio captions from the test set. We do not show the spectrograms here to avoid clutter. 6 Model Variant Search Annotation Pooling Caption type length (s) R@1 R@5 R@10 R@1 R@5 R@10 Mean 10 .056 .192 .289 .051 .194 .283 Mean 20 .066 .215 .299 .082 .195 .295 Max 10 .069 .192 .278 .068 .190 .274 Max 20 .068 .223 .309 .061 .192 .291 Table 1: Experimental results for image search and annotation on the Places audio caption data. All models shown used an embedding dimension of 1024. across the audio caption. We found that truncating the captions to 20 seconds instead of 10 only slightly boosts the scores, and that mean and max pooling work about equally well. All models were trained on an NVIDIA Titan X GPU, which usually took about 2 days. 4.2 Analysis of Image-Caption Pairs In order to gain a better understanding of what kind of acoustic patterns are being learned by our models, we computed time-dependent similarity profiles for each ground truth image/caption pair. This was done by removing the final pooling layer from the spectrogram branch of a trained model, leaving a temporal sequence of vectors reflecting the activations of the top-level convolutional units with respect to time. We computed the dot product of the image embedding vector with each of these vectors individually, rectified the signal to show only positive similarities, and then applied a 5th order median smoothing filter. We time aligned the recognition hypothesis to the spectrogram, allowing us to see exactly which words overlapped the audio regions that were highly similar to the image. Figure 2 displays several examples of these similarity curves along with the overlaid recognition text. In the majority of cases, the regions of the spectrogram which have the highest similarity to the accompanying image turn out to be highly informative words or phrases, often making explicit references to the salient objects in the image scenes. This suggests that our network is in fact learning to recognize audio patterns consistent with words using zero linguistic supervision whatsoever, and perhaps even more impressively is able to learn their semantics. 4.3 Analysis of Learned Acoustic Representations To further examine the high-level acoustic representations learned by our networks, we extracted spectrograms for 1645 instances of 14 different ground truth words from the development set by force aligning the Google recognizer hypotheses to the audio. We did a forward pass of each of these individual words through the audio branch of our network, leaving us with an embedding vector for each spoken word instance. We performed t-SNE [32] analysis on these points, shown in Figure 5. We observed that the points form pure clusters, indicating that the top-level activations of the audio network carry information which is discriminative across different words. We also examined the acoustic representations being learned at the bottom of the audio network by using the first convolutional layer and its nonlinearity as a feature extractor for a query-byexample keyword spotting task on the TIMIT data [33]. We then concatenate delta and double delta features (in the same style as the standard MFCC39 scheme), and finally apply PCA to reduce the dimensionality of the resulting features to 60. Exemplars of 10 different keywords are selected from the TIMIT training set, and frame-by-frame dynamic time warping using the cosine distance measure is used to search for occurrences of those keywords in the TIMIT testing set. Precision@N (P@N) and equal error rate (EER) are reported as evaluation metrics. We follow exactly the same experimental setup, including the same keywords, described in detail by [9] and [12], and compare against their published results in Table 2, along with a baseline system using standard MFCC39 features. The features extracted by our network are competitive against the best previously published baseline [12] in term of P@N, while outperforming it on EER. Because [12] and [9] are unsupervised approaches trained only on the TIMIT training set, this experiment is not a completely fair comparison, but serves to demonstrate that discriminative phonetic information is indeed being 7 modelled by our networks, even though we do not use any conventional linguistic supervision. Figure 5: t-SNE visualization in 2 dimensions for 1645 spoken instances of 14 different word types taken from the development data. System P@N EER MFCC baseline 0.50 0.127 [9] 0.53 0.164 [12] 0.63 0.169 This work 0.62 0.049 Table 2: Precision @ N and equal error rate (EER) results for the TIMIT keyword spotting task. The 10 keywords used for the task were: development, organizations, money, age, artists, surface, warm, year, problem, children. 5 Conclusion In this paper, we have presented a deep neural network architecture capable of learning associations between natural image scenes and accompanying free-form spoken audio captions. The networks do not rely on any form of conventional speech recognition, text transcriptions, or expert linguistic knowledge, but are able to learn to recognize semantically meaningful words and phrases at the spectral feature level. Aside from the pre-training of the off-the-shelf VGG network used in the image branch of the network, contextual information derived from the images is the only form of supervision used. We presented experimental results in which the networks were used to perform image search and annotation tasks, as well as some preliminary analysis geared towards understanding the kinds of acoustic representations are being learned by the network. There are many possible paths that future work might take. In the near term, the embeddings learned by the networks could be used to perform acoustic segmentation and clustering, effectively learning a lexicon of word-like units. The embeddings might be combined with other forms of word clustering such as those based on dynamic time warping [3] to perform acoustically and semantically aware word clustering. Further work should also more directly explore the regions of the images which hold the highest affinity for different word or phrase-like units in the caption; this would enrich the learned lexicon of units with visual semantics. One interesting long-term idea would be to collect spoken captions for the same set of images across multiple languages and then train a network to learn words across each of the languages. By identifying which words across the languages are highly associated with the same kinds of visual objects, the network would have a means of performing speech-to-speech translation. Yet another long-term idea would be to train networks capable of synthesizing spoken captions for an arbitrary image, or alternatively synthesizing images given a spoken description. Finally, it would be possible to apply our model to more generic forms audio with visual context, such as environmental sounds. References [1] M.P. Lewis, G.F. Simon, and C.D. Fennig, Ethnologue: Languages of the World, Nineteenth edition, SIL International. Online version: http://www.ethnologue.com, 2016. [2] James Glass, “Towards unsupervised speech processing,” in ISSPA Keynote, Montreal, 2012. [3] A. Park and J. Glass, “Unsupervised pattern discovery in speech,” in IEEE Transactions on Audio, Speech, and Language Processing vol. 16, no.1, pp. 186-197, 2008. 8 [4] A. Jansen, K. Church, and H. Hermansky, “Toward spoken term discovery at scale with zero resources,” in Proceedings of Interspeech, 2010. [5] A. Jansen and B. Van Durme, “Efficient spoken term discovery using randomized algorithms,” in Proceedings of IEEE Workshop on Automatic Speech Recognition and Understanding, 2011. [6] I. Malioutov, A. Park, R. Barzilay, and J. Glass, “Making sense of sound: Unsupervised topic segmentation over acoustic input,” in Proceedings of the Association for Computational Linguistics (ACL), 2007. [7] M. Dredze, A. Jansen, G. Coppersmith, and K. Church, “NLP on spoken documents without ASR,” in Proceedings of EMNLP, 2010. [8] D. Harwath, T.J. Hazen, and J. Glass, “Zero resource spoken audio corpus analysis,” in Proceedings of ICASSP, 2012. [9] Y. Zhang and J. Glass, “Unsupervised spoken keyword spotting via segmental DTW on Gaussian posteriorgrams,” in Proceedings ASRU, 2009. [10] M. Johnson, “Unsupervised word segmentation for sesotho using adaptor grammars,” in Proceedings of ACL SIG on Computational Morphology and Phonology, 2008. [11] S. Goldwater, T. Griffiths, and M. Johnson, “A Bayesian framework for word segmentation: exploring the effects of context,” in Cognition, vol. 112 pp.21-54, 2009. [12] C. Lee and J. Glass, “A nonparametric Bayesian approach to acoustic model discovery,” in Proceedings of the 2012 meeting of the Association for Computational Linguistics, 2012. [13] C. Lee, T.J. O’Donnell, and J. Glass, “Unsupervised lexicon discovery from acoustic input,” in Transactions of the Association for Computational Linguistics, 2015. [14] K. Barnard, P. Duygulu, D. Forsyth, N. DeFreitas, D.M. Blei, and M.I. Jordan, “Matching words and pictures,” in Journal of Machine Learning Research, 2003. [15] R. Socher and F. Li, “Connecting modalities: Semi-supervised segmentation and annotation of images using unaligned text corpora,” in Proceedings of CVPR, 2010. [16] A. Karpathy and F. Li, “Deep visual-semantic alignments for generating image descriptions,” in Proceedings of the 2015 Conference on Computer Vision and Pattern Recognition, 2015. [17] O. Vinyals, A. Toshev, S. Bengio, and D. Erhan, “Show and tell: A neural image caption generator,” in Proceedings of the 2015 Conference on Computer Vision and Pattern Recognition, 2015. [18] A. Karpathy, A. Joulin, and F. Li, “Deep fragment embeddings for bidirectional image sentence mapping,” in Proceedings of the Neural Information Processing Society, 2014. [19] A. Frome, G. Corrado, J. Shlens, S. Bengio, J. Dean, M. Ranzato, and T. Mikolov, “Devise: A deep visual-semantic embedding model,” in Proceedings of the Neural Information Processing Society, 2013. [20] H. Fang, S. Gupta, F. Iandola, Srivastava R., L. Deng, P. Dollar, J. Gao, X. He, M. Mitchell, J.C. Platt, C.L. Zitnick, and G. Zweig, “From captions to visual concepts and back,” in Proceedings of CVPR, 2015. [21] D. Harwath and J. Glass, “Deep multimodal semantic embeddings for speech and images,” in Proceedings of the IEEE Workshop on Automatic Speech Recognition and Understanding, 2015. [22] R. Girshick, J. Donahue, T. Darrell, and J. Malik, “Rich feature hierarchies for accurate object detection and semantic segmentation,” in Proceedings of CVPR, 2013. [23] B. Zhou, A. Lapedriza, J. Xiao, A. Torralba, and A. Oliva, “Learning deep features for scene recognition using places database,” in Proceedings of the Neural Information Processing Society, 2014. [24] C. Rashtchian, P. Young, M. Hodosh, and J. Hockenmaier, “Collecting image annotations using amazon’s mechanical turk,” in Proceedings of the NAACL HLT 2010 Workshop on Creating Speech and Language Data with Amazon’s Mechanical Turk, 2010. [25] P. Young, A. Lai, M. Hodosh, and J. Hockenmaier, “From image descriptions to visual denotations: New similarity metrics for semantic inference over event descriptions,” in Transactions for the Association of Computational Linguistics, 2014. [26] T. Lin, M. Marie, S. Belongie, L. Bourdev, R. Girshick, P. Perona, D. Ramanan, C.L. Zitnick, and P. Dollar, “Microsoft COCO: Common objects in context,” in arXiv:1405.0312, 2015. [27] P. Saylor, “Spoke: A framework for building speech-enabled websites,” M.S. thesis, Massachusetts Institute of Technology, 32 Vassar Street, Cambridge, MA 02139, 2015, Available at https://github.com/psaylor/spoke. [28] D. Povey, A. Ghoshal, G. Boulianne, L. Burget, O. Glembek, N. Goel, M. Hannemann, P. Motlicek, Y. Qian, P. Schwarz, J. Silovsky, G. Stemmer, and K. Vesely, “The Kaldi speech recognition toolkit,” in IEEE 2011 Workshop on Automatic Speech Recognition and Understanding, 2011. [29] K. Simonyan and A. Zisserman, “Very deep convolutional networks for large-scale image recognition,” CoRR, vol. abs/1409.1556, 2014. [30] S. Chopra, R. Hadsell, and Y. LeCun, “Learning a similarity metric discriminatively, with application to face verification,” in Proceedings of CVPR, 2005. [31] R. Socher, A. Karpathy, Q.V. Le, C.D. Manning, and A.Y. Ng, “Grounded compositional semantics for finding and describing images with sentences,” in Transactions of the Association for Computational Linguistics, 2014. [32] L. van der Maaten and G. Hinton, “Visualizing high-dimensional data using t-sne,” in Journal of Machine Learning Research, 2008. [33] J. Garofolo, L. Lamel, W. Fisher, J. Fiscus, D. Pallet, N. Dahlgren, and V. Zue, “The timit acoustic-phonetic continuous speech corpus,” 1993. 9
2016
301
6,219
Crowdsourced Clustering: Querying Edges vs Triangles Ramya Korlakai Vinayak Department of Electrical Engineering Caltech, Pasadena ramya@caltech.edu Babak Hassibi Department of Electrical Engineering Caltech, Pasadena hassibi@systems.caltech.edu Abstract We consider the task of clustering items using answers from non-expert crowd workers. In such cases, the workers are often not able to label the items directly, however, it is reasonable to assume that they can compare items and judge whether they are similar or not. An important question is what queries to make, and we compare two types: random edge queries, where a pair of items is revealed, and random triangles, where a triple is. Since it is far too expensive to query all possible edges and/or triangles, we need to work with partial observations subject to a fixed query budget constraint. When a generative model for the data is available (and we consider a few of these) we determine the cost of a query by its entropy; when such models do not exist we use the average response time per query of the workers as a surrogate for the cost. In addition to theoretical justification, through several simulations and experiments on two real data sets on Amazon Mechanical Turk, we empirically demonstrate that, for a fixed budget, triangle queries uniformly outperform edge queries. Even though, in contrast to edge queries, triangle queries reveal dependent edges, they provide more reliable edges and, for a fixed budget, many more of them. We also provide a sufficient condition on the number of observations, edge densities inside and outside the clusters and the minimum cluster size required for the exact recovery of the true adjacency matrix via triangle queries using a convex optimization-based clustering algorithm. 1 Introduction Collecting data from non-expert workers on crowdsourcing platforms such as Amazon Mechanical Turk, Zooinverse, Planet Hunters, etc. for various applications has recently become quite popular. Applications range from creating a labeled dataset for training and testing supervised machine learning algorithms [1, 2, 3, 4, 5, 6] to making scientific discoveries [7, 8]. Since the workers on the crowdsourcing platforms are often non-experts, the answers obtained will invariably be noisy. Therefore the problem of designing queries and inferring quality data from such non-expert crowd workers is of great importance. As an example, consider the task of collecting labels of images, e.g, of birds or dogs of different kinds and breeds. To label the image of a bird, or dog, a worker should either have some expertise regarding the bird species and dog breeds, or should be trained on how to label each of them. Since hiring experts or training non-experts is expensive, we shall focus on collecting labels of images through image comparison followed by clustering. Instead of asking a worker to label an image of a bird, we can show her two images of birds and ask: “Do these two birds belong to the same species?"(Figure 1(a)). Answering this comparison question is much easier than the labeling task and does not require expertise or training. Though different workers might use different criteria for comparison, e.g, color of feathers, shape, size etc., the hope is that, averaged over the crowd workers, we will be able to reasonably resolve the clusters (and label each). Consider a graph of n images that needs to be clustered, where each pairwise comparison is an ‘edge query’. Since the number of edges grows as O(n2), it is too expensive to query all edges. Instead, we want to query a subset of the edges, based on our total query budget, and cluster the resulting 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. (a) Do these two birds belong to the same species? (b) Which of these birds belong to the same species? Figure 1: Example of (a) an edge query and (b) a triangle query. partially observed graph. Of course, since the workers are non-experts, their answers will be noisy and this should be taken into consideration in designing the queries. For example, it is not clear what the best strategy to choose the subsets of edges to be queried is. 1.1 Our Contribution In this work we compare two ways of partially observing the graph: random edge queries, where a pair of items is revealed for comparison, and random triangle queries, where a triplet is revealed. We give intuitive generative models for the data obtained for both types of queries. Based on these models we determine the cost of a query to be its entropy (the information obtained from the response to the query). On real data sets where such a generative model may not be known we use the average response time per query as a surrogate for the cost of the query. To fairly compare the use of edge vs. triangle queries we fix the total budget, defined as the (aforementioned) cost per query times the total number of queries. Empirical evidence, based on extensive simulations, as well as two real data sets (images of birds and dogs, respectively), strongly suggests that, for a fixed query budget, querying for triangles significantly outperforms querying for edges. Even though, in contrast to edge queries that give information on independent edges, triangle queries give information on dependent edges, i.e., edges that share vertices, we (theoretically and empirically) argue that triangle queries are superior because (1) they allow for far more edges to be revealed, given a fixed query budget, and (2) due to the self-correcting nature of triangle queries, they result in much more reliable edges. Furthermore, for a specific convex optimization-based clustering algorithm, we also provide theoretical guarantee for the exact recovery of the true adjacency matrix via random triangle queries, which gives a sufficient condition on the number of queries, edge densities inside and outside the clusters and the minimum cluster size. In particular, we show that the lower bound of Ω(√n) on the cluster size still holds even though the edges revealed via triangle queries are not independent. 1.2 Problem Setup Consider n items with K disjoint classes/clusters plus outliers (items that do not belong to any clusters). Consider a graph with these n items as nodes. In the true underlying graph G∗, all the items in the same cluster are connected to each other and the items that are not in the same cluster are not connected to each other. We do not have access to G∗. Instead we have a crowdsourced query mechanism that can be used to observe a noisy and partial snapshot Gobs of this graph. Our goal is to find the cluster assignments from Gobs. We consider the following two querying methods: Random Edge Query: We sample E edges uniformly at random from n 2  possible edges. Figure 1(a) shows an example of an edge query. For each edge observation, there are two possible configurations: (1) Both items are similar, denoted by ll, (2) The items are not similar, denoted by lm. Random Triangle Query: We sample T triangles uniformly at random from n 3  possible triangles. Figure 1(b) shows an example of a triangle query. For each triangle observation, there are five possible configurations (Figure 2):(1) All items are similar, denoted by lll, (2) Items 1 and 2 are similar, denoted by llm, (3) Items 1 and 3 are similar, denoted by lml, (4) Items 2 and 3 are similar, denoted by mll, (5) None are similar, denoted by lmj. 1" 2" 3" lll! 1" 2" 3" llm! 1" 2" 3" lml! 1" 2" 3" mll! 1" 2" 3" lmj! 1" 2" 3" 1" 2" 3" 1" 2" 3" (a)"Allowed" (b)"Not"allowed" Figure 2: Configurations for a triangle query that are (a) observed and (b) not allowed. 2 Pr(y|x) lll llm lmj lll p3 + 3p2(1 −p) pq2 q3 llm p(1 −p)2 p(1 −q)2 + (1 −p)q2 + 2pq(1 −q) q(1 −q)2 lml p(1 −p)2 (1 −p)q(1 −q) q(1 −q)2 mll p(1 −p)2 (1 −p)q(1 −q) q(1 −q)2 lmj (1 −p)3 (1 −p)(1 −q)2 (1 −q)3 + 3q2(1 −q) Table 1: Query confusion matrix for the triangle block model for the homogeneous case. 1.3 Related Works [9, 10, 11, 12, 13, 14] and references therein focus on the problem of inferring true labels from crowdsoruced multiclass labeling. The common setup in these problems is as follows: A set of items are shown to workers and labels are elicited from them. Since the workers give noisy answers, each item is labeled by multiple workers. Algorithms based on Expectation-Maximization [14] for maximum likelihood estimation and minimax entropy based optimization [12] have been studied for inferring the underlying true labels. In our setup we do not ask the workers to label the items. Instead we use comparison between items to find the clusters of items that are similar to each other. [15] considers the problem of inferring the complete clustering on n images from a large set of clustering on smaller subsets via crowdsourcing. Each HIT (Human Intelligent Task) is designed such that all of them share a subset of images to ensure overlapping. Each HIT has M images and all the M 2  comparisons are made. Each HIT is then assigned to multiple workers to get reliable answers. These clustering are then combined using an algorithm based on variational Bayesian inference. In our work we consider a different setup, where either pairs or triples of images are compared by the crowd to obtain a partial graph on the images which can be clustered. [16] considers a convex approach to graph clustering with partially observed adjacency matrices, and provides an example of clustering images by crowdsourcing pairwise comparisons. However, it does not consider other types of querying such as triangle queries. In this work, we extend the analysis in [16] and show that similar performance guarantee holds for clustering via triangle queries. Another interesting line of work is learning embeddings and kernels through triplet comparison tasks in [17, 18, 19, 20, 21, 22] and references therein. The ‘triplet comparison’ task in these works is of type: ‘Is a closer to b or to c?’, with two possible answers, to judge the relative distances between the items. On the other hand, a triangle query in our work has five possible answers (Figure 1(b)) that gives a clustering (discrete partitioning) of the three items. 2 Models Probability of observing a particular configuration y is given by: Pr(y) = P x∈X Pr(y|x)Pr(x), where x is the true configuration and X is the set of true configurations. Let Y be the set of all observed configurations. Each query has a |Y| × |X| confusion matrix [Pr(y|x)] associated to it. Note that the columns of this confusion matrix sum to 1, i.e P y∈Y Pr(y|x) = 1. 2.1 Random Edge Observation Models For the random edge query case, there are two observation configurations, Y = {ll, lm} where lm denotes ‘no edge’ and ll denotes ‘edge’. One-coin Edge Model: Assume all the queries are equally hard. Let the ζ be the probability of answering a question wrong. Then Pr(ll|ll) = Pr(lm|lm) = 1 −ζ, Pr(lm|ll) = Pr(ll|lm) = ζ. This model is inspired by the one-coin Dawid-Skene Model [23], which is used in inference for item label elicitation tasks. This is a very simple model and does not capture the difficulty of a query depending on which clusters the items in the query belong to. In order to incorporate these differences we consider the popular Stochastic Block model (SBM) [24, 25] which is one of the most widely used model for graph clustering. Stochastic Block Model (SBM): Consider a graph on n nodes with K disjoint clusters and outliers. Any two nodes i and j are connected (independent of other edges) with probability p if they belong to the same cluster and with probability q otherwise. That is, Pr(ll|ll) = p, Pr(lm|ll) = 1 −p, Pr(ll|lm) = q and Pr(lm|lm) = 1 −q. We assume that the density of the edges inside the clusters is higher than that between the clusters, that is, p > q. 2.2 Random Triangle Observation Models For the triangle query model, there are five possible observation configurations (Figure 2), Y = {lll, llm, lml, mll, lmj}. One-coin Triangle Model: Let each question be answered correctly with probability 1 −ζ, and 3 Pr(y|x) lll llm lmj lll p3/zlll pq2/zllm q3/zlmj llm p(1 −p)2/zlll p(1 −q)2/zllm q(1 −q)2 lml p(1 −p)2/zlll (1 −p)q(1 −q)/zllm q(1 −q)2/zlmj mll p(1 −p)2/zlll (1 −p)q(1 −q)/zllm q(1 −q)2/zlmj lmj (1 −p)3/zlll (1 −p)(1 −q)2/zllm (1 −q)3/zlmj Table 2: Query confusion matrix for the conditional block model for the homogeneous case. when wrongly answered, all the other configurations are equally confusing. So, Pr(lll|lll) = 1 −ζ and Pr(llm|lll) = Pr(lml|lll) = Pr(mll|lll) = Pr(lmj|lll) = ζ/4 and so on. This model, as in the case of the one-coin model for edge query, does not capture the differences in difficulty for different clusters. In order to include the differences in confusion between different clusters, we consider the following observation models for a triangle query. For these 3 items in the triangle query, the edges are first generated from the SBM. This can give rise to 8 configurations, out of which 5 are allowed as an answer to triangle query while the rest 3 are not allowed (Figure 2). The two models differ in how they handle the configurations that are not allowed, and are described below: Triangle Block Model (TBM): In this model we assume that a triangle query helps in correctly resolving the configurations that are not allowed. So, when the triangle generated from the SBM takes one of the 3 non-allowed configurations, it is mapped to the true configuration. This gives a 5 × 5 query confusion matrix which is given in Table 1. Note that the columns for lml and mll can be filled in a similar manner to that of llm. Conditional Block Model (CBM): In this model when a non-allowed configuration is encountered, it is redrawn again. This is equivalent to conditioning on the allowed configurations. Define the normalizing factors, zlll := 3p3 −3p2 + 1, zllm := 3pq2 −2pq −q2 + 1, zllm := 3q3 −3q2 + 1 . The 5 × 5 query confusion matrix which is given in Table 2. Remark: Note that the SBM (and hence the derived models) can be made more general by considering different edge probabilities Pii for cluster i and Pij = Pji between clusters i ̸= j. Some intuitive properties of the triangle query models described in this section are: 1. If p > q, then the diagonal term will dominate any other term in a row. That is Pr(lll|lll) > Pr(lll|⋆̸= lll), Pr(llm|llm) > Pr(llm|⋆̸= llm) and so on. 2. If p > 1/2 > q, then the diagonal term will dominate the other terms in the column, i.e, Pr(lll|lll) > Pr(llm|lll) = Pr(lml|lll) = Pr(mll|lll) > Pr(lmj|lll) etc. 3. When there is a symmetry between the items, the observation probability should be the same. That is, if the true configuration is llm, then observing lml and mll should be equally likely as item1 and item2 belong to the same cluster and so on. This property will hold good in the general case as well except for when the true configuration is lmj. In this case, the probability of observing llm, lml and mll can be different as it depends on the clusters to which items 1, 2 and 3 belong. 2.3 Adjacency Matrix: Edge Densities and Edge Errors The adjacency matrix, A = AT of a graph can be partially filled by querying a subset of edges. Since we query edges randomly, most of the edges are seen only once. Some edges might get queried multiple times, in which case, we randomly pick one of them. Similarly we can also partially fill the adjacency matrix from triangle queries. We fill the unobserved entries of the adjacency matrix with zeros. We can perform clustering on A to obtain a partition of items. The true underlying graph G∗has perfect clusters (disjoint cliques). So, the performance of clustering on A depends on how noisy it is. This in turn depends on the probability of error for each revealed edge in A, i.e, what is the probability that a true edge was registered as no-edge and vice versa. The hope is that triangle queries help workers to resolve the edges better and hence have less errors among the revealed edges than those obtained from edge queries. If we make E edge queries, then the probability of observing an edge is, r = E/ n 2  . If we make T triangle queries, the probability of observing an edge is rT = 3T/ n 2  . Let rp (rT pT ) and rq (rT qT ) be the edge probability in side the clusters and between the clusters respectively, in A which is partially filled via edge (triangle) queries. For simplicity consider a graph with K clusters of size m each (n = Km). The probability that a randomly chosen edge in A filled via edge query is in error can be computed as: pedge err := (1 −rp) (m −1)/(n −1) + rq (n −m)/(n −1). Similarly, we can write p∆ err. Under reasonable conditions on the parameters involved, p∆ err < pedge err . 4 0.7 0.8 0.9 0 0.1 0.2 0.3 0.4 0.5 One−coin Model, r=0.2, q = 1−p p Fraction of Entries in Error E TE TB 0.7 0.8 0.9 0 0.1 0.2 0.3 0.4 0.5 Triangle Block Model, r=0.2, q = 0.25 p E TE TB 0.7 0.8 0.9 0 0.1 0.2 0.3 0.4 0.5 Conditional Block Model, r=0.2, q = 0.25 p E TE TB 0.7 0.8 0.9 0 0.1 0.2 0.3 0.4 0.5 One−coin Model, r=0.3, q = 1−p p E TE TB 0.7 0.8 0.9 0 0.1 0.2 Triangle Block Model, r=0.3, q = 0.25 p E TE TB 0.7 0.8 0.9 0 0.1 0.2 Conditional Block Model, r=0.3, q = 0.25 p E TE TB Figure 3: Fraction of entries in error in the matrix recovered via Program 4.1. For example, in the case of One-coin model, for edge qurey, rp = r (1−ζ) and rq = rζ. For triangle query, rT pT = rT (1 −3ζ/4) and rT qT = rT ζ/2. If rT < 2r, we have rT qT < rq and rT pT > rp, and hence p∆ err < pedge err . For the TBM, when p > 1/2 > q, with r < rT < r/(1 −q), we get rT pT > rp and rT qT < rq, and hence p∆ err < pedge err . For the CBM, when p > 1/2 > q, under reasonable assumptions on r, rT qT < rq, but depending on the values of r and rT , rT pT can get below rp. If the decrease in edge probability between the clusters is large enough to overcome the fall in edge density inside the clusters, then p∆ err < pedge err . In summary, when A is filled by triangle queries, the edge density between the clusters decreases and the overall number of edge errors decreases (we observe this in real data as well, see Table 3). Both of these are desirable for clustering algorithms that try to approximate the minimum cut to find the clusters like spectral clustering. 3 Value of a Query To make a meaningful comparison between edge queries and triangle queries, we need to fix a budget. Suppose we have a budget to make E edge queries. To find the number of triangle queries that can be made with the same budget, we need to define the value (cost) of a triangle query. Although a triangle query has 3 edges, they are not independent and hence its relative cost is less than that of making 3 random edge queries. Thus we need a fair way to compare the value of a triangle query to that of an edge query. Let s ∈[0, 1]|Y|, P y∈Y sy = 1 be the probability mass function (pmf) of the observation in a query, with sy := Pr(y) = P x∈X Pr(y|x)Pr(x). We define the value of a query as the information obtained from the observation, which is measured by its entropy: H(s) = −P i∈Y si log(si). Ideally, the cost of a query should be proportional to the amount of information it provides. So, if E is the number of edge queries, then the number of triangle queries we can make with the same budget is: TB = E × HE/H∆. We should remark that detetrmining the above cost requires knowledge of the generative model of the graph, which may not be available for empirical data sets. In such situations, a very reasonable cost is the relative time it takes for a worker to respond to a triangle query, compared to an edge query. (In this manner, a fixed budget means a fixed amount of time for the queries to be completed.) A good rule of thumb, which is widely supported by empirical data, is the cost of 1.5, ostensibly because in triangle queries workers need to study three images, rather than two, and so it takes them 50% longer to respond. The end result is that, for a fixed budget, triangle queries reveal twice as many edges. 4 Guaranteed Recovery of the True Adjacency Matrix In this section we provide a sufficient condition for the full recovery of the adjacency matrix corresponding to the underlying true G∗from partially observed noisy A filled via random triangle queries. We consider the following convex program from [16]: minimize L,S ∥L∥⋆+ λ∥S∥1 (4.1) s. t. 1 ≥Li,j ≥Si,j ≥0 for all i, j ∈{1, 2, . . . n}, Li,j = Si,j whenever Ai,j = 0, n X i,j=1 Lij ≥|R| where ∥.∥⋆is the nuclear norm (sum of the singular values of the matrix), and ∥.∥1 is the l1-norm (sum of absolute values of the entries of the matrix) and λ ≥0 is the regularization parameter. L is the low-rank matrix corresponding to the true cluster structure, S is the sparse error matrix that accounts only for the missing edges inside the clusters and |R| is the size of the cluster region. 5 When A is filled using a subset of random edge queries, under the SBM with parameters {n, nmin, K, p, q}, [16] provides the following sufficient condition for the guaranteed recovery of the true G∗: nmin r (p −q) ≥1 λ ≥2√n p rq(1 −rq) + 2√nmax p rp(1 −rp) + rq(1 −rq), (4.2) where nmin and nmax are the sizes of the smallest and the largest clusters respectively. We extend the analysis in[16] to the case when A is filled via a subset of random triangle queries, and obtain the following sufficient condition: Theorem 1 If the following condition holds: nmin rT (pT −qT ) ≥1 λ ≥3  2√n r rT qT 3 (1 −rT qT 3 ) + 2√nmax r rT pT 3 (1 −rT pT 3 ) + rT qT 3 (1 −rT qT 3 )  then Program 4.1 succeeds in recovering the true G∗with high probability. When A is filled using random edge queries, the entries are independent of each other (since the edges are independent in the SBM). When we use triangle queries to fill A, this no longer holds as the 3 edges filled from a triangle query are not independent. Due to the limited space, we present only the key idea of our proof: The analysis in [16] relies on the independence of entries of A to use Bernstein-type concentration results for the sum of independent random variables and the bound on the spectral norm of random matrix with independent entries. We make the following observation: Split A filled via random triangle queries into three parts, A = A1 + A2 + A3. For each triangle query, allocate one edge to each part randomly. If an edge gets queried as a part of multiple triangle queries, keep one of them randomly. Each Ai now contains independent entries. The edge density in Ai is rT pT /3 and rT qT /3 inside the clusters and outside respectively. This allows us to use the results on concentration of sum of independent random variables and the O(√n) bound on the spectral norm of random matrices, with a penalty due to triangle inequality for spectral norm. It can be seen that, when the number of revealed edges is the same (rT = r) and the probability of correctly identifying edges is the same (pT = p and 1 −qT = 1 −q), then the reovery condition of Theorem 1 is worse than that of (4.2). (This is expected, since triangle queries yield dependent edges.) However, it is overcompensated by the fact that triangle queries result in more reliable edges (pT −qT > p −q) and also reveal more edges (rT > r, since the relative cost is less than 3). To illustrate this, consider a graph on n = 600 nodes with K = 3 clusters of equal size m = 200. We generate the adjacency matrices from different models in Section 2 for varying p from 0.65 to 0.9. For the one-coin models, 1−ζ = p. For the rest of the models q = 0.25. We run the improved convex program (4.1) by setting λ = 1/√n. Figure 3 shows the fraction of the entries in the recovered matrix that are wrong compared to the true adjacency matrix for r = 0.2 and 0.3 (averaged over 5 runs; TE = ⌈E/3⌉and TB = EHE/H∆). We note that the error drops significantly when A is filled via triangle queries than via edge queries. 5 Performance of Spectral Clustering: Simulated Experiments We generate adjacency matrices from the edge query and the triangle query models (Section 2) and run the spectral clustering algorithm [26] on them. We compare the output clustering with the ground truth via variation of information (VI) [27] which is defined for two clusterings (partitions) of a dataset and has information theoretical justification. Smaller values of VI indicate a closer match and a VI of 0 means that the clusterings are identical. We compare the performance of the spectral clustering algorithms on the partial adjacency matrices obtained from querying: (1) E = ⌈r n 2  ⌉ random edges, (2) TB = E × HE/H∆random triangles, which has the same budget as querying E edges and (3) TE = ⌈E/3⌉< TB random triangles, which has same number of edges as in the adjacency matrix obtained by querying E edges. Varying Edge Density Inside the Clusters: Consider a graph on n = 450 nodes with K = 3 clusters of equal size m = 150. We vary edge density inside the cluster p from 0.55 to 0.9. For the one-coin models, 1 −ζ = p, and q = 0.25 for the rest. Figure 4 shows the performance of spectral clustering for r = 0.15 and r = 0.3 (averaged over 5 runs). Varying Cluster Sizes: Let N = 1200. Consider a graph with K clusters of equal sizes m = ⌊N/K⌋and n = K m. We vary K from 2 to 12 which varies the cluster sizes from 600 (large clusters) to 100 (small clusters, note that √ 1200 ≈35). We set p = 0.7. For the one-coin models 6 0.6 0.8 1 0 0.5 1 1.5 2 2.5 One−coin, r=0.15, q = 1−p p VI (Variation of Information) E TE TB 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 Triangle Block Model r=0.15, q = 0.25 p E TE TB 0.6 0.8 1 0 0.5 1 1.5 Conditional Block Model r=0.15, q = 0.25 p E TE TB 0.6 0.8 1 0 0.5 1 1.5 2 2.5 One−coin r=0.3, q = 1−p p E TE TB 0.6 0.8 1 0 0.1 0.2 0.3 0.4 Triangle Block Model r=0.3, q = 0.25 p E TE TB 0.6 0.8 1 0 0.2 0.4 0.6 0.8 Conditional Block Model r=0.3, q = 0.25 p E TE TB Figure 4: VI for Spectral Clustering output for varying edge density inside the clusters. 0 5 10 0 1 2 3 4 5 One−coin r=0.2, p = 1−q = 0.7 K VI (Variation of Information) E TE TB 0 5 10 0 1 2 3 4 Triangle Block Model r=0.2, p = 0.7, q = 0.25 K E TE TB 0 5 10 0 1 2 3 4 Conditional Block Model r=0.2, p = 0.7, q = 0.25 K E TE TB 0 5 10 0 1 2 3 4 One−coin r=0.3, p = 1− q = 0.7 K E TE TB 0 5 10 0 0.5 1 1.5 2 Triangle Block Model r=0.3, p = 0.7, q = 0.25 K E TE TB 0 5 10 0 0.5 1 1.5 2 Conditional Block Model r=0.3, p = 0.7, q = 0.25 K E TE TB Figure 5: VI for Spectral Clustering output for varying number of clusters (K). 1 −ζ = p and q = 0.25 for the rest. Figure 5 shows the performance of spectral clustering for r = 0.2 and 0.3. The performance is significantly better with triangle queries compared to that with edge queries. 6 Experiments on Real Data We use Amazon Mechanical Turk as crowdsourcing platform. For edge queries, each HIT (Human Intelligence Task) has 30 queries of random pairs, a sample is shown in Figure 1(a). For triangle queries, each HIT has 20 queries, with each query having 3 random images, a sample is shown in Figure 1(b). Each HIT is answered by a unique worker. Note that we do not provide any examples of different classes or any training to do the task. We fill A as described in Section 2.3 and run the k-means, the Spectral Clustering and Program 4.1 followed by Spectral Clusteirng on it. Since we do not know the model parameters and hence have no access to the entropy information, we can use the the average time taken as the “cost” or value of the query. For E edge comparisons, the equivalent number of triangle comparisons would be T = E × tE/t∆, where tE and t∆are average time taken to answer an edge query and a triangle query respectively. We consider two datasets: 1. Dogs3 dataset has images of the following 3 breeds of dogs from the Stanford Dogs Dataset [28]: Norfolk Terrier (172), Toy Poodle (150) and Bouvier des Flanders (151), giving a total of 473 dogs images. On an average a worker took tE = 8.4s to answer an edge query and t∆= 11.7s to answer a triangle query. 2. Birds5 dataset has 5 bird species from CUB-200-2011 dataset [29]: Laysan Albatross (60), Least Tern (60), Artic Tern (58), Cardinal (57) and Green Jay (57). We also add 50 random species as outliers, giving us a total if 342 bird images. On an average, workers took tE = 8.3s to answer one edge query and t∆= 12.1s to answer a triangle query. Details of the data obtained from edge query and triangle query experiments is summarized in Table 3. Note that the error in the revealed edges drop significantly for triangle queries. For the Dogs3 dataset, the empirical edge densities inside and between the clusters for A obtained from the edge queries ( ˆPE) and the triangle queries ( ˆPT ) is: ˆPE = "0.7577 0.1866 0.2043 0.1866 0.6117 0.2487 0.2043 0.2487 0.7391 # , ˆPT = "0.7139 0.1138 0.1253 0.1138 0.6231 0.1760 0.1253 0.1760 0.7576 # . E: Edge, T: ∆ # Workers # Unique Edges % of Edges Seen % of Edge Errors Dogs3, Edge Query 300 E′ = 8630 7.73% 25.2% Dogs3, ∆Query 150 3T ′ E = 8644 7.74% 19.66% Dogs3, ∆Query 320 3T ′ = 17, 626 15.79% 20% Birds5, Edge Query 300 E′ = 8319 14.27% 14.82% Birds5, ∆Query 155 3T ′ E = 8600 14.74% 10.96% Birds5, ∆Query 285 3T ′ = 14, 773 25.34% 11.4% Table 3: Summary of the data colleced in the real experiments. 7 Query (E: Edge, T: ∆) k-means Spectral Clustering Convex Program E′ = 8630 0.8374 ± 0.0121 (K=2) 0.6972 ± 0 (K = 3) 0.5176 ± 0 (K=3) 3T ′ E = 8644 0.6675 ± 0.0246 (K=3) 0.5690 ± 0 (K=3) 0.4605 ± 0 (K = 3) 3T ′ = 17626 0.3268 ± 0 (K=3) 0.3470 ± 0 (K=3) 0.2279 ± 0 (K = 3) Table 4: VI for clustering output by k-means and spectral clustering for the Dogs3 dataset. Query k-means Spectral Clustering Convex Program E′ = 8319 1.4504 ± 0.0338 (K = 2) 1.2936 ± 0.0040 (K = 4) 1.0392 ± 0 (K = 4) 3T ′ E = 8600 1.1793 ± 0.0254 (K = 3) 1.1299 ± 0(K = 4) 0.9105 ± 0 (K=4) 3T ′ = 14, 773 0.7989 ± 0 (K = 4) 0.8713 ± 0 (K = 4) 0.9135 ± 0 (K = 4) Table 5: VI for clustering output by k-means and spectral clustering for the Birds5 dataset. For the Birds5 dataset, the emprical edge densities within and between various clusters in A filled via edge queries ( ˆPE) and triangle queries ( ˆPT ) are: ˆ PE =   0.801 0.304 0.208 0.016 0.032 0.100 0.304 0.778 0.656 0.042 0.131 0.123 0.208 0.656 0.912 0.062 0.094 0.096 0.016 0.042 0.062 0.855 0.154 0.110 0.032 0.131 0.094 0.154 0.958 0.158 0.100 0.123 0.096 0.110 0.158 0.224   , ˆ PT =   0.786 0.207 0.151 0.011 0.021 0.058 0.207 0.797 0.625 0.023 0.047 0.1 0.151 0.625 0.865 0.024 0.06 0.071 0.011 0.023 0.024 0.874 0.059 0.076 0.021 0.047 0.06 0.059 0.943 0.08 0.058 0.1 0.071 0.078 0.08 0.182   . As we see the triangle queries give rise to an adjacency matrix with significantly less confusion across the clusters (compare the off-diagonal entries in ˆPE and ˆPT ). Tables 4 and 5 show the performance of clustering algorithms (in terms of variation of information) for the two datasets. The no. of clusters found is given in brackets. We note that for both the datasets, the performance is significantly better with triangle queries than with edge queries. Furthermore, even with less triangle queries (3T ′ E ≈E) than that is allowed by the budget, the clustering obtained is better compared to edge queries. 7 Summary In this work we compare two ways of querying for crowdsourcing clustering using non-experts: random edge comparisons and random triangle comparisons. We provide simple and intuitive models for both. Compared to edge queries that reveal independent entries of the adjacency matrix, triangle queries reveal dependent ones (edges in a triangle share a vertex). However, due to their errorcorrecting capabilities, triangle queries result in more reliable edges and, furthermore, because the cost of a triangle query is less than that of 3 edge queries, for a fixed budget, triangle queries reveal many more edges. Simulations based on our models, as well as empirical evidence strongly support these facts. In particular, experiments on two real datasets suggests that clustering items from random triangle queries significantly outperforms random edge queries when the total query budget is fixed. We also provide theoretical guarantee for the exact recovery of the true adjacency matrix using random triangle queries. In the future we will focus on exploiting the structure of triangle queries via tensor representations and sketches, which might further improve the clustering performance. References [1] Vikas C. Raykar, Shipeng Yu, Linda H. Zhao, Gerardo Hermosillo Valadez, Charles Florin, Luca Bogoni, and Linda Moy. Learning from crowds. J. Mach. Learn. Res., 11:1297–1322, August 2010. [2] Rion Snow, Brendan O’Connor, Daniel Jurafsky, and Andrew Y. Ng. Cheap and fast—but is it good?: Evaluating non-expert annotations for natural language tasks. In Proceedings of the Conference on Empirical Methods in Natural Language Processing, EMNLP ’08, pages 254–263, 2008. [3] Luis Von Ahn, Benjamin Maurer, Colin McMillen, David Abraham, and Manuel Blum. reCAPTCHA: Human-based character recognition via web security measures. Science, 321(5895):1465–1468, 2008. [4] A. Sorokin and D. Forsyth. Utility data annotation with Amazon Mechanical Turk. In Computer Vision and Pattern Recognition Workshops, 2008. CVPRW &#039;08. IEEE Computer Society Conference on, pages 1–8. IEEE, June 2008. [5] Peter Welinder, Steve Branson, Serge Belongie, and Pietro Perona. The multidimensional wisdom of crowds. In Neural Information Processing Systems Conference (NIPS), 2010. [6] Jinfeng Yi, Rong Jin, Anil K. Jain, Shaili Jain, and Tianbao Yang. Semi-crowdsourced clustering: Generalizing crowd labeling by robust distance metric learning. In Neural Information Processing Systems Conference (NIPS), 2012. 8 [7] Robert Simpson, Kevin R. Page, and David De Roure. Zooniverse: Observing the world’s largest citizen science platform. In Proceedings of the 23rd International Conference on World Wide Web, WWW ’14 Companion, 2014. [8] Chris Lintott, Megan E. Schwamb, Charlie Sharzer, Debra A. Fischer, Thomas Barclay, Michael Parrish, Natalie Batalha, Steve Bryson, Jon Jenkins, Darin Ragozzine, Jason F. Rowe, Kevin Schawinski, Rovert Gagliano, Joe Gilardi, Kian J. Jek, Jari-Pekka Pääkkönen, and Tjapko Smits. Planet hunters: New kepler planet candidates from analysis of quarter 2, 2012. cite arxiv:1202.6007Comment: Submitted to AJ. [9] David R. Karger, Sewoong Oh, and Devavrat Shah. Iterative learning for reliable crowdsourcing systems. In Neural Information Processing Systems Conference (NIPS), 2011. [10] David R. Karger, Sewoong Oh, and Devavrat Shah. Budget-optimal task allocation for reliable crowdsourcing systems. Operations Research, 62(1):1–24, 2014. [11] Aditya Vempaty, Lav R. Varshney, and Pramod K. Varshney. Reliable crowdsourcing for multi-class labeling using coding theory. CoRR, abs/1309.3330, 2013. [12] Denny Zhou, Sumit Basu, Yi Mao, and John C. Platt. Learning from the wisdom of crowds by minimax entropy. In Advances in Neural Information Processing Systems 25, pages 2195–2203. 2012. [13] Qiang Liu, Jian Peng, and Alexander T Ihler. Variational inference for crowdsourcing. In Neural Information Processing Systems Conference (NIPS). 2012. [14] Yuchen Zhang, Xi Chen, Dengyong Zhou, and Michael I. Jordan. Spectral methods meet EM: A provably optimal algorithm for crowdsourcing. In Neural Information Processing Systems Conference (NIPS), 2014. [15] Ryan G. Gomes, Peter Welinder, Andreas Krause, and Pietro Perona. Crowdclustering. In Advances in Neural Information Processing Systems 24, pages 558–566. 2011. [16] Ramya Korlakai Vinayak, Samet Oymak, and Babak Hassibi. Graph clustering with missing data: Convex algorithms and analysis. In Neural Information Processing Systems Conference (NIPS), 2014. [17] Omer Tamuz, Ce Liu, Serge Belongie, Ohad Shamir, and Adam Tauman Kalai. Adaptively learning the crowd kernel. CoRR, abs/1105.1033, 2011. [18] Michael Wilber, Sam Kwak, and Serge Belongie. Cost-effective hits for relative similarity comparisons. In Human Computation and Crowdsourcing (HCOMP), Pittsburgh, November 2014. [19] Eric Heim, Hamed Valizadegan, and Milos Hauskrecht. Machine Learning and Knowledge Discovery in Databases: European Conference, ECML PKDD 2014, chapter Relative Comparison Kernel Learning with Auxiliary Kernels, pages 563–578. Springer Berlin Heidelberg. [20] L. van der Maaten and K. Weinberger. Stochastic triplet embedding. In Machine Learning for Signal Processing (MLSP), 2012 IEEE International Workshop on, pages 1–6, Sept 2012. [21] Catherine Wah, Grant Van Horn, Steve Branson, Subhransu Maji, Pietro Perona, and Serge Belongie. Similarity comparisons for interactive fine-grained categorization. In CVPR, pages 859–866. IEEE, 2014. [22] Hannes Heikinheimo and Antti Ukkonen. The crowd-median algorithm. In HCOMP. AAAI, 2013. [23] A. P. Dawid and A. M. Skene. Maximum Likelihood Estimation of Observer Error-Rates Using the EM Algorithm. Journal of the Royal Statistical Society. Series C (Applied Statistics), 28(1):20–28, 1979. [24] Paul W. Holland, Kathryn Blackmond Laskey, and Samuel Leinhardt. Stochastic blockmodels: First steps. Social Networks, 5(2):109 – 137, 1983. [25] Anne Condon and Richard M. Karp. Algorithms for graph partitioning on the planted partition model. Random Struct. Algorithms, 18(2):116–140, 2001. [26] Andrew Y. Ng, Michael I. Jordan, and Yair Weiss. On spectral clustering: Analysis and an algorithm. In ADVANCES IN NEURAL INFORMATION PROCESSING SYSTEMS, pages 849–856. MIT Press, 2001. [27] Marina Meila. Comparing clusterings—an information based distance. J. Multivar. Anal., 98(5):873–895, May 2007. [28] Aditya Khosla, Nityananda Jayadevaprakash, Bangpeng Yao, and Li Fei-Fei. Novel dataset for fine-grained image categorization. In First Workshop on Fine-Grained Visual Categorization, IEEE Conference on Computer Vision and Pattern Recognition, Colorado Springs, CO, June 2011. [29] C. Wah, S. Branson, P. Welinder, P. Perona, and S. Belongie. The Caltech-UCSD Birds-200-2011 Dataset. Technical Report CNS-TR-2011-001, California Institute of Technology, 2011. 9
2016
302
6,220
Learning feed-forward one-shot learners Luca Bertinetto∗ University of Oxford luca@robots.ox.ac.uk João F. Henriques∗ University of Oxford joao@robots.ox.ac.uk Jack Valmadre∗ University of Oxford jvlmdr@robots.ox.ac.uk Philip H. S. Torr University of Oxford philip.torr@eng.ox.ac.uk Andrea Vedaldi University of Oxford vedaldi@robots.ox.ac.uk Abstract One-shot learning is usually tackled by using generative models or discriminative embeddings. Discriminative methods based on deep learning, which are very effective in other learning scenarios, are ill-suited for one-shot learning as they need large amounts of training data. In this paper, we propose a method to learn the parameters of a deep model in one shot. We construct the learner as a second deep network, called a learnet, which predicts the parameters of a pupil network from a single exemplar. In this manner we obtain an efficient feed-forward one-shot learner, trained end-to-end by minimizing a one-shot classification objective in a learning to learn formulation. In order to make the construction feasible, we propose a number of factorizations of the parameters of the pupil network. We demonstrate encouraging results by learning characters from single exemplars in Omniglot, and by tracking visual objects from a single initial exemplar in the Visual Object Tracking benchmark. 1 Introduction Deep learning methods have taken by storm areas such as computer vision, natural language processing and speech recognition. One of their key strengths is the ability to leverage large quantities of labelled data and extract meaningful and powerful representations from it. However, this capability is also one of their most significant limitations since using large datasets to train deep neural network is not just an option, but a necessity. It is well known, in fact, that these models are prone to overfitting. Thus, deep networks seem less useful when the goal is to learn a new concept on the fly, from a few or even a single example as in one shot learning. These problems are usually tackled by using generative models [18, 13] or, in a discriminative setting, using ad-hoc solutions such as exemplar support vector machines (SVMs) [14]. Perhaps the most common discriminative approach to one-shot learning is to learn off-line a deep embedding function and then to define on-line simple classification rules such as nearest neighbors in the embedding space [5, 16]. However, computing an embedding is a far cry from learning a model of the new object. In this paper, we take a very different approach and ask whether we can induce, from a single supervised example, a full, deep discriminative model to recognize other instances of the same object class. Furthermore, we do not want our solution to require a lengthy optimization process, but to be computable on-the-fly, efficiently and in one go. We formulate this problem as the one of learning a deep neural network, called a learnet, that, given a single exemplar of a new object class, predicts the parameters of a second network that can recognize other objects of the same type. ∗The first three authors contributed equally, and are listed in alphabetical order. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. Our model has several elements of interest. Firstly, if we consider learning to be any process that maps a set of images to the parameters of a model, then it can be seen as a “learning to learn” approach. Clearly, learning from a single exemplar is only possible given sufficient prior knowledge on the learning domain. This prior knowledge is incorporated in the learnet in an off-line phase by solving millions of small one-shot learning tasks and back-propagating errors end-to-end. Secondly, our learnet provides a feed-forward learning algorithm that extracts from the available exemplar the final model parameters in one go. This is different from iterative approaches such as exemplar SVMs or complex inference processes in generative modeling. It also demonstrates that deep neural networks can learn at the “meta-level” of predicting filter parameters for a second network, which we consider to be an interesting result in its own right. Thirdly, our method provides a competitive, efficient, and practical way of performing one-shot learning using discriminative methods. 1.1 Related work Our work is related to several others in the literature. However, we believe to be the first to look at methods that can learn the parameters of complex discriminative models in one shot. One-shot learning has been widely studied in the context of generative modeling, which unlike our work is often not focused on solving discriminative tasks. One very recent example is by Rezende et al. [18], which uses a recurrent spatial attention model to generate images, and learns by optimizing a measure of reconstruction error using variational inference [9]. They demonstrate results by sampling images of novel classes from this generative model, not by solving discriminative tasks. Another notable work is by Lake et al. [13], which instead uses a probabilistic program as a generative model. This model constructs written characters as compositions of pen strokes, so although more general programs can be envisioned, they demonstrate it only on Optical Character Recognition (OCR) applications. A different approach to one-shot learning is to learn an embedding space, which is typically done with a siamese network [2]. Given an exemplar of a novel category, classification is performed in the embedding space by a simple rule such as nearest-neighbor. Training is usually performed by classifying pairs according to distance [5], or by enforcing a distance ranking with a triplet loss [16]. Our work departs from the paradigms of generative modeling and similarity learning, instead predicting the parameters of a neural network from a single exemplar image. It can be seen as a network that effectively “learns to learn”, generalizing across tasks defined by different exemplars. The idea of parameter prediction was, to our knowledge, first explored by Schmidhuber [20] in a recurrent architecture with one network that modifies the weights of another. Parameter prediction has also been used for zero-shot learning (as opposed to one-shot learning), which is the related problem of learning a new object class without a single example image, based solely on a description such as binary attributes or text. Whereas it is usually framed as a modality transfer problem and solved through transfer learning [21], Noh et al. [15] recently employed parameter prediction to induce the weights of an image classifier from text for the problem of visual question answering. Denil et al. [4] investigated the redundancy of neural network parameters, showing that it is possible to linearly predict as many as 95% of the parameters in a layer given the remaining 5%. This is a vastly different proposition from ours, which is to predict all of the parameters of a layer given an external exemplar image, and to do so non-linearly. 2 One-shot learning as dynamic parameter prediction Since we consider one-shot learning as a discriminative task, our starting point is standard discriminative learning. It generally consists of finding the parameters W that minimize the average loss L of a predictor function ϕ(x; W), computed over a dataset of n samples xi and corresponding labels ℓi: min W 1 n n X i=1 L(ϕ(xi; W), ℓi). (1) Unless the model space is very small, generalization also requires constraining the choice of model, usually via regularization. However, in the extreme case in which the goal is to learn W from a single exemplar z of the class of interest, called one-shot learning, even regularization may be insufficient and additional prior information must be injected into the learning process. The main challenge in 2 siamese siamese learnet learnet Figure 1: Our proposed architectures predict the parameters of a network from a single example, replacing static convolutions (green) with dynamic convolutions (red). The siamese learnet predicts the parameters of an embedding function that is applied to both inputs, whereas the single-stream learnet predicts the parameters of a function that is applied to the other input. Linear layers are denoted by ∗and nonlinear layers by σ. Dashed connections represent parameter sharing. discriminative one-shot learning is to find a mechanism to incorporate domain-specific information in the learner, i.e. learning to learn. Another challenge, which is of practical importance in applications of one-shot learning, is to avoid a lengthy optimization process such as eq. (1). We propose to address both challenges by learning the parameters W of the predictor from a single exemplar z using a meta-prediction process, i.e. a non-iterative feed-forward function ω that maps (z; W ′) to W. Since in practice this function will be implemented using a deep neural network, we call it a learnet. The learnet depends on the exemplar z, which is a single representative of the class of interest, and contains parameters W ′ of its own. Learning to learn can now be posed as the problem of optimizing the learnet meta-parameters W ′ using an objective function defined below. Furthermore, the feed-forward learnet evaluation is much faster than solving the optimization problem (1). In order to train the learnet, we require the latter to produce good predictors given any possible exemplar z, which is empirically evaluated as an average over n training samples zi: min W ′ 1 n n X i=1 L(ϕ(xi; ω(zi; W ′)), ℓi). (2) In this expression, the performance of the predictor extracted by the learnet from the exemplar zi is assessed on a single “validation” pair (xi, ℓi), comprising another exemplar and its label ℓi. Hence, the training data consists of triplets (xi, zi, ℓi). Notice that the meaning of the label ℓi is subtly different from eq. (1) since the class of interest changes depending on the exemplar zi: ℓi is positive when xi and zi belong to the same class and negative otherwise. Triplets are sampled uniformly with respect to these two cases. Importantly, the parameters of the original predictor ϕ of eq. (1) now change dynamically with each exemplar zi. Note that the training data is reminiscent of that of siamese networks [2], which also learn from labeled sample pairs. However, siamese networks apply the same model ϕ(x; W) with shared weights W to both xi and zi, and compute their inner-product to produce a similarity score: min W 1 n n X i=1 L(⟨ϕ(xi; W), ϕ(zi; W)⟩, ℓi). (3) There are two key differences with our model. First, we treat xi and zi asymmetrically, which results in a different objective function. Second, and most importantly, the output of ω(z; W ′) is used to parametrize linear layers that determine the intermediate representations in the network ϕ. This is significantly different to computing a single inner product in the last layer (eq. (3)). Eq. (2) specifies the optimization objective of one-shot learning as dynamic parameter prediction. By application of the chain rule, backpropagating derivatives through the computational blocks of ϕ(x; W) and ω(z; W ′) is no more difficult than through any other standard deep network. Nevertheless, when we dive into concrete implementations of such models we face a peculiar challenge, discussed next. 2.1 The challenge of naive parameter prediction In order to analyse the practical difficulties of implementing a learnet, we will begin with one-shot prediction of a fully-connected layer, as it is simpler to analyse. This is given by y = Wx + b, (4) 3 𝑤(𝑧) 𝑀 𝑀′ 𝑦 𝑥 Figure 2: Factorized convolutional layer (eq. (8)). The channels of the input x are projected to the factorized space by M (a 1 × 1 convolution), the resulting channels are convolved independently with a corresponding filter prediction from w(z), and finally projected back using M ′. given an input x ∈Rd, output y ∈Rk, weights W ∈Rk×d and biases b ∈Rk. We now replace the weights and biases with their functional counterparts, w(z) and b(z), representing two outputs of the learnet ω(z; W ′) given the exemplar z ∈Rm as input (to avoid clutter, we omit the implicit dependence on W ′): y = w(z)x + b(z). (5) While eq. (5) seems to be a drop-in replacement for linear layers, careful analysis reveals that it scales extremely poorly. The main cause is the unusually large output space of the learnet w : Rm →Rk×d. For a comparable number of input and output units in a linear layer (d ≃k), the output space of the learnet grows quadratically with the number of units. While this may seem to be a concern only for large networks, it is actually extremely difficult also for networks with few units. Consider a simple linear learnet w(z) = W ′z. Even for a very small fullyconnected layer of only 100 units (d = k = 100), and an exemplar z with 100 features (m = 100), the learnet already contains 1M parameters that must be learned. Overfitting and space and time costs make learning such a regressor infeasible. Furthermore, reducing the number of features in the exemplar can only achieve a small constant-size reduction on the total number of parameters. The bottleneck is the quadratic size of the output space dk, not the size of the input space m. 2.2 Factorized linear layers A simple way to reduce the size of the output space is to consider a factorized set of weights, by replacing eq. (5) with: y = M ′ diag (w(z)) Mx + b(z). (6) The product M ′diag (w(z)) M can be seen as a factorized representation of the weights, analogous to the Singular Value Decomposition. The matrix M ∈Rd×d projects x into a space where the elements of w(z) represent disentangled factors of variation. The second projection M ′ ∈Rk×d maps the result back from this space. Both M and M ′ contain additional parameters to be learned, but they are modest in size compared to the case discussed in sect. 2.1. Importantly, the one-shot branch w(z) now only has to predict a set of diagonal elements (see eq. (6)), so its output space grows linearly with the number of units in the layer (i.e. w(z): Rm →Rd). 2.3 Factorized convolutional layers The factorization of eq. (6) can be generalized to convolutional layers as follows. Given an input tensor x ∈Rr×c×d, weights W ∈Rf×f×d×k (where f is the filter support size), and biases b ∈Rk, the output y ∈Rr′×c′×k of the convolutional layer is given by y = W ∗x + b, (7) where ∗denotes convolution, and the biases b are applied to each of the k channels. Projections analogous to M and M ′ in eq. (6) can be incorporated in the filter bank in different ways and it is not obvious which one to pick. Here we take the view that M and M ′ should disentangle the feature channels (i.e. third dimension of x) so that the predicted filters w(z) can operate on each channel independently. As such, we consider the following factorization: y = M ′ ∗w(z) ∗d M ∗x + b(z), (8) 4 · · · · · · · · · · · · · · · · · · z x Predicted filters w(z) Activations Figure 3: The predicted filters and the output of a dynamic convolutional layer in a single-stream learnet trained for the OCR task. Different exemplars z define different filters w(z). Applying the filters of each exemplar to the same input x yields different responses. Best viewed in colour. · · · · · · · · · · · · · · · · · · z x Predicted filters w(z) Activations Figure 4: The predicted filters and the output of a dynamic convolutional layer in a siamese learnet trained for the object tracking task. Best viewed in colour. where M ∈R1×1×d×d, M ′ ∈R1×1×d×k, and w(z) ∈Rf×f×d. Convolution with subscript d denotes independent filtering of d channels, i.e. each channel of x ∗d y is simply the convolution of the corresponding channel in x and y. In practice, this can be achieved with filter tensors that are diagonal in the third and fourth dimensions, or using d filter groups [12], each group containing a single filter. An illustration is given in fig. 2. The predicted filters w(z) can be interpreted as a filter basis, as described in the supplementary material (sec. A). Notice that, under this factorization, the number of elements to be predicted by the one-shot branch w(z) is only f 2d (the filter size f is typically very small, e.g. 3 or 5 [5, 23]). Without the factorization, it would be f 2dk (the number of elements of W in eq. (7)). Similarly to the case of fully-connected layers (sect. 2.2), when d ≃k this keeps the number of predicted elements from growing quadratically with the number of channels, allowing them to grow only linearly. Examples of filters that are predicted by learnets are shown in figs. 3 and 4. The resulting activations confirm that the networks induced by different exemplars do indeed possess different internal representations of the same input. 3 Experiments We evaluate learnets against baseline one-shot architectures (sect. 3.1) on two one-shot learning problems in Optical Character Recognition (OCR; sect. 3.2) and visual object tracking (sect. 3.3). All experiments were performed using MatConvNet [22]. 3.1 Architectures As noted in sect. 2, the closest competitors to our method in discriminative one-shot learning are embedding learning using siamese architectures. Therefore, we structure the experiments to compare against this baseline. In particular, we choose to implement learnets using similar network topologies for a fairer comparison. The baseline siamese architecture comprises two parallel streams ϕ(x; W) and ϕ(z; W) composed of a number of layers, such as convolution, max-pooling, and ReLU, sharing parameters W (fig. 1.a). The outputs of the two streams are compared by a layer Γ(ϕ(x; W), ϕ(z; W)) computing a measure of similarity or dissimilarity. We consider in particular: the dot product ⟨a, b⟩between vectors a and b, the Euclidean distance ∥a −b∥, and the weighted l1-norm ∥w ⊙a −w ⊙b∥1 where w is a vector of learnable weights and ⊙the Hadamard product). The first modification to the siamese baseline is to use a learnet to predict some of the intermediate shared stream parameters (fig. 1.b). In this case W = ω(z; W ′) and the siamese architecture writes Γ(ϕ(x; ω(z; W ′)), ϕ(z; ω(z; W ′))). Note that the siamese parameters are still the same in the two 5 Table 1: Error rate for character recognition in foreign alphabets (chance is 95%). Inner-product (%) Euclidean dist. (%) Weighted ℓ1 dist. (%) Siamese (shared) 48.5 37.3 41.8 Siamese (unshared) 47.0 41.0 34.6 Siamese (unshared, fact.) 48.4 – 33.6 Siamese learnet (shared) 51.0 39.8 31.4 Learnet 43.7 36.7 28.6 Modified Hausdorff distance 43.2 streams, whereas the learnet is an entirely new subnetwork whose purpose is to map the exemplar image to the shared weights. We call this model the siamese learnet. The second modification is a single-stream learnet configuration, using only one stream ϕ of the siamese architecture and predicting its parameter using the learnet ω. In this case, the comparison block Γ is reinterpreted as the last layer of the stream ϕ (fig. 1.c). Note that: i) the single predicted stream and learnet are asymmetric and with different parameters and ii) the learnet predicts both the final comparison layer parameters Γ as well as intermediate filter parameters. The single-stream learnet architecture can be understood to predict a discriminant function from one example, and the siamese learnet architecture to predict an embedding function for the comparison of two images. These two variants demonstrate the versatility of the dynamic convolutional layer from eq. (6). Finally, in order to ensure that any difference in performance is not simply due to the asymmetry of the learnet architecture or to the induced filter factorizations (sect. 2.2 and sect. 2.3), we also compare unshared siamese nets, which use distinct parameters for each stream, and factorized siamese nets, where convolutions are replaced by factorized convolutions as in learnet. 3.2 Character recognition in foreign alphabets This section describes our experiments in one-shot learning on OCR. For this, we use the Omniglot dataset [13], which contains images of handwritten characters from 50 different alphabets. These alphabets are divided into 30 background and 20 evaluation alphabets. The associated one-shot learning problem is to develop a method for determining whether, given any single exemplar of a character in an evaluation alphabet, any other image in that alphabet represents the same character or not. Importantly, all methods are trained using only background alphabets and tested on the evaluation alphabets. Dataset and evaluation protocol. Character images are resized to 28 × 28 pixels in order to be able to explore efficiently several variants of the proposed architectures. There are exactly 20 sample images for each character, and an average of 32 characters per alphabet. The dataset contains a total of 19,280 images in the background alphabets and 13,180 in the evaluation alphabets. Algorithms are evaluated on a series of recognition problems. Each recognition problem involves identifying the image in a set of 20 that shows the same character as an exemplar image (there is always exactly one match). All of the characters in a single problem belong to the same alphabet. At test time, given a collection of characters (x1, . . . , xm), the function is evaluated on each pair (z, xi) and the candidate with the highest score is declared the match. In the case of the learnet architectures, this can be interpreted as obtaining the parameters W = ω(z; W ′) and then evaluating a static network ϕ(xi; W) for each xi. Architecture. The baseline stream ϕ for the siamese, siamese learnet, and single-stream learnet architecture consists of 3 convolutional layers, with 2 × 2 max-pooling layers of stride 2 between them. The filter sizes are 5 × 5 × 1 × 16, 5 × 5 × 16 × 64 and 4 × 4 × 64 × 512. For both the siamese learnet and the single-stream learnet, ω consists of the same layers as ϕ, except the number of outputs is 1600 – one for each element of the 64 predicted filters (of size 5 × 5). To keep the experiments simple, we only predict the parameters of one convolutional layer. We conducted cross-validation to choose the predicted layer and found that the second convolutional layer yields the best results for both of the proposed variants. Siamese nets have previously been applied to this problem by Koch et al. [10] using much deeper networks applied to images of size 105 × 105. However, we have restricted this investigation to relatively shallow networks to enable a thorough exploration of the parameter space. A more powerful 6 algorithm for one-shot learning, Hierarchical Bayesian Program Learning [13], is able to achieve human-level performance. However, this approach involves computationally expensive inference at test time, and leverages extra information at training time that describes the strokes drawn by the human author. Learning. Learning involves minimizing the objective function specific to each method (e.g. eq. (2) for learnet and eq. (3) for siamese architectures) and uses stochastic gradient descent (SGD) in all cases. As noted in sect. 2, the objective is obtained by sampling triplets (zi, xi, ℓi) where exemplars zi and xi are congruous (ℓi = +1) or incongruous (ℓi = −1) with 50% probability. We consider 100,000 random pairs for training per epoch, and train for 60 epochs. We conducted a random search to find the best hyper-parameters for each algorithm (initial learning rate and geometric decay, standard deviation of Gaussian parameter initialization, and weight decay). Results and discussion. Tab. 1 shows the classification error obtained using variants of each architecture. A dash indicates a failure to converge given a large range of hyper-parameters. The two learnet architectures combined with the weighted ℓ1 distance are able to achieve significantly better results than other methods. The best architecture reduced the error from 37.3% for a siamese network with shared parameters to 28.6% for a single-stream learnet. While the Euclidean distance gave the best results for siamese networks with shared parameters, better results were achieved by learnets (and siamese networks with unshared parameters) using a weighted ℓ1 distance. In fact, none of the alternative architectures are able to achieve lower error under the Euclidean distance than the shared siamese net. The dot product was, in general, less effective than the other two metrics. The introduction of the factorization in the convolutional layer might be expected to improve the quality of the estimated model by reducing the number of parameters, or to worsen it by diminishing the capacity of the hypothesis space. For this relatively simple task of character recognition, the factorization did not seem to have a large effect. 3.3 Object tracking The task of single-target object tracking requires to locate an object of interest in a sequence of video frames. A video frame can be seen as a collection F = {w1, . . . , wK} of image windows; then, in a one-shot setting, given an exemplar z ∈F1 of the object in the first frame F1, the goal is to identify the same window in the other frames F2, . . . , FM. Datasets. The method is trained using the ImageNet Large Scale Visual Recognition Challenge 2015 [19], with 3,862 videos totalling more than one million annotated frames. Instances of objects of thirty different classes (mostly vehicles and animals) are annotated throughout each video with bounding boxes. For tracking, instance labels are retained but object class labels are ignored. We use 90% of the videos for training, while the other 10% are held-out to monitor validation error during network training. Testing uses the VOT 2015 benchmark [11]. Architecture. We experiment with siamese and siamese learnet architectures (fig. 1) where the learnet ω predicts the parameters of the second (dynamic) convolutional layer of the siamese streams. Each siamese stream has five convolutional layers and we test three variants of those: variant (A) has the same configuration as AlexNet [12] but with stride 2 in the first layer, and variants (B) and (C) reduce to 50% the number of filters in the first two convolutional layers and, respectively, to 25% and 12.5% the number of filters in the last layer. Training. In order to train the architecture efficiently from many windows, the data is prepared as follows. Given an object bounding box sampled at random, a crop z double the size of that is extracted from the corresponding frame, padding with the average image color when needed. The border is included in order to incorporate some visual context around the exemplar object. Next, ℓ∈{+1, −1} is sampled at random with 75% probability of being positive. If ℓ= −1, an image x is extracted by choosing at random a frame that does not contain the object. Otherwise, a second frame containing the same object and within 50 temporal samples of the first is selected at random. From that, a patch x centered around the object and four times bigger is extracted. In this way, x contains both subwindows that do and do not match z. Images z and x are resized to 127 × 127 and 255 × 255 pixels, respectively, and the triplet (z, x, ℓ) is formed. All 127 × 127 subwindows in x are considered to not match z except for the central 2 × 2 ones when ℓ= +1. 7 Table 2: Tracking accuracy and number of tracking failures in the VOT 2015 Benchmark, as reported by the toolkit [11]. Architectures are grouped by size of the main network (see text). For each group, the best entry for each column is in bold. We also report the scores of 5 recent trackers. Method Accuracy Failures Siamese (ϕ=B) 0.465 105 Siamese (ϕ=B; unshared) 0.447 131 Siamese (ϕ=B; factorized) 0.444 138 Siamese learnet (ϕ=B; ω=A) 0.500 87 Siamese learnet (ϕ=B; ω=B) 0.497 93 DAT [17] 0.442 113 SO-DLT [23] 0.540 108 Method Accuracy Failures Siamese (ϕ=C) 0.466 120 Siamese (ϕ=C; factorized) 0.435 132 Siamese learnet (ϕ=C; ω=A) 0.483 105 Siamese learnet (ϕ=C; ω=C) 0.491 106 DSST [3] 0.483 163 MEEM [24] 0.458 107 MUSTer [7] 0.471 132 All networks are trained from scratch using SGD for 50 epoch of 50,000 sample triplets (zi, xi, ℓi). The multiple windows contained in x are compared to z efficiently by making the comparison layer Γ convolutional (fig. 1), accumulating a logistic loss across spatial locations. The same hyperparameters (learning rate of 10−2 geometrically decaying to 10−5, weight decay of 0.005, and small mini-batches of size 8) are used for all experiments, which we found to work well for both the baseline and proposed architectures. The weights are initialized using the improved Xavier [6] method, and we use batch normalization [8] after all linear layers. Testing. Adopting the initial crop as exemplar, the object is sought in a new frame within a radius of the previous position, proceeding sequentially. This is done by evaluating the pupil net convolutionally, as well as searching at five possible scales in order to track the object through scale space. The approach is described in more detail in Bertinetto et al. [1]. Results and discussion. Tab. 2 compares the methods in terms of the official metrics (accuracy and number of failures) for the VOT 2015 benchmark [11]. The ranking plot produced by the VOT toolkit is provided in the supplementary material (fig. B.1). From tab. 2, it can be observed that factorizing the filters in the siamese architecture significantly diminishes its performance, but using a learnet to predict the filters in the factorization recovers this gap and in fact achieves better performance than the original siamese net. The performance of the learnet architectures is not adversely affected by using the slimmer prediction networks B and C (with less channels). An elementary tracker based on learnet compares favourably against recent tracking systems, which make use of different features and online model update strategies: DAT [17], DSST [3], MEEM [24], MUSTer [7] and SO-DLT [23]. SO-DLT in particular is a good example of direct adaptation of standard batch deep learning methodology to online learning, as it uses SGD during tracking to fine-tune an ensemble of deep convolutional networks. However, the online adaptation of the model comes at a big computational cost and affects the speed of the method, which runs at 5 frames-persecond (FPS) on a GPU. Due to the feed-forward nature of our one-shot learnets, they can track objects in real-time at framerates in excess of 60 FPS, while achieving less tracking failures. We consider, however, that our implementation serves mostly as a proof-of-concept, using tracking as an interesting demonstration of one-shot-learning, and is orthogonal to many technical improvements found in the tracking literature [11]. 4 Conclusions In this work, we have shown that it is possible to obtain the parameters of a deep neural network using a single, feed-forward prediction from a second network. This approach is desirable when iterative methods are too slow, and when large sets of annotated training samples are not available. We have demonstrated the feasibility of feed-forward parameter prediction in two demanding one-shot learning tasks in OCR and visual tracking. Our results hint at a promising avenue of research in “learning to learn” by solving millions of small discriminative problems in an offline phase. Possible extensions include domain adaptation and sharing a single learnet between different pupil networks. Acknowledgements This research was supported by Apical Ltd. and ERC grants ERC-2012-AdG 321162-HELIOS, HELIOS-DFR00200 and “Integrated and Detailed Image Understanding” (EP/L024683/1). 8 References [1] L. Bertinetto, J. Valmadre, J. F. Henriques, A. Vedaldi, and P. H. S. Torr. Fully-convolutional siamese networks for object tracking. 2016. [2] J. Bromley, J. W. Bentz, L. Bottou, I. Guyon, Y. LeCun, C. Moore, E. Säckinger, and R. Shah. Signature verification using a “siamese” time delay neural network. International Journal of Pattern Recognition and Artificial Intelligence, 1993. [3] M. Danelljan, G. Häger, F. Khan, and M. Felsberg. Accurate scale estimation for robust visual tracking. In BMVC, 2014. [4] M. Denil, B. Shakibi, L. Dinh, N. de Freitas, et al. Predicting parameters in deep learning. In NIPS, 2013. [5] H. Fan, Z. Cao, Y. Jiang, Q. Yin, and C. Doudou. Learning deep face representation. arXiv, 2014. [6] K. He, X. Zhang, S. Ren, and J. Sun. Delving deep into rectifiers: Surpassing human-level performance on ImageNet classification. In ICCV, 2015. [7] Z. Hong, Z. Chen, C. Wang, X. Mei, D. Prokhorov, and D. Tao. Multi-store tracker (MUSTER): A cognitive psychology inspired approach to object tracking. In CVPR, 2015. [8] S. Ioffe and C. Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv, 2015. [9] D. P. Kingma and M. Welling. Auto-encoding variational bayes. arXiv, 2013. [10] G. Koch, R. Zemel, and R. Salakhutdinov. Siamese neural networks for one-shot image recognition. In ICML 2015 Deep Learning Workshop, 2016. [11] M. Kristan, J. Matas, A. Leonardis, M. Felsberg, L. Cehovin, G. Fernandez, T. Vojir, G. Hager, G. Nebehay, and R. Pflugfelder. The VOT2015 challenge results. In ICCV Workshop, 2015. [12] A. Krizhevsky, I. Sutskever, and G. E. Hinton. ImageNet classification with deep convolutional neural networks. In NIPS, 2012. [13] B. M. Lake, R. Salakhutdinov, and J. B. Tenenbaum. Human-level concept learning through probabilistic program induction. Science, 350(6266):1332–1338, 2015. [14] T. Malisiewicz, A. Gupta, and A. A. Efros. Ensemble of exemplar-SVMs for object detection and beyond. In ICCV, 2011. [15] H. Noh, P. Hongsuck Seo, and B. Han. Image question answering using convolutional neural network with dynamic parameter prediction. In CVPR, 2016. [16] O. M. Parkhi, A. Vedaldi, and A. Zisserman. Deep face recognition. BMVC, 2015. [17] H. Possegger, T. Mauthner, and H. Bischof. In defense of color-based model-free tracking. In CVPR, 2015. [18] D. J. Rezende, S. Mohamed, I. Danihelka, K. Gregor, and D. Wierstra. One-shot generalization in deep generative models. arXiv, 2016. [19] O. Russakovsky, J. Deng, H. Su, J. Krause, S. Satheesh, S. Ma, Z. Huang, A. Karpathy, A. Khosla, M. Bernstein, A. C. Berg, and L. Fei-Fei. ImageNet Large Scale Visual Recognition Challenge. IJCV, 2015. [20] J. Schmidhuber. Learning to control fast-weight memories: An alternative to dynamic recurrent networks. Neural Computation, 4(1):131–139, 1992. [21] R. Socher, M. Ganjoo, C. D. Manning, and A. Ng. Zero-shot learning through cross-modal transfer. In NIPS, 2013. [22] A. Vedaldi and K. Lenc. MatConvNet – Convolutional Neural Networks for MATLAB. In Proceedings of the ACM Int. Conf. on Multimedia, 2015. [23] N. Wang, S. Li, A. Gupta, and D.-Y. Yeung. Transferring rich feature hierarchies for robust visual tracking. arXiv, 2015. [24] J. Zhang, S. Ma, and S. Sclaroff. MEEM: Robust tracking via multiple experts using entropy minimization. In ECCV. 2014. 9
2016
303
6,221
Reshaped Wirtinger Flow for Solving Quadratic System of Equations Huishuai Zhang Department of EECS Syracuse University Syracuse, NY 13244 hzhan23@syr.edu Yingbin Liang Department of EECS Syracuse University Syracuse, NY 13244 yliang06@syr.edu Abstract We study the problem of recovering a vector x ∈Rn from its magnitude measurements yi = |⟨ai, x⟩|, i = 1, ..., m. Our work is along the line of the Wirtinger flow (WF) approach Candès et al. [2015], which solves the problem by minimizing a nonconvex loss function via a gradient algorithm and can be shown to converge to a global optimal point under good initialization. In contrast to the smooth loss function used in WF, we adopt a nonsmooth but lower-order loss function, and design a gradient-like algorithm (referred to as reshaped-WF). We show that for random Gaussian measurements, reshaped-WF enjoys geometric convergence to a global optimal point as long as the number m of measurements is at the order of O(n), where n is the dimension of the unknown x. This improves the sample complexity of WF, and achieves the same sample complexity as truncated-WF Chen and Candes [2015] but without truncation at gradient step. Furthermore, reshaped-WF costs less computationally than WF, and runs faster numerically than both WF and truncated-WF. Bypassing higher-order variables in the loss function and truncations in the gradient loop, analysis of reshaped-WF is simplified. 1 Introduction Recovering a signal via a quadratic system of equations has gained intensive attention recently. More specifically, suppose a signal of interest x ∈Rn/Cn is measured via random design vectors ai ∈Rn/Cn with the measurements yi given by yi = |⟨ai, x⟩| , for i = 1, · · · , m, (1) which can also be written equivalently in a quadratic form as y′ i = |⟨ai, x⟩|2. The goal is to recover the signal x based on the measurements y = {yi}m i=1 and the design vectors {ai}m i=1. Such a problem arises naturally in the phase retrieval applications, in which the sign/phase of the signal is to be recovered from only measurements of magnitudes. Various algorithms have been proposed to solve this problem since 1970s. The error-reduction methods proposed in Gerchberg [1972], Fienup [1982] work well empirically but lack theoretical guarantees. More recently, convex relaxation of the problem has been formulated, for example, via phase lifting Chai et al. [2011], Candès et al. [2013], Gross et al. [2015] and via phase cut Waldspurger et al. [2015], and the correspondingly developed algorithms typically come with performance guarantee. The reader can refer to the review paper Shechtman et al. [2015] to learn more about applications and algorithms of the phase retrieval problem. While with good theoretical guarantee, these convex methods often suffer from computational complexity particularly when the signal dimension is large. On the other hand, more efficient nonconvex approaches have been proposed and shown to recover the true signal as long as initialization is good enough. Netrapalli et al. [2013] proposed AltMinPhase algorithm, which alternatively updates the 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. phase and the signal with each signal update solving a least-squares problem, and showed that AltMinPhase converges linearly and recovers the true signal with O(n log3 n) Gaussian measurements. More recently, Candès et al. [2015] introduces Wirtinger flow (WF) algorithm, which guarantees signal recovery via a simple gradient algorithm with only O(n log n) Gaussian measurements and attains ϵ−accuracy within O(mn2 log 1/ϵ) flops. More specifically, WF obtains good initialization by the spectral method, and then minimizes the following nonconvex loss function ℓW F (z) := 1 4m m X i=1 (|aT i z|2 −y2 i )2, (2) via the gradient descent scheme. WF was further improved by truncated Wirtinger flow (truncated-WF) algorithm proposed in Chen and Candes [2015], which adopts a Poisson loss function of |aT i z|2, and keeps only well-behaved measurements based on carefully designed truncation thresholds for calculating the initial seed and every step of gradient . Such truncation assists to yield linear convergence with certain fixed step size and reduces both the sample complexity to (O(n)) and the convergence time to (O(mn log 1/ϵ)). It can be observed that WF uses the quadratic loss of |aT i z|2 so that the optimization objective is a smooth function of aT i z and the gradient step becomes simple. But this comes with a cost of a quartic loss function. In this paper, we adopt the quadratic loss of |aT i z|. Although the loss function is not smooth everywhere, it reduces the order of aT i z to be two, and the general curvature can be more amenable to convergence of the gradient algorithm. The goal of this paper is to explore potential advantages of such a nonsmooth lower-order loss function. 1.1 Our Contribution This paper adopts the following loss function1 ℓ(z) := 1 2m m X i=1 |aT i z| −yi 2 . (3) Compared to the loss function (2) in WF that adopts |aT i z|2, the above loss function adopts the absolute value/magnitude |aT i z| and hence has lower-order variables. For such a nonconvex and nonsmooth loss function, we develop a gradient descent-like algorithm, which sets zero for the “gradient" component corresponding to nonsmooth samples. We refer to such an algorithm together with truncated initialization using spectral method as reshaped Wirtinger flow (reshaped-WF). We show that the lower-order loss function has great advantage in both statistical and computational efficiency, although scarifying smoothness. In fact, the curvature of such a loss function behaves similarly to that of a least-squares loss function in the neighborhood of global optimums (see Section 2.2), and hence reshaped-WF converges fast. The nonsmoothness does not significantly affect the convergence of the algorithm because only with negligible probability the algorithm encounters nonsmooth points for some samples, which furthermore are set not to contribute to the gradient direction by the algorithm. We summarize our main results as follows. • Statistically, we show that reshaped-WF recovers the true signal with O(n) samples, when the design vectors consist of independently and identically distributed (i.i.d.) Gaussian entries, which is optimal in the order sense. Thus, even without truncation in gradient steps (truncation only in initialization stage), reshaped WF improves the sample complexity O(n log n) of WF, and achieves the same sample complexity as truncated-WF. It is thus more robust to random measurements. • Computationally, reshaped-WF converges geometrically, requiring O(mn log 1/ϵ) flops to reach ϵ−accuracy. Again, without truncation in gradient steps, reshaped-WF improves computational cost O(mn2 log(1/ϵ) of WF and achieves the same computational cost as truncated-WF. Numerically, reshaped-WF is generally two times faster than truncated-WF and four to six times faster than WF in terms of the number of iterations and time cost. Compared to WF and truncated-WF, our technical proof of performance guarantee is much simpler, because the lower-order loss function allows to bypass higher-order moments of variables and 1The loss function (3) was also used in Fienup [1982] to derive a gradient-like update for the phase retrieval problem with Fourier magnitude measurements. However, our paper is to characterize global convergence guarantee for such an algorithm with appropriate initialization, which was not studied in Fienup [1982]. 2 truncation in gradient steps. We also anticipate that such analysis is more easily extendable. On the other hand, the new form of the gradient step due to nonsmoothness of absolute function requires new developments of bounding techniques. 1.2 Connection to Related Work Along the line of developing nonconvex algorithms with global performance guarantee for the phase retrieval problem, Netrapalli et al. [2013] developed alternating minimization algorithm, Candès et al. [2015], Chen and Candes [2015], Zhang et al. [2016], Cai et al. [2015] developed/studied first-order gradient-like algorithms, and a recent study Sun et al. [2016] characterized geometric structure of the nonconvex objective and designed a second-order trust-region algorithm. Also notably is Wei [2015], which empirically demonstrated fast convergence of a so-called Kaczmarz stochastic algorithm. This paper is most closely related to Candès et al. [2015], Chen and Candes [2015], Zhang et al. [2016], but develops a new gradient-like algorithm based on a lower-order nonsmooth (as well as nonconvex) loss function that yields advantageous statistical/computational efficiency. Various algorithms have been proposed for minimizing a general nonconvex nonsmooth objective, such as gradient sampling algorithm Burke et al. [2005], Kiwiel [2007] and majorization-minimization method Ochs et al. [2015]. These algorithms were often shown to convergence to critical points which may be local minimizers or saddle points, without explicit characterization of convergence rate. In contrast, our algorithm is specifically designed for the phase retrieval problem, and can be shown to converge linearly to global optimum under appropriate initialization. The advantage of nonsmooth loss function exhibiting in our study is analogous in spirit to that of the rectifier activation function (of the form max{0, ·}) in neural networks. It has been shown that rectified linear unit (ReLU) enjoys superb advantage in reducing the training time Krizhevsky et al. [2012] and promoting sparsity Glorot et al. [2011] over its counterparts of sigmoid and hyperbolic tangent functions, in spite of non-linearity and non-differentiability at zero. Our result in fact also demonstrates that a nonsmooth but simpler loss function yields improved performance. 1.3 Paper Organization and Notations The rest of this paper is organized as follows. Section 2 describes reshaped-WF algorithm in detail and establishes its performance guarantee. In particular, Section 2.2 provides intuition about why reshaped-WF is fast. Section 3 compares reshaped-WF with other competitive algorithms numerically. Finally, Section 4 concludes the paper with comments on future directions. Throughout the paper, boldface lowercase letters such as ai, x, z denote vectors, and boldface capital letters such as A, Y denote matrices. For two matrices, A ⪯B means that B −A is positive definite. The indicator function 1A = 1 if the event A is true, and 1A = 0 otherwise. The Euclidean distance between two vectors up to a global sign difference is defined as dist(z, x) := min{∥z−x∥, ∥z+x∥}. 2 Algorithm and Performance Guarantee In this paper, we wish to recover a signal x ∈Rn based on m measurements yi given by yi = |⟨ai, x⟩| , for i = 1, · · · , m, (4) where ai ∈Rn for i = 1, · · · , m are known measurement vectors generated by Gaussian distribution N(0, In×n). We focus on the real-valued case in analysis, but the algorithm designed below is applicable to the complex-valued case and the case with coded diffraction pattern (CDP) as we demonstrate via numerical results in Section 3. We design reshaped-WF (see Algorithm 1) for solving the above problem, which contains two stages: spectral initialization and gradient loop. Suggested values for parameters are αl = 1, αu = 5 and µ = 0.8. The scaling parameter in λ0 and the conjugate transpose a∗ i allow the algorithm readily applicable to complex and CDP cases. We next describe the two stages of the algorithm in detail in Sections 2.1 and 2.2, respectively, and establish the convergence of the algorithm in Section 2.3. 2.1 Initialization via Spectral Method We first note that initialization can adopt the spectral initialization method for WF in Candès et al. [2015] or that for truncated-WF in Chen and Candes [2015], both of which are based on |a∗ i x|2. Here, we propose an alternative initialization in Algorithm 1 that uses magnitude |a∗ i x| instead, and truncates samples with both lower and upper thresholds as in (5). We show that such initialization achieves smaller sample complexity than WF and the same order-level sample complexity as truncatedWF, and furthermore, performs better than both WF and truncated-WF numerically. 3 Algorithm 1 Reshaped Wirtinger Flow Input: y = {yi}m i=1, {ai}m i=1; Parameters: Lower and upper thresholds αl, αu for truncation in initialization, stepsize µ; Initialization: Let z(0) = λ0˜z, where λ0 = mn Pm i=1 ∥ai∥1 · 1 m Pm i=1 yi  and ˜z is the leading eigenvector of Y := 1 m m X i=1 yiaia∗ i 1{αlλ0<yi<αuλ0}. (5) Gradient loop: for t = 0 : T −1 do z(t+1) = z(t) −µ m m X i=1  a∗ i z(t) −yi · a∗ i z(t) |a∗ i z(t)|  ai. (6) Output z(T ). Our initialization consists of estimation of both the norm and direction of x. The norm estimation of x is given by λ0 in Algorithm 1 with mathematical justification in Suppl. A. Intuitively, with real Gaussian measurements, the scaling coefficient mn Pm i=1 ∥ai∥1 ≈p π 2 . Moreover, yi = |aT i x| are independent sub-Gaussian random variables for i = 1, . . . , m with mean q 2 π∥x∥, and thus 1 m Pm i=1 yi ≈ q 2 π∥x∥. Combining these two facts yields the desired argument. 0 1000 2000 3000 4000 5000 6000 7000 8000 n: signal dimension 0.6 0.7 0.8 0.9 1 1.1 Relative error reshaped-WF truncated-WF WF Figure 1: Comparison of three initialization methods with m = 6n and 50 iterations using power method. The direction of x is approximated by the leading eigenvector of Y , because Y approaches E[Y ] by concentration of measure and the leading eigenvector of E[Y ] takes the form cx for some scalar c ∈R. We note that (5) involves truncation of samples from both sides, in contrast to truncation only by an upper threshold in Chen and Candes [2015]. This is because yi = |aT i x|2 in Chen and Candes [2015] so that small |aT i x| is further reduced by the square power to contribute less in Y , but small values of yi = |aT i x| can still introduce considerable contributions and hence should be truncated by the lower threshold. We next provide the formal statement of the performance guarantee for the initialization step that we propose. The proof adapts that in Chen and Candes [2015] and is provided in Suppl. A. Proposition 1. Fix δ > 0. The initialization step in Algorithm 1 yields z(0) satisfying ∥z(0) −x∥≤δ∥x∥with probability at least 1 −exp(−c′mϵ2), if m > C(δ, ϵ)n, where C is a positive number only affected by δ and ϵ, and c′ is some positive constant. Finally, Figure 1 demonstrates that reshaped-WF achieves better initialization accuracy in terms of the relative error ∥z(0)−x∥ ∥x∥ than WF and truncated-WF with Gaussian measurements. 2.2 Gradient Loop and Why Reshaped-WF is Fast The gradient loop of Algorithm 1 is based on the loss function (3), which is rewritten below ℓ(z) := 1 2m m X i=1 |aT i z| −yi 2 . (7) We define the update direction as ∇ℓ(z) := 1 m m X i=1 aT i z −yi · sgn(aT i z)  ai = 1 m m X i=1  aT i z −yi · aT i z |aT i z|  ai, (8) 4 where sgn(·) is the sign function for nonzero arguments. We further set sgn(0) = 0 and 0 |0| = 0. In fact, ∇ℓ(z) equals the gradient of the loss function (7) if aT i z ̸= 0 for all i = 1, ..., m. For samples with nonsmooth point, i.e., aT i z = 0, we adopt Fréchet superdifferential Kruger [2003] for nonconvex function to set the corresponding gradient component to be zero (as zero is an element in Fréchet superdifferential). With abuse of terminology, we still refer to ∇ℓ(z) in (8) as “gradient” for simplicity, which rather represents the update direction in the gradient loop of Algorithm 1. We next provide the intuition about why reshaped WF is fast. Suppose that the spectral method sets an initial point in the neighborhood of ground truth x. We compare reshaped-WF with the following problem of solving x from linear equations yi = ⟨ai, x⟩with yi and ai for i = 1, . . . , m given. In particular, we note that this problem has both magnitude and sign observation of the measurements. Further suppose that the least-squares loss is used and gradient descent is applied to solve this problem. Then the gradient is given by Least square gradient: ∇ℓLS(z) = 1 m m X i=1 aT i z −aT i x  ai. (9) We now argue informally that the gradient (8) of reshaped-WF behaves similarly to the least-squares gradient (9). For each i, the two gradient components are close if |aT i x| · sgn(aT i z) is viewed as an estimate of aT i x. The following lemma (see Suppl. B.2 for the proof) shows that if dist(z, x) is small (guaranteed by initialization), then aT i z has the same sign with aT i x for large |aT i x|. Lemma 1. Let ai ∼N(0, In×n). For any given x and z satisfying ∥x −z∥< √ 2−1 √ 2 ∥x∥, we have P{(aT i x)(aT i z) < 0 (aT i x)2 = t∥x∥2} ≤erfc √ t∥x∥ 2∥h∥  , (10) where h = z −x and erfc(u) := 2 √π R ∞ u exp(−τ 2)dτ. It is easy to observe in (10) that large aT i x is likely to have the same sign as aT i z so that the corresponding gradient components in (8) and (9) are likely equal, whereas small aT i x may have different sign as aT i z but contributes less to the gradient. Hence, overall the two gradients (8) and (9) should be close to each other with a large probability. This fact can be further verified numerically. Figure 2(a) illustrates that reshaped-WF takes almost the same number of iterations for recovering a signal (with only magnitude information) as the leastsquares gradient descent method for recovering a signal (with both magnitude and sign information). 0 20 40 60 80 100 Number of iterations 10-20 10-15 10-10 10-5 100 Relative error Least-squares gradient RWF (a) Convergence behavior -2 0 0.5 1 1.5 -1 -2 2 2.5 3 3.5 -1.5 4 4.5 5 -1 z1 0 -0.5 z2 0 0.5 1 1 1.5 2 2 (b) Expected loss of reshaped-WF 2 0 20 40 2 60 80 1 100 120 1.5 140 160 1 z1 0 0.5 z2 0 -0.5 -1 -1 -1.5 -2 -2 (c) Expected loss of WF Figure 2: Intuition of why reshaped-WF fast. (a) Comparison of convergence behavior between reshaped-WF and least-squares gradient descent. Initialization and parameters are the same for two methods: n = 1000, m = 6n, step size µ = 0.8. (b) Expected loss function of reshaped-WF for x = [1 −1]T . (c) Expected loss function of WF for x = [1 −1]T . Figure 2(b) further illustrates that the expected loss surface of reshaped-WF (see Suppl. B for expression) behaves similarly to a quadratic surface around the global optimums as compared to the expected loss surface for WF (see Suppl. B for expression) in Figure 2(c). 5 2.3 Geometric Convergence of Reshaped-WF We characterize the convergence of reshaped-WF in the following theorem. Theorem 1. Consider the problem of solving any given x ∈Rn from a system of equations (4) with Gaussian measurement vectors. There exist some universal constants µ0 > 0 (µ0 can be set as 0.8 in practice), 0 < ρ, ν < 1 and c0, c1, c2 > 0 such that if m ≥c0n and µ < µ0, then with probability at least 1 −c1 exp(−c2m), Algorithm 1 yields dist(z(t), x) ≤ν(1 −ρ)t∥x∥, ∀t ∈N. (11) Outline of the Proof. We outline the proof here with details relegated to Suppl. C. Compared to WF and truncated-WF, our proof is much simpler due to the lower-order loss function that reshaped-WF relies on. The central idea is to show that within the neighborhood of global optimums, reshaped-WF satisfies the Regularity Condition RC(µ, λ, c) Chen and Candes [2015], i.e., ⟨∇ℓ(z), h⟩≥µ 2 ∥∇ℓ(z)∥2 + λ 2 ∥h∥2 (12) for all z and h = z −x obeying ∥h∥≤c∥x∥, where 0 < c < 1 is some constant. Then, as shown in Chen and Candes [2015], once the initialization lands into this neighborhood, geometric convergence can be guaranteed, i.e., dist2 (z + µ∇ℓ(z), x) ≤(1 −µλ)dist2(z, x), (13) for any z with ∥z −x∥≤ϵ∥x∥. Lemmas 2 and 3 in Suppl.C yield that ⟨∇ℓ(z), h⟩≥(1 −0.26 −2ϵ)∥h∥2 = (0.74 −2ϵ)∥h∥2. And Lemma 4 in Suppl.C further yields that ∥∇ℓ(z)∥≤(1 + δ) · 2∥h∥. (14) Therefore, the above two bounds imply that Regularity Condition (12) holds for µ and λ satisfying 0.74 −2ϵ ≥µ 2 · 4(1 + δ)2 + λ 2 . (15) We note that (15) implies an upper bound µ ≤0.74 2 = 0.37, by taking ϵ and δ to be sufficiently small. This suggests a range to set the step size in Algorithm 1. However, in practice, µ can be set much larger than such a bound, say 0.8, while still keeping the algorithm convergent. This is because the coefficients in the proof are set for convenience of proof rather than being tightly chosen. Theorem 1 indicates that reshaped-WF recovers the true signal with O(n) samples, which is orderlevel optimal. Such an algorithm improves the sample complexity O(n log n) of WF. Furthermore, reshaped-WF does not require truncation of weak samples in the gradient step to achieve the same sample complexity as truncated-WF. This is mainly because reshaped-WF benefits from the lowerorder loss function given in (7), the curvature of which behaves similarly to the least-squares loss function locally as we explain in Section 2.2. Theorem 1 also suggests that reshaped-WF converges geometrically at a constant step size. To reach ϵ−accuracy, it requires computational cost of O(mn log 1/ϵ) flops, which is better than WF (O(mn2 log(1/ϵ)). Furthermore, it does not require truncation in gradient steps to reach the same computational cost as truncated-WF. Numerically, as we demonstrate in Section 3, reshaped-WF is two times faster than truncated-WF and four to six times faster than WF in terms of both iteration count and time cost in various examples. Although our focus in this paper is on the noise-free model, reshaped-WF can be applied to noisy models as well. Suppose the measurements are corrupted by bounded noises {ηi}m i=1 satisfying ∥η∥/√m ≤c∥x∥. Then by adapting the proof of Theorem 1, it can be shown that the gradient loop of reshaped-WF is robust such that dist(z(t), x) ≲∥η∥ √m + (1 −ρ)t∥x∥, ∀t ∈N, (16) for some ρ ∈(0, 1). The numerical result under the Poisson noise model in Section 3 further corroborates the stability of reshaped-WF. 6 Table 1: Comparison of iteration count and time cost among algorithms (n = 1000, m = 8n) Algorithms reshaped-WF truncated-WF WF AltMinPhase real case iterations 72 182 319.2 5.8 time cost(s) 0.477 1.232 2.104 0.908 complex case iterations 272.7 486.7 915.4 156 time cost(s) 6.956 12.815 23.306 93.22 3 Numerical Comparison with Other Algorithms In this section, we demonstrate the numerical efficiency of reshaped-WF by comparing its performance with other competitive algorithms. Our experiments are run not only for real-valued case but also for complex-valued and CDP cases. All the experiments are implemented in Matlab 2015b and carried out on a computer equipped with Intel Core i7 3.4GHz CPU and 12GB RAM. We first compare the sample complexity of reshaped-WF with those of truncated-WF and WF via the empirical successful recovery rate versus the number of measurements. For reshaped-WF, we follow Algorithm 1 with suggested parameters. For truncated-WF and WF, we use the codes provided in the original papers with the suggested parameters. We conduct the experiment for real, complex and CDP cases respectively. For real and complex cases, we set the signal dimension n to be 1000, and the ratio m/n take values from 2 to 6 by a step size 0.1. For each m, we run 100 trials and count the number of successful trials. For each trial, we run a fixed number of iterations T = 1000 for all algorithms. A trial is declared to be successful if z(T ), the output of the algorithm, satisfies dist(z(T ), x)/∥x∥≤10−5. For the real case, we generate signal x ∼N(0, In×n), and the measurement vectors ai ∼N(0, In×n) i.i.d. for i = 1, . . . , m. For the complex case, we generate signal x ∼N(0, In×n) + jN(0, In×n) and measurements ai ∼1 2N(0, In×n) + j 1 2N(0, In×n) i.i.d. for i = 1, . . . , m. For the CDP case, we generate signal x ∼N(0, In×n) + jN(0, In×n) that yields measurements y(l) = |F D(l)x|, 1 ≤l ≤L, (17) where F represents the discrete Fourier transform (DFT) matrix, and D(l) is a diagonal matrix (mask). We set n = 1024 for convenience of FFT and m/n = L = 1, 2, . . . , 8. All other settings are the same as those for the real case. 2n 3n 4n 5n 6n m: Number of measurements (n=1000) 0 0.2 0.4 0.6 0.8 1 Empirical success rate reshaped-WF truncated-WF WF (a) Real case 2n 3n 4n 5n 6n m: Number of measurements (n=1000) 0 0.2 0.4 0.6 0.8 1 Empirical success rate reshaped-WF truncated-WF WF (b) Complex case 1n 2n 3n 4n 5n 6n 7n 8n m: Number of measurements (n=1024) 0 0.2 0.4 0.6 0.8 1 Empirical success rate reshaped-WF truncated-WF WF (c) CDP case Figure 3: Comparison of sample complexity among reshaped-WF, truncated-WF and WF. Figure 3 plots the fraction of successful trials out of 100 trials for all algorithms, with respect to m. It can be seen that for although reshaped-WF outperforms only WF (not truncated-WF) for the real case, it outperforms both WF and truncated-WF for complex and CDP cases. An intuitive explanation for the real case is that a substantial number of samples with small |aT i z| can deviate gradient so that truncation indeed helps to stabilize the algorithm if the number of measurements is not large. Furthermore, reshaped-WF exhibits shaper transition than truncated-WF and WF. We next compare the convergence rate of reshaped-WF with those of truncated-WF, WF and AltMinPhase. We run all of the algorithms with suggested parameter settings in the original codes. We generate signal and measurements in the same way as those in the first experiment with n = 1000, m = 8n. All algorithms are seeded with reshaped-WF initialization. In Table 1, we list the number of iterations and time cost for those algorithms to achieve the relative error of 10−14 averaged over 10 trials. Clearly, reshaped-WF takes many fewer iterations as well as runing much faster than truncated-WF and WF. Although reshaped-WF takes more iterations than AltMinPhase, it runs much faster than 7 AltMinPhase due to the fact that each iteration of AltMinPhase needs to solve a least-squares problem that takes much longer time than a simple gradient update in reshaped-WF. We also compare the performance of the above algorithms on the recovery of a real image from the Fourier intensity measurements (2D CDP with the number of masks L = 16). The image (provided in Suppl.D) is the Milky Way Galaxy with resolution 1920×1080. Table 2 lists the number of iterations and time cost of the above four algorithms to achieve the relative error of 10−15. It can be seen that reshaped-WF outperforms all other three algorithms in computational time cost. In particular, it is two times faster than truncated-WF and six times faster than WF in terms of both the number of iterations and computational time cost. Table 2: Comparison of iterations and time cost among algorithms on Galaxy image (L = 16) Algorithms reshaped-WF truncated-WF WF AltMinPhase iterations 65 160 420 110 time cost(s) 141 567 998 213 We next demonstrate the robustness of reshaped-WF to noise corruption and compare it with truncatedWF. We consider the phase retrieval problem in imaging applications, where random Poisson noises are often used to model the sensor and electronic noise Fogel et al. [2013]. Specifically, the noisy measurements of intensity can be expressed as yi = q α · Poisson |aT i x|2/α  , for i = 1, 2, ...m where α denotes the level of input noise, and Poisson(λ) denotes a random sample generated by the Poisson distribution with mean λ. It can be observed from Figure 4 that reshaped-WF performs better than truncated-WF in terms of recovery accuracy under different noise levels. 0 10 20 30 40 50 60 Number of iterations 10-4 10-3 10-2 10-1 100 Relative error reshaped-WF truncated-WF noise level ,=1 noise level ,=0.001 Figure 4: Comparison of relative error under Poisson noise between reshaped-WF and truncated WF. 4 Conclusion In this paper, we proposed reshaped-WF to recover a signal from a quadratic system of equations, based on a nonconvex and nonsmooth quadratic loss function of absolute values of measurements. This loss function sacrifices the smoothness but enjoys advantages in statistical and computational efficiency. It also has potential to be extended in various scenarios. One interesting direction is to extend such an algorithm to exploit signal structures (e.g., nonnegativity, sparsity, etc) to assist the recovery. The lower-order loss function may offer great simplicity to prove performance guarantee in such cases. Another interesting topic is to study stochastic version of reshaped-WF. We have observed in preliminary experiments that the stochastic version of reshaped-WF converges fast numerically. It will be of great interest to fully understand the theoretic performance of such an algorithm and explore the reason behind its fast convergence. Acknowledgments This work is supported in part by the grants AFOSR FA9550-16-1-0077 and NSF ECCS 16-09916. 8 References J. V. Burke, A. S. Lewis, and M. L. Overton. A robust gradient sampling algorithm for nonsmooth, nonconvex optimization. SIAM Journal on Optimization, 15(3):751–779, 2005. T. T. Cai, X. Li, and Z. Ma. Optimal rates of convergence for noisy sparse phase retrieval via thresholded wirtinger flow. arXiv preprint arXiv:1506.03382, 2015. E. J. Candès, T. Strohmer, and V. Voroninski. Phaselift: Exact and stable signal recovery from magnitude measurements via convex programming. Communications on Pure and Applied Mathematics, 66(8):1241– 1274, 2013. E. J. Candès, X. Li, and M. Soltanolkotabi. Phase retrieval via wirtinger flow: Theory and algorithms. IEEE Transactions on Information Theory, 61(4):1985–2007, 2015. A. Chai, M. Moscoso, and G. Papanicolaou. Array imaging using intensity-only measurements. Inverse Problems, 27(1), 2011. Y. Chen and E. Candes. Solving random quadratic systems of equations is nearly as easy as solving linear systems. In Advances in Neural Information Processing Systems (NIPS). 2015. J. D. Donahue. Products and quotients of random variables and their applications. Technical report, DTIC Document, 1964. J. R. Fienup. Phase retrieval algorithms: a comparison. Applied Optics, 21(15):2758–2769, 1982. F. Fogel, I. Waldspurger, and A. d’Aspremont. Phase retrieval for imaging problems. arXiv preprint arXiv:1304.7735, 2013. R. W. Gerchberg. A practical algorithm for the determination of phase from image and diffraction plane pictures. Optik, 35:237, 1972. X. Glorot, A. Bordes, and Y. Bengio. Deep sparse rectifier neural networks. In International Conference on Artificial Intelligence and Statistics (AISTATS), 2011. D. Gross, F. Krahmer, and R. Kueng. Improved recovery guarantees for phase retrieval from coded diffraction patterns. Applied and Computational Harmonic Analysis, 2015. K. C. Kiwiel. Convergence of the gradient sampling algorithm for nonsmooth nonconvex optimization. SIAM Journal on Optimization, 18(2):379–388, 2007. A. Krizhevsky, I. Sutskever, and G. E. Hinton. Imagenet classification with deep convolutional neural networks. In Advances in neural information processing systems (NIPS), 2012. A. Y. Kruger. On fréchet subdifferentials. Journal of Mathematical Sciences, 116(3):3325–3358, 2003. P. Netrapalli, P. Jain, and S. Sanghavi. Phase retrieval using alternating minimization. Advances in Neural Information Processing Systems (NIPS), 2013. P. Ochs, A. Dosovitskiy, T. Brox, and T. Pock. On iteratively reweighted algorithms for nonsmooth nonconvex optimization in computer vision. SIAM Journal on Imaging Sciences, 8(1):331–372, 2015. Y. Shechtman, Y. C. Eldar, O. Cohen, H. N. Chapman, J. Miao, and M. Segev. Phase retrieval with application to optical imaging: a contemporary overview. IEEE Signal Processing Magazine, 32(3):87–109, 2015. J. Sun, Q. Qu, and J. Wright. A geometric analysis of phase retrieval. arXiv preprint arXiv:1602.06664, 2016. R. Vershynin. Introduction to the non-asymptotic analysis of random matrices. Compressed Sensing, Theory and Applications, pages 210 – 268, 2012. I. Waldspurger, A. d’Aspremont, and S. Mallat. Phase recovery, maxcut and complex semidefinite programming. Mathematical Programming, 149(1-2):47–81, 2015. K. Wei. Solving systems of phaseless equations via kaczmarz methods: a proof of concept study. Inverse Problems, 31(12):125008, 2015. H. Zhang, Y. Chi, and Y. Liang. Provable non-convex phase retrieval with outliers: Median truncated wirtinger flow. arXiv preprint arXiv:1603.03805, 2016. 9
2016
304
6,222
Data Poisoning Attacks on Factorization-Based Collaborative Filtering Bo Li ∗ Vanderbilt University bo.li.2@vanderbilt.edu Yining Wang ∗ Carnegie Mellon University ynwang.yining@gmail.com Aarti Singh Carnegie Mellon University aarti@cs.cmu.edu Yevgeniy Vorobeychik Vanderbilt University yevgeniy.vorobeychik@vanderbilt.edu Abstract Recommendation and collaborative filtering systems are important in modern information and e-commerce applications. As these systems are becoming increasingly popular in the industry, their outputs could affect business decision making, introducing incentives for an adversarial party to compromise the availability or integrity of such systems. We introduce a data poisoning attack on collaborative filtering systems. We demonstrate how a powerful attacker with full knowledge of the learner can generate malicious data so as to maximize his/her malicious objectives, while at the same time mimicking normal user behavior to avoid being detected. While the complete knowledge assumption seems extreme, it enables a robust assessment of the vulnerability of collaborative filtering schemes to highly motivated attacks. We present efficient solutions for two popular factorizationbased collaborative filtering algorithms: the alternative minimization formulation and the nuclear norm minimization method. Finally, we test the effectiveness of our proposed algorithms on real-world data and discuss potential defensive strategies. 1 Introduction Recommendation systems have emerged as a crucial feature of many electronic commerce systems. In machine learning such problems are usually referred to as collaborative filtering or matrix completion, where the known users’ preferences are abstracted into an incomplete user-by-item matrix, and the goal is to complete the matrix and subsequently make new item recommendations for each user. Existing approaches in the literature include nearest-neighbor methods, where a user’s (item’s) preference is determined by other users (items) with similar profiles [1], and factorization-based methods where the incomplete preference matrix is assumed to be approximately low-rank [2, 3]. As recommendation systems play an ever increasing role in current information and e-commerce systems, they are susceptible to a risk of being maliciously attacked. One particular form of attacks is called data poisoning, in which a malicious party creates dummy (malicious) users in a recommendation system with carefully chosen item preferences (i.e., data) such that the effectiveness or credibility of the system is maximally degraded. For example, an attacker might attempt to make recommendations that are as different as possible from those that would otherwise be made by the recommendation system. In another, more subtle, example, the attacker is associated with the producer of a specific movie or product, who may wish to increase or decrease the popularity of a certain item. In both cases, the credibility of a recommendation system is harmed by the malicious activities, which could lead to significant economic loss. Due to the open nature of recommendation ∗Both authors contribute equally 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. systems and their reliance on user-specified judgments for building profiles, various forms of attacks are possible and have been discussed, such as the random attack and random product push/nuke attack [4, 5]. However, these attacks are not formally analyzed and cannot be optimized according to specific collaborative filtering algorithms. As it is not difficult for attackers to determine the defender’s filtering algorithm or even its parameters settings (e.g., through insider attacks), this can lead one to significantly under-estimate the attacker’s ability and result in substantial loss. We present a systematic approach to computing near-optimal data poisoning attacks for factorizationbased collaborative filtering/recommendation models. We assume a highly motivated attacker with knowledge of both the learning algorithms and parameters of the learner following the Kerckhoffs’ principle to ensure reliable vulnerability analysis in the worst case. We focus on two most popular algorithms: alternating minimization [6] and nuclear norm minimization [3]. Our main contributions are as follows: • Comprehensive characterization of attacker utilities: We characterize several attacker utilities, which include availability attacks, where prediction error is increased, and integrity attacks, where item-specific objectives are considered. Optimal attack strategies for all utilities can be computed under a unified optimization framework. • Novel gradient computations: Building upon existing gradient-based data poisoning frameworks [7, 8, 9], we develop novel methods for gradient computation based on first-order KKT conditions for two widely used algorithms: alternating minimization [6] and nuclear norm minimization [2]. The resulting derivations are highly non-trivial; in addition, to our knowledge this work is the first to give systematic data poisoning attacks for problems involving non-smooth nuclear norm type objectives. • Mimicking normal user behaviors: For data poisoning attacks, most prior work focuses on maximizing attacker’s utility. A less investigated problem is how to synthesize malicious data points that are hard for a defender to detect. In this paper we provide a novel technique based on stochastic gradient Langevin dynamics optimization [10] to produce malicious users that mimic normal user behaviors in order to avoid detection, while achieving attack objectives. Related Work: There has been extensive prior research concerning the security of machine learning algorithms [11, 12, 13, 14, 15]. Biggio et al. pioneered the research of optimizing malicious datadriven attacks for kernel-based learning algorithms such as SVM [16]. The key optimization technique is to approximately compute implicit gradients of the solution of an optimization problem based on first-order KKT conditions. Similar techniques were later generalized to optimize data poisoning attacks for several other important learning algorithms, such as Lasso regression [7], topic modeling [8], and autoregressive models [17]. The reader may refer to [9] for a general algorithmic framework of the abovementioned methods. In terms of collaborative filtering/matrix completion, there is another line of established research that focuses on robust matrix completion, in which a small portion of elements or rows in the underlying low-rank matrix is assumed to be arbitrarily perturbed [18, 19, 20, 21]. Specifically, the stability of alternating minimization solutions was analyzed with respect to malicious data manipulations in [22]. However, [22] assumes a globally optimal solution of alternating minimization can be obtained, which is rarely true in practice. 2 Preliminaries We first set up the collaborative filtering/matrix completion problem and give an overview of existing low-rank factorization based approaches. Let M ∈Rm×n be a data matrix consisting of m rows and n columns. Mij for i ∈[m] and j ∈[n] would then correspond to the rating the ith user gives for the jth item. We use Ω= {(i, j) : Mij is observed} to denote all observable entries in M and assume that |Ω| ≪mn. We also use Ωi ⊆[n] and Ω′ j ⊆[m] for columns (rows) that are observable at the ith row (jth column). The goal of collaborative filtering (also referred to as matrix completion in the statistical learning literature [2]) is then to recover the complete matrix M from few observations MΩ. The matrix completion problem is in general ill-posed as it is impossible to complete an arbitrary matrix with partial observations. As a result, additional assumptions are imposed on the underlying data matrix M. One standard assumption is that M is very close to an m × n rank-k matrix with 2 k ≪min(m, n). Under such assumptions, the complete matrix M can be recovered by solving the following optimization problem: min X∈Rm×n ∥RΩ(M −X)∥2 F , s.t. rank(X) ≤k, (1) where ∥A∥2 F = P i,j A2 ij denotes the squared Frobenious norm of matrix A and [RΩ(A)]ij equals Aij if (i, j) ∈Ωand 0 otherwise. Unfortunately, the feasible set in Eq. (1) is non-convex, making the optimimzation problem difficult to solve. There has been an extensive prior literature on approximately solving Eq. (1) and/or its surrogates that lead to two standard approaches: alternating minimization and nuclear norm minimization. For the first approach, one considers the following problem: min U∈Rm×k,V∈Rn×k  ∥RΩ(M −UV⊤)∥2 F +2λU∥U∥2 F + 2λV ∥V∥2 F . (2) Eq. (2) is equivalent to Eq. (1) when λU = λV = 0. In practice people usually set both regularization parameters λU and λV to be small positive constants in order to avoid large entries in the completed matrix and also improve convergence. Since Eq. (2) is bi-convex in U and V, an alternating minimization procedure can be applied. Alternatively, one solves a nuclear-norm minimization problem min X∈Rm×n ∥RΩ(M −X)∥2 F + 2λ∥X∥∗, (3) where λ > 0 is a regularization parameter and ∥X∥∗= Prank(X) i=1 |σi(X)| is the nuclear norm of X, which acts as a convex surrogate of the rank function. Eq. (3) is a convex optimization function and can be solved using an iterative singular value thresholding algorithm [3]. It can be shown that both methods in Eq. (2) and (3) provably approximate the true underlying data matrix M under certain conditions [6, 2]. 3 The Attack Model In this section we describe the data poisoning attack model considered in this paper. For a data matrix consisting of m users and n items, the attacker is capable of adding αm malicious users to the training data matrix, and each malicious user is allowed to report his/her preference on at most B items with each preference bounded in the range [−Λ, Λ]. Before proceeding to describe the attacker’s goals, we first introduce some notation to facilitate presentation. We use M ∈Rm×n to denote the original data matrix and f M ∈Rm′×n to denote the data matrix of all m′ = αm malicious users. Let eΩbe the set of non-zero entries in f M and eΩi ⊆[n] be all items that the ith malicious user rated. According to our attack models, |eΩi| ≤B for every i ∈{1, · · · , m′} and ∥f M∥max = max |f Mij| ≤Λ. Let Θλ(f M; M) be the optimal solution computed jointly on the original and poisoned data matrices (f M; M) using regularization parameters λ. For example, Eq. (2) becomes Θλ(f M; M) = arg min U, e U,V ∥RΩ(M−UV⊤)∥2 F +∥R˜Ω(f M−eUV⊤)∥2 F +2λU(∥U∥2 F +∥eU∥2 F )+2λV ∥V∥2 F (4) where the resulting Θ consists of low-rank latent factors U, eU for normal and malicious users as well as V for items. Simiarly, for the nuclear norm minimization formulation in Eq. (3), we have Θλ(f M; M) = arg min X, e X ∥RΩ(M − X)∥2 F + ∥R˜Ω(f M − eX)∥2 F + 2λ∥(X; eX)∥∗, (5) where Θ = (X, eX) . Let c M(Θ) be the matrix estimated from learnt model Θ. For example, for Eq. (4) we have c M(Θ) = UV⊤and for Eq. (5) we have c M(Θ) = X. The goal of the attacker is to find optimal malicious users f M∗such that f M∗∈argmaxf M∈MR(c M(Θλ(f M; M)), M). (6) Here M = {f M ∈Rm′×n : |˜Ωi| ≤B, ∥f M∥max ≤Λ} is the set of all feasible poisoning attacks discussed earlier in this section and R(c M, M) denotes the attacker’s utility for diverting the collaborative filtering algorithm to predict c M on an original data set M, with the help of few malicious users f M. Below we list several typical attacker utilities: 3 Availability attack the attacker wants to maximize the error of the collaborative filtering system, and eventually render the system useless. Suppose M is the prediction of the collaborative filtering system without data poisoning attacks.2 The utility function is then defined as the total amount of perturbation of predictions between M and c M (predictions after poisoning attacks) on unseen entries ΩC: Rav(c M, M) = ∥RΩC(c M −M)∥2 F . (7) Integrity attack in this model the attacker wants to boost (or reduce) the popularity of a (subset) of items. Suppose J0 ⊆[n] is the subset of items the attacker is interested in and w : J0 →R is a pre-specified weight vector by the attacker. The utility function is Rin J0,w(c M, M) = m X i=1 X j∈J0 w(j)c Mij. (8) Hybrid attack a hybrid loss function can also be defined: Rhybrid J0,w,µ(c M, M) = µ1Rav J0,w(c M, M) + µ2Rin(c M, M), (9) where µ = (µ1, µ2) are coefficients that trade off the availability and integrity attack objectives. In addition, µ1 could be negative, which models the case when the attacker wants to leave a “light trace": the attacker wants to make his item more popular while making the other recommendations of the system less perturbed to avoid detection. 4 Computing Optimal Attack Strategies We describe practical algorithms to solve the optimization problem in Eq. (6) for optimal attack strategy f M∗that maximizes the attacker’s utility. We first consider the alternating minimization formulation in Eq. (4) and derive a projected gradient ascent method that solves for the corresponding optimal attack strategy. Similar derivations are then extended to the nuclear norm minimization formulation in Eq. (5). Finally, we discuss how to design malicious users that mimic normal user behavior in order to avoid detection. 4.1 Attacking Alternating Minimization We use the projected gradient ascent (PGA) method for solving the optimization problem in Eq. (6) with respect to the alternating minimization formulation in Eq. (4): in iteration t we update f M(t) as follows: f M(t+1) = ProjM  f M(t) + st · ∇f MR(c M, M)  , (10) where ProjM(·) is the projection operator onto the feasible region M and st is the step size in iteration t. Note that the estimated matrix c M depends on the model Θλ(f M; M) learnt on the joint data matrix, which further depends on the malicious users f M. Since the constraint set M is highly non-convex, we generate B items uniformly at random for each malicious user to rate. The ProjM(·) operator then reduces to projecting each malicious users’ rating vector onto an ℓ∞ball of diameter Λ, which can be easily evaluated by truncating all entries in f M at the level of ±Λ. We next show how to (approximately) compute ∇f MR(c M, M). This is challenging because one of the arguments in the loss function involves an implicit optimization problem. We first apply chain rule to arrive at ∇f MR(c M, M) = ∇f MΘλ(f M; M)∇ΘR(c M, M). (11) The second gradient (with respect to Θ) is easy to evaluate, as all loss functions mentioned in the previous section are smooth and differentiable. Detailed derivation of ∇ΘR(c M, M) is deferred to Appendix A. On the other hand, the first gradient term term is much harder to evaluate because Θλ(·) is an optimization procedure. Inspired by [7, 8, 9], we exploit the KKT conditions of the optimization problem Θλ(·) to approximately compute ∇f MΘλ(f M; M). More specifically, the optimal solution Θ = (U, eU, V) of Eq. (4) satisfies λUui = X j∈Ωi (Mij −u⊤ i vj)vj; 2Note that when the collaborative filtering algorithm and its parameters are set, M is a function of observed entries RΩ(M). 4 Algorithm 1 Optimizing f M via PGA 1: Input: Original partially observed m × n data matrix M, algorithm regularization parameter λ, attack budget parameters α, B and Λ, attacker’s utility function R, step size {st}∞ t=1. 2: Initialization: random f M(0) ∈M with both ratings and rated items uniformly sampled at random; t = 0. 3: while f M(t) does not converge do 4: Compute the optimal solution Θλ(f M(t); M). 5: Compute gradient ∇f MR(c M, M) using Eq. (10). 6: Update: f M(t+1) = ProjM(f M(t) + st∇f MR). 7: t ←t + 1. 8: end while 9: Output: m′ × n malicious matrix f M(t). λU ˜ui = X j∈eΩi (f Mij −˜u⊤ i vj)vj; λV vj = X i∈Ω′ j (Mij −u⊤ i vj)ui + X i∈eΩ′ j (f Mij −˜u⊤ i vj)˜ui, where ui, ˜ui are the ith rows (of dimension k) in U or eU and vj is the jth row (also of dimension k) in V. Subsequently, {ui, ˜ui, vj} can be expressed as functions of the original and malicious data matrices M and f M. Using the fact that (a⊤x)a = (aa⊤)x and M does not change with f M, we obtain ∂ui(f M) ∂f Mij = 0; ∂˜ui(f M) ∂f Mij =  λUIk + Σ(i) U −1 vj; ∂vj(f M) ∂f Mij =  λV Ik + Σ(j) V −1 ui. Here Σ(i) U and Σ(j) V are defined as Σ(i) U = X j∈Ωi∪eΩi vjv⊤ j , Σ(j) V = X i∈Ω′ j∪eΩ′ j uiu⊤ i . (12) A framework of the proposed optimization algorithm is described in Algorithm 1. 4.2 Attacking Nuclear Norm Minimization We extend the projected gradient ascent algorithm in Sec. 4.1 to compute optimal attack strategies for the nuclear norm minimization formulation in Eq. (5). Since the objective in Eq. (5) is convex, the global optimal solution Θ = (X, eX) can be obtained by conventional convex optimization procedures such as proximal gradient descent (a.k.a. singular value thresholding [3] for nuclear norm minimization). In addition, the resulting estimation (X; eX) is low rank due to the nuclear norm penalty [2]. Suppose (X; eX) has rank ρ ≤min(m, n). We use Θ′ = (U, eU, V, Σ) as an alternative characterization of the learnt model with a reduced number of parameters. Here X = UΣV⊤and eX = eUΣV⊤are singular value decompositions of X and eX; that is, U ∈Rm×ρ, eU ∈Rm′×ρ, V ∈Rn×ρ have orthornormal columns and Σ = diag(σ1, · · · , σρ) is a non-negative diagonal matrix. To compute the gradient ∇f MR(c M, M), we again apply the chain rule to decompose the gradient into two parts: ∇f MR(c M, M) = ∇f MΘ′ λ(f M; M)∇Θ′R(c M, M). (13) Similar to Eq. (11), the second gradient term ∇Θ′R(c M, M) is relatively easier to evaluate. Its derivation details are deferred to the Appendix. In the remainder of this section we shall focus on the computation of the first gradient term, which involves partial derivatives of Θ′ = (U, eU, V, Σ) with respect to malicious users f M. We begin with the KKT condition at the optimal solution Θ′ of Eq. (5). Unlike the alternating minimization formulation, the nuclear norm function ∥· ∥∗is not everywhere differentiable. As a 5 Algorithm 2 Optimizing f M via SGLD 1: Input: Original partially observed m × n data matrix M, algorithm regularization parameter λ, attack budget parameters α, B and Λ, attacker’s utility function R, step size {st}∞ t=1, tuning parameter β, number of SGLD iterations T. 2: Prior setup: compute ξj = 1 m Pm i=1 Mij and σ2 j = 1 m Pm i=1 (Mij −ξj)2 for every j ∈[n]. 3: Initialization: sample f M(0) ij ∼N(ξj, σ2 j ) for i ∈[m′] and j ∈[n]. 4: for t = 0 to T do 5: Compute the optimal solution Θλ(f M(t); M). 6: Compute gradient ∇f MR(c M, M) using Eq. (10). 7: Update f M(t+1) according to Eq. (17). 8: end for 9: Projection: find f M∗∈arg minf M∈M ∥f M −f M(t)∥2 F . Details in the main text. 10: Output: m′ × n malicious matrix f M∗. result, the KKT condition relates the subdifferential of the nuclear norm function ∂∥· ∥∗as RΩ,˜Ω  [M; f M] −[X; eX]  ∈λ∂∥[X; eX]∥∗. (14) Here [X; eX] is the concatenated (m + m′) × n matrix of X and eX. The subdifferential of the nuclear norm function ∂∥· ∥∗is also known [2]: ∂∥X∥∗= n UV⊤+ W : U⊤W = WV = 0, ∥W∥2 ≤1 o , where X = UΣV⊤is the singular value decomposition of X. Suppose {ui}, {˜ui} and {vj} are rows of U, eU, V and W = {wij}. We can then re-formulate the KKT condition Eq. (14) as follows: ∀(i, j) ∈Ω, Mij = u⊤ i (Σ + λIρ)vj + λwij; ∀(i, j) ∈eΩ, f Mij = ˜u⊤ i (Σ + λIρ)vj + λ ˜wij. Now we derive ∇f MΘ = ∇f M(u, ˜u, v, σ); the full derivation is deferred to the extended version 3. 4.3 Mimicing Normal User Behaviors Normal users generally do not rate items uniformly at random. For example, some movies are significantly more popular than others. As a result, malicious users that pick rated movies uniformly at random can be easily identified by running a t-test against a known database consisting of only normal users, as shown in Sec. 5. To alleviate this issue, in this section we propose an alternative approach to compute data poisoning attacks such that the resulting malicious users f M mimics normal users M to avoid potential detection, while still achieving reasonably large utility R(c M, M) for the attacker. We use a Bayesian formulation to take both data poisoning and detection avoidance objectives into consideration. The prior distribution p0(f M) captures normal user behaviors and is defined as a multivariate normal distribution p0(f M) = m′ Y i=1 n Y j=1 N(f Mij; ξj, σ2 j ), where ξj and σ2 j are mean and variance parameters for the rating of the jth item provided by normal users. In practice both parameters can be estimated using normal user matrix M as ξj = 1 m Pm i=1 Mij and σ2 = 1 m Pm i=1 (Mij −ξj)2. On the other hand, the likelihood p(M|f M) is defined as p(M|f M) = 1 Z exp  β · R(c M, M)  , (15) where R(c M, M) = R(c M(Θλ(f M; M)), M) is one of the attacker utility functions defined in Sec. 3, Z is a normalization constant and β > 0 is a tuning parameter that trades off attack performance and 3http://arxiv.org/abs/1608.08182 6 (a) (b) (c) (d) Figure 1: RMSE/Average ratings for alternating minimization with different percentage of malicious profiles; (a) µ1 = 1, µ2 = 0, (b) µ1 = 1, µ2 = −1, (c)µ1 = 0, µ2 = 1, (d)µ1 = −1, µ2 = 1. detection avoidance. A small β shifts the posterior of f M toward its prior, which makes the resulting attack strategy less effective but harder to detect, and vice versa. Given both prior and likelihood functions, an effective detection-avoiding attack strategy f M can be obtained by sampling from its posterior distribution: p(f M|M) = p0(f M)p(M|f M)/p(M) ∝ exp  − m′ X i=1 n X j=1 (f Mij −ξj)2 2σ2 j + βR(c M, M)  . (16) Posterior sampling of Eq. (16) is clearly intractable due to the implicit and complicated dependency of the estimated matrix c M on the malicious data f M, that is, c M = c M(Θλ(f M; M))). To circumvent this problem, we apply Stochastic Gradient Langevin Dynamics (SGLD, [10]) to approximately sample f M from its posterior distribution in Eq. (16). More specfically, the SGLD algorithm iteratively computes a sequence of posterior samples {f M(t)}t≥0 and in iteration t the new sample f M(t+1) is computed as f M(t+1) = f M(t) + st 2  ∇f M log p(f M|M)  + εt, (17) where {st}t≥0 are step sizes and εt ∼N(0, stI) are independent Gaussian noises injected at each SGLD iteration. The gradient ∇f M log p(f M|M) can be computed as ∇f M log p(f M|M) = −(f M −Ξ)Σ−1 + β∇f MR(c M, M), where Σ = diag(σ2 1, · · · , σ2 n) and Ξ is an m′ × n matrix with Ξij = ξj for i ∈[m′] and j ∈[n]. The other gradient ∇f MR(c M, M) can be computed using the procedure in Sections 4.1 and 4.2. Finally, the sampled malicious matrix f M(t) is projected back onto the feasible set M by selecting B items per user with the largest absolute rating and truncating ratings to the level of {±Λ}. A high-level description of the proposed method is given in Algorithm 2. 5 Experimental Results To evaluate the effectiveness of our proposed poisoning attack strategy, we use the publicly available MovieLens dataset which contains 20 millions ratings and 465,000 tag applications applied to 27,000 movies by 138,000 users [23]. We shift the rating range to [−2, 2] for computation convenience. To avoid the “cold-start” problem, we consider users who have rated at least 20 movies. Two metrics are employed to measure the relative performance of the systems before and after data poisoning attacks: root mean square error (RMSE) for the predicted unseen entries4 and average rating for specific items. We then analyze the tradeoff between attack performance and detection avoidance, which is controled by the β parameter in Eq. (15). This serves as a guide for how β should be set in later experiments. We use a paired t-test to compare the distributions of rated items between normal and malicious users. We present the trend of p-value against different values of β in the extended version of the paper. To strive for a good tradeoff, we set β = 0.6 at which the p-value stablizes around 0.7 and the poisoning attack performance is not significantly sacrificed. We employ attack models specified in Eq. (9), where the utility parameters µ1 and µ2 balance two different malicious goals (availability and integrity) an attacker wishes to achieve. For the integrity 4defined as RMSE = qP (i,j)∈ΩC (Mij −c Mij)2/|ΩC|, where M is the prediction of model trained on clean data RΩ(M) only (i.e., without data poisoning attacks). 7 (a) (b) (c) (d) Figure 2: RMSE/Average ratings for nuclear norm minimization with different percentage of malicious profiles; (a) µ1 = 1, µ2 = 0, (b) µ1 = 1, µ2 = −1, (c)µ1 = 0, µ2 = 1, (d)µ1 = −1, µ2 = 1. utility Rin J0,w, the J0 set contains only one item j0 selected randomly from all items whose average predicted ratings are around 0.8. The weight wj0 is set as wj0 = 2. Figure 1 (a) (b) plots the RMSE after data poisoning attacks. When µ1 = 1, µ2 = 0, the attacker is interested in increasing the RMSE of the collaborative filtering system and hence reducing the system’s availability. On the other hand, when µ1 = 1, µ2 = −1 the attacker wishes to increase RMSE while at the same time keeping the rating of specific items (j0) as low as possible for certain malicious purposes. Figure 1 (b) shows that when the attackers consider to both objectives (µ1 = 1, µ2 = −1), the RMSE after poisoning is slightly lower than that if only availability is targeted (µ1 = 1, µ2 = 0). In addition, the projected gradient ascent (PGA) strategy generates the largest RMSE score compared with the other methods. However, PGA requires malicious users to rate each item uniformly at random, which might expose the malicious profiles to an informed defender. More specifically, the paired t-test on those malicious profiles produced by PGA rejects the null hypothesis that the items rated by the attacker strategies are the same as those obtained from normal users (p < 0.05). In contrast, the SGLD method leads to slightly worse attacker utility but generates malicious users that are hard to distinguish from the normal users (for example, the paired t-test leads to inconclusive p-values (larger than 0.7) with β = 0.6. Finally, both PGA and SGLD result in higher attacker utility compared to uniform attacks, where both ratings and rated items are sampled uniformly at random for malicious profiles. Apart from the RMSE scores, we also plot ratings of specific items against percentage of malicious profiles in Figure 1 (c) (d). We consider two additional attack utility settings: µ1 = 0, µ2 = 1, in which the attacker wishes to push the ratings of some particular items (specified in w and J0 of Rin) as high as possible; and µ1 = −1, µ2 = 1, where the attacker also wants to leave a “light trace" by reducing the impact on the entire system resulted from malicious activities. It is clear that targeted attackes (both PGA and SGLD) are indeed more effective at manipulating ratings of specific items for integrity attacks. We also plot RMSE/Average ratings against malicious user percentage in Figure 2 for the nuclear norm minimization under similar settings based on a subset of 1000 users and 1700 movies (items), since it is more computationally expensive than alternating minimization. In general, we observe similar behavior of both RMSE/Average ratings under different attacking models µ1, µ2 with alternating minimization. 6 Discussion and Concluding Remarks Our ultimate goal for the poisoning attack analysis is to develop possible defensive strategies based on the careful analysis of adversarial behaviors. Since the poisoning data is optimized based on the attacker’s malicious objectives, the correlations among features within a feature vector may change to appear different from normal instances. Therefore, tracking and detecting deviations in the feature correlations and other accuracy metrics can be one potential defense. Additionally, defender can also apply the combinational models or sampling strategies, such as bagging, to reduce the influence of poisoning attacks. Acknowledgments This research was partially supported by the NSF (CNS-1238959, IIS-1526860), ONR (N00014-151-2621), ARO (W911NF-16-1-0069), AFRL (FA8750-14-2-0180), Sandia National Laboratories, and Symantec Labs Graduate Research Fellowship. 8 References [1] Jun Wang, Arjen de Vires, and Marcel Reinders. Unifying user-based and item-based collaborative filtering approaches by similarity fusion. In SIGIR, 2006. [2] Emmanuel Candès and Ben Recht. Exact matrix completion via convex optimization. Foundations of Computational Mathematics, 9(6):717–772, 2007. [3] Jian-Feng Cai, Emmanuel Candès, and Zuowei Shen. A singular value thresholding algorithm for matrix completion. SIAM Journal on Optimization, 20(4):1956–1982, 2010. [4] Bamshad Mobasher, Robin Burke, Runa Bhaumik, and Chad Williams. Effective attack models for shilling item-based collaborative filtering systems. In Proceedings of the 2005 WebKDD Workshop, held in conjuction with ACM SIGKDD’2005, 2005. [5] Michael P O’Mahony, Neil J Hurley, and Guenole CM Silvestre. Promoting recommendations: An attack on collaborative filtering. In Database and Expert Systems Applications, pages 494–503. Springer, 2002. [6] Prateek Jain, Praneeth Netrapalli, and Sujay Sanghavi. Low-rank matrix completion using alternating minimization. In STOC, 2013. [7] Huang Xiao, Battista Biggio, Gavin Brown, Giorgio Fumera, Claudia Eckert, and Fabio Roli. Is feature selection secure against training data poisoning. In ICML, 2015. [8] Shike Mei and Xiaojin Zhu. The security of latent dirichlet allocation. In AISTATS, 2015. [9] Shike Mei and Xiaojin Zhu. Using machine teaching to identify optimal training-set attacks on machine learners. In AAAI, 2015. [10] Max Welling and Yee W Teh. Bayesian learning via stochastic gradient langevin dynamics. In Proceedings of the 28th International Conference on Machine Learning (ICML-11), pages 681–688, 2011. [11] Nilesh Dalvi, Pedro Domingos, Sumit Sanghai, Deepak Verma, et al. Adversarial classification. In Proceedings of the tenth ACM SIGKDD international conference on Knowledge discovery and data mining, pages 99–108. ACM, 2004. [12] Daniel Lowd and Christopher Meek. Adversarial learning. In Proceedings of the eleventh ACM SIGKDD international conference on Knowledge discovery in data mining, pages 641–647. ACM, 2005. [13] Bo Li and Yevgeniy Vorobeychik. Feature cross-substitution in adversarial classification. In Advances in Neural Information Processing Systems, pages 2087–2095, 2014. [14] Bo Li and Yevgeniy Vorobeychik. Scalable optimization of randomized operational decisions in adversarial classification settings. In Proceedings of the Eighteenth International Conference on Artificial Intelligence and Statistics, pages 599–607, 2015. [15] Marco Barreno, Blaine Nelson, Russell Sears, Anthony D Joseph, and J Doug Tygar. Can machine learning be secure? In Proceedings of the 2006 ACM Symposium on Information, computer and communications security, pages 16–25. ACM, 2006. [16] Battista Biggio, Blaine Nelson, and Pavel Laskov. Poisoning attacks against support vector machines. In ICML, 2012. [17] Scott Alfeld, Xiaojin Zhu, and Paul Barford. Data poisoning attacks against autoregressive models. In AAAI, 2016. [18] Olga Klopp, Karim Lounici, and Alexandre Tsybakov. Robust matrix completion. arXiv:1412.8132, 2014. [19] Yudong Chen, Huan Xu, Constantine Caramanis, and Sujay Sanghavi. Robust matrix completion and corrupted columns. In ICML, 2011. [20] Yudong Chen, Ali Jalali, Sujay Sanghavi, and Constantine Caramanis. Low-rank matrix recovery from errors and erasures. IEEE Transactions on Information Theory, 59(7):4324–4337, 2013. [21] Feiping Nie, Hua Wang, Xiao Cai, Heng Huang, and Chris Ding. Robust matrix completion via joint schatten p-norm and lp-norm minimization. In ICDM, 2012. [22] Yu-Xiang Wang and Huan Xu. Stability of matrix factorization for collaborative filtering. In ICML, 2012. [23] Research GroupLens. www.grouplens.org. 9
2016
305
6,223
PAC-Bayesian Theory Meets Bayesian Inference Pascal Germain† Francis Bach† Alexandre Lacoste‡ Simon Lacoste-Julien† † INRIA Paris - École Normale Supérieure, firstname.lastname@inria.fr ‡ Google, allac@google.com Abstract We exhibit a strong link between frequentist PAC-Bayesian risk bounds and the Bayesian marginal likelihood. That is, for the negative log-likelihood loss function, we show that the minimization of PAC-Bayesian generalization risk bounds maximizes the Bayesian marginal likelihood. This provides an alternative explanation to the Bayesian Occam’s razor criteria, under the assumption that the data is generated by an i.i.d. distribution. Moreover, as the negative log-likelihood is an unbounded loss function, we motivate and propose a PAC-Bayesian theorem tailored for the sub-gamma loss family, and we show that our approach is sound on classical Bayesian linear regression tasks. 1 Introduction Since its early beginning [24, 34], the PAC-Bayesian theory claims to provide “PAC guarantees to Bayesian algorithms” (McAllester [24]). However, despite the amount of work dedicated to this statistical learning theory—many authors improved the initial results [8, 21, 25, 30, 35] and/or generalized them for various machine learning setups [4, 12, 15, 20, 28, 31, 32, 33]—it is mostly used as a frequentist method. That is, under the assumptions that the learning samples are i.i.d.-generated by a data-distribution, this theory expresses probably approximately correct (PAC) bounds on the generalization risk. In other words, with probability 1−δ, the generalization risk is at most " away from the training risk. The Bayesian side of PAC-Bayes comes mostly from the fact that these bounds are expressed on the averaging/aggregation/ensemble of multiple predictors (weighted by a posterior distribution) and incorporate prior knowledge. Although it is still sometimes referred as a theory that bridges the Bayesian and frequentist approach [e.g., 16], it has been merely used to justify Bayesian methods until now.1 In this work, we provide a direct connection between Bayesian inference techniques [summarized by 5, 13] and PAC-Bayesian risk bounds in a general setup. Our study is based on a simple but insightful connection between the Bayesian marginal likelihood and PAC-Bayesian bounds (previously mentioned by Grünwald [14]) obtained by considering the negative log-likelihood loss function (Section 3). By doing so, we provide an alternative explanation for the Bayesian Occam’s razor criteria [18, 22] in the context of model selection, expressed as the complexity-accuracy trade-off appearing in most PAC-Bayesian results. In Section 4, we extend PAC-Bayes theorems to regression problems with unbounded loss, adapted to the negative log-likelihood loss function. Finally, we study the Bayesian model selection from a PAC-Bayesian perspective (Section 5), and illustrate our finding on classical Bayesian regression tasks (Section 6). 2 PAC-Bayesian Theory We denote the learning sample (X, Y )={(xi, yi)}n i=12(X⇥Y)n, that contains n input-output pairs. The main assumption of frequentist learning theories—including PAC-Bayes—is that (X, Y ) is 1Some existing connections [3, 6, 14, 19, 29, 30, 36] are discussed in Appendix A.1. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. randomly sampled from a data generating distribution that we denote D. Thus, we denote (X, Y )⇠Dn the i.i.d. observation of n elements. From a frequentist perspective, we consider in this work loss functions ` : F⇥X⇥Y ! R, where F is a (discrete or continuous) set of predictors f : X ! Y, and we write the empirical risk on the sample (X, Y ) and the generalization error on distribution D as bL ` X,Y (f) = 1 n n X i=1 `(f, xi, yi) ; L ` D(f) = E (x,y)⇠D `(f, x, y) . The PAC-Bayesian theory [24, 25] studies an averaging of the above losses according to a posterior distribution ˆ⇢over F. That is, it provides probably approximately correct generalization bounds on the (unknown) quantity Ef⇠ˆ⇢L ` D(f) = Ef⇠ˆ⇢E(x,y)⇠D `(f, x, y) , given the empirical estimate Ef⇠ˆ⇢bL ` X,Y (f) and some other parameters. Among these, most PAC-Bayesian theorems rely on the Kullback-Leibler divergence KL(ˆ⇢k⇡) = Ef⇠ˆ⇢ln[ˆ⇢(f)/⇡(f)] between a prior distribution ⇡ over F—specified before seeing the learning sample X, Y —and the posterior ˆ⇢—typically obtained by feeding a learning process with (X, Y ). Two appealing aspects of PAC-Bayesian theorems are that they provide data-driven generalization bounds that are computed on the training sample (i.e., they do not rely on a testing sample), and that they are uniformly valid for all ˆ⇢over F. This explains why many works study them as model selection criteria or as an inspiration for learning algorithm conception. Theorem 1, due to Catoni [8], has been used to derive or study learning algorithms [10, 17, 26, 27]. Theorem 1 (Catoni [8]). Given a distribution D over X ⇥Y, a hypothesis set F, a loss function `0 : F ⇥X ⇥Y ! [0, 1], a prior distribution ⇡over F, a real number δ 2 (0, 1], and a real number β > 0, with probability at least 1 −δ over the choice of (X, Y ) ⇠Dn, we have 8ˆ⇢on F : E f⇠ˆ⇢L `0 D (f)  1 1 −e−β  1 −e−β Ef⇠ˆ ⇢b L `0 X,Y (f)−1 n $ KL(ˆ⇢k⇡)+ ln 1 δ %& . (1) Theorem 1 is limited to loss functions mapping to the range [0, 1]. Through a straightforward rescaling we can extend it to any bounded loss, i.e., ` : F ⇥X ⇥Y ! [a, b], where [a, b] ⇢R. This is done by using β := b −a and with the rescaled loss function `0(f, x, y) := (`(f, x, y)−a)/(b−a) 2 [0, 1] . After few arithmetic manipulations, we can rewrite Equation (1) as 8ˆ⇢on F : E f⇠ˆ⇢L ` D(f) a + b−a 1−ea−b h 1−exp ⇣ −E f⇠ˆ⇢ bL ` X,Y (f)+a−1 n $ KL(ˆ⇢k⇡)+ ln 1 δ %⌘i . (2) From an algorithm design perspective, Equation (2) suggests optimizing a trade-off between the empirical expected loss and the Kullback-Leibler divergence. Indeed, for fixed ⇡, X, Y , n, and δ, minimizing Equation (2) is equivalent to find the distribution ˆ⇢that minimizes n E f⇠ˆ⇢ bL ` X,Y (f) + KL(ˆ⇢k⇡) . (3) It is well known [1, 8, 10, 21] that the optimal Gibbs posterior ˆ⇢⇤is given by ˆ⇢⇤(f) = 1 ZX,Y ⇡(f) e−n b L ` X,Y (f) , (4) where ZX,Y is a normalization term. Notice that the constant β of Equation (1) is now absorbed in the loss function as the rescaling factor setting the trade-off between the expected empirical loss and KL(ˆ⇢k⇡). 3 Bridging Bayes and PAC-Bayes In this section, we show that by choosing the negative log-likelihood loss function, minimizing the PAC-Bayes bound is equivalent to maximizing the Bayesian marginal likelihood. To obtain this result, we first consider the Bayesian approach that starts by defining a prior p(✓) over the set of possible model parameters ⇥. This induces a set of probabilistic estimators f✓2 F, mapping x to a probability distribution over Y. Then, we can estimate the likelihood of observing y given x and ✓, i.e., p(y|x, ✓) ⌘f✓(y|x).2 Using Bayes’ rule, we obtain the posterior p(✓|X, Y ): p(✓|X, Y ) = p(✓) p(Y |X, ✓) p(Y |X) / p(✓) p(Y |X, ✓) , (5) where p(Y |X, ✓) = Qn i=1 p(yi|xi, ✓) and p(Y |X) = R ⇥p(✓) p(Y |X, ✓) d✓. 2To stay aligned with the PAC-Bayesian setup, we only consider the discriminative case in this paper. One can extend to the generative setup by considering the likelihood of the form p(y, x|✓) instead. 2 To bridge the Bayesian approach with the PAC-Bayesian framework, we consider the negative log-likelihood loss function [3], denoted `nll and defined by `nll(f✓, x, y) ⌘−ln p(y|x, ✓) . (6) Then, we can relate the empirical loss bL ` X,Y of a predictor to its likelihood: bL `nll X,Y (✓) = 1 n n X i=1 `nll(✓, xi, yi) = −1 n n X i=1 ln p(yi|xi, ✓) = −1 n ln p(Y |X, ✓) , or, the other way around, p(Y |X, ✓) = e−n b L `nll X,Y (✓) . (7) Unfortunately, existing PAC-Bayesian theorems work with bounded loss functions or in very specific contexts [e.g., 9, 36], and `nll spans the whole real axis in its general form. In Section 4, we explore PAC-Bayes bounds for unbounded losses. Meanwhile, we consider priors with bounded likelihood. This can be done by assigning a prior of zero to any ✓yielding ln 1 p(y|x,✓) /2 [a, b]. Now, using Equation (7) in the optimal posterior (Equation 4) simplifies to ˆ⇢⇤(✓) = ⇡(✓) e−n b L `nll X,Y (✓) ZX,Y = p(✓) p(Y |X, ✓) p(Y |X) = p(✓|X, Y ) , (8) where the normalization constant ZX,Y corresponds to the Bayesian marginal likelihood: ZX,Y ⌘p(Y |X) = Z ⇥ ⇡(✓) e−n b L `nll X,Y (✓)d✓. (9) This shows that the optimal PAC-Bayes posterior given by the generalization bound of Theorem 1 coincides with the Bayesian posterior, when one chooses `nll as loss function and β := b−a (as in Equation 2). Moreover, using the posterior of Equation (8) inside Equation (3), we obtain n E ✓⇠ˆ⇢⇤bL `nll X,Y (✓) + KL(ˆ⇢⇤k⇡) (10) = n Z ⇥ ⇡(✓) e −n b L `nll X,Y (✓) ZX,Y bL `nll X,Y (✓) d✓+ Z ⇥ ⇡(✓) e −n b L `nll X,Y (✓) ZX,Y ln h ⇡(✓) e −n b L `nll X,Y (✓) ⇡(✓) ZX,Y i d✓ = Z ⇥ ⇡(✓) e −n b L `nll X,Y (✓) ZX,Y h ln 1 ZX,Y i d✓= ZX,Y ZX,Y ln 1 ZX,Y = −ln ZX,Y . In other words, minimizing the PAC-Bayes bound is equivalent to maximizing the marginal likelihood. Thus, from the PAC-Bayesian standpoint, the latter encodes a trade-off between the averaged negative log-likelihood loss function and the prior-posterior Kullback-Leibler divergence. Note that Equation (10) has been mentioned by Grünwald [14], based on an earlier observation of Zhang [36]. However, the PAC-Bayesian theorems proposed by the latter do not bound the generalization loss directly, as the “classical” PAC-Bayesian results [8, 24, 29] that we extend to regression in forthcoming Section 4 (see the corresponding remarks in Appendix A.1). We conclude this section by proposing a compact form of Theorem 1 by expressing it in terms of the marginal likelihood, as a direct consequence of Equation (10). Corollary 2. Given a data distribution D, a parameter set ⇥, a prior distribution ⇡over ⇥, a δ 2 (0, 1], if `nll lies in [a, b], we have, with probability at least 1 −δ over the choice of (X, Y ) ⇠Dn, E ✓⇠ˆ⇢⇤L`nll D (✓) a + b−a 1−ea−b h 1 −ea np ZX,Y δ i , where ˆ⇢⇤is the Gibbs optimal posterior (Eq. 8) and ZX,Y is the marginal likelihood (Eq. 9). In Section 5, we exploit the link between PAC-Bayesian bounds and Bayesian marginal likelihood to expose similarities between both frameworks in the context of model selection. Beforehand, next Section 4 extends the PAC-Bayesian generalization guarantees to unbounded loss functions. This is mandatory to make our study fully valid, as the negative log-likelihood loss function is in general unbounded (as well as other common regression losses). 3 4 PAC-Bayesian Bounds for Regression This section aims to extend the PAC-Bayesian results of Section 3 to real valued unbounded loss. These results are used in forthcoming sections to study `nll, but they are valid for broader classes of loss functions. Importantly, our new results are focused on regression problems, as opposed to the usual PAC-Bayesian classification framework. The new bounds are obtained through a recent theorem of Alquier et al. [1], stated below (we provide a proof in Appendix A.2 for completeness). Theorem 3 (Alquier et al. [1]). Given a distribution D over X ⇥Y, a hypothesis set F, a loss function ` : F ⇥X ⇥Y ! R, a prior distribution ⇡over F, a δ 2 (0, 1], and a real number λ > 0, with probability at least 1−δ over the choice of (X, Y ) ⇠Dn, we have 8ˆ⇢on F : E f⇠ˆ⇢L ` D(f)  E f⇠ˆ⇢ bL ` X,Y (f) + 1 λ  KL(ˆ⇢k⇡) + ln 1 δ + `,⇡,D(λ, n) & , (11) where `,⇡,D(λ, n) = ln E f⇠⇡ E X0,Y 0⇠Dn exp h λ ⇣ L ` D(f) −bL ` X0,Y 0(f) ⌘i . (12) Alquier et al. used Theorem 3 to design a learning algorithm for {0, 1}-valued classification losses. Indeed, a bounded loss function ` : F ⇥X ⇥Y ! [a, b] can be used along with Theorem 3 by applying the Hoeffding’s lemma to Equation (12), that gives `,⇡,D(λ, n) λ2(b−a)2/(2n). More specifically, with λ := n, we obtain the following bound 8ˆ⇢on F : E f⇠ˆ⇢L ` D(f)  E f⇠ˆ⇢ bL ` X,Y (f) + 1 n ⇥ KL(ˆ⇢k⇡) + ln 1 δ ⇤ + 1 2(b −a)2. (13) Note that the latter bound leads to the same trade-off as Theorem 1 (expressed by Equation 3). However, the choice λ := n has the inconvenience that the bound value is at least 1 2(b −a)2, even at the limit n ! 1. With λ := pn the bound converges (a result similar to Equation (14) is also formulated by Pentina and Lampert [28]): 8ˆ⇢on F : E f⇠ˆ⇢L ` D(f)  E f⇠ˆ⇢ bL ` X,Y (f) + 1 pn ⇥ KL(ˆ⇢k⇡) + ln 1 δ + 1 2(b −a)2⇤ . (14) Sub-Gaussian losses. In a regression context, it may be restrictive to consider strictly bounded loss functions. Therefore, we extend Theorem 3 to sub-Gaussian losses. We say that a loss function ` is sub-Gaussian with variance factor s2 under a prior ⇡and a data-distribution D if it can be described by a sub-Gaussian random variable V =L ` D(f)−`(f, x, y), i.e., its moment generating function is upper bounded by the one of a normal distribution of variance s2 (see Boucheron et al. [7, Section 2.3]): V (λ) = ln E eλV = ln E f⇠⇡ E (x,y)⇠D exp ⇥ λ $ L ` D(f) −`(f, x, y) %⇤  λ2s2 2 , 8λ 2 R . (15) The above sub-Gaussian assumption corresponds to the Hoeffding assumption of Alquier et al. [1], and allows to obtain the following result. Corollary 4. Given D, F, `, ⇡and δ defined in the statement of Theorem 3, if the loss is sub-Gaussian with variance factor s2, we have, with probability at least 1−δ over the choice of (X, Y ) ⇠Dn, 8ˆ⇢on F : E f⇠ˆ⇢L ` D(f)  E f⇠ˆ⇢ bL ` X,Y (f) + 1 n ⇥ KL(ˆ⇢k⇡) + ln 1 δ ⇤ + 1 2 s2 . Proof. For i = 1 . . . n, we denote `i a i.i.d. realization of the random variable L ` D(f) −`(f, x, y). `,⇡,D(λ, n) = ln E exp ⇥λ n Pn i=1 `i ⇤ = ln Qn i=1 E exp ⇥λ n`i ⇤ = Pn i=1 `i( λ n) n λ2s2 2n2 = λ2s2 2n , where the inequality comes from the sub-Gaussian loss assumption (Equation 15). The result is then obtained from Theorem 3, with λ := n. Sub-gamma losses. We say that an unbounded loss function ` is sub-gamma with a variance factor s2 and scale parameter c, under a prior ⇡and a data-distribution D, if it can be described by a sub-gamma random variable V (see Boucheron et al. [7, Section 2.4]), that is V (λ)  s2 c2 (−ln(1−λc) −λc)  λ2s2 2(1−cλ) , 8λ 2 (0, 1 c) . (16) Under this sub-gamma assumption, we obtain the following new result, which is necessary to study linear regression in the next sections. 4 Corollary 5. Given D, F, `, ⇡and δ defined in the statement of Theorem 3, if the loss is sub-gamma with variance factor s2 and scale c < 1, we have, with probability at least 1−δ over (X, Y ) ⇠Dn, 8ˆ⇢on F : E f⇠ˆ⇢L ` D(f)  E f⇠ˆ⇢ bL ` X,Y (f) + 1 n ⇥ KL(ˆ⇢k⇡) + ln 1 δ ⇤ + 1 2(1−c) s2 . (17) As a special case, with ` := `nll and ˆ⇢:= ˆ⇢⇤(Equation 8), we have E ✓⇠ˆ⇢⇤L`nll D (✓)  s2 2(1−c) −1 n ln (ZX,Y δ) . (18) Proof. Following the same path as in the proof of Corollary 4 (with λ := n), we have `,⇡,D(n, n) = ln E exp [Pn i=1 `i] = ln Qn i=1 E exp [`i] = Pn i=1 `i(1) n s2 2(1−c) = n s2 2(1−c) , where the inequality comes from the sub-gamma loss assumption, with 1 2 (0, 1 c). Squared loss. The parameters s and c of Corollary 5 rely on the chosen loss function and prior, and the assumptions concerning the data distribution. As an example, consider a regression problem where X⇥Y ⇢Rd⇥R, a family of linear predictors fw(x) = w · x, with w 2 Rd, and a Gaussian prior N(0, σ2 ⇡I). Let us assume that the input examples are generated by x⇠N(0, σ2 x I) with label y = w⇤·x+✏, where w⇤2Rd and ✏⇠N(0, σ2 ✏) is a Gaussian noise. Under the squared loss function `sqr(w, x, y) = (w · x −y)2 , (19) we show in Appendix A.4 that Corollary 5 is valid with s2 ≥2 ⇥ σ2 x(σ2 ⇡d + kw⇤k2) + σ2 ✏(1 −c) ⇤ and c ≥2σ2 xσ2 ⇡. As expected, the bound degrades when the noise increases Regression versus classification. The classical PAC-Bayesian theorems are stated in a classification context and bound the generalization error/loss of the stochastic Gibbs predictor Gˆ⇢. In order to predict the label of an example x 2 X, the Gibbs predictor first draws a hypothesis h 2 F according to ˆ⇢, and then returns h(x). Maurer [23] shows that we can generalize PAC-Bayesian bounds on the generalization risk of the Gibbs classifier to any loss function with output between zero and one. Provided that y 2 {−1, 1} and h(x) 2 [−1, 1], a common choice is to use the linear loss function `0 01(h, x, y) = 1 2 −1 2y h(x). The Gibbs generalization loss is then given by RD(Gˆ⇢) = E(x,y)⇠D Eh⇠ˆ⇢`0 01(h, x, y) . Many PAC-Bayesian works use RD(Gˆ⇢) as a surrogate loss to study the zero-one classification loss of the majority vote classifier RD(Bˆ⇢): RD(Bˆ⇢) = Pr (x,y)⇠D ⇣ y E h⇠ˆ⇢h(x) < 0 ⌘ = E (x,y)⇠D I h y E h⇠ˆ⇢h(x) < 0 i , (20) where I[·] being the indicator function. Given a distribution ˆ⇢, an upper bound on the Gibbs risk is converted to an upper bound on the majority vote risk by RD(Bˆ⇢) 2RD(Gˆ⇢) [20]. In some situations, this factor of two may be reached, i.e., RD(Bˆ⇢) ' 2RD(Gˆ⇢). In other situations, we may have RD(Bˆ⇢) = 0 even if RD(Gˆ⇢) = 1 2−✏(see Germain et al. [11] for an extensive study). Indeed, these bounds obtained via the Gibbs risk are exposed to be loose and/or unrepresentative of the majority vote generalization error.3 In the current work, we study regression losses instead of classification ones. That is, the provided results express upper bounds on Ef⇠ˆ⇢L ` D(f) for any (bounded, sub-Gaussian, or sub-gamma) losses. Of course, one may want to bound the regression loss of the averaged regressor Fˆ⇢(x) = Ef⇠ˆ⇢f(x). In this case, if the loss function ` is convex (as the squared loss), Jensen’s inequality gives L ` D(Fˆ⇢) Ef⇠ˆ⇢L ` D(f) . Note that a strict inequality replaces the factor two mentioned above for the classification case, due to the non-convex indicator function of Equation (20). Now that we have generalization bounds for real-valued loss functions, we can continue our study linking PAC-Bayesian results to Bayesian inference. In the next section, we focus on model selection. 3It is noteworthy that the best PAC-Bayesian empirical bound values are so far obtained by considering a majority vote of linear classifiers, where the prior and posterior are Gaussian [2, 10, 20], similarly to the Bayesian linear regression analyzed in Section 6. 5 5 Analysis of Model Selection We consider L distinct models {Mi}L i=1, each one defined by a set of parameters ⇥i. The PACBayesian theorems naturally suggest selecting the model that is best adapted for the given task by evaluating the bound for each model {Mi}L i=1 and selecting the one with the lowest bound [2, 25, 36]. This is closely linked with the Bayesian model selection procedure, as we showed in Section 3 that minimizing the PAC-Bayes bound amounts to maximizing the marginal likelihood. Indeed, given a collection of L optimal Gibbs posteriors—one for each model—given by Equation (8), p(✓|X, Y, Mi) ⌘ˆ⇢⇤ i (✓) = 1 ZX,Y,i ⇡i(✓) e−n b L `nll X,Y (✓), for ✓2 ⇥i , (21) the Bayesian Occam’s razor criteria [18, 22] chooses the one with the higher model evidence p(Y |X, Mi) ⌘ZX,Y,i = Z ⇥i ⇡i(✓) e−n b L ` X,Y (✓) d✓. (22) Corollary 6 below formally links the PAC-Bayesian and the Bayesian model selection. To obtain this result, we simply use the bound of Corollary 5 L times, together with `nll and Equation (10). From the union bound (a.k.a. Bonferroni inequality), it is mandatory to compute each bound with a confidence parameter of δ/L, to ensure that the final conclusion is valid with probability at least 1−δ. Corollary 6. Given a data distribution D, a family of model parameters {⇥i}L i=1 and associated priors {⇡i}L i=1—where ⇡i is defined over ⇥i— , a δ 2 (0, 1], if the loss is sub-gamma with parameters s2 and c < 1, then, with probability at least 1 −δ over (X, Y ) ⇠Dn, 8i 2 {1, . . . , L} : E ✓⇠ˆ⇢⇤ i L`nll D (✓)  1 2(1−c) s2 −1 n ln $ ZX,Y,i δ L % . where ˆ⇢⇤ i is the Gibbs optimal posterior (Eq. 21) and ZX,Y,i is the marginal likelihood (Eq. 22). Hence, under the uniform prior over the L models, choosing the one with the best model evidence is equivalent to choosing the one with the lowest PAC-Bayesian bound. Hierarchical Bayes. To perform proper inference on hyperparameters, we have to rely on the Hierarchical Bayes approach. This is done by considering an hyperprior p(⌘) over the set of hyperparameters H. Then, the prior p(✓|⌘) can be conditioned on a choice of hyperparameter ⌘. The Bayes rule of Equation (5) becomes p(✓, ⌘|X, Y ) = p(⌘) p(✓|⌘) p(Y |X,✓) p(Y |X) . Under the negative log-likelihood loss function, we can rewrite the results of Corollary 5 as a generalization bound on E⌘⇠ˆ⇢0 E✓⇠ˆ⇢⇤⌘L`nll D (✓), where ˆ⇢0(⌘) / ⇡0(⌘) ZX,Y,⌘is the hyperposterior on H and ⇡0 the hyperprior. Indeed, Equation (18) becomes E ✓⇠ˆ⇢⇤L`nll D (✓) = E ⌘⇠ˆ⇢⇤ 0 E ✓⇠ˆ⇢⇤ ⌘ L`nll D (✓)  1 2(1−c) s2 −1 n ln ✓ E ⌘⇠⇡0 ZX,Y,⌘δ ◆ . (23) To relate to the bound obtained in Corollary 6, we consider the case of a discrete hyperparameter set H = {⌘i}L i=1, with a uniform prior ⇡0(⌘i) = 1 L (from now on, we regard each hyperparameter ⌘i as the specification of a model ⇥i). Then, Equation (23) becomes E ✓⇠ˆ⇢⇤L`nll D (✓) = E ⌘⇠ˆ⇢⇤ 0 E ✓⇠ˆ⇢⇤⌘ L`nll D (✓)  1 2(1−c) s2 −1 n ln ⇣PL i=1 ZX,Y,⌘i δ L ⌘ . This bound is now a function of PL i=1 ZX,Y,⌘i instead of maxi ZX,Y,⌘i as in the bound given by the “best” model in Corollary 6. This yields a tighter bound, corroborating the Bayesian wisdom that model averaging performs best. Conversely, when selecting a single hyperparameter ⌘⇤2 H, the hierarchical representation is equivalent to choosing a deterministic hyperposterior, satisfying ˆ⇢0(⌘⇤) = 1 and 0 for every other values. We then have KL(ˆ⇢||⇡) = KL(ˆ⇢0||⇡0) + E ⌘⇠ˆ⇢0 KL(ˆ⇢⌘||⇡⌘) = ln(L) + KL(ˆ⇢⌘⇤||⇡⌘⇤) . With the optimal posterior for the selected ⌘⇤, we have n E ✓⇠ˆ⇢ bL `nll X,Y (✓) + KL(ˆ⇢||⇡) = n E ✓⇠ˆ⇢⇤⌘ bL `nll X,Y (✓) + KL(ˆ⇢⇤ ⌘⇤||⇡⌘⇤) + ln(L) = −ln(ZX,Y,⌘⇤) + ln(L) = −ln ⇣ ZX,Y,⌘⇤ L ⌘ . Inserting this result into Equation (17), we fall back on the bound obtained in Corollary 6. Hence, by comparing the values of the bounds, one can get an estimate on the consequence of performing model selection instead of model averaging. 6 6 Linear Regression In this section, we perform Bayesian linear regression using the parameterization of Bishop [5]. The output space is Y := R and, for an arbitrary input space X, we use a mapping function φφφ :X!Rd. The model. Given (x, y) 2 X ⇥Y and model parameters ✓:= hw, σi 2 Rd ⇥R+, we consider the likelihood p(y|x, hw, σi) = N(y|w · φφφ(x), σ2). Thus, the negative log-likelihood loss is `nll(h w, σ i, x, y) = −ln p(y|x, h w, σ i) = 1 2 ln(2⇡σ2) + 1 2σ2 (y −w · φφφ(x))2 . (24) For a fixed σ2, minimizing Equation (24) is equivalent to minimizing the squared loss function of Equation (19). We also consider an isotropic Gaussian prior of mean 0 and variance σ2 ⇡: p(w|σ⇡) = N(w|0, σ2 ⇡I). For the sake of simplicity, we consider fixed parameters σ2 and σ2 ⇡. The Gibbs optimal posterior (see Equation 8) is then given by ˆ⇢⇤(w) ⌘p(w|X, Y, σ, σ⇡) = p(w|σ⇡) p(Y |X,w,σ) p(Y |X,σ,σ⇡) = N(w | bw, A−1) , (25) where A := 1 σ2 ΦT Φ + 1 σ2⇡I ; bw := 1 σ2 A−1ΦT y ; Φ is a n⇥d matrix such that the ith line is φφφ(xi) ; y := [y1, . . . yn] is the labels-vector ; and the negative log marginal likelihood is −ln p(Y |X, σ, σ⇡) = 1 2σ2 ky −Φbwk2 + n 2 ln(2⇡σ2) + 1 2σ2⇡kbwk2 + 1 2 log |A| + d ln σ⇡ = n bL `nll X,Y (bw) + 1 2σ2 tr(ΦT ΦA−1) | {z } n Ew⇠ˆ ⇢⇤b L `nll X,Y (w) + 1 2σ2⇡tr(A−1) −d 2 + 1 2σ2⇡kbwk2 + 1 2 log |A| + d ln σ⇡ | {z } KL $ N ( bw,A−1) k N (0,σ2⇡I) % . To obtain the second equality, we substitute 1 2σ2 ky−Φbwk2+ n 2 ln(2⇡σ2) = n bL `nll X,Y (bw) and insert 1 2σ2 tr(ΦT ΦA−1) + 1 2σ2 ⇡tr(A−1) = 1 2 tr( 1 σ2 ΦT ΦA−1 + 1 σ2 ⇡A−1) = 1 2 tr(A−1A) = d 2 . This exhibits how the Bayesian regression optimization problem is related to the minimization of a PAC-Bayesian bound, expressed by a trade-off between Ew⇠ˆ⇢⇤bL `nll X,Y (w) and KL $ N(bw, A−1) k N(0, σ2 ⇡I) % . See Appendix A.5 for detailed calculations. Model selection experiment. To produce Figures 1a and 1b, we reimplemented the toy experiment of Bishop [5, Section 3.5.1]. That is, we generated a learning sample of 15 data points according to y = sin(x) + ✏, where x is uniformly sampled in the interval [0, 2⇡] and ✏⇠N(0, 1 4) is a Gaussian noise. We then learn seven different polynomial models applying Equation (25). More precisely, for a polynomial model of degree d, we map input x 2 R to a vector φφφ(x) = [1, x1, x2, . . . , xd] 2 Rd+1, and we fix parameters σ2 ⇡= 1 0.005 and σ2 = 1 2. Figure 1a illustrates the seven learned models. Figure 1b shows the negative log marginal likelihood computed for each polynomial model, and is designed to reproduce Bishop [5, Figure 3.14], where it is explained that the marginal likelihood correctly indicates that the polynomial model of degree d = 3 is “the simplest model which gives a good explanation for the observed data”. We show that this claim is well quantified by the trade-off intrinsic to our PAC-Bayesian approach: the complexity KL term keeps increasing with the parameter d 2 {1, 2, . . . , 7}, while the empirical risk drastically decreases from d = 2 to d = 3, and only slightly afterward. Moreover, we show that the generalization risk (computed on a test sample of size 1000) tends to increase with complex models (for d ≥4). Empirical comparison of bound values. Figure 1c compares the values of the PAC-Bayesian bounds presented in this paper on a synthetic dataset, where each input x2R20 is generated by a Gaussian x⇠N(0, I). The associated output y2R is given by y=w⇤· x + ✏, with kw⇤k= 1 2, ✏⇠N(0, σ2 ✏), and σ2 ✏= 1 9. We perform Bayesian linear regression in the input space, i.e., φφφ(x)=x, fixing σ2 ⇡= 1 100 and σ2=2. That is, we compute the posterior of Equation (25) for training samples of sizes from 10 to 106. For each learned model, we compute the empirical negative log-likelihood loss of Equation (24), and the three PAC-Bayes bounds, with confidence parameter of δ= 1 20. Note that this loss function is an affine transformation of the squared loss studied in Section 4 (Equation 19), i.e., `nll(hw, σi, x, y)= 1 2 ln(2⇡σ2)+ 1 2σ2 `sqr(w, x, y). It turns out that `nll is sub-gamma with parameters s2 ≥ 1 σ2 ⇥ σ2 x(σ2 ⇡d+kw⇤k2)+σ2 ✏(1−c) ⇤ and c ≥ 1 σ2 (σ2 xσ2 ⇡), as shown in Appendix A.6. The bounds of Corollary 5 are computed using the above mentioned values of kw⇤k, d, σ, σx, σ✏, σ⇡, leading 7 0 1 2⇡ ⇡ 3 2⇡ 2⇡ x −2.0 −1.5 −1.0 −0.5 0.0 0.5 1.0 1.5 model d=1 model d=2 model d=3 model d=4 model d=5 model d=6 model d=7 sin(x) (a) Predicted models. Black dots are the 15 training samples. 1 2 3 4 5 6 7 model degree d 0 10 20 30 40 50 60 −ln ZX,Y KL(ˆ⇢⇤k⇡) n E✓⇠ˆ⇢⇤bL `nll X,Y (✓) n E✓⇠ˆ⇢⇤L `nll D (✓) (b) Decomposition of the marginal likelihood into the empirical loss and KL-divergence. 101 102 103 104 105 n 1.0 1.5 2.0 2.5 3.0 3.5 4.0 Alquier et al’s [a, b] bound (Theorem 3 + Eq 14) Catoni’s [a, b] bound (Corollary 2) sub-gamma bound (Corollary 5) E✓⇠ˆ⇢⇤L `nll D (✓) (test loss) E✓⇠ˆ⇢⇤bL `nll X,Y (✓) (train loss) (c) Bound values on a synthetic dataset according to the number of training samples. Figure 1: Model selection experiment (a-b); and comparison of bounds values (c). to s2 ' 0.280 and c ' 0.005. As the two other bounds of Figure 1c are not suited for unbounded loss, we compute their value using a cropped loss [a, b] = [1, 4]. Different parameter values could have been chosen, sometimes leading to another picture: a large value of s degrades our sub-gamma bound, as a larger [a, b] interval does for the other bounds. In the studied setting, the bound of Corollary 5—that we have developed for (unbounded) subgamma losses—gives tighter guarantees than the two results for [a, b]-bounded losses (up to n=106). However, our new bound always maintains a gap of 1 2(1−c)s2 between its value and the generalization loss. The result of Corollary 2 (adapted from Catoni [8]) for bounded losses suffers from a similar gap, while having higher values than our sub-gamma result. Finally, the result of Theorem 3 (Alquier et al. [1]), combined with λ = 1/pn (Eq. 14), converges to the expected loss, but it provides good guarantees only for large training sample (n & 105). Note that the latter bound is not directly minimized by our “optimal posterior”, as opposed to the one with λ = 1/n (Eq. 13), for which we observe values between 5.8 (for n=106) and 6.4 (for n=10)—not displayed on Figure 1c. 7 Conclusion The first contribution of this paper is to bridge the concepts underlying the Bayesian and the PACBayesian approaches; under proper parameterization, the minimization of the PAC-Bayesian bound maximizes the marginal likelihood. This study motivates the second contribution of this paper, which is to prove PAC-Bayesian generalization bounds for regression with unbounded sub-gamma loss functions, including the squared loss used in regression tasks. In this work, we studied model selection techniques. On a broader perspective, we would like to suggest that both Bayesian and PAC-Bayesian frameworks may have more to learn from each other than what has been done lately (even if other works paved the way [e.g., 6, 14, 30]). Predictors learned from the Bayes rule can benefit from strong PAC-Bayesian frequentist guarantees (under the i.i.d. assumption). Also, the rich Bayesian toolbox may be incorporated in PAC-Bayesian driven algorithms and risk bounding techniques. Acknowledgments We thank Gabriel Dubé and Maxime Tremblay for having proofread the paper and supplemental. 8 References [1] Pierre Alquier, James Ridgway, and Nicolas Chopin. On the properties of variational approximations of Gibbs posteriors. JMLR, 17(239):1–41, 2016. [2] Amiran Ambroladze, Emilio Parrado-Hernández, and John Shawe-Taylor. Tighter PAC-Bayes bounds. In NIPS, 2006. [3] Arindam Banerjee. On Bayesian bounds. In ICML, pages 81–88, 2006. [4] Luc Bégin, Pascal Germain, François Laviolette, and Jean-Francis Roy. PAC-Bayesian theory for transductive learning. In AISTATS, pages 105–113, 2014. [5] Christopher M. Bishop. Pattern Recognition and Machine Learning (Information Science and Statistics). Springer-Verlag New York, Inc., Secaucus, NJ, USA, 2006. [6] P. G. Bissiri, C. C. Holmes, and S. G. Walker. A general framework for updating belief distributions. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 2016. [7] Stéphane Boucheron, Gábor Lugosi, and Pascal Massart. Concentration inequalities : a nonasymptotic theory of independence. Oxford university press, 2013. ISBN 978-0-19-953525-5. [8] Olivier Catoni. PAC-Bayesian supervised classification: the thermodynamics of statistical learning, volume 56. Inst. of Mathematical Statistic, 2007. [9] Arnak S. Dalalyan and Alexandre B. Tsybakov. Aggregation by exponential weighting, sharp PAC-Bayesian bounds and sparsity. Machine Learning, 72(1-2):39–61, 2008. [10] Pascal Germain, Alexandre Lacasse, François Laviolette, and Mario Marchand. PAC-Bayesian learning of linear classifiers. In ICML, pages 353–360, 2009. [11] Pascal Germain, Alexandre Lacasse, Francois Laviolette, Mario Marchand, and Jean-Francis Roy. Risk bounds for the majority vote: From a PAC-Bayesian analysis to a learning algorithm. JMLR, 16, 2015. [12] Pascal Germain, Amaury Habrard, François Laviolette, and Emilie Morvant. A new PAC-Bayesian perspective on domain adaptation. In ICML, pages 859–868, 2016. [13] Zoubin Ghahramani. Probabilistic machine learning and artificial intelligence. Nature, 521:452–459, 2015. [14] Peter Grünwald. The safe Bayesian - learning the learning rate via the mixability gap. In ALT, 2012. [15] Peter D. Grünwald and Nishant A. Mehta. Fast rates with unbounded losses. CoRR, abs/1605.00252, 2016. [16] Isabelle Guyon, Amir Saffari, Gideon Dror, and Gavin C. Cawley. Model selection: Beyond the Bayesian/frequentist divide. JMLR, 11:61–87, 2010. [17] Tamir Hazan, Subhransu Maji, Joseph Keshet, and Tommi S. Jaakkola. Learning efficient random maximum a-posteriori predictors with non-decomposable loss functions. In NIPS, pages 1887–1895, 2013. [18] William H. Jeffreys and James O. Berger. Ockham’s razor and Bayesian analysis. American Scientist, 1992. [19] Alexandre Lacoste. Agnostic Bayes. PhD thesis, Université Laval, 2015. [20] John Langford and John Shawe-Taylor. PAC-Bayes & margins. In NIPS, pages 423–430, 2002. [21] Guy Lever, François Laviolette, and John Shawe-Taylor. Tighter PAC-Bayes bounds through distributiondependent priors. Theor. Comput. Sci., 473:4–28, 2013. [22] David J. C. MacKay. Bayesian interpolation. Neural Computation, 4(3):415–447, 1992. [23] Andreas Maurer. A note on the PAC-Bayesian theorem. CoRR, cs.LG/0411099, 2004. [24] David McAllester. Some PAC-Bayesian theorems. Machine Learning, 37(3):355–363, 1999. [25] David McAllester. PAC-Bayesian stochastic model selection. Machine Learning, 51(1):5–21, 2003. [26] David McAllester and Joseph Keshet. Generalization bounds and consistency for latent structural probit and ramp loss. In NIPS, pages 2205–2212, 2011. [27] Asf Noy and Koby Crammer. Robust forward algorithms via PAC-Bayes and Laplace distributions. In AISTATS, 2014. [28] Anastasia Pentina and Christoph H. Lampert. A PAC-Bayesian bound for lifelong learning. In ICML, 2014. [29] Matthias Seeger. PAC-Bayesian generalization bounds for Gaussian processes. JMLR, 3:233–269, 2002. [30] Matthias Seeger. Bayesian Gaussian Process Models: PAC-Bayesian Generalisation Error Bounds and Sparse Approximations. PhD thesis, University of Edinburgh, 2003. [31] Yevgeny Seldin and Naftali Tishby. PAC-Bayesian analysis of co-clustering and beyond. JMLR, 11, 2010. [32] Yevgeny Seldin, Peter Auer, François Laviolette, John Shawe-Taylor, and Ronald Ortner. PAC-Bayesian analysis of contextual bandits. In NIPS, pages 1683–1691, 2011. [33] Yevgeny Seldin, François Laviolette, Nicolò Cesa-Bianchi, John Shawe-Taylor, and Peter Auer. PACBayesian inequalities for martingales. In UAI, 2012. [34] John Shawe-Taylor and Robert C. Williamson. A PAC analysis of a Bayesian estimator. In COLT, 1997. [35] Ilya O. Tolstikhin and Yevgeny Seldin. PAC-Bayes-empirical-Bernstein inequality. In NIPS, 2013. [36] Tong Zhang. Information-theoretic upper and lower bounds for statistical estimation. IEEE Trans. Information Theory, 52(4):1307–1321, 2006. 9
2016
306
6,224
Fast Mixing Markov Chains for Strongly Rayleigh Measures, DPPs, and Constrained Sampling Chengtao Li MIT ctli@mit.edu Stefanie Jegelka MIT stefje@csail.mit.edu Suvrit Sra MIT suvrit@mit.edu Abstract We study probability measures induced by set functions with constraints. Such measures arise in a variety of real-world settings, where prior knowledge, resource limitations, or other pragmatic considerations impose constraints. We consider the task of rapidly sampling from such constrained measures, and develop fast Markov chain samplers for them. Our first main result is for MCMC sampling from Strongly Rayleigh (SR) measures, for which we present sharp polynomial bounds on the mixing time. As a corollary, this result yields a fast mixing sampler for Determinantal Point Processes (DPPs), yielding (to our knowledge) the first provably fast MCMC sampler for DPPs since their inception over four decades ago. Beyond SR measures, we develop MCMC samplers for probabilistic models with hard constraints and identify sufficient conditions under which their chains mix rapidly. We illustrate our claims by empirically verifying the dependence of mixing times on the key factors governing our theoretical bounds. 1 Introduction Distributions over subsets of objects arise in a variety of machine learning applications. They occur as discrete probabilistic models [5, 20, 28, 36, 38] in computer vision, computational biology and natural language processing. They also occur in combinatorial bandit learning [9], as well as in recent applications to neural network compression [32] and matrix approximations [29]. Yet, practical use of discrete distributions can be hampered by computational challenges due to their combinatorial nature. Consider for instance sampling, a task fundamental to learning, optimization, and approximation. Without further restrictions, efficient sampling can be impossible [13]. Several lines of work thus focus on identifying tractable sub-classes, which in turn have had wide-ranging impacts on modeling and algorithms. Important examples include the Ising model [22], matchings (and the matrix permanent) [23], spanning trees (and graph algorithms) [2, 6, 16, 37], and Determinantal Point Processes (DPPs) that have gained substantial attention in machine learning [3, 17, 24, 26, 28, 30]. In this work, we extend the classes of tractable discrete distributions. Specifically, we consider the following two classes of distributions on 2V (the set of subsets of a ground set V = [N] := {1, . . . , N}): (1) strongly Rayleigh (SR) measures, and (2) distributions with certain cardinality or matroid-constraints. We analyze Markov chains for sampling from both classes. As a byproduct of our analysis, we answer a long-standing question about rapid mixing of MCMC sampling from DPPs. SR measures are defined by strong negative correlations, and have recently emerged as valuable tools in the design of algorithms [2], in the theory of polynomials and combinatorics [4], and in machine learning through DPPs, a special case of SR distributions. Our first main result is the first polynomial-time sampling algorithm that applies to all SR measures (and thus a fortiori to DPPs). General distributions on 2V with constrained support (case (2) above) typically arise upon incorporating prior knowledge or resource constraints. We focus on resource constraints such as bounds on 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. cardinality and bounds on including limited items from sub-groups. Such constraints can be phrased as a family C ✓2V of subsets; we say S satisfies the constraint C iff S 2 C. Then the distribution of interest is of the form ⇡C(S) / exp(βF(S))JS 2 CK, (1.1) where F : 2V ! R is a set function that encodes relationships between items i 2 V , J·K is the Iverson bracket, and β a constant (also referred to as the inverse temperature). Most prior work on sampling with combinatorial constraints (such as sampling the bases of a matroid), assumes that F breaks up linearly using element-wise weights wi, i.e., F(S) = P i2S wi. In contrast, we allow generic, nonlinear functions, and obtain a mixing times governed by structural properties of F. Contributions. We briefly summarize the key contributions of this paper below. – We derive a provably fast mixing Markov chain for efficient sampling from strongly Rayleigh measure ⇡(Theorem 2). This Markov chain is novel and may be of independent interest. Our results provide the first polynomial guarantee (to our knoweldge) for Markov chain sampling from a general DPP, and more generally from an SR distribution.1 – We analyze (Theorem 4) mixing times of an exchange chain when the constraint family C is the set of bases of a special matroid, i.e., |S| = k or S obeys a partition constraint. Both of these constraints have high practical relevance [25, 27, 38]. – We analyze (Theorem 6) mixing times of an add-delete chain for the case |S| k, which, perhaps surprisingly, turns out to be quite different from |S| = k. This constraint can be more practical than the strict choice |S| = k, because in many applications, the user may have an upper bound on the budget, but may not necessarily want to expend all k units. Finally, a detailed set of experiments illustrates our theoretical results. Related work. Recent work in machine learning addresses sampling from distributions with sub- or supermodular F [19, 34], determinantal point processes [3, 29], and sampling by optimization [14, 31]. Many of these works (necessarily) make additional assumptions on ⇡C, or are approximate, or cannot handle constraints. Moreover, the constraints cannot easily be included in F: an out-of-the-box application of the result in [19], for instance, would lead to an unbounded constant in the mixing time. Apart from sampling, other related tracts include work on variational inference for combinatorial distributions [5, 11, 36, 38] and inference for submodular processes [21]. Special instances of (1.1) include [27], where the authors limit DPPs to sets that satisfy |S| = k; partition matroid constraints are studied in [25], while the budget constraint |S| k has been used recently in learning DPPs [17]. Important existing results show fast mixing for a sub-family of strongly Rayleigh distributions [3, 15]; but those results do not include, for instance, general DPPs. 1.1 Background and Formal Setup Before describing the details of our new contributions, let us briefly recall some useful background that also serves to set the notation. Our focus is on sampling from ⇡C in (1.1); we denote by Z = P S✓V exp(βF(S)) and ZC = P S✓C exp(βF(S)). The simplest example of ⇡C is the uniform distribution over sets in C, where F(S) is constant. In general, F may be highly nonlinear. We sample from ⇡C using MCMC, i.e., we run a Markov Chain with state space C. All our chains are ergodic. The mixing time of the chain indicates the number of iterations t that we must perform (after starting from an arbitrary set X0 2 C) before we can consider Xt as a valid sample from ⇡C. Formally, if δX0(t) is the total variation distance between the distribution of Xt and ⇡C after t steps, then ⌧X0(") = min{t : δX0(t0) ", 8t0 ≥t} is the mixing time to sample from a distribution ✏-close to ⇡C in terms of total variation distance. We say that the chain mixes fast if ⌧X0 is polynomial in N. The mixing time can be bounded in terms of the eigenvalues of the transition matrix, as the following classic result shows: Theorem 1 (Mixing Time [10]). Let λi be the eigenvalues of the transition matrix, and λmax = max{λ2, |λN|} < 1. Then, the mixing time starting from an initial set X0 2 C is bounded as ⌧X0(") (1 −λmax)−1(log ⇡C(X0)−1 + log "−1). 1The analysis in [24] is not correct since it relies on a wrong construction of path coupling. 2 Most of the effort in bounding mixing times hence is devoted to bounding this eigenvalue. 2 Sampling from Strongly Rayleigh Distributions In this section, we consider sampling from strongly Rayleigh (SR) distributions. Such distributions capture the strongest form of negative dependence properties, while enjoying a host of other remarkable properties [4]. For instance, they include the widely used DPPs as a special case. A distribution is SR if its generating polynomial p⇡: CN ! C, p⇡(z) = P S✓V ⇡(S) Q i2S zi is real stable. This means if =(zi) > 0 for all arguments zi of p⇡(z), then p⇡(z) > 0. We show in particular that SR distributions are amenable to efficient Markov chain sampling. Our starting point is the observation of [4] on closure properties of SR measures; of these we use symmetric homogenization. Given a distribution ⇡on 2[N], its symmetric homogenization ⇡sh on 2[2N] is ⇡sh(S) := ( ⇡(S \ [N]) $ N S\[N] %−1 if |S| = N; 0 otherwise. If ⇡is SR, so is ⇡sh. We use this property below in our derivation of a fast-mixing chain. We use here a recent result of Anari et al. [3], who show a Markov chain that mixes rapidly for homogeneous SR distributions. These distributions are over all subsets S ✓V of some fixed size |S| = k, and hence do not include general DPPs. Concretely, for any k-homogeneous SR distribution ⇡: {0, 1}N ! R+, a Gibbs-exchange sampler has mixing time ⌧X0(") 2k(N −k)(log ⇡(X0)−1 + log "−1). This sampler uniformly samples one item in the current set, and one outside the current set, and swaps them with an appropriate probability. Using these ideas we show how to obtain fast mixing chains for any general SR distribution ⇡on [N]. First, we construct its symmetric homogenization ⇡sh, and sample from ⇡sh using a Gibbs-exchange sampler. This chain is fast mixing, thus we will efficiently get a sample T ⇠⇡sh. The corresponding sample for ⇡can be then obtained by computing S = T \ V . Theorem 2, proved in the appendix, formally establishes the validity of this idea. Theorem 2. If ⇡is SR, then the mixing time of a Gibbs-exchange sampler for ⇡sh is bounded as ⌧X0(") 2N 2⇣ log ✓N |X0| ◆ + log(⇡(X0))−1 + log "−1⌘ . (2.1) For Theorem 2 we may choose the initial set such that X0 makes the first term in the sum logarithmic in N (X0 = T0 \ V in Algorithm 1). Algorithm 1 Markov Chain for Strongly Rayleigh Distributions Require: SR distribution ⇡ Initialize T ✓[2N] where |T| = N and take S = T \ V while not mixed do Draw q ⇠Unif [0, 1] Draw t 2 V \S and s 2 S uniformly at random if q 2 [0, (N−|S|)2 2N2 ) then S = S [ {t} with probability min{1, ⇡(S[{t}) ⇡(S) ⇥|S|+1 N−|S|} . Add t else if q 2 [ (N−|S|)2 2N2 , N−|S| 2N ) then S = S [ {t}\{s} with probability min{1, ⇡(S[{t}\{s}) ⇡(S) } . Exchange s with t else if q 2 [ N−|S| 2N , |S|2+N(N−|S|) 2N2 ) then S = S\{s} with probability min{1, ⇡(S\{s}) ⇡(S) ⇥ |S| N−|S|+1} . Delete s else Do nothing end if end while Efficient Implementation. Directly running a chain to sample N items from a (doubled) set of size 2N adds some computational overhead. Hence, we construct an equivalent, more space-efficient 3 chain (Algorithm 1) on the initial ground set V = [N] that only manintains S ✓V . Interestingly, this sampler is a mixture of add-delete and Gibbs-exchange samplers. This combination makes sense intuitively, too: add-delete moves (also shown in Alg. 3) are needed since the exchange sampler cannot change the cardinality of S. But a pure add-delete chain can stall if the sets concentrate around a fixed cardinality (low probability of a larger or smaller set). Exchange moves will not suffer the same high rejection rates. The key idea underlying Algorithm 1 is that the elements in {N + 1, . . . , 2N} are indistinguishable, so it suffices to maintain merely the cardinality of the currently selected subset instead of all its indices. Appendix C contains a detailed proof. Corollary 3. The bound (2.1) applies to the mixing time of Algorithm 1. Remarks. By assuming ⇡is SR, we obtain a clean bound for fast mixing. Compared to the bound in [19], our result avoids the somewhat opaque factor exp(β⇣F ) that depends on F. In certain cases, the above chain may mix slower in practice than a pure add-delete chain that was used in previous works [19, 24], since its probability of doing nothing is higher. In other cases, it mixes much faster than the pure add-delete chain; we observe both phenomena in our experiments in Sec. 4. Contrary to a simple add-delete chain, in all cases, it is guaranteed to mix well. 3 Sampling from Matroid-Constrained Distributions In this section we consider sampling from an explicitly-constrained distribution ⇡C where C specifies certain matroid base constraints (§3.1) or a uniform matroid of a given rank (§3.2). 3.1 Matroid Base Constraints We begin with constraints that are special cases of matroid bases2: 1. Uniform matroid: C = {S ✓V | |S| = k}, 2. Partition matroid: Given a partition V = Sk i=1 Pi, we allow sets that contain exactly one element from each Pi: C = {S ✓V | |S \ Pi| = 1 for all 1 i k}. An important special case of a distribution with a uniform matroid constraint is the k-DPP [27]. Partition matroids are used in multilabel problems [38], and also in probabilistic diversity models [21]. Algorithm 2 Gibbs Exchange Sampler for Matroid Bases Require: set function F, β, matroid C ✓2V Initialize S 2 C while not mixed do Let b = 1 with probability 0.5 if b = 1 then Draw s 2 S and t 2 V \S (t 2 P(s) \ {s}) uniformly at random if S [ {t}\{s} 2 C then S S [ {t}\{s} with probability ⇡C(S[{t}\{s}) ⇡C(S)+⇡C(S[{t}\{s}) end if end if end while The sampler is shown in Algorithm 2. At each iteration, we randomly select an item s 2 S and t 2 V \S such that the new set S [ {t}\{s} satisfies C, and swap them with certain probability. For uniform matroids, this means t 2 V \S; for partition matroids, t 2 P(s) \ {s} where P(s) is the part that s resides in. The fact that the chain has stationary distribution ⇡C can be inferred via detailed balance. Similar to the analysis in [19] for unconstrained sampling, the mixing time depends on a quantity that measures how much F deviates from linearity: ⇣F = maxS,T 2C |F(S) + F(T) − F(S \ T) −F(S [ T)|. Our proof, however, differs from that of [19]. While they use canonical paths [10], we use multicommodity flows, which are more effective in our constrained setting. Theorem 4. Consider the chain in Algorithm 2. For the uniform matroid, ⌧X0(") is bounded as ⌧X0(") 4k(N −k) exp(β(2⇣F ))(log ⇡C(X0)−1 + log "−1); (3.1) 2Drawing even a uniform sample from the bases of an arbitrary matroid can be hard. 4 For the partition matroid, the mixing time is bounded as ⌧X0(") 4k2 max i |Pi| exp(β(2⇣F ))(log ⇡C(X0)−1 + log "−1). (3.2) Observe that if Pi’s form an equipartition, i.e., |Pi| = N/k for all i, then the second bound becomes e O(kN). For k = O(log N), the mixing times depend as O(Npolylog(N)) = e O(N) on N. For uniform matroids, the time is equally small if k is close to N. Finally, the time depends on the initialization, ⇡C(X0). If F is monotone increasing, one may run a simple greedy algorithm to ensure that ⇡C(X0) is large. If F is monotone submodular, this ensures that log ⇡C(X0)−1 = O(log N). Our proof uses a multicommodity flow to upper bound the largest eigenvalue of the transition matrix. Concretely, let H be the set of all simple paths between states in the state graph of Markov chain, we construct a flow f : H ! R+ that assigns a nonnegative flow value to any simple path between any two states (sets) X, Y 2 C. Each edge e = (S, T) in the graph has a capacity Q(e) = ⇡C(S)P(S, T) where P(S, T) is the transition probability from S to T. The total flow sent from X to Y must be ⇡C(X)⇡C(Y ): if HXY is the set of all simple paths from X to Y , then we need P p2HXY f(p) = ⇡C(X)⇡C(Y ). Intuitively, the mixing time relates to the congestion in any edge, and the length of the paths. If there are many short paths X Y across which flow can be distributed, then mixing is fast. This intuition is captured in a fundamental theorem: Theorem 5 (Multicommodity Flow [35]). Let E be the set of edges in the transition graph, and P(X, Y ) the transition probability. Define ⇢(f) = max e2E 1 Q(e) X p3e f(p)len(p), where len(p) the length of the path p. Then λmax 1 −1/⇢(f). With this property of multicommodity flow, we are ready to prove Thm. 4. Proof. (Theorem 4) We sketch the proof for partition matroids; the full proofs is in Appendix A. For any two sets X, Y 2 C, we distribute the flow equally across all shortest paths X Y in the transition graph and bound the amount of flow through any edge e 2 E. Consider two arbitrary sets X, Y 2 C with symmetric difference |X ⊕Y | = 2m 2k, i.e., m elements need to be exchanged to reach from X to Y . However, these m steps are a valid path in the transition graph only if every set S along the way is in C. The exchange property of matroids implies that this requirement is indeed true, so any shortest path X Y has length m. Moreover, there are exactly m! such paths, since we can exchange the elements in X \ Y in any order to reach at Y . Note that once we choose s 2 X \ Y to swap out, there is only one choice t 2 Y \ X to swap in, where t lies in the same part as s in the partition matroid, otherwise the constraint will be violated. Since the total flow is ⇡C(X)⇡C(Y ), each path receives ⇡C(X)⇡C(Y )/m! flow. Next, let e = (S, T) be any edge on some shortest path X Y ; so S, T 2 C and T = S [ {j}\{i} for some i, j 2 V . Let 2r = |X ⊕S| < 2m be the length of the shortest path X S, i.e., r elements need to be exchanged to reach from X to S. Similarly, m −r −1 elements are exchanged to reach from T to Y . Since there is a path for every permutation of those elements, the ratio of the total flow we(X, Y ) that edge e receives from pair X, Y , and Q(e), becomes we(X, Y ) Q(e) 2r!(m −1 −r)!kL m!ZC exp(2β⇣F )(exp(βF(σS(X, Y ))) + exp(βF(σT (X, Y )))), (3.3) where we define σS(X, Y ) = X ⊕Y ⊕S = (X \Y \S)[(X \(Y [S))[(Y \(X [S)). To bound the total flow, we must count the pairs X, Y such that e is on their shortest path(s), and bound the flow they send. We do this in two steps, first summing over all (X, Y )’s that share the upper bound (3.3) since they have the same difference sets US = σS(X, Y ) and UT = σT (X, Y ), and then we sum over all possible US and UT . For fixed US, UT , there are $m−1 r % pairs that share those difference sets, since the only freedom we have is to assign r of the m −1 elements in S \ (X \ Y \ S) to Y , and the rest to X. Hence, for fixed US, UT . Appropriate summing and canceling then yields X (X,Y ): σS(X,Y )=US, σT (X,Y )=UT we(X, Y ) Q(e) 2kL ZC exp(2β⇣F )(exp(βF(US)) + exp(βF(UT ))). (3.4) 5 Finally, we sum over all valid US (UT is determined by US). One can show that any valid US 2 C, and hence P US exp(βF(US)) ZC, and likewise for UT . Hence, summing the bound (3.4) over all possible choices of US yields ⇢(f) 4kL exp(2β⇣F ) max p len(p) 4k2L exp(2β⇣F ), where we upper bound the length of any shortest path by k, since m k. Hence ⌧X0(") 4k2L exp(2β⇣F )(log ⇡(X0)−1 + log "−1). For more restrictive constraints, there are fewer paths, and the bounds can become larger. Appendix A shows the general dependence on k (as k!). It is also interesting to compare the bound on uniform matroid in Eq. (3.1) to that shown in [3] for a sub-class of distributions that satisfy the property of being homogeneous strongly Rayleigh3. If ⇡C is homogeneous strongly Rayleigh, we have ⌧X0(") 2k(N −k)(log ⇡C(X0)−1 + log "−1). In our analysis, without additional assumptions on ⇡C, we pay a factor of 2 exp(2β⇣F )) for generality. This factor is one for some strongly Rayleigh distributions (e.g., if F is modular), but not for all. 3.2 Uniform Matroid Constraint We consider constraints that is a uniform matroid of certain rank: C = {S : |S| k}. We employ the lazy add-delete Markov chain in Algo. 3, where in each iteration, with probability 0.5 we uniformly randomly sample one element from V and either add it to or delete it from the current set, while respecting constraints. To show fast mixing, we consider using path coupling, which essentially says that if we have a contraction of two (coupling) chains then we have fast mixing. We construct path coupling (S, T) ! (S0, T 0) on a carefully generated graph with edges E (from a proper metric). With all details in Appendix B we end up with the following theorem: Theorem 6. Consider the chain shown in Algorithm 3. Let ↵= max(S,T )2E{↵1, ↵2} where ↵1 and ↵2 are functions of edges (S, T) 2 E and are defined as ↵1 =1 − X i2T |p−(T, i) −p−(S, i)|+ −J|S| < kK X i2[N]\S(p+(S, i) −p+(T, i))+; ↵2 = min{p−(S, s), p−(T, t)} − X i2R |p−(S, i) −p−(T, i)|+ J|S| < kK(min{p+(S, t), p+(T, s)} − X i2[N]\(S[T ) |p+(S, i) −p+(T, i)|), where (x)+ = max(0, x). The summations over absolute differences quantify the sensitivity of transition probabilities to adding/deleting elements in neighboring (S, T). Assuming ↵< 1, we get ⌧(") 2N log(N"−1) 1 −↵ Algorithm 3 Gibbs Add-Delete Markov Chain for Uniform Matroid Require: F the set function, β the inverse temperature, V the ground set, k the rank of C Ensure: S sampled from ⇡C Initialize S 2 C while not mixed do Let b = 1 with probability 0.5 if b = 1 then Draw s 2 V uniformly randomly if s /2 S and |S [ {s}| k then S S [ {s} with probability p+(S, s) = ⇡C(S[{s}) ⇡C(S)+⇡C(S[{s}) else S S\{s} with probability p−(S, s) = ⇡C(S\{s}) ⇡C(S)+⇡C(S\{s}) end if end if end while Remarks. If ↵is less than 1 and independent of N, then the mixing time is nearly linear in N. The condition is conceptually similar to those in [29, 34]. The fast mixing requires both ↵1 and ↵2, specifically, the change in probability when adding or deleting single element to neighboring subsets, to be small. Such notion is closely related to the curvature of discrete set functions. 3Appendix C contains details about strongly Rayleigh distributions. 6 4 Experiments We next empirically study the dependence of sampling times on key factors that govern our theoretical bounds. In particular, we run Markov chains on chain-structured Ising models on a partition matroid base and DPPs on a uniform matroid, and consider estimating marginal and conditional probabilities of a single variable. To monitor the convergence of Markov chains, we use potential scale reduction factor (PSRF) [7, 18] that runs several chains in parallel and compares within-chain variances to between-chain variances. Typically, PSRF is greater than 1 and will converge to 1 in the limit; if it is close to 1 we empirically conclude that chains have mixed well. Throughout experiments we run 10 chains in parallel for estimations, and declare “convergence” at a PSRF of 1.05. We first focus on small synthetic examples where we can compute exact marginal and conditional probabilities. We construct a 20-variable chain-structured Ising model as ⇡C(S) / exp ⇣ β ⇣⇣ δ X19 i=1 wi(si ⊕si+1) ⌘ + (1 −δ)|S| ⌘⌘ JS 2 CK, where the si are 0-1 encodings of S, and the wi are drawn uniformly randomly from [0, 1]. The parameters (β, δ) govern bounds on the mixing time via exp(2β⇣F ); the smaller δ, the smaller ⇣F . C is a partition matroid of rank 5. We estimate conditional probabilities of one random variable conditioned on 0, 1 and 2 other variables and compare against the ground truth. We set (β, δ) to be (1, 1), (3, 1) and (3, 0.5) and results are shown in Fig. 1. All marginals and conditionals converge to their true values, but with different speed. Comparing Fig. 1a against 1b, we observe that with fixed δ, increase in β slows down the convergence, as expected. Comparing Fig. 1b against 1c, we observe that with fixed β, decrease in δ speeds up the convergence, also as expected given our theoretical results. Appendix D.1 and D.2 illustrate the convergence of estimations under other (β, δ) settings. # Iter ×104 0 0.5 1 1.5 2 Error 0 0.05 0.1 0.15 Convergence for Inference Marg Cond-1 Cond-2 (a) (β, δ) = (1, 1) # Iter ×104 0 1 2 3 4 5 Error 0 0.05 0.1 0.15 Convergence for Inference Marg Cond-1 Cond-2 (b) (β, δ) = (3, 1) # Iter ×104 0 1 2 3 4 5 Error 0 0.05 0.1 0.15 Convergence for Inference Marg Cond-1 Cond-2 (c) (β, δ) = (3, 0.5) Figure 1: Convergence of marginal (Marg) and conditional (Cond-1 and Cond-2, conditioned on 1 and 2 other variables) probabilities of a single variable in a 20-variable Ising model with different (β, δ). Full lines show the means and dotted lines the standard deviations of estimations. We also check convergence on larger models. We use a DPP on a uniform matroid of rank 30 on the Ailerons data (http://www.dcc.fc.up.pt/657~ltorgo/Regression/DataSets. html) of size 200. Here, we do not have access to the ground truth, and hence plot the estimation mean with standard deviations among 10 chains in 3a. We observe that the chains will eventually converge, i.e., the mean becomes stable and variance small. We also use PSRF to approximately judge the convergence. More results can be found in Appendix D.3. Furthermore, the mixing time depends on the size N of the ground set. We use a DPP on Ailerons and vary N from 50 to 1000. Fig. 2a shows the PSRF from 10 chains for each setting. By thresholding PSRF at 1.05 in Fig. 2b we see a clearer dependence on N. At this scale, the mixing time grows almost linearly with N, indicating that this chain is efficient at least at small to medium scale. Finally, we empirically study how fast our sampler on strongly Rayleigh distribution converges. We compare the chain in Algorithm 1 (Mix) against a simple add-delete chain (Add-Delete). We use a DPP on Ailerons data4 of size 200, and the corresponding PSRF is shown in Fig. 3b. We observe that Mix converges slightly slower than Add-Delete since it is lazier. However, the Add-Delete chain does not always mix fast. Fig. 3c illustrates a different setting, where we modify the eigenspectrum of the kernel matrix: the first 100 eigenvalues are 500 and others 1/500. Such a kernel corresponds to 4http://www.dcc.fc.up.pt/657~ltorgo/Regression/DataSets.html 7 # Iter ×104 0 1 2 3 4 5 6 7 8 9 10 PSRF 1 1.1 1.2 1.3 1.4 1.5 Potential Scale Reduction Factor N=50 N=100 N=200 N=300 N=500 N=1000 (a) Data Size 0 200 400 600 800 1000 # Iters ×104 0 1 2 3 4 5 6 7 Approximate Mixing Time (b) Figure 2: Empirical mixing time analysis when varying dataset sizes, (a) PSRF’s for each set of chains, (b) Approximate mixing time obtained by thresholding PSRF at 1.05. almost an elementary DPP, where the size of the observed subsets sharply concentrates around 100. Here, Add-Delete moves very slowly. Mix, in contrast, has the ability of exchanging elements and thus converges way faster than Add-Delete. # Iter ×104 0 0.5 1 1.5 2 Val -0.2 -0.1 0 0.1 0.2 0.3 0.4 0.5 0.6 Convergence for Inference Marg Cond-5 Cond-10 (a) # Iter ×104 0 2 4 6 8 10 PSRF 1 1.05 1.1 1.15 1.2 1.25 1.3 Potential Scale Reduction Factor Add-Delete Mix (b) # Iter ×104 0 2 4 6 8 10 PSRF 1 1.05 1.1 1.15 1.2 1.25 1.3 Potential Scale Reduction Factor Add-Delete Mix (c) Figure 3: (a) Convergence of marginal and conditional probabilities by DPP on uniform matroid, (b,c) comparison between add-delete chain (Algorithm 3) and projection chain (Algorithm 1) for two instances: slowly decaying spectrum and sharp step in the spectrum. 5 Discussion and Open Problems We presented theoretical results on Markov chain sampling for discrete probabilistic models subject to implicit and explicit constraints. In particular, under an implicit constraint that the probability measure is strongly Rayleigh, we obtain an unconditional fast mixing guarantee. For distributions with various explicit constraints we showed sufficient conditions for fast mixing. We show empirically that the dependencies of mixing times on various factors are consistent with our theoretical analysis. There still exist many open problems in both implicitly- and explicitly-constrained settings. Many bounds that we show depend on structural quantities (⇣F or ↵) that may not always be easy to quantify in practice. It will be valuable to develop chains on special classes of distributions (like we did for strongly Rayleigh) whose mixing time is independent of these factors. Moreover, we only considered matroid bases or uniform matroids, while several important settings such as knapsack constraints remain open. In fact, even uniform sampling with a knapsack constraint is not easy; a mixing time of O(N 4.5) is known [33]. We defer the development of similar or better bounds, potentially with structural factors like exp(β⇣F ), on specialized discrete probabilistic models as our future work. Acknowledgements. This research was partially supported by NSF CAREER 1553284 and a Google Research Award. 8 References [1] D. J. Aldous. Some inequalities for reversible Markov chains. Journal of the London Mathematical Society, pages 564–576, 1982. [2] N. Anari and S. O. Gharan. Effective-resistance-reducing flows and asymmetric tsp. In FOCS, 2015. [3] N. Anari, S. O. Gharan, and A. Rezaei. Monte Carlo Markov chain algorithms for sampling strongly Rayleigh distributions and determinantal point processes. In COLT, 2016. [4] J. Borcea, P. Brändén, and T. Liggett. Negative dependence and the geometry of polynomials. Journal of the American Mathematical Society, pages 521–567, 2009. [5] A. Bouchard-Côté and M. I. Jordan. Variational inference over combinatorial spaces. In NIPS, 2010. [6] A. Broder. Generating random spanning trees. In FOCS, pages 442–447, 1989. [7] S. P. Brooks and A. Gelman. General methods for monitoring convergence of iterative simulations. Journal of computational and graphical statistics, pages 434–455, 1998. [8] R. Bubley and M. Dyer. Path coupling: A technique for proving rapid mixing in Markov chains. In FOCS, pages 223–231, 1997. [9] N. Cesa-Bianchi and G. Lugosi. Combinatorial bandits. In COLT, 2009. [10] P. Diaconis and D. Stroock. Geometric bounds for eigenvalues of Markov chains. The Annals of Applied Probability, pages 36–61, 1991. [11] J. Djolonga and A. Krause. From MAP to marginals: Variational inference in bayesian submodular models. In NIPS, pages 244–252, 2014. [12] M. Dyer and C. Greenhill. A more rapidly mixing Markov chain for graph colorings. Random Structures and Algorithms, pages 285–317, 1998. [13] M. Dyer, A. Frieze, and M. Jerrum. On counting independent sets in sparse graphs. In FOCS, 1999. [14] S. Ermon, C. P. Gomes, A. Sabharwal, and B. Selman. Embed and project: Discrete sampling with universal hashing. In NIPS, pages 2085–2093, 2013. [15] T. Feder and M. Mihail. Balanced matroids. In STOC, pages 26–38, 1992. [16] A. Frieze, N. Goyal, L. Rademacher, and S. Vempala. Expanders via random spanning trees. SIAM Journal on Computing, 43(2):497–513, 2014. [17] M. Gartrell, U. Paquet, and N. Koenigstein. Low-rank factorization of determinantal point processes for recommendation. arXiv:1602.05436, 2016. [18] A. Gelman and D. B. Rubin. Inference from iterative simulation using multiple sequences. Statistical science, pages 457–472, 1992. [19] A. Gotovos, H. Hassani, and A. Krause. Sampling from probabilistic submodular models. In NIPS, 2015. [20] D. M. Greig, B. T. Porteous, and A. H. Seheult. Exact maximum a posteriori estimation for binary images. Journal of the Royal Statistical Society, 1989. [21] R. Iyer and J. Bilmes. Submodular point processes. In AISTATS, 2015. [22] M. Jerrum and A. Sinclair. Polynomial-time approximation algorithms for the Ising model. SIAM J. Computing, 1993. [23] M. Jerrum, A. Sinclair, and E. Vigoda. A polynomial-time approximation algorithm for the permanent of a matrix with nonnegative entries. JACM, 2004. [24] B. Kang. Fast determinantal point process sampling with application to clustering. In NIPS, pages 2319–2327, 2013. [25] T. Kathuria and A. Deshpande. On sampling from constrained diversity promoting point processes. 2016. [26] M. Kojima and F. Komaki. Determinantal point process priors for Bayesian variable selection in linear regression. arXiv:1406.2100, 2014. [27] A. Kulesza and B. Taskar. k-DPPs: Fixed-size determinantal point processes. In ICML, pages 1193–1200, 2011. [28] A. Kulesza and B. Taskar. Determinantal point processes for machine learning. arXiv preprint arXiv:1207.6083, 2012. [29] C. Li, S. Jegelka, and S. Sra. Fast DPP sampling for Nyström with application to kernel methods. In ICML, 2016. [30] C. Li, S. Sra, and S. Jegelka. Gaussian quadrature for matrix inverse forms with applications. In ICML, 2016. [31] C. J. Maddison, D. Tarlow, and T. Minka. A* sampling. In NIPS, 2014. [32] Z. Mariet and S. Sra. Diversity networks. In ICLR, 2016. [33] B. Morris and A. Sinclair. Random walks on truncated cubes and sampling 0-1 knapsack solutions. SIAM journal on computing, pages 195–226, 2004. [34] P. Rebeschini and A. Karbasi. Fast mixing for discrete point processes. In COLT, 2015. [35] A. Sinclair. Improved bounds for mixing rates of Markov chains and multicommodity flow. Combinatorics, probability and Computing, pages 351–370, 1992. [36] D. Smith and J. Eisner. Dependency parsing by belief propagation. In EMNLP, 2008. [37] D. Spielman and N. Srivastava. Graph sparsification by effective resistances. In STOC, 2008. [38] J. Zhang, J. Djolonga, and A. Krause. Higher-order inference for multi-class log-supermodular models. In ICCV, pages 1859–1867, 2015. 9
2016
307
6,225
Temporal Regularized Matrix Factorization for High-dimensional Time Series Prediction Hsiang-Fu Yu University of Texas at Austin rofuyu@cs.utexas.edu Nikhil Rao Technicolor Research nikhilrao86@gmail.com Inderjit S. Dhillon University of Texas at Austin inderjit@cs.utexas.edu Abstract Time series prediction problems are becoming increasingly high-dimensional in modern applications, such as climatology and demand forecasting. For example, in the latter problem, the number of items for which demand needs to be forecast might be as large as 50,000. In addition, the data is generally noisy and full of missing values. Thus, modern applications require methods that are highly scalable, and can deal with noisy data in terms of corruptions or missing values. However, classical time series methods usually fall short of handling these issues. In this paper, we present a temporal regularized matrix factorization (TRMF) framework which supports data-driven temporal learning and forecasting. We develop novel regularization schemes and use scalable matrix factorization methods that are eminently suited for high-dimensional time series data that has many missing values. Our proposed TRMF is highly general, and subsumes many existing approaches for time series analysis. We make interesting connections to graph regularization methods in the context of learning the dependencies in an autoregressive framework. Experimental results show the superiority of TRMF in terms of scalability and prediction quality. In particular, TRMF is two orders of magnitude faster than other methods on a problem of dimension 50,000, and generates better forecasts on real-world datasets such as Wal-mart E-commerce datasets. 1 Introduction Time series analysis is a central problem in many applications such as demand forecasting and climatology. Often, such applications require methods that are highly scalable to handle a very large number (n) of possibly inter-dependent one-dimensional time series and/or have a large time frame (T). For example, climatology applications involve data collected from possibly thousands of sensors, every hour (or less) over several years. Similarly, a store tracking its inventory would track thousands of items every day for multiple years. Not only is the scale of such problems huge, but they might also involve missing values, due to sensor malfunctions, occlusions or simple human errors. Thus, modern time series applications present two challenges to practitioners: scalability to handle large n and T and the flexibility to handle missing values. Most approaches in the traditional time series literature such as autoregressive (AR) models or dynamic linear models (DLM)[7, 21] focus on low-dimensional time-series data and fall short of handling the two aforementioned issues. For example, an AR model of order L requires O(TL2n4 + L3n6) time to estimate O(Ln2) parameters, which is prohibitive even for moderate values of n. Similarly, Kalman filter based DLM approaches need O(kn2T + k3T) computation cost to update parameters, where k is the latent dimensionality, which is usually chosen to be larger than n in many situations [13]. As a specific example, the maximum likelihood estimator implementation in the widely used R-DLM package [12], which relies on a general optimization solver, cannot scale beyond 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. n in the tens. (See Appendix D for details). On the other hand, for models such as AR, the flexibility to handle missing values can also be very challenging even for one-dimensional time series [1], let alone the difficulty to handle high dimensional time series. A natural way to model high-dimensional time series data is in the form of a matrix, with rows corresponding to each one-dimensional time series and columns corresponding to time points. In light of the observation that n time series are usually highly correlated with each other, there have been some attempts to apply low-rank matrix factorization (MF) or matrix completion (MC) techniques to analyze high-dimensional time series [2, 14, 16, 23, 26]. Unlike the AR and DLM models above, state-of-the-art MF methods scale linearly in n, and hence can handle large datasets. Let Y 2 Rn⇥T be the matrix for the observed n-dimensional time series with Yit being the observation at the t-th time point of the i-th time series. Under the standard MF approach, Yit is estimated by the inner product f > i xt, where fi 2 Rk is a k-dimensional latent embedding for the i-th time series, and xt 2 Rk is a k-dimensional latent temporal embedding for the t-th time point. We can stack the xts into the columns into a matrix X 2 Rk⇥T and f > i into the rows of F 2 Rn⇥k (Figure 1) to get Y ⇡FX. We can then solve: min F,X X (i,t)2⌦ " Yit −f > i xt #2 + λfRf(F) + λxRx(X), (1) Items Y Time ⇡ F X Time- dependent variables f > i xt Ynew Xnew Figure 1: Matrix Factorization model for multiple time series. F captures features for each time series in the matrix Y , and X captures the latent and time-varying variables. where ⌦is the set of the observed entries. Rf(F), Rx(X) are regularizers for F and X, which usually play a role to avoid overfitting and/or to encourage some specific temporal structures among the embeddings. It is clear that the common choice of the regularizer Rx(X) = kXkF is no longer appropriate for time series applications, as it does not take into account the ordering among the temporal embeddings {xt}. Most existing MF approaches [2, 14, 16, 23, 26] adapt graph-based approaches to handle temporal dependencies. Specifically, the dependencies are described by a weighted similarity graph and incorporated through a Laplacian regularizer [18]. However, graph-based regularization fails in cases where there are negative correlations between two time points. Furthermore, unlike scenarios where explicit graph information is available with the data (such as a social network or product co-purchasing graph for recommender systems), explicit temporal dependency structure is usually unavailable and has to be inferred or approximated, which causes practitioners to either perform a separate procedure to estimate the dependencies or consider very short-term dependencies with simple fixed weights. Moreover, existing MF approaches, while yielding good estimations for missing values in past points, are poor in terms of forecasting future values, which is the problem of interest in time series analysis. In this paper, we propose a novel temporal regularized matrix factorization framework (TRMF) for high-dimensional time series analysis. In TRMF, we consider a principled approach to describe the structure of temporal dependencies among latent temporal embeddings {xt} and design a temporal regularizer to incorporate this temporal structure into the standard MF formulation. Unlike most existing MF approaches, our TRMF method supports data-driven temporal dependency learning and also brings the ability to forecast future values to a matrix factorization approach. In addition, inherited from the property of MF approaches, TRMF can easily handle high-dimensional time series data even in the presence of many missing values. As a specific example, we demonstrate a novel autoregressive temporal regularizer which encourages AR structure among temporal embeddings {xt}. We also make connections between the proposed regularization framework and graph-based approaches [18], where even negative correlations can be accounted for. This connection not only leads to better understanding about the dependency structure incorporated by our framework but also brings the benefit of using off-the-shelf efficient solvers such as GRALS [15] directly to solve TRMF. Paper Organization. In Section 2, we review the existing approaches and their limitations on data with temporal dependencies. We present the proposed TRMF framework in Section 3, and show that the method is highly general and can be used for a variety of time series applications. We introduce a novel AR temporal regularizer in Section 4, and make connections to graph-based regularization approaches. We demonstrate the superiority of the proposed approach via extensive experimental results in Section 5 and conclude the paper in Section 6. 2 2 Motivations: Existing Approaches and Limitations 2.1 Classical Time-Series Models Models such as AR and DLM are not suitable for modern multiple high-dimensional time series data (i.e., both n and T are large) due to their inherent computational inefficiency (see Section 1). To avoid overfitting in AR models, there have been studies with various structured transition matrices such as low rank and sparse matrices [5, 10, 11]. The focus of this research has been on obtaining better statistical guarantees. The scalability issue of AR models remains open. On the other hand, it is also challenging for many classic time-series models to deal with data that has many missing values [1]. In many situations where the model parameters are either given or designed by practitioners, the Kalman filter approach is used to perform forecasting, while the Kalman smoothing approach is used to impute missing entries. When model parameters are unknown, EM algorithms are applied to estimate both the model parameters and latent embeddings for DLM [3, 8, 9, 17, 19]. As most EM approaches for DLM contain the Kalman filter as a building block, they cannot scale to very high dimensional time series data. Indeed, as shown in Section 5, the popular R package for DLM’s does not scale beyond data with tens of dimensions. 2.2 Existing Matrix Factorization Approaches for Data with Temporal Dependencies In standard MF (1), the squared Frobenius norm Rx(X) = kXk2 F = PT t=1kxtk2 is usually the regularizer of choice for X. Because squared Frobenius norm assumes no dependencies among {xt}, standard MF formulation is invariant to column permutation and not applicable to data with temporal dependencies. Hence most existing temporal MF approaches turn to the framework of graph-based regularization [18] for temporally dependent {xt}, with a graph encoding the temporal dependencies. An exception is the work in [22], where the authors use specially designed regularizers to encourage a log-normal structure on the temporal coefficients. Graph regularization for temporal dependencies:The framework of graph-based regularization is an approach to describe and incorporate general dependencies among variables. Let G be a graph over {xt} and Gts be the edge weight between the t-th node and s-th node. A popular regularizer to include as part of an objective function is the following: Rx(X) = G(X | G, ⌘) := 1 2 X t⇠s Gtskxt −xsk2 + ⌘ 2 X t kxtk2, (2) t t −1 t −2 t −3 t −4 t + 1 · · · · · · w1 w4 w1 w4 w1 w1 w1 Figure 2: Graph-based regularization for temporal dependencies. where t ⇠s denotes an edge between t-th node and s-th node, and the second summation term is used to guarantee strong convexity. A large Gts will ensure that xt and xs are close to each other in Euclidean distance, when (2) is minimized. Note that to guarantee the convexity of G(X | G, ⌘), we need Gts ≥0. To apply graph-based regularizers to temporal dependencies, we need to specify the (repeating) dependency pattern by a lag set L and a weight vector w such that all the edges t ⇠s of distance l (i.e., |s −t| = l) share the same weight Gts = wl. See Figure 2 for an example with L = {1, 4}. Given L and w, the corresponding graph regularizer becomes G(X | G, ⌘)= 1 2 X l2L X t:t>l wl(xt −xt−l)2 + ⌘ 2 X t kxtk2. (3) This direct use of graph-based approach, while intuitive, has two issues: a) there might be negatively correlated dependencies between two time points; b) unlike many applications where such regularizers are used, the explicit temporal dependency structure is usually not available and has to be inferred. As a result, most existing approaches consider only very simple temporal dependencies such as a small size of L (e.g., L = {1}) and/or uniform weights (e.g., wl = 1, 8l 2 L). For example, a simple chain graph is considered to design the smoothing regularizer in TCF [23]. This leads to poor forecasting abilities of existing MF methods for large-scale time series applications. 2.3 Challenges to Learn Temporal Dependencies One could try to learn the weights wl automatically, by using the same regularizer as in (3) but with the weights unknown. This would lead to the following optimization problem: min F,X,w≥0 X (i,t)2⌦ " Yit −f > i xt #2+λfRf(F)+ λx 2 X l2L X t:t−l>0 wl(xt −xt−l)2+ λx⌘ 2 X t kxtk2, (4) where 0 is the zero vector, and w ≥0 is the constraint imposed by graph regularization. 3 It is not hard to see that the above optimization yields the trivial all-zero solution for w⇤, meaning the objective function is minimized when no temporal dependencies exist! To avoid the all zero solution, one might want to impose a simplex constraint on w (i.e., P l2L wl = 1). Again, it is not hard to see that this will result in w⇤being a 1-sparse vector, with wl⇤being 1, where l⇤= arg minl2L P t:t>l kxt −xt−lk2. Thus, looking to learn the weights automatically by simply plugging in the regularizer in the MF formulation is not a viable option. 3 Temporal Regularized Matrix Factorization In order to resolve the limitations mentioned in Sections 2.2 and 2.3, we propose the Temporal Regularized Matrix Factorization (TRMF) framework, which is a novel approach to incorporate temporal dependencies into matrix factorization models. Unlike the aforementioned graph-based approaches, we propose to use well-studied time series models to describe temporal dependencies among {xt} explicitly. Such models take the form: xt = M⇥({xt−l : l 2 L}) + ✏t, (5) where ✏t is a Gaussian noise vector, and M⇥is the time-series model parameterized by L and ⇥. L is a set containing the lag indices l, denoting a dependency between t-th and (t −l)-th time points, while ⇥captures the weighting information of temporal dependencies (such as the transition matrix in AR models). To incorporate the temporal dependency into the standard MF formulation (1), we propose to design a new regularizer TM(X | ⇥) which encourages the structure induced by M⇥. Taking a standard approach to model time series, we set TM(X | ⇥) be the negative log likelihood of observing a particular realization of the {xt} for a given model M⇥: TM(X | ⇥) = −log P(x1, . . . , xT | ⇥). (6) When ⇥is given, we can use Rx(X) = TM(X | ⇥) in the MF formulation (1) to encourage {xt} to follow the temporal dependency induced by M⇥. When the ⇥is unknown, we can treat ⇥as another set of variables and include another regularizer R✓(⇥) into (1): min F,X,⇥ X (i,t)2⌦ " Yit −f > i xt #2 + λfRf(F) + λxTM(X | ⇥) + λ✓R✓(⇥), (7) which be solved by an alternating minimization procedure over F, X, and ⇥. Data-driven Temporal Dependency Learning in TRMF:Recall that in Section 2.3, we showed that directly using graph based regularizers to incorporate temporal dependencies leads to trivial solutions for the weights. TRMF circumvents this issue. When F and X are fixed, (7) is reduced to: min ⇥ λxTM(X | ⇥) + λ✓R✓(⇥), (8) which is a maximum-a-posterior (MAP) estimation problem (in the Bayesian sense) to estimate the best ⇥for a given {xt} under the M⇥model. There are well-developed algorithms to solve (8) and obtain non-trivial ⇥. Thus, unlike most existing temporal matrix factorization approaches where the strength of dependencies is fixed, ⇥in TRMF can be learned automatically from data. Time Series Analysis with TRMF:We can see that TRMF (7) lends itself seamlessly to handle a variety of commonly encountered tasks in analyzing data with temporal dependency: • Time-series Forecasting: Once we have M⇥for latent embeddings {xt : 1, . . . , T}, we can use it to predict future latent embeddings {xt : t > T} and have the ability to obtain non-trivial forecasting results for yt = Fxt for t > T. • Missing-value Imputation: In some time-series applications, some entries in Y might be unobserved, for example, due to faulty sensors in electricity usage monitoring or occlusions in the case of motion recognition in video. We can use f > i xt to impute these missing entries, much like standard matrix completion, and is useful in recommender systems [23] and sensor networks [26]. Extensions to Incorporate Extra Information:Like matrix factorization, TRMF (7) can be extended to incorporate additional information. For example, pairwise relationships between the time series can be incorporated using structural regularizers on F. Furthermore, when features are known for the time series, we can make use of interaction models such as those in [6, 24, 25]. Also, TRMF can be extended to tensors. More details on these extensions can be found in Appendix B. 4 A Novel Autoregressive Temporal Regularizer In Section 3, we described the TRMF framework in a very general sense, with the regularizer TM(X | ⇥) incorporating dependencies specified by the time series model M⇥. In this section, we specialize this to the case of AR models, which are parameterized by a lag set L and weights W = % W (l) 2 Rk⇥k : l 2 L . Assume that xt is a noisy linear combination of some previous 4 points; that is, xt = P l2L W (l)xt−l + ✏t, where ✏t is a Gaussian noise vector. For simplicity, we assume that the ✏t ⇠N(0, σ2Ik), where Ik is the k ⇥k identity matrix1. The temporal regularizer TM(X | ⇥) corresponding to this AR model can be written as: TAR(X |L, W, ⌘) := 1 2 T X t=m '''''xt − X l2L W (l)xt−l ''''' 2 + ⌘ 2 X t kxtk2, (9) where m := 1 + L, L := max(L), and ⌘> 0 to guarantee the strong convexity of (9). TRMF allows us to learn the weights % W (l) when they are unknown. Since each W (l) 2 Rk⇥k, there will be |L|k2 variables to learn, which may lead to overfitting. To prevent this and to yield more interpretable results, we consider diagonal W (l), reducing the number of parameters to |L|k. To simplify notation, we use W to denote the k ⇥L matrix where the l-th column constitutes the diagonal elements of W (l). Note that for l /2 L, the l-th column of W is a zero vector. Let ¯x> r = [· · · , Xrt, · · · ] be the r-th row of X and ¯w> r = [· · · , Wrl, · · · ] be the r-th row of W. Then (9) can be written as TAR(X |L, W, ⌘) = Pk r=1 TAR(¯xr |L, ¯wr, ⌘), where we define TAR(¯x|L, ¯w, ⌘) = 1 2 T X t=m xt − X l2L wlxt−l !2 + ⌘ 2k¯xk2, (10) with xt being the t-th element of ¯x, and wl being the l-th element of ¯w. Correlations among Multiple Time Series. Even when % W l is diagonal, TRMF retains the power to capture the correlations among time series via the factors {fi}, since it has an effect only on the structure of latent embeddings {xt}. Indeed, as the i-th dimension of {yt} is modeled by f > i X in (7), the low rank F is a k dimensional latent embedding of multiple time series. This embedding captures correlations among multiple time series. Furthermore, {fi} acts as time series features, which can be used to perform classification/clustering even in the presence of missing values. Choice of Lag Index Set L. Unlike most approaches mentioned in Section 2.2, the choice of L in TRMF is more flexible. Thus, TRMF can provide important advantages: First, because there is no need to specify the weight parameters W, L can be chosen to be larger to account for long range dependencies, which also yields more accurate and robust forecasts. Second, the indices in L can be discontinuous so that one can easily embed domain knowledge about periodicity or seasonality. For example, one might consider L = {1, 2, 3, 51, 52, 53} for weekly data with a one year seasonality. Connections to Graph Regularization. We now establish connections between TAR(¯x|L, ¯w, ⌘) and graph regularization (2) for matrix factorization. Let ¯L := L [ {0}, w0 = −1 so that (10) is TAR(¯x|L, ¯w, ⌘) = 1 2 T X t=m 0 @X l2 ¯ L wlxt−l 1 A 2 + ⌘ 2k¯xk2, and let δ(d) := % l 2 ¯L : l −d 2 ¯L . We then have the following result: Theorem 1. Given a lag index set L, weight vector ¯w 2 RL, and ¯x 2 RT , there is a weighted signed graph GAR with T nodes and a diagonal matrix D 2 RT ⇥T such that TAR(¯x|L, ¯w, ⌘) = G "¯x | GAR, ⌘ # + 1 2 ¯x>D¯x, (11) where G "¯x | GAR, ⌘ # is the graph regularization (2) with G = GAR. Furthermore, 8t and d GAR t,t+d = 8 < : X l2δ(d) X mt+lT −wlwl−d if δ(d) 6= φ, 0 otherwise, and Dtt = 0 @X l2 ¯ L wl 1 A 0 @X l2 ¯ L wl[m t + l T] 1 A t t −1 t −2 t −3 t −4 t + 1 · · · · · · w1 w4 −w1w4 −w1w4 −w1w4 w1 w4 w1 w1 w1 Figure 3: The graph structure induced by the AR temporal regularizer (10) with L = {1, 4}. See Appendix C.1 for a detailed proof. From Theorem 1, we see that δ(d) is non-empty if and only if there are edges between time points separated by d in GAR. Thus, we can construct the dependency graph for TAR(¯x|L, ¯w, ⌘) by checking whether δ(d) is empty. Figure 3 demonstrates an example with L = {1, 4}. We can see that besides edges of distance d = 1 and d = 4, there are also edges of distance d = 3 (dotted edges in Figure 3) because 4 −3 2 ¯L and δ(3) = {4}. 1If the (known) covariance matrix is not identity, we can suitably modify the regularizer. 5 Table 1: Data statistics. synthetic electricity traffic walmart-1 walmart-2 n 16 370 963 1,350 1,582 T 128 26,304 10,560 187 187 missing ratio 0% 0% 0% 55.3% 49.3% Although Theorem 1 shows that AR-based regularizers are similar to the graph-based regularization framework, we note the following key differences: • The graph GAR in Theorem 1 contains both positive and negative edges. This implies that the AR temporal regularizer is able to support negative correlations, which the standard graph-based regularizer cannot. This can make G "¯x | GAR, ⌘ # non-convex. The addition of the second term in (11), however, still leads to a convex regularizer TAR(¯x|L, ¯w, ⌘). • Unlike (3) where there is freedom to specify a weight for each distance, in the graph GAR, the weight values for the edges are more structured (e.g., the weight for d = 3 in Figure 3 is −w1w4). Hence, minimization w.r.t. w0s is not trivial, and neither are the obtained solutions. Plugging TM(X | ⇥) = TAR(X |L, W, ⌘) into (7), we obtain the following problem: min F,X,W X (i,t)2⌦ " Yit −f > i xt #2 + λfRf(F) + k X r=1 λxTAR(¯xr |L, ¯wr, ⌘) + λwRw(W), (12) where Rw(W) is a regularizer for W. We will refer to (12) as TRMF-AR. We can apply alternating minimization to solve (12). In fact, solving for each variable reduces to well known methods, for which highly efficient algorithms exist: Updates for F. When X and W are fixed, the subproblem of updating F is the same as updating F while X fixed in (1). Thus, fast algorithms such as alternating least squares or coordinate descent can be applied directly to find F, which costs O(|⌦|k2) time. Updates for X. We solve arg minX P (i,t)2⌦ " Yit −f > i xt #2 + λx Pk r=1 TAR(¯xr |L, ¯wr, ⌘). From Theorem 1, we see that TAR(¯x|L, ¯w, ⌘) shares the same form as the graph regularizer, and we can apply GRALS [15] to find X, which costs O(|L|Tk2) time. Updates for W. How to update W while F and X fixed depends on the choice of Rw(W). There are many parameter estimation techniques developed for AR with various regularizers [11, 20]. For simplicity, we consider the squared Frobenius norm: Rw(W) = kWk2 F . As a result, each row of ¯wr of W can be updated by solving the following one-dimensional autoregressive problem. arg min ¯ w λxTAR(¯xr |L, ¯w, ⌘) + λwk ¯wk2 ⌘arg min ¯ w T X t=m xt − X l2L wlxt−l !2 + λw λx k ¯wk2, which is a simple |L| dimensional ridge regression problem with T −m + 1 instances, which can be solved efficiently by Cholesky factorization in O(|L|3 + T|L|2) time Note that since our method is highly modular, one can resort to any method to solve the optimization subproblems that arise for each module. Moreover, as mentioned in Section 3, TRMF can also be used with different regularization structures, making it highly adaptable. 4.1 Connections to Existing MF Approaches TRMF-AR is a generalization of many existing MF approaches to handle data with temporal dependencies. Specifically, Temporal Collaborative Filtering [23] corresponds to W (1) = Ik on {xt}. The NMF method of [2] is an AR(L) model with W (l) = ↵l−1(1 −↵)Ik, 8l, where ↵is pre-defined. The AR(1) model of [16, 26] has W (1) = In on {Fxt}. Finally the DLM [7] is a latent AR(1) model with a general W (1), which can be estimated by EM algorithms. 4.2 Connections to Learning Gaussian Markov Random Fields The Gaussian Markov Random Field (GMRF) is a general way to model multivariate data with dependencies. GMRF assumes that data are generated from a multivariate Gaussian distribution with a covariance matrix ⌃which describes the dependencies among T dimensional variables i.e., ¯x ⇠N(0, ⌃). If the unknown ¯x is assumed to be generated from this model, The negative log likelihood of the data can be written as ¯x>⌃−1 ¯x, ignoring the constants and where ⌃−1 is the inverse covariance matrix of the Gaussian distribution. This prior can be incorporated into an empirical risk minimization framework as a regularizer. Furthermore, it is known that if " ⌃−1# st = 0, xt and xs are conditionally independent, given the other variables. In Theorem 1 we established connections 6 Table 2: Forecasting results: ND/ NRMSE for each approach. Lower values are better. “-” indicates an unavailability due to scalability or an inability to handle missing values. Forecasting with Full Observation Matrix Factorization Models Time Series Models TRMF-AR SVD-AR(1) TCF AR(1) DLM R-DLM Mean synthetic 0.373/ 0.487 0.444/ 0.872 1.000/ 1.424 0.928/ 1.401 0.936/ 1.391 0.996/ 1.420 1.000/ 1.424 electricity 0.255/ 1.397 0.257/ 1.865 0.349/ 1.838 0.219/ 1.439 0.435/ 2.753 -/ 1.410/ 4.528 traffic 0.187/ 0.423 0.555/ 1.194 0.624/ 0.931 0.275/ 0.536 0.639/ 0.951 -/ 0.560/ 0.826 Forecasting with Missing Values walmart-1 0.533/ 1.958 -/ 0.540/2.231 -/ 0.602/ 2.293 -/ 1.239/3.103 walmart-2 0.432/ 1.065 -/ 0.446/1.124 -/ 0.453/ 1.110 -/ 1.097/2.088 to graph based regularizers, and that such methods can be seen as regularizing with the inverse covariance matrix for Gaussians [27]. We thus have the following result: Corollary 1. For any lag set L, ¯w, and ⌘> 0, the inverse covariance matrix ⌃−1 AR of the GMRF model corresponding to the quadratic regularizer Rx(¯x) := TAR(¯x|L, ¯w, ⌘) shares the same off-diagonal non-zero pattern as GAR defined in Theorem 1. Moreover, we have TAR(¯x|L, ¯w, ⌘) = ¯x>⌃−1 AR ¯x. A detailed proof is in Appendix C.2. As a result, our proposed AR-based regularizer is equivalent to imposing a Gaussian prior on ¯x with a structured inverse covariance described by the matrix GAR defined in Theorem 1. Moreover, the step to learn W has a natural interpretation: the lag set L imposes the non-zero pattern of the graphical model on the data, and then we solve a simple least squares problem to learn the weights corresponding to the edges. As an application of Theorem 1 from [15] and Corollary 1, when Rf(F) = kFk2 F ,we can relate TAR to a weighted nuclear norm: kZBk⇤= 1 2 inf F,X:Z=F XkFk2 F + X r TAR(¯xr |L, ¯w, ⌘), (13) where B = US1/2 and ⌃−1 AR = USU > is the eigen-decomposition of ⌃−1 AR. (13) enables us to apply the results from [15] to obtain guarantees for the use of AR temporal regularizer when W is given. For simplicity, we assume ¯wr = ¯w, 8r and consider a relaxed convex formulation for (12) as follows: ˆZ = arg min Z2C 1 N X (i,j)2⌦ (Yij −Zij)2 + λzkZBk⇤, (14) where N = |⌦|, and C is a set of matrices with low spikiness. Full details are provided in Appendix C.3. As an application of Theorem 2 from [15], we have the following corollary. Corollary 2. Let Z? = FX be the ground truth n ⇥T time series matrix of rank k. Let Y be the matrix with N = |⌦| randomly observed entries corrupted with additive Gaussian noise with variance σ2. Then if λz ≥C1 q (n+T ) log(n+T ) N , with high probability for the ˆZ obtained by (14), '''Z? −ˆZ ''' F C2↵2 max(1, σ2)k(n + T) log(n + T) N + O(↵2/N), where C1,C2 are positive constants, and ↵depends on the product Z?B. See Appendix C.3 for details. From the results in Table 3, we observe superior performance of TRMF-AR over standard MF, indicating that ¯w learnt from our data-driven approach (12) does aid in recovering the missing entries for time series. We would like to point out that establishing a theoretical guarantee for TRMF with W is unknown remains a challenging research direction. 5 Experimental Results Figure 4: Scalability: T = 512. n 2 {500, 1000, . . . , 50000}. AR({1, . . . , 8}) cannot finish in 1 day. We consider five datasets (Table 1). For synthetic, we first randomly generate F 2 R16⇥4 and generate {xt} following an AR process with L = {1, 8}. Then Y is obtained by yt = Fxt + ✏t where ✏t ⇠N(0, 0.1I). The data sets electricity and traffic are obtained from the UCI repository, while walmart-1 and walmart-2 are two propriety datasets from Walmart E-commerce containing weekly sale information. Due to reasons such as out-of-stock, 55.3% and 49.3% of entries are missing respectively. To evaluate the prediction performance, we consider the normalized deviation (ND) and normalized RMSE (NRMSE). See details for the description for each dataset and the formal definition for each criterion in Appendix A. 7 Table 3: Missing value imputation results: ND/ NRMSE for each approach. Note that TRMF outperforms all competing methods in almost all cases. |⌦| n⇥T Matrix Factorization Models Time Series Models TRMF-AR TCF MF DLM Mean synthetic 20% 0.467/ 0.661 0.713/ 1.030 0.688/ 1.064 0.933/ 1.382 1.002/ 1.474 30% 0.336/ 0.455 0.629/ 0.961 0.595/ 0.926 0.913/ 1.324 1.004/ 1.445 40% 0.231/ 0.306 0.495/ 0.771 0.374/ 0.548 0.834/ 1.259 1.002/ 1.479 50% 0.201/ 0.270 0.289/ 0.464 0.317/ 0.477 0.772/ 1.186 1.001/ 1.498 electricity 20% 0.245/ 2.395 0.255/ 2.427 0.362/ 2.903 0.462/ 4.777 1.333/ 6.031 30% 0.235/ 2.415 0.245/ 2.436 0.355/ 2.766 0.410/ 6.605 1.320/ 6.050 40% 0.231/ 2.429 0.242/ 2.457 0.348/ 2.697 0.196/ 2.151 1.322/ 6.030 50% 0.223/ 2.434 0.233/ 2.459 0.319/ 2.623 0.158/ 1.590 1.320/ 6.109 traffic 20% 0.190/ 0.427 0.208/ 0.448 0.310/ 0.604 0.353/ 0.603 0.578/ 0.857 30% 0.186/ 0.419 0.199/ 0.432 0.299/ 0.581 0.286/ 0.518 0.578/ 0.856 40% 0.185/ 0.416 0.198/ 0.428 0.292/ 0.568 0.251/ 0.476 0.578/ 0.857 50% 0.184/ 0.415 0.193/ 0.422 0.251/ 0.510 0.224/ 0.447 0.578/ 0.857 Methods/Implementations Compared: • TRMF-AR: The proposed formulation (12) with Rw(W) = kWk2 F . For L, we use {1, 2, . . . , 8} for synthetic, {1, . . . , 24}[{7 ⇥24, . . . , 8 ⇥24 −1} for electricity and traffic, and {1, . . . , 10}[ {50, . . . , 56} for walmart-1 and walmart-2 to capture seasonality. • SVD-AR(1): The rank-k approximation of Y = USV > is first obtained by SVD. After setting F = US and X = V >, a k-dimensional AR(1) is learned on X for forecasting. • TCF: Matrix factorization with the simple temporal regularizer proposed in [23]. • AR(1): n-dimensional AR(1) model.2 • DLM: two implementations: the widely used R-DLM package [12] and the code provided in [8]. • Mean: The baseline, which predicts everything to be the mean of the observed portion of Y . For each method and data set, we perform a grid search over various parameters (such as k, λ values) following a rolling validation approach described in [11]. Scalability: Figure 4 shows that traditional time-series approaches such as AR or DLM suffer from the scalability issue for large n, while TRMF-AR scales much better with n. Specifically, for n = 50, 000, TRMF is 2 orders of magnitude faster than competing AR/DLM methods. Note that the results for R-DLM are not available because the R package cannot scale beyond n in the tens (See Appendix D for more details.). Furthermore, the dlmMLE routine in R-DLM uses a general optimization solver, which is orders of magnitude slower than the implementation provided in [8]. 5.1 Forecasting Forecasting with Full Observations. We first compare various methods on the task of forecasting values in the test set, given fully observed training data. For synthetic, we consider one-point ahead forecasting task and use the last ten time points as the test periods. For electricity and traffic, we consider the 24-hour ahead forecasting task and use last seven days as the test periods. From Table 2, we can see that TRMF-AR outperforms all the other methods on both metrics considered. Forecasting with Missing Values. We next compare the methods on the task of forecasting in the presence of missing values in the data. We use the Walmart datasets here, and consider 6-week ahead forecasting and use last 54 weeks as the test periods. Note that SVD-AR(1) and AR(1) cannot handle missing values. The second part of Table 2 shows that we again outperform other methods. 5.2 Missing Value Imputation We next consider the case of imputing missing values in the data. As in [9], we assume that blocks of data are missing, corresponding to sensor malfunctions for example, over a length of time. To create data with missing entries, we first fixed the percentage of data that we were interested in observing, and then uniformly at random occluded blocks of a predetermined length (2 for synthetic data and 5 for the real datasets). The goal was to predict the occluded values. Table 3 shows that TRMF outperforms the methods we compared to on almost all cases. 6 Conclusions We propose a novel temporal regularized matrix factorization framework (TRMF) for highdimensional time series problems with missing values. TRMF not only models temporal dependency among the data points, but also supports data-driven dependency learning. TRMF generalizes several well-known methods and yields superior performance when compared to other state-of-the-art methods on real-world datasets. Acknowledgements: This research was supported by NSF grants (CCF-1320746, IIS-1546459, and CCF1564000) and gifts from Walmart Labs and Adobe. We thank Abhay Jha for the help on Walmart experiments. 2In Appendix A, we also show a baseline which applies an independent AR model to each dimension. 8 References [1] O. Anava, E. Hazan, and A. Zeevi. Online time series prediction with missing data. In Proceedings of the International Conference on Machine Learning, pages 2191–2199, 2015. [2] Z. Chen and A. Cichocki. Nonnegative matrix factorization with temporal smoothness and/or spatial decorrelation constraints. Laboratory for Advanced Brain Signal Processing, RIKEN, Tech. Rep, 68, 2005. [3] Z. Ghahramani and G. E. Hinton. Parameter estimation for linear dynamical systems. Technical report, Technical Report CRG-TR-96-2, University of Totronto, Dept. of Computer Science, 1996. [4] R. L. Graham, D. E. Knuth, and O. Patashnik. Concrete Mathematics: A Foundation for Computer Science. Addison-Wesley Longman Publishing Co., Inc., 2nd edition, 1994. [5] F. Han and H. Liu. Transition matrix estimation in high dimensional time series. In Proceedings of the International Conference on Machine Learning, pages 172–180, 2013. [6] P. Jain and I. S. Dhillon. Provable inductive matrix completion. arXiv preprint arXiv:1306.0626, 2013. [7] R. E. Kalman. A new approach to linear filtering and prediction problems. Journal of Fluids Engineering, 82(1):35–45, 1960. [8] L. Li and B. A. Prakash. Time series clustering: Complex is simpler! In Proceedings of the International Conference on Machine Learning, pages 185–192, 2011. [9] L. Li, J. McCann, N. S. Pollard, and C. Faloutsos. DynaMMo: Mining and summarization of coevolving sequences with missing values. In ACM SIGKDD International Conference on Knowledge discovery and data mining, pages 507–516. ACM, 2009. [10] I. Melnyk and A. Banerjee. Estimating structured vector autoregressive model. In Proceedings of the Thirty Third International Conference on Machine Learning (ICML), 2016. [11] W. B. Nicholson, D. S. Matteson, and J. Bien. Structured regularization for large vector autoregressions. Technical report, Technical Report, University of Cornell, 2014. [12] G. Petris. An r package for dynamic linear models. Journal of Statistical Software, 36(12):1–16, 2010. [13] G. Petris, S. Petrone, and P. Campagnoli. Dynamic Linear Models with R. Use R! Springer, 2009. [14] S. Rallapalli, L. Qiu, Y. Zhang, and Y.-C. Chen. Exploiting temporal stability and low-rank structure for localization in mobile networks. In International Conference on Mobile Computing and Networking, MobiCom ’10, pages 161–172. ACM, 2010. [15] N. Rao, H.-F. Yu, P. K. Ravikumar, and I. S. Dhillon. Collaborative filtering with graph information: Consistency and scalable methods. In Advances in Neural Information Processing Systems 27, 2015. [16] M. Roughan, Y. Zhang, W. Willinger, and L. Qiu. Spatio-temporal compressive sensing and internet traffic matrices (extended version). IEEE/ACM Transactions on Networking, 20(3):662–676, June 2012. [17] R. H. Shumway and D. S. Stoffer. An approach to time series smoothing and forecasting using the EM algorithm. Journal of time series analysis, 3(4):253–264, 1982. [18] A. J. Smola and R. Kondor. Kernels and regularization on graphs. In Learning theory and kernel machines, pages 144–158. Springer, 2003. [19] J. Z. Sun, K. R. Varshney, and K. Subbian. Dynamic matrix factorization: A state space approach. In Proceedings of International Conference on Acoustics, Speech and Signal Processing, pages 1897–1900. IEEE, 2012. [20] H. Wang, G. Li, and C.-L. Tsai. Regression coefficient and autoregressive order shrinkage and selection via the lasso. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 69(1):63–78, 2007. [21] M. West and J. Harrison. Bayesian Forecasting and Dynamic Models. Springer Series in Statistics. Springer, 2013. [22] K. Wilson, B. Raj, and P. Smaragdis. Regularized non-negative matrix factorization with temporal dependencies for speech denoising. In Interspeech, pages 411–414, 2008. [23] L. Xiong, X. Chen, T.-K. Huang, J. G. Schneider, and J. G. Carbonell. Temporal collaborative filtering with Bayesian probabilistic tensor factorization. In SIAM International Conference on Data Mining, pages 223–234, 2010. [24] M. Xu, R. Jin, and Z.-H. Zhou. Speedup matrix completion with side information: Application to multilabel learning. In C. Burges, L. Bottou, M. Welling, Z. Ghahramani, and K. Weinberger, editors, Advances in Neural Information Processing Systems 26, pages 2301–2309, 2013. [25] H.-F. Yu, P. Jain, P. Kar, and I. S. Dhillon. Large-scale multi-label learning with missing labels. In Proceedings of the International Conference on Machine Learning, pages 593–601, 2014. [26] Y. Zhang, M. Roughan, W. Willinger, and L. Qiu. Spatio-temporal compressive sensing and internet traffic matrices. SIGCOMM Comput. Commun. Rev., 39(4):267–278, Aug. 2009. ISSN 0146-4833. [27] T. Zhou, H. Shan, A. Banerjee, and G. Sapiro. Kernelized probabilistic matrix factorization: Exploiting graphs and side information. In SDM, volume 12, pages 403–414. SIAM, 2012. 9
2016
308
6,226
FPNN: Field Probing Neural Networks for 3D Data Yangyan Li1,2 Sören Pirk1 Hao Su1 Charles R. Qi1 Leonidas J. Guibas1 1Stanford University, USA 2Shandong University, China Abstract Building discriminative representations for 3D data has been an important task in computer graphics and computer vision research. Convolutional Neural Networks (CNNs) have shown to operate on 2D images with great success for a variety of tasks. Lifting convolution operators to 3D (3DCNNs) seems like a plausible and promising next step. Unfortunately, the computational complexity of 3D CNNs grows cubically with respect to voxel resolution. Moreover, since most 3D geometry representations are boundary based, occupied regions do not increase proportionately with the size of the discretization, resulting in wasted computation. In this work, we represent 3D spaces as volumetric fields, and propose a novel design that employs field probing filters to efficiently extract features from them. Each field probing filter is a set of probing points — sensors that perceive the space. Our learning algorithm optimizes not only the weights associated with the probing points, but also their locations, which deforms the shape of the probing filters and adaptively distributes them in 3D space. The optimized probing points sense the 3D space “intelligently”, rather than operating blindly over the entire domain. We show that field probing is significantly more efficient than 3DCNNs, while providing state-of-the-art performance, on classification tasks for 3D object recognition benchmark datasets. 1 Introduction 10.41% 5.09% 2.41% Figure 1: The sparsity characteristic of 3D data in occupancy grid representation. 3D occupancy grids in resolution 30, 64 and 128 are shown in this figure, together with their density, defined as #occupied grid #total grid . It is clear that 3D occupancy grid space gets sparser and sparser as the fidelity of the surface approximation increases. Rapid advances in 3D sensing technology have made 3D data ubiquitous and easily accessible, rendering them an important data source for high level semantic understanding in a variety of environments. The semantic understanding problem, however, remains very challenging for 3D data as it is hard to find an effective scheme for converting input data into informative features for further processing by machine learning algorithms. For semantic understanding problems in 2D images, deep CNNs [15] have been widely used and have achieved great success, where the convolutional layers play an essential role. They provide a set of 2D filters, which when convolved with input data, transform the data to informative features for higher level inference. In this paper, we focus on the problem of learning a 3D shape representation by a deep neural network. We keep two goals in mind when designing the network: the shape features should be discriminative for shape recognition and efficient for extraction at runtime. However, existing 3D CNN pipelines that simply replace the conventional 2D filters by 3D ones [31, 19], have difficulty in capturing geometric structures with sufficient efficiency. The input to these 3D CNNs are voxelized shapes represented by occupancy grids, in direct analogy to pixel array representation for images. We observe that the computational cost of 3D convolution is quite high, since convolving 3D voxels has cubical complexity with respect to spatial resolution, one order higher than the 2D case. Due to this high computational cost, researchers typically choose 30 × 30 × 30 resolution to voxelize shapes [31, 19], which is significantly lower than the widely adopted resolution 227 × 227 for processing images [24]. We suspect that the strong artifacts introduced at this level of quantization (see Figure 1) hinder the process of learning effective 3D convolutional filters. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. (a) (b) (c) (d) Figure 2: An visualization of probing filters before (a) and after (d) training them for extracting 3D features. The colors associated with each probing point visualize the filter weights for them. Note that probing points belong to the same filter are linked together for visualizing purpose. (b) and (c) are subsets of probing filters of (a) and (d), for better visualizing that not only the weights on the probing points, but also their locations are optimized for them to better “sense” the space. Two significant differences between 2D images and 3D shapes interfere with the success of directly applying 2D CNNs on 3D data. First, as the voxel resolution grows, the grids occupied by shape surfaces get sparser and sparser (see Figure 1). The convolutional layers that are designed for 2D images thereby waste much computation resource in such a setting, since they convolve with 3D blocks that are largely empty and a large portion of multiplications are with zeros. Moreover, as the voxel resolution grows, the local 3D blocks become less and less discriminative. To capture informative features, long range connections have to be established for taking distant voxels into consideration. This long range effect demands larger 3D filters, which yields an even higher computation overhead. To address these issues, we represent 3D data as 3D fields, and propose a field probing scheme, which samples the input field by a set of probing filters (see Figure 2). Each probing filter is composed of a set of probing points which determine the shape and location of the filter, and filter weights associated with probing points. In typical CNNs, only the filter weights are trained, while the filter shape themselves are fixed. In our framework, due to the usage of 3D field representation, both the weights and probing point locations are trainable, making the filters highly flexible in coupling long range effects and adapting to the sparsity of 3D data when it comes to feature extraction. The computation amount of our field probing scheme is determined by how many probing filters we place in the 3D space, and how many probing points are sampled per filter. Thus, the computational complexity does not grow as a function of the input resolution. We found that a small set of field probing filters is enough for sampling sufficient information, probably due to the sparsity characteristic of 3D data. Intuitively, we can think our field probing scheme as a set of sensors placed in the space to collect informative signals for high level semantic tasks. With the long range connections between the sensors, global overview of the underlying object can be easily established for effective inference. Moreover, the sensors are “smart” in the sense that they learn how to sense the space (by optimizing the filter weights), as well as where to sense (by optimizing the probing point locations). Note that the intelligence of the sensors is not hand-crafted, but solely derived from data. We evaluate our field probing based neural networks (FPNN) on a classification task on ModelNet [31] dataset, and show that they match the performance of 3DCNNs while requiring much less computation, as they are designed and trained to respect the sparsity of 3D data. 2 Related Work 3D Shape Descriptors. 3D shape descriptors lie at the core of shape analysis and a large variety of shape descriptors have been designed in the past few decades. 3D shapes can be converted into 2D images and represented by descriptors of the converted images [13, 4]. 3D shapes can also be represented by their inherent statistical properties, such as distance distribution [22] and spherical harmonic decomposition [14]. Heat kernel signatures extract shape descriptions by simulating an heat diffusion process on 3D shapes [29, 3]. In contrast, we propose an approach for learning the shape descriptor extraction scheme, rather than hand-crafting it. Convolutional Neural Networks. The architecture of CNN [15] is designed to take advantage of the 2D structure of an input image (or other 2D input such as a speech signal), and CNNs have advanced the performance records in most image understanding tasks in computer vision [24]. An important reason for this success is that by leveraging large image datasets (e.g., ImageNet [6]), general purpose image descriptors can be directly learned from data, which adapt to the data better and outperform hand-crafted features [16]. Our approach follows this paradigm of feature learning, but is specifically designed for 3D data coming from object surface representations. 2 CNNs on Depth and 3D Data. With rapid advances in 3D sensing technology, depth has became available as an additional information channel beyond color. Such 2.5D data can be represented as multiple channel images, and processed by 2D CNNs [26, 10, 8]. Wu et al. [31] in a pioneering paper proposed to extend 2D CNNs to process 3D data directly (3D ShapeNets). A similar approach (VoxNet) was proposed in [19]. However, such approaches cannot work on high resolution 3D data, as the computational complexity is a cubic function of the voxel grid resolution. Since CNNs for images have been extensively studied, 3D shapes can be rendered into 2D images, and be represented by the CNN features of the images [25, 28], which, surprisingly, outperforms any 3D CNN approaches, in a 3D shape classification task. Recently, Qi et al. [23] presented an extensive study of these volumetric and multi-view CNNs and refreshed the performance records. In this work, we propose a feature learning approach that is specifically designed to take advantage of the sparsity of 3D data, and compare against results reported in [23]. Note that our method was designed without explicit consideration of deformable objects, which is a purely extrinsic construction. While 3D data is represented as meshes, neural networks can benefit from intrinsic constructions[17, 18, 1, 2] to learn object invariance to isometries, thus require less training data for handling deformable objects. Our method can be viewed as an efficient scheme of sparse coding[7]. The learned weights of each probing curve can be interpreted as the entries of the coding matrix in the sparse coding framework. Compared with conventional sparse coding, our framework is not only computationally more tractable, but also enables an end-to-end learning system. 3 Field Probing Neural Network 3.1 Input 3D Fields (a) (b) (c) (d) (e) Figure 3: 3D mesh (a) or point cloud (b) can be converted into occupancy grid (c), from which the input to our algorithm — a 3D distance field (d), is obtained via a distance transform. We further transform it to a Gaussian distance field (e) for focusing attention to the space near the surface. The fields are visualized by two crossing slices. We study the 3D shape classification problem by employing a deep neural network. The input of our network is a 3D vector field built from the input shape and the output is an object category label. 3D shapes represented as meshes or point clouds can be converted into 3D distance fields. Given a mesh (or point cloud), we first convert it into a binary occupancy grid representation, where the binary occupancy value in each grid is determined by whether it intersects with any mesh surface (or contains any sample point). Then we treat the occupied cells as the zero level set of a surface, and apply a distance transform to build a 3D distance field D, which is stored in a 3D array indexed by (i, j, k), where i, j, k = 1, 2, ..., R, and R is the resolution of the distance field. We denote the distance value at (i, j, k) by D(i,j,k). Note that D represents distance values at discrete grid locations. The distance value at an arbitrary location d(x, y, z) can be computed by standard trilinear interpolation over D. See Figure 3 for an illustration of the 3D data representations. Similar to 3D distance fields, other 3D fields, such as normal fields Nx, Ny, and Nz, can also be used for representing shapes. Note that the normal fields can be derived from the gradient of the distance field: Nx(x, y, z) = 1 l ∂d ∂x, Ny(x, y, z) = 1 l ∂d ∂y, Nz(x, y, z) = 1 l ∂d ∂z , where l = |( ∂d ∂x, ∂d ∂y, ∂d ∂z )|. Our framework can employ any set of fields as input, as long as the gradients can be computed. 3.2 Field Probing Layers Figure 4: Initialization of field probing layers. For simplicity, a subset of the filters are visualized. The basic modules of deep neural networks are layers, which gradually convert input to output in a forward pass, and get updated during a backward pass through the Back-propagation [30] mechanism. The key contribution of our approach is that we replace the convolutional layers in CNNs by field probing layers, a novel component that uses field probing filters to efficiently extract features from the 3D vector field. They are composed of three layers: Sensor layer, 3 DotProduct layer and Gaussian layer. The Sensor layer is responsible for collecting the signals (the values in the input fields) at the probing points in the forward pass, and updating the probing point locations in the backward pass. The DotProduct layer computes the dot product between the probing filter weights and the signals from the Sensor layer. The Gaussian layer is an utility layer that transforms distance field into a representation that is more friendly for numerical computation. We introduce them in the following paragraphs, and show that they fit well for training a deep network. Sensor Layer. The input to this layer is a 3D field V, where V(x, y, z) yields a T channel (T = 1 for distance field and T = 3 for normal fields) vector at location (x, y, z). This layer contains C probing filters scattered in space, each with N probing points. The parameters of this layer are the locations of all probing points {(xc,n, yc,n, zc,n)}, where c indexes the filter and n indexes the probing point within each filter. This layer simply outputs the vector at the probing points V(xc,n, yc,n, zc,n). The output of this layer forms a data chunk of size C × N × T. The gradient of this function ∇V = ( ∂V ∂x , ∂p ∂y, ∂p ∂z ) can be evaluated by numerical computation, which will be used for updating the locations of probing points in the back-propagation process. This formal definition emphasizes why we need the input being represented as 3D fields: the gradients computed from the input fields are the forces to push the probing points towards more informative locations until they converge to a local optimum. DotProduct Layer. The input to this layer is the output of the Sensor layer — a data chunk of size C × N × T, denoted as {pc,n,t}. The parameters of DotProduct layer are the filter weights associated with probing points, i.e., there are C filters, each of length N, in T channels. We denote the set of parameters as {wc,n,t}. The function at this layer computes a dot product between {pc,n,t} and {wc,n,t}, and outputs vc = v({pc,i,j}, {wc,i,j}) = P i=1,...,N j=1,...,T pc,i,j × wc,i,j, — a C-dimensional vector, and the gradient for the backward pass is: ∇vc = ( ∂v ∂{pc,i,j}, ∂v ∂{wc,i,j}) = ({wc,i,j}, {pc,i,j}). Typical convolution encourages weight sharing within an image patch by “zipping” the patch into a single value for upper layers by a dot production between the patch and a 2D filter. Our DotProduct layer shares the same “zipping” idea, which facilitates to fully connect it: probing points are grouped into probing filters to generate output with lower dimensionality. Another option in designing convolutional layers is to decide whether their weights should be shared across different spatial locations. In 2D CNNs, these parameters are usually shared when processing general images. In our case, we opt not to share the weights, as information is not evenly distributed in 3D space, and we encourage our probing filters to individually deviate for adapting to the data. Gaussian Layer. Samples in locations distant to the object surface are associated with large distance values from the distance field. Directly feeding them into the DotProduct layer does not converge and thus does not yield reasonable performance. To emphasize the importance of samples in the vicinity of the object surface, we apply a Gaussian transform (inverse exponential) on the distances so that regions approaching the zero surface have larger weights while distant regions matter less.1. We implement this transform with a Gaussian layer. The input is the output values of the Sensor layer. Let us assume the values are {x}, then this layer applies an element-wise Gaussian transform g(x) = e−x2 2σ2 , and the gradient is ∇g = −xe −x2 2σ2 σ2 for the backward pass. Complexity of Field Probing Layers. The complexity of field probing layers is O(C × N × T), where C is the number of probing filters, N is the number of probing points on each filter, and T is the number of input fields. The complexity of the convolutional layer is O(K3 × C × S3), where K is the 3D kernel size, C is the output channel number, and S is the number of the sliding locations for each dimension. In field probing layers, we typically use C = 1024, N = 8, and T = 4 (distance and normal fields), while in 3D CNN K = 6, C = 48 and S = 12. Compared with convolutional layers, field probing layers save a majority of computation (1024 × 8 × 4 ≈1.83% × 63 × 48 × 123), as the 1Applying a batch normalization [11] on the distances also resolves the problem. However, Gaussian transform has two advantages: 1. it can be approximated by truncated distance fields [5], which is widely used in real time scanning and can be compactly stored by voxel hashing [21], 2. it is more efficient to compute than batch normalization, since it is element-wise operation. 4 probing filters in field probing layers are capable of learning where to “sense”, whereas convolutional layers exhaustively examine everywhere by sliding the 3D kernels. Initialization of Field Probing Layers. There are two sets of parameters: the probing point locations and the weights associated with them. To encourage the probing points to explore as many potential locations as possible, we initialize them to be widely distributed in the input fields. We first divide the space into G × G × G grids and then generate P filters in each grid. Each filter is initialized as a line segment with a random orientation, a random length in [llow, lhigh] (we use [llow, lhigh] = [0.2, 0.8] ∗R by default), and a random center point within the grid it belongs to (Figure 4 left). Note that a probing filter spans distantly in the 3D space, so they capture long range effects well. This is a property that distinguishes our design from those convolutional layers, as they have to increase the kernel size to capture long range effects, at the cost of increased complexity. The weights of field probing filters are initialized by the Xavier scheme [9]. In Figure 4 right, weights for distance field are visualized by probing point colors and weights for normal fields by arrows attached to each probing point. Figure 5: FPNN architecture. Field probing layers can be used together with other inference layers to minimize task specific losses. FPNN Architecture and Usage. Field probing layers transform input 3D fields into an intermediate representation, which can further be processed and eventually linked to task specific loss layers (Figure 5). To further encourage long range connections, we feed the output of our field probing layers into fully connected layers. The advantage of long range connections makes it possible to stick with a small number of probing filters, while the small number of probing filters makes it possible to directly use fully connected layers. Object classification is widely used in computer vision as a testbed for evaluating neural network designs, and the neural network parameters learned from this task may be transferred to other highlevel understanding tasks such as object retrieval and scene parsing. Thus we choose 3D object classification as the task for evaluating our FPNN. 4 Results and Discussions 4.1 Timing Grid Resolution 16 32 64 128 227 Running Time (ms) 1.99 50 100 150 200 234.9 Convolutional Layers Field Probing Layers Figure 6: Running time of convolutional layers (same settings as that in [31]) and field probing layers (C × N × T = 1024 × 8 × 4) on Nvidia GTX TITAN with batch size 83. We implemented our field probing layers in Caffe [12]. The Sensor layer is parallelized by assigning computation on each probing point to one GPU thread, and DotProduct layer by assigning computation on each probing filter to one GPU thread. Figure 6 shows a run time comparison between convonlutional layers and field probing layers on different input resolutions. The computation cost of our field probing layers is agnostic to input resolutions, the slight increase of the run time on higher resolution is due to GPU memory latency introduced by the larger 3D fields. Note that the convolutional layers in [12] are based on highly optimized cuBlas library from NVIDIA, while our field probing layers are implemented with our naive parallelism, which is likely to be further improved. 4.2 Datasets and Evaluation Protocols We use ModelNet40 [31] (12,311 models from 40 categories, training/testing split with 9,843/2,468 models4) — the standard benchmark for 3D object classification task, in our experiments. Models 3The batch size is chosen to make sure the largest resolution data fits well in GPU memory. 4The split is provided on the authors’ website. In their paper, a split composed of at most 80/20 training/testing models for each category was used, which is tiny for deep learning tasks and thus prone to overfitting. Therefore, we report and compare our performance on the whole ModelNet40 dataset. 5 in this dataset are already aligned with a canonical orientation. For 3D object recognition scenarios in real world, the gravity direction can often be captured by the sensor, but the horizontal “facing” direction of the objects are unknown. We augment ModelNet40 data by randomly rotating the shapes horizontally. Note that this is done for both training and testing samples, thus in the testing phase, the orientation of the inputs are unknown. This allows us to assess how well the trained network perform on real world data. 4.3 Performance of Field Probing Layers 1-FC 4-FCs w/o FP w/ FP +NF w/o FP w/ FP +NF 79.1 85.0 86.0 86.6 87.5 88.4 Table 1: Top-1 accuracy of FPNNs on 3D object classification task on ModelNet40 dataset. We train our FPNN 80, 000 iterations on 64 × 64 × 64 distance field with batch size 1024.5, with SGD solver, learning rate 0.01, momentum 0.9, and weight decay 0.0005. Trying to study the performance of our field probing layers separately, we build up an FPNN with only one fully connected layer that converts the output of field probing layers into the representation for softmax classification loss (1-FC setting). Batch normalization [11] and rectified-linear unit [20] are used in-between our field probing layers and the fully connected layer for reducing internal covariate shift and introducing non-linearity. We train the network without/with updating the field probing layer parameters. We show their top-1 accuracy on 3D object classification task on ModelNet40 dataset with single testing view in Table 1. It is clear that our field probing layers learned to sense the input field more intelligently, with a 5.9% performance gain from 79.1% to 85.0%. Note that, what achieved by this simple network, 85.0%, is already better than the state-of-the-art 3DCNN before [23] (83.0% in [31] and 83.8% in [19]). We also evaluate the performance of our field probing layers in the context of a deeper FPNN, where four fully connected layers6, with in-between batch normalization, rectified-linear unit and Dropout [27] layers, are used (4-FCs setting). As shown in Table 1, the deeper FPNN performs better, while the gap between with and without field probing layers, 87.5%−86.6% = 0.9%, is smaller than that in one fully connected FPNN setting. This is not surprising, as the additional fully connected layers, with many parameters introduced, have strong learning capability. The 0.9% performance gap introduced by our field probing layers is a precious extra over a strong baseline. It is important to note that in both settings (1-FC and 4-FCs), our FPNNs provides reasonable performance even without optimizing the field probing layers. This confirms that long range connections among the sensors are beneficial. Furthermore, we evaluate our FPNNs with multiple input fields (+NF setting). We did not only employ distance fields, but also normal fields for our probing layers and found a consistent performance gain for both of the aforementioned FPNNs (see Table 1). Since normal fields are derived from distance fields, the same group of probing filters are used for both fields. Employing multiple fields in the field probing layers with different groups of filters potentially enables even higher performance. FPNN Setting R R15 R15 + T0.1 + S R45 T0.2 1-FC 85.0 82.4 76.2 74.1 72.2 4-FCs 87.5 86.8 84.9 85.3 85.4 [31] 84.7 83.0 84.8 Table 2: Performance on different perturbations. Robustness Against Spatial Perturbations. We evaluate our FPNNs on different levels of spatial perturbations, and summarize the results in Table 2, where R indicates random horizontal rotation, R15 indicates R plus a small random rotation (−15◦, 15◦) in the other two directions, T0.1 indicates random translations within range (−0.1, 0.1) of the object size in all directions, S indicates random scaling within range (0.9, 1.1) in all directions. R45 and T0.2 shares the same notations, but with even stronger rotation and translation, and are used in [23] for evaluating the performance of [31]. Note that such perturbations are done on both training and testing samples. It is clear that our FPNNs are robust against spatial perturbations. FPNN Setting 0.2 −0.8 0.2 −0.4 0.1 −0.2 1-FC 85.0 84.1 82.8 4-FCs 87.5 86.8 86.9 Table 3: Performance with different filter spans. Advantage of Long Range Connections. We evaluate our FPNNs with different range parameters [llow, lhigh] used in initializing the probing filters, and summarize the results in Table 3. Note that since the output dimensionality 5To save disk I/O footprint, a data augmentation is done on the fly. Each iteration, 256 data samples are loaded, and augmented into 1024 samples for a batch. 6The first three of them output 1024 dimensional feature vector. 6 of our field probing layers is low enough to be directly feed into fully connected layers, distant sensor information is directly coupled by them. This is a desirable property, however, it poses the difficulty to study the advantage of field probing layers in coupling long range information separately. Table 3 shows that even if the following fully connected layer has the capability to couple distance information, the long range connections introduced in our field probing layers are beneficial. FPNN Setting 16 × 16 × 16 32 × 32 × 32 64 × 64 × 64 1-FC 84.2 84.5 85.0 4-FCs 87.3 87.3 87.5 Table 4: Performance on different field resolutions. Performance on Different Field Resolutions. We evaluate our FPNNs on different input field resolutions, and summarize the results in Table 4. Higher resolution input fields can represent input data more accurately, and Table 4 shows that our FPNN can take advantage of the more accurate representations. Since the computation cost of our field probing layers is agnostic to the resolution of the data representation, higher resolution input fields are preferred for better performance, while coupling with efficient data structures reduces the I/O footprint. “Sharpness” of Gaussian Layer. The σ hyper-parameter in Gaussian layer controls how “sharp” is the transform. We select its value empirically in our experiments, and the best performance is given when we use σ ≈10% of the object size. Smaller σ slightly hurts the performance (≈1%), but has the potential of reducing I/O footprint. Figure 7: t-SNE visualization of FPNN features. FPNN Features and Visual Similarity. Figure 7 shows a visualization of the features extracted by the FPNN trained for a classification task. Our FPNN is capable of capturing 3D geometric structures such that it allows to map 3D models that belong to the same categories (indicated by colors) to similar regions in the feature space. More specifically, our FPNN maps 3D models into points in a high dimensional feature space, where the distances between the points measure the similarity between their corresponding 3D models. As can be seen from Figure 7 (better viewed in zoomin mode), the FPNN feature distances between 3D models represent their shape similarities, thus FPNN features can support shape exploration and retrieval tasks. 4.4 Generalizability of FPNN Features Testing Dataset FP+FC FC Only FP+FC on Source FC Only on Target MN401 93.8 90.7 92.7 MN402 89.4 85.1 88.2 Table 5: Generalizability test of FPNN features. One superior characteristic of CNN features is that features from one task or dataset can be transferred to another task or dataset. We evaluate the generalizability of FPNN features by cross validation — we train on one dataset and test on another. We first split ModelNet40 (lexicographically by the category names) into two parts MN401 and MN402, where each of them contains 20 non-overlapping categories. Then we train two FPNNs in a 1-FC setting (updating both field probing layers and the only one fully connected layer) on these two datasets, achieving 93.8% and 89.4% accuracy, respectively (the second column in Table 5).7 Finally, we fine tune only the fully connected layer of these two FPNNs on the dataset that they were not trained from, and achieved 92.7% and 88.2% on MN401 and MN402, respectively (the fourth column in Table 5), which is comparable to that directly trained from the testing categories. We also trained two FPNNs in 1-FC setting with updating only the fully connected layer, which achieves 90.7% and 85.1% accuracy on MN401 and MN402, respectively (the third column in Table 5). These two FPNNs do not perform as well as the fine-tuned FPNNs (90.7% < 92.7% on MN401 7The performance is higher than that on all the 40 categories, since the classification task is simpler on less categories. The performance gap between MN401 and MN402 is presumably due to the fact that MN401 categories are easier to classify than MN402 ones. 7 and 85.1% < 88.2% on MN402), although all of them only update the fully connected layer. These experiments show that the field probing filters learned from one dataset can be applied to another one. 4.5 Comparison with State-of-the-art Our FPNN [23] (4-FCs+NF) SubvolSup+BN MVCNN-MultiRes 88.4 88.8 93.8 Table 6: Comparison with state-of-the-art methods. We compare the performance of our FPNNs against two state-of-the-art approaches — SubvolSup+BN and MVCNN-MultiRes, both from [23], in Table 6. SubvolSup+BN is a subvolume supervised volumetric 3D CNN, with batch normalization applied during the training, and MVCNNMultiRes is a multi-view multi-resolution image based 2D CNN. Note that our FPNN achieves comparable performance to SubvolSup+BN with less computational complexity. However, both our FPNN and SubvolSup+BN do not perform as well as MVCNN-MultiRes. It is intriguing to answer the question why methods directly operating on 3D data cannot match or outperform multi-view 2D CNNs. The research on closing the gap between these modalities can lead to a deeper understanding of both 2D images and 3D shapes or even higher dimensional data. 4.6 Limitations and Future Work FPNN on Generic Fields. Our framework provides a general means for optimizing probing locations in 3D fields where the gradients can be computed. We suspect this capability might be particularly important for analyzing 3D data with invisible internal structures. Moreover, our approach can easily be extended into higher dimensional fields, where a careful storage design of the input fields is important for making the I/O footprint tractable though. From Probing Filters to Probing Network. In our current framework, the probing filters are independent to each other, which means, they do not share locations and weights, which may result in too many parameters for small training sets. On the other hand, fully shared weights greatly limit the representation power of the probing filters. A trade-off might be learning a probing network, where each probing point belongs to multiple “pathes” in the network for partially sharing parameters. FPNN for Finer Shape Understanding. Our current approach is superior for extracting robust global descriptions of the input data, but lacks the capability of understanding finer structures inside the input data. This capability might be realized by strategically initializing the probing filters hierarchically, and jointly optimizing filters at different hierarchies. 5 Conclusions We proposed a novel design for feature extraction from 3D data, whose computation cost is agnostic to the resolution of data representation. A significant advantage of our design is that long range interaction can be easily coupled. As 3D data is becoming more accessible, we believe that our method will stimulate more work on feature learning from 3D data. We open-source our code at https://github.com/yangyanli/FPNN for encouraging future developments. Acknowledgments We would first like to thank all the reviewers for their valuable comments and suggestions. Yangyan thanks Daniel Cohen-Or and Zhenhua Wang for their insightful proofreading. The work was supported in part by NSF grants DMS-1546206 and IIS-1528025, UCB MURI grant N00014-131-0341, Chinese National 973 Program (2015CB352501), the Stanford AI Lab-Toyota Center for Artificial Intelligence Research, the Max Planck Center for Visual Computing and Communication, and a Google Focused Research award. References [1] D. Boscaini, J. Masci, S. Melzi, M. M. Bronstein, U. Castellani, and P. Vandergheynst. Learning classspecific descriptors for deformable shapes using localized spectral convolutional networks. In SGP, pages 13–23. Eurographics Association, 2015. [2] Davide Boscaini, Jonathan Masci, Emanuele Rodolà, Michael M Bronstein, and Daniel Cremers. Anisotropic diffusion descriptors. CGF, 35(2):431–441, 2016. [3] Alexander M. Bronstein, Michael M. Bronstein, Leonidas J. Guibas, and Maks Ovsjanikov. Shape google: Geometric words and expressions for invariant shape retrieval. ToG, 30(1):1:1–1:20, February 2011. 8 [4] Ding-Yun Chen, Xiao-Pei Tian, Yu-Te Shen, and Ming Ouhyoung. On visual similarity based 3d model retrieval. CGF, 22(3):223–232, 2003. [5] Brian Curless and Marc Levoy. A volumetric method for building complex models from range images. In SIGGRAPH, SIGGRAPH ’96, pages 303–312, New York, NY, USA, 1996. ACM. [6] Jia Deng, Wei Dong, R. Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In CVPR, pages 248–255, June 2009. [7] David L Donoho. Compressed sensing. IEEE Transactions on information theory, 52(4):1289–1306, 2006. [8] Andreas Eitel, Jost Tobias Springenberg, Luciano Spinello, Martin Riedmiller, and Wolfram Burgard. Multimodal deep learning for robust rgb-d object recognition. In IEEE/RSJ International Conference on Intelligent Robots and Systems, pages 681–687. IEEE, 2015. [9] Xavier Glorot and Yoshua Bengio. Understanding the difficulty of training deep feedforward neural networks. In International conference on artificial intelligence and statistics, pages 249–256, 2010. [10] Saurabh Gupta, Ross Girshick, Pablo Arbelaez, and Jitendra Malik. Learning rich features from rgbd images for object detection and segmentation. In ECCV, volume 8695, pages 345–360. Springer International Publishing, 2014. [11] Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In ICML, pages 448–456, 2015. [12] Yangqing Jia, Evan Shelhamer, Jeff Donahue, Sergey Karayev, Jonathan Long, Ross Girshick, Sergio Guadarrama, and Trevor Darrell. Caffe: Convolutional architecture for fast feature embedding. arXiv preprint arXiv:1408.5093, 2014. [13] Andrew E. Johnson and Martial Hebert. Using spin images for efficient object recognition in cluttered 3d scenes. TPAMI, 21(5):433–449, May 1999. [14] Michael Kazhdan, Thomas Funkhouser, and Szymon Rusinkiewicz. Rotation invariant spherical harmonic representation of 3d shape descriptors. In SGP, SGP ’03, pages 156–164, Aire-la-Ville, Switzerland, Switzerland, 2003. Eurographics Association. [15] Y. Lecun, L. Bottou, Y. Bengio, and P. Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278–2324, Nov 1998. [16] Yann LeCun, Yoshua Bengio, and Geoffrey Hinton. Deep learning. Nature, 521:436–444, 2015. [17] Roee Litman and Alexander M Bronstein. Learning spectral descriptors for deformable shape correspondence. TPAMI, 36(1):171–180, 2014. [18] Jonathan Masci, Davide Boscaini, Michael M Bronstein, and Pierre Vandergheynst. Geodesic convolutional neural networks on riemannian manifolds. In ICCV Workshop on 3D Representation and Recognition (3dRR), 2015. [19] Daniel Maturana and Sebastian Scherer. Voxnet: A 3d convolutional neural network for real-time object recognition. In IEEE/RSJ International Conference on Intelligent Robots and Systems. IEEE, September 2015. [20] Vinod Nair and Geoffrey E Hinton. Rectified linear units improve restricted boltzmann machines. In ICML, pages 807–814, 2010. [21] Matthias Nießner, Michael Zollhöfer, Shahram Izadi, and Marc Stamminger. Real-time 3d reconstruction at scale using voxel hashing. ToG, 32(6):169:1–169:11, November 2013. [22] Robert Osada, Thomas Funkhouser, Bernard Chazelle, and David Dobkin. Shape distributions. ToG, 21(4):807–832, October 2002. [23] Charles R. Qi, Hao Su, Matthias Nießner, Angela Dai, Mengyuan Yan, and Leonidas Guibas. Volumetric and multi-view cnns for object classification on 3d data. In CVPR, 2016. [24] Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, AlexanderC. Berg, and Li Fei-Fei. Imagenet large scale visual recognition challenge. IJCV, 115(3):211–252, 2015. [25] Baoguang Shi, Song Bai, Zhichao Zhou, and Xiang Bai. Deeppano: Deep panoramic representation for 3-d shape recognition. IEEE Signal Processing Letters, 22(12):2339–2343, Dec 2015. [26] Richard Socher, Brody Huval, Bharath Bath, Christopher D Manning, and Andrew Y Ng. Convolutionalrecursive deep learning for 3d object classification. In NIPS, pages 665–673, 2012. [27] Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: A simple way to prevent neural networks from overfitting. The Journal of Machine Learning Research, 15(1):1929–1958, 2014. [28] Hang Su, Subhransu Maji, Evangelos Kalogerakis, and Erik G. Learned-Miller. Multi-view convolutional neural networks for 3d shape recognition. In ICCV, 2015. [29] Jian Sun, Maks Ovsjanikov, and Leonidas Guibas. A concise and provably informative multi-scale signature based on heat diffusion. In SGP, pages 1383–1392. Eurographics Association, 2009. [30] DE Rumelhart GE Hinton RJ Williams and GE Hinton. Learning representations by back-propagating errors. Nature, pages 323–533, 1986. [31] Zhirong Wu, Shuran Song, Aditya Khosla, Fisher Yu, Linguang Zhang, Xiaoou Tang, and Jianxiong Xiao. 3d shapenets: A deep representation for volumetric shapes. In CVPR, pages 1912–1920, 2015. 9
2016
309
6,227
Variational Bayes on Monte Carlo Steroids Aditya Grover, Stefano Ermon Department of Computer Science Stanford University {adityag,ermon}@cs.stanford.edu Abstract Variational approaches are often used to approximate intractable posteriors or normalization constants in hierarchical latent variable models. While often effective in practice, it is known that the approximation error can be arbitrarily large. We propose a new class of bounds on the marginal log-likelihood of directed latent variable models. Our approach relies on random projections to simplify the posterior. In contrast to standard variational methods, our bounds are guaranteed to be tight with high probability. We provide a new approach for learning latent variable models based on optimizing our new bounds on the log-likelihood. We demonstrate empirical improvements on benchmark datasets in vision and language for sigmoid belief networks, where a neural network is used to approximate the posterior. 1 Introduction Hierarchical models with multiple layers of latent variables are emerging as a powerful class of generative models of data in a range of domains, ranging from images to text [1, 18]. The great expressive power of these models, however, comes at a significant computational cost. Inference and learning are typically very difficult, often involving intractable posteriors or normalization constants. The key challenge in learning latent variable models is to evaluate the marginal log-likelihood of the data and optimize it over the parameters. The marginal log-likelihood is generally nonconvex and intractable to compute, as it requires marginalizing over the unobserved variables. Existing approaches rely on Monte Carlo [12] or variational methods [2] to approximate this integral. Variational approximations are particularly suitable for directed models, because they directly provide tractable lower bounds on the marginal log-likelihood. Variational Bayes approaches use variational lower bounds as a tractable proxy for the true marginal log-likelihood. While optimizing a lower bound is a reasonable strategy, the true marginal loglikelihood of the data is not necessarily guaranteed to improve. In fact, it is well known that variational bounds can be arbitrarily loose. Intuitively, difficulties arise when the approximating family of tractable distributions is too simple and cannot capture the complexity of the (intractable) posterior, no matter how well the variational parameters are chosen. In this paper, we propose a new class of marginal log-likelihood approximations for directed latent variable models with discrete latent units that are guaranteed to be tight, assuming an optimal choice for the variational parameters. Our approach uses a recently introduced class of random projections [7, 15] to improve the approximation achieved by a standard variational approximation such as mean-field. Intuitively, our approach relies on a sequence of random projections to simplify the posterior, without losing too much information at each step, until it becomes easy to approximate with a mean-field distribution. We provide a novel learning framework for directed, discrete latent variable models based on optimizing this new lower bound. Our approach jointly optimizes the parameters of the generative model and the variational parameters of the approximating model using stochastic gradient descent 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. (SGD). We demonstrate an application of this approach to sigmoid belief networks, where neural networks are used to specify both the generative model and the family of approximating distributions. We use a new stochastic, sampling based approximation of the variational projected bound, and show empirically that by employing random projections we are able to significantly improve the marginal log-likelihood estimates. Overall, our paper makes the following contributions: 1. We extend [15], deriving new (tight) stochastic bounds for the marginal log-likelihood of directed, discrete latent variable models. 2. We develop a “black-box” [23] random-projection based algorithm for learning and inference that is applicable beyond the exponential family and does not require deriving potentially complex updates or gradients by hand. 3. We demonstrate the superior performance of our algorithm on sigmoid belief networks with discrete latent variables in which a highly expressive neural network approximates the posterior and optimization is done using an SGD variant [16]. 2 Background setup Let pθ(X, Z) denote the joint probability distribution of a directed latent variable model parameterized by θ. Here, X = {Xi}m i=1 represents the observed random variables which are explained through a set of latent variables Z = {Zi}n i=1. In general, X and Z can be discrete or continuous. Our learning framework assumes discrete latent variables Z whereas X can be discrete or continuous. Learning latent variable models based on the maximum likelihood principle involves an intractable marginalization over the latent variables. There are two complementary approaches to learning latent variable models based on approximate inference which we discuss next. 2.1 Learning based on amortized variational inference In variational inference, given a data point x, we introduce a distribution qφ(z) parametrized by a set of variational parameters φ. Using Jensen’s inequality, we can lower bound the marginal log-likelihood of x as an expectation with respect to q. log pθ(x) = log X z pθ(x, z) = log X z qφ(z) · pθ(x, z) qφ(z) ≥ X z qφ(z) · log pθ(x, z) qφ(z) = Eq[log pθ(x, z) −log qφ(z)]. (1) The evidence lower bound (ELBO) above is tight when qφ(z) = pθ(z|x). Therefore, variational inference can be seen as a problem of computing the parameters φ from an approximating family of distributions Q such that the ELBO can be evaluated efficiently and the approximate posterior over the latent variables is close to the true posterior. In the setting we consider, we only have access to samples x ∼pθ(x) from the underlying distribution. Further, we can amortize the cost of inference by learning a single data-dependent variational posterior qφ(z|x) [9]. This increases the generalization strength of our approximate posterior and speeds up inference at test time. Hence, learning using amortized variational inference optimizes the average ELBO (across all x) jointly over the model parameters (θ) as well as the variational parameters (φ). 2.2 Learning based on importance sampling A tighter lower bound of the log-likelihood can be obtained using importance sampling (IS) [4]. From this perspective, we view qφ(z|x) as a proposal distribution and optimize the following lower bound: log pθ(x) ≥Eq " log 1 S S X i=1 pθ(x, zi) qφ(zi|x) # (2) 2 where each of the S samples are drawn from qφ(z|x). The IS estimate reduces to the variational objective for S = 1 in Eq. (1). From Theorem 1 of [4], the IS estimate is also a lower bound to the true log-likelihood of a model and is asymptotically unbiased under mild conditions. Furthermore, increasing S will never lead to a weaker lower bound. 3 Learning using random projections Complex data distributions are well represented by generative models that are flexible and have many modes. Even though the posterior is generally much more peaked than the prior, learning a model with multiple modes can help represent arbitrary structure and supports multiple explanations for the observed data. This largely explains the empirical success of deep models for representational learning, where the number of modes grows nearly exponentially with the number of hidden layers [1, 22]. Sampling-based estimates for the marginal log-likelihood in Eq. (1) and Eq. (2) have high variance, because they might “miss” important modes of the distribution. Increasing S helps but one might need an extremely large number of samples to cover the entire posterior if it is highly multi-modal. 3.1 Exponential sampling Our key idea is to use random projections [7, 15, 28], a hash-based inference scheme that can efficiently sample an exponentially large number of latent variable configurations from the posterior. Intuitively, instead of sampling a single latent configuration each time, we sample (exponentially large) buckets of configurations defined implicitly as the solutions to randomly generated constraints. Formally, let P be the set of all posterior distributions defined over z ∈{0, 1}n conditioned on x. 1 A random projection Rk A,b : P →P is a family of operators specified by A ∈{0, 1}k×n, b ∈{0, 1}k for a k ∈{0, 1, . . . , n}. Each operator maps the posterior distribution pθ(z|x) to another distribution Rk A,b[pθ(z|x)] with probability mass proportional to pθ(z|x) and a support set restricted to {z : Az = b mod 2}. When A, b are chosen uniformly at random, this defines a family of pairwise independent hash functions H = {hA,b(z) : {0, 1}n →{0, 1}k} where hA,b(z) = Az + b mod 2. See [7, 27] for details. The constraints on the space of assignments of z can be viewed as parity (XOR) constraints. The random projection reduces the dimensionality of the problem in the sense that a subset of k variables becomes a deterministic function of the remaining n−k. 2 By uniformly randomizing over the choice of the constraints, we can extend similar results from [28] to get the following expressions for the first and second order moments of the normalization constant of the projected posterior distribution. Lemma 3.1. Given A ∈{0, 1}k×n iid ∼Bernoulli( 1 2) and b ∈{0, 1}k iid ∼Bernoulli( 1 2) for k ∈ {0, 1, . . . , n}, we have the following relationships: EA,b " X z:Az=b mod 2 pθ(x, z) # = 2−kpθ(x) (3) V ar  X z:Az=b mod 2 pθ(x, z)  = 2−k(1 −2−k) X z pθ(x, z)2 (4) Hence, a typical random projection of the posterior distribution partitions the support into 2k subsets or buckets, each containing 2n−k states. In contrast, typical Monte Carlo estimators for variational inference and importance sampling can be thought of as partitioning the state space into 2n subsets, each containing a single state. There are two obvious challenges with this random projection approach: 1. What is a good proposal distribution to select the appropriate constraint sets, i.e., buckets? 1For brevity, we use binary random variables, although our analysis extends to discrete random variables. 2This is the typical case: randomly generated constraints can be linearly dependent, leading to larger buckets. 3 2. Once we select a bucket, how can we perform efficient inference over the (exponentially large number of) configurations within the bucket? Surprisingly, using a uniform proposal for 1) and a simple mean-field inference strategy for 2), we will provide an estimator for the marginal log-likelihood that will guarantee tight bounds for the quality of our solution. Unlike the estimates produced by variational inference in Eq. (1) and importance sampling in Eq. (2) which are stochastic lower bounds for the true log-likelihood, our estimate will be a provably tight approximation for the marginal log-likelihood with high probability using a small number of samples, assuming we can compute an optimal mean-field approximation. Given that finding an optimal mean-field (fully factored) approximation is a non-convex optimization problem, our result does not violate known worst-case hardness results for probabilistic inference. 3.2 Tighter guarantees on the marginal log-likelihood Intuitively, we want to project the posterior distribution in a “predictable” way such that key properties are preserved. Specifically, in order to apply the results in Lemma 3.1, we will use a uniform proposal for any given choice of constraints. Secondly, we will reason about the exponential configurations corresponding to any given choice of constraint set using variational inference with an approximating family of tractable distributions Q. We follow the proof strategy of [15] and extend their work on bounding the partition function for inference in undirected graphical models to the learning setting for directed latent variable models. We assume the following: Assumption 3.1. The set D of degenerate distributions, i.e., distributions which assign all the probability mass to a single configuration, is contained in Q: D ⊂Q. This assumption is true for most commonly used approximating families of distributions such as mean-field QMF = {q(z) : q(z) = q1(z1) · · · qℓ(xℓ)}, structured mean-field [3], etc. We now define a projected variational inference problem as follows: Definition 3.1. Let Ak t ∈{0, 1}k×n iid ∼Bernoulli( 1 2) and bk t ∈{0, 1}k iid ∼Bernoulli( 1 2) for k ∈ [0, 1, · · · , n] and t ∈[1, 2, · · · , T]. Let Q be a family of distributions such that Assumption 3.1 holds. The optimal solutions for the projected variational inference problems, γk t , are defined as follows: log γk t (x) = max q∈Q X z:Ak t z=bk t mod 2 qφ(z|x) log pθ(x, z) −log qφ(z|x)  (5) We now derive bounds on the marginal likelihood pθ(x) using two estimators that aggregate solutions to the projected variational inference problems. 3.2.1 Bounds based on mean aggregation Our first estimator is a weighted average of the projected variational inference problems. Definition 3.2. For any given k, the mean estimator over T instances of the projected variational inference problems is defined as follows: Lk,T µ (x) = 1 T T X t=1 γk t (x)2k. (6) Note that the stochasticity in the mean estimator is due to the choice of our random matrices Ak t , bk t in Definition 5. Consequently, we obtain the following guarantees: Theorem 3.1. The mean estimator is a lower bound for pθ(x) in expectation: E  Lk,T µ (x)  ≤pθ(x). Moreover, there exists a k⋆and a positive constant α such that for any ∆> 0, if T ≥1 α (log(2n/∆)) then with probability at least (1 −2∆), Lk⋆,T µ (x) ≥ pθ(x) 64(n + 1). 4 Proof sketch: For the first part of the theorem, note that the solution of a projected variational problem for any choice of Ak t and bk t with a fixed k in Eq. (5) is a lower bound to the sum P z:Ak t z=bk t mod 2 pθ(x, z) using Eq. (1). Now, we can use Eq. (3) in Lemma 3.1 to obtain the upper bound in expectation. The second part of the proof extends naturally from Theorem 3.2 which we state next. Please refer to the supplementary material for a detailed proof. 3.2.2 Bounds based on median aggregation We can additionally aggregate the solutions to Eq. (5) using the median estimator. This gives us tighter guarantees, including a lower bound that does not require us to take an expectation. Definition 3.3. For any given k, the median estimator over T instances of the projected variational inference problems is defined as follows: Lk,T Md(x) = Median γk 1(x), · · · , γk T (x)  2k. (7) The guarantees we obtain through the median estimator are formalized in the theorem below: Theorem 3.2. For the median estimator, there exists a k⋆> 0 and positive constant α such that for any ∆> 0, if T ≥1 α (log(2n/∆)) then with probability at least (1 −2∆), 4pθ(x) ≥Lk⋆,T Md (x) ≥ pθ(x) 32(n + 1) Proof sketch: The upper bound follows from the application of Markov’s inequality to the positive random variable P z:Ak t z=bk t mod 2 pθ(x, z) (first moments are bounded from Lemma 3.1) and γk t (x) lower bounds this sum. The lower bound of the above theorem extends a result from Theorem 2 of [15]. Please refer to the supplementary material for a detailed proof. Hence, the rescaled variational solutions aggregated through a mean or median can provide tight bounds on the log-likelihood estimate for the observed data with high probability unlike the ELBO estimates in Eq. (1) and Eq. (2), which could be arbitrarily far from the true log-likelihood. 4 Algorithmic framework In recent years, there have been several algorithmic advancements in variational inference and learning using black-box techniques [23]. These techniques involve a range of ideas such as the use of mini-batches, amortized inference, Monte Carlo gradient computation, etc., for scaling variational techniques to large data sets. See Section 6 for a discussion. In this section, we integrate random projections into a black-box algorithm for belief networks, a class of directed, discrete latent variable models. These models are especially hard to learn, since the “reparametrization trick” [17] is not applicable to discrete latent variables leading to gradient updates with high variance. 4.1 Model specification We will describe our algorithm using the architecture of a sigmoid belief network (SBN), a multi-layer perceptron which is the basic building block for directed deep generative models with discrete latent variables [21]. A sigmoid belief network consists of L densely connected layers of binary hidden units (Z1:L) with the bottom layer connected to a single layer of binary visible units (X). The nodes and edges in the network are associated with biases and weights respectively. The state of the units in the top layer (ZL) is a sigmoid function (σ(·)) of the corresponding biases. For all other layers, the conditional distribution of any unit given its parents is represented compactly by a non-linear activation of the linear combination of the weights of parent units with their binary state and an additive bias term. The generative process can be summarized as follows: p(ZL i = 1) = σ(bL i ); p(Zl i = 1|zl+1) = σ(W l+1 · zl+1 + bl i); p(Xi = 1|z1) = σ(W 1 · z1 + b0 i ) In addition to the basic SBN design, we also consider the amortized inference setting. Here, we have an inference network with the same architecture as the SBN, but the feedforward loop running in the reverse direction from the input (x) to the output q(zL|x). 5 Algorithm 1 VB-MCS: Learning belief networks with random projections. VB-MCS (Mini-batches {xh}H h=1, Generative Network (G, θ), Inference Network (I, φ), Epochs E, Constraints k, Instances T) for e = 1 : E do for h = 1 : H do for t = 1 : T do Sample A ∈{0, 1}k×n iid ∼Bernoulli( 1 2) and b ∈{0, 1}k iid ∼Bernoulli( 1 2) C, b′ ←RowReduce(A, b) log γk t (xh) ←ComputeProjectedELBO(xh, G, θ, I, φ, C, b′) log Lk,T (xh) ←log [Aggregate(γk 1(xh), · · · , γk T (xh))] Update θ, φ ←StochasticGradientDescent(−log Lk,T (xh)) return θ, φ 4.2 Algorithm The basic algorithm for learning belief networks with augmented inference networks is inspired by the wake-sleep algorithm [13]. One key difference from the wake-sleep algorithm is that there is a single objective being optimized. This is typically the ELBO (see Eq. ( 1)) and optimization is done using stochastic mini-batch descent jointly over the model and inference parameters. Training consists of two alternating phases for every mini-batch of points. The first step makes a forward pass through the inference network producing one or more samples from the top layer of the inference network, and finally, these samples complete a forward pass through the generative network. The reverse pass computes the gradient of the model and variational parameters with respect to the ELBO in Eq. (1) and uses these gradient updates to perform a gradient descent step on the ELBO. We now introduce a black-box technique within this general learning framework, which we refer to as Variational Bayes on Monte Carlo Steroids (VB-MCS) due to the exponential sampling property. VB-MCS requires as input a data-dependent parameter k, which is the number of variables to constrain. At every training epoch, we first sample entries of a full-rank constraint matrix A ∈{0, 1}k×n and vector b ∈{0, 1}k and then optimize for the objective corresponding to a projected variational inference problem defined in Eq. (5). This procedure is repeated for T problem instances, and the individual likelihood estimates are aggregated using the mean or median based estimators defined in Eq. (6) and Eq. (7). The pseudocode is given in Algorithm 1. For computing the projected ELBO, the inference network considers the marginal distribution of only n −k free latent variables. We consider the mean-field family of approximations where the free latent variables are sampled independently from their corresponding marginal distributions. The remaining k latent variables are specified by parity constraints. Using Gaussian elimination, the original linear system Az = b mod 2 is reduced into a row echleon representation of the form Cz = b′ where C = [Ikxk|A′] such that A′ ∈{0, 1}k×(n−k) and b′ ∈{0, 1}k. Finally, we read off the constrained variables as zj = Ln i=k+1 cjizi ⊕b′ j for j = 1, 2, · · · , k where ⊕is the XOR operator. 5 Experimental evaluation We evaluated the performance of VB-MCS as a black-box technique for learning discrete, directed latent variable models for images and documents. Our test-architecture is a simple sigmoid belief network with a single hidden layer consisting of 200 units and a visible layer. Through our experiments, we wish to demonstrate that the theoretical advantage offered by random projections easily translates into practice using an associated algorithm such as VB-MCS. We will compare a baseline sigmoid belief network (Base-SBN) learned using Variational Bayes and evaluate it against a similar network with parity constraints imposed on k latent variables (henceforth, referred as k-SBN) and learned using VB-MCS. We now discuss some parameter settings below, which have been fixed with respect to the best validation performance of Base-SBN on the Caltech 101 Silhouettes dataset. Implementation details: The prior probabilities for the latent layer are specified using autoregressive connections [10]. The learning rate was fixed based on validation performance to 3 × 10−4 for the generator network and reduced by a factor of 5 for the inference network. Mini-batch size was fixed 6 Table 1: Test performance evaluation of VB-MCS. Random projections lead to improvements in terms of estimated negative log-likelihood and log-perplexity. Dataset Evaluation Metric Base k=5 k=10 k=20 Vision: Caltech 101 Silhouettes NLL 251.04 245.60 248.79 256.60 Language: NIPS Proceedings log-perplexity 5009.79 4919.35 4919.22 4920.71 (a) Dataset Images (b) Denoised Images (c) Samples Figure 1: Denoised images (center) of the actual ones (left) and sample images (right) generated from the best k-SBN model trained on the Caltech 101 Silhouettes dataset. to 20. Regularization was imposed by early stopping of training after 50 epochs. The optimizer used is Adam [16]. For k-SBN, we show results for three values of k: 5, 10, and 20, and the aggregation is done using the median estimator with T = 3. 5.1 Generative modeling of images in the Caltech 101 Silhouettes dataset We trained a generative model for silhouette images of 28 × 28 dimensions from the Caltech 101 Silhouettes dataset 3. The dataset consists of 4,100 train images, 2,264 validation images and 2,307 test images. This is a particularly hard dataset due to the asymmetry in silhouettes compared to other commonly used structured datasets. As we can see in Table 1, the k-SBNs trained using VB-MCS can outperform the Base-SBN by several nats in terms of the negative log-likelihood estimates on the test set. The performance for k-SBNs dips as we increase k, which is related to the empirical quality of the approximation our algorithm makes for different k values. The qualitative evaluation results of SBNs trained using VB-MCS and additional control variates [19] on denoising and sampling are shown in Fig. 1. While the qualitative evaluation is subjective, the denoised images seem to smooth out the edges in the actual images. The samples generated from the model largely retain essential qualities such as silhouette connectivity and varying edge patterns. 5.2 Generative modeling of documents in the NIPS Proceedings dataset We performed the second set of experiments on the latest version of the NIPS Proceedings dataset4 which consists of the distribution of words in all papers that appeared in NIPS from 1988-2003. We performed a 80/10/10 split of the dataset into 1,986 train, 249 validation, and 248 test documents. The relevant metric here is the average perplexity per word for D documents, given by P = exp −1 D PD i=1 1 Li log p(xi)  where Li is the length of document i. We feed in raw word counts per document as input to the inference network and consequently, the visible units in the generative network correspond to the (unnormalized) probability distribution of words in the document. Table 1 shows the log-perplexity scores (in nats) on the test set. From the results, we again observe the superior performance of all k-SBNs over the Base-SBN. The different k-SBNs have comparable performance, although we do not expect this observation to hold true more generally for other 3Available at https://people.cs.umass.edu/~marlin/data.shtml 4Available at http://ai.stanford.edu/~gal/ 7 datasets. For a qualitative evaluation, we sample the relative word frequencies in a document and then generate the top-50 words appearing in a document. One such sampling is shown in Figure 2. The bag-of-words appears to be semantically reflective of coappearing words in a NIPS paper. 6 Discussion and related work Figure 2: Bag-of-words for a 50 word document sampled from the best k-SBN model trained on the NIPS Proceedings dataset. There have been several recent advances in approximate inference and learning techniques from both a theoretical and empirical perspective. On the empirical side, the various blackbox techniques [23] such as mini-batch updates [14], amortized inference [9] etc. are key to scaling and generalizing variational inference to a wide range of settings. Additionally, advancements in representational learning have made it possible to specify and learn highly expressive directed latent variable models based on neural networks, for e.g., [4, 10, 17, 19, 20, 24]. Rather than taking a purely variational or sampling-based approach, these techniques stand out in combining the computational efficiency of variational techniques with the generalizability of Monte Carlo methods [25, 26]. On the theoretical end, there is a rich body of recent work in hash-based inference applied to sampling [11], variational inference [15], and hybrid inference techniques at the intersection of the two paradigms [28]. The techniques based on random projections have not only lead to better algorithms but more importantly, they come with strong theoretical guarantees [5, 6, 7]. In this work, we attempt to bridge the gap between theory and practice by employing hash-based inference techniques to the learning of latent variable models. We introduced a novel bound on the marginal log-likelihood of directed latent variable models with discrete latent units. Our analysis extends the theory of random projections for inference previously done in the context of discrete, fully-observed log-linear undirected models to the general setting of both learning and inference in directed latent variable models with discrete latent units while the observed data can be discrete or continuous. Our approach combines a traditional variational approximation with random projections to get provable accuracy guarantees and can be used to improve the quality of traditional ELBOs such as the ones obtained using a mean-field approximation. The power of black-box techniques lies in their wide applicability, and in the second half of the paper, we close the loop by developing VB-MCS, an algorithm that incorporates the theoretical underpinnings of random projections into belief networks that have shown tremendous promise for generative modeling. We demonstrate an application of this idea to sigmoid belief networks, which can also be interpreted as probabilistic autoencoders. VB-MCS simultaneously learns the parameters of the (generative) model and the variational parameters (subject to random projections) used to approximate the intractable posterior. Our approach can still leverage backpropagation to efficiently compute gradients of the relevant quantities. The resulting algorithm is scalable and the use of random projections significantly improves the quality of the results on benchmark data sets in both vision and language domains. Future work will involve devising random projection schemes for latent variable models with continuous latent units and other variational families beyond mean-field [24]. On the empirical side, it would be interesting to investigate potential performance gains by employing complementary heuristics such as variance reduction [19] and data augmentation [8] in conjunction with random projections. Acknowledgments This work was supported by grants from the NSF (grant 1649208) and Future of Life Institute (grant 2016-158687). 8 References [1] Y. Bengio. Learning deep architectures for AI. Foundations and trends in ML, 2(1):1–127, 2009. [2] D. M. Blei, A. Y. Ng, and M. I. Jordan. Latent dirichlet allocation. JMLR, 3:993–1022, 2003. [3] A. Bouchard-Côté and M. I. Jordan. Optimization of structured mean field objectives. In UAI, 2009. [4] Y. Burda, R. Grosse, and R. Salakhutdinov. Importance weighted autoencoders. In ICLR, 2016. [5] S. Ermon, C. Gomes, A. Sabharwal, and B. Selman. Low-density parity constraints for hashing-based discrete integration. In ICML, 2014. [6] S. Ermon, C. P. Gomes, A. Sabharwal, and B. Selman. Optimization with parity constraints: From binary codes to discrete integration. In UAI, 2013. [7] S. Ermon, C. P. Gomes, A. Sabharwal, and B. Selman. Taming the curse of dimensionality: Discrete integration by hashing and optimization. In ICML, 2013. [8] Z. Gan, R. Henao, D. E. Carlson, and L. Carin. Learning deep sigmoid belief networks with data augmentation. In AISTATS, 2015. [9] S. Gershman and N. D. Goodman. Amortized inference in probabilistic reasoning. In Proceedings of the Thirty-Sixth Annual Conference of the Cognitive Science Society, 2014. [10] K. Gregor, I. Danihelka, A. Mnih, C. Blundell, and D. Wierstra. Deep autoregressive networks. In ICML, 2014. [11] S. Hadjis and S. Ermon. Importance sampling over sets: A new probabilistic inference scheme. In UAI, 2014. [12] G. E. Hinton. Training products of experts by minimizing contrastive divergence. Neural computation, 14(8):1771–1800, 2002. [13] G. E. Hinton, P. Dayan, B. J. Frey, and R. M. Neal. The "wake-sleep" algorithm for unsupervised neural networks. Science, 268(5214):1158–1161, 1995. [14] M. D. Hoffman, D. M. Blei, C. Wang, and J. Paisley. Stochastic variational inference. JMLR, 14(1):1303– 1347, 2013. [15] L.-K. Hsu, T. Achim, and S. Ermon. Tight variational bounds via random projections and I-projections. In AISTATS, 2016. [16] D. Kingma and J. Ba. Adam: A method for stochastic optimization. In ICLR, 2015. [17] D. P. Kingma and M. Welling. Auto-encoding variational bayes. In ICLR, 2014. [18] H. Lee, R. Grosse, R. Ranganath, and A. Y. Ng. Convolutional deep belief networks for scalable unsupervised learning of hierarchical representations. In ICML, 2009. [19] A. Mnih and K. Gregor. Neural variational inference and learning in belief networks. In ICML, 2014. [20] A. Mnih and D. J. Rezende. Variational inference for Monte Carlo objectives. In ICML, 2016. [21] R. M. Neal. Connectionist learning of belief networks. AIJ, 56(1):71–113, 1992. [22] H. Poon and P. Domingos. Sum-product networks: A new deep architecture. In UAI, 2011. [23] R. Ranganath, S. Gerrish, and D. M. Blei. Black box variational inference. In AISTATS, 2013. [24] D. J. Rezende and S. Mohamed. Variational inference with normalizing flows. In ICML, 2015. [25] T. Salimans, D. P. Kingma, and M. Welling. Markov chain Monte Carlo and variational inference: Bridging the gap. In ICML, 2015. [26] M. Titsias and M. Lázaro-Gredilla. Local expectation gradients for black box variational inference. In NIPS, 2015. [27] S. P. Vadhan et al. Pseudorandomness. In Foundations and Trends in TCS, 2011. [28] M. Zhu and S. Ermon. A hybrid approach for probabilistic inference using random projections. In ICML, 2015. 9
2016
31
6,228
Object based Scene Representations using Fisher Scores of Local Subspace Projections Mandar Dixit and Nuno Vasconcelos Department of Electrical and Computer Engineering University of California, San Diego {mdixit, nvasconcelos}@ucsd.edu Abstract Several works have shown that deep CNNs can be easily transferred across datasets, e.g. the transfer from object recognition on ImageNet to object detection on Pascal VOC. Less clear, however, is the ability of CNNs to transfer knowledge across tasks. A common example of such transfer is the problem of scene classification, that should leverage localized object detections to recognize holistic visual concepts. While this problems is currently addressed with Fisher vector representations, these are now shown ineffective for the high-dimensional and highly non-linear features extracted by modern CNNs. It is argued that this is mostly due to the reliance on a model, the Gaussian mixture of diagonal covariances, which has a very limited ability to capture the second order statistics of CNN features. This problem is addressed by the adoption of a better model, the mixture of factor analyzers (MFA), which approximates the non-linear data manifold by a collection of local sub-spaces. The Fisher score with respect to the MFA (MFA-FS) is derived and proposed as an image representation for holistic image classifiers. Extensive experiments show that the MFA-FS has state of the art performance for object-to-scene transfer and this transfer actually outperforms the training of a scene CNN from a large scene dataset. The two representations are also shown to be complementary, in the sense that their combination outperforms each of the representations by itself. When combined, they produce a state-of-the-art scene classifier. 1 Introduction In recent years, convolutional neural networks (CNNs) trained on large scale datasets have achieved remarkable performance on traditional vision problems such as image classification [8, 18, 26], object detection and localization [5, 16] and others. The success of CNNs can be attributed to their ability to learn highly discriminative, non-linear, visual transformations with the help of supervised backpropagation [9]. Beyond the impressive, sometimes even superhuman, results on certain datasets, a remarkable property of these classifiers is the solution of the dataset bias problem [20] that has plagued computer vision for decades. It has now been shown many times that a network trained to solve a task on a certain dataset (e.g. object recognition on ImageNet) can be very easily fine-tuned to solve a related problem on another dataset (e.g. object detection on the Pascal VOC or MS-COCO). Less clear, however, is the robustness of current CNNs to the problem of task bias, i.e. their ability to generalize accross tasks. Given the large number of possible vision tasks, it is impossible to train a CNN from scratch for each. In fact, it is likely not even feasible to collect the large number of images needed to train effective deep CNNs for every task. Hence, there is a need to investigate the problem of task transfer. In this work, we consider a very common class of such problems, where a classifier trained on a class of instances is to be transferred to a second class of instances, which are loose combinations of the 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. original ones. In particular, we consider the problem where the original instances are objects and the target instances are scene-level concepts that somehow depend on those objects. Examples of this problem include the transfer of object classifiers to tasks such as scene classification [6, 11, 2] or image captioning [23]. In all these cases, the goal is to predict holistic scene tags from the scores (or features) from an object CNN classifier. The dependence of the holistic descriptions on these objects could range from very explicit to very subtle. For example, on the explicit end of the spectrum, an image captioning system could produce sentence such as “a person is sitting on a stool and feeding a zebra.” On the other hand, on the subtle end of the spectrum, a scene classification system would leverage the recognition of certain rocks, tree stumps, bushes and a particular lizard species to label an image with the tag “Joshua Tree National Park”. While it is obviously possible 1) to collect a large dataset of images, and 2) use them to train a CNN to directly solve each of these tasks, this approach has two main limitations. First, it is extremely time consuming. Second, the “directly learned” CNN will typically not accommodate explicit relations between the holistic descriptions and the objects in the scene. This has, for example, been documented in the scene classification literature, where the performance of the best “directly learned” CNNs [26], can be substantially improved by fusion with object recognition CNNs [6, 11, 2]. So far, the transfer from object CNNs to holistic scene description has been most extensively studied in the area of scene classification, where state of the art results have been obtained with the bag of semantics representation of [2]. This consists of feeding image patches through an object recognition CNN, collecting a bag vectors of object recognition scores, and embedding this bag into a fixed dimensional vector space with recourse to a Fisher vector [7]. While there are variations of detail, all other competitive methods are based on a similar architecture [6, 11]. This observation is, in principle, applicable to other tasks. For example, the state of the art in image captioning is to use a CNN as an image encoder that extracts a feature vector from the image. This feature vector is the fed to a natural language decoder (typically an LSTM) that produces sentences. While there has not yet been an extensive investigation of the best image encoder, it is likely that the best representations for scene classification should also be effective encodings for language generation. For these reasons, we restrict our attention to the scene classifcation problem in the remainder of this work, focusing on the question of how to address possible limitations of the Fisher vector embedding. We note, in particular, that while Fisher vectors have been classically defined using gradients of image loglikelihood with respect to the means and variances of a Gaussian mixture model (GMM) [13], this definition has not been applied universally in the CNN transfer context, where variance statistics are often disregarded [6, 2]. In this work we make several contributions to the use of Fisher vector type of representations for object to scene transfer. The first is to show that, for object recognition scores produced by a CNN [2], variance statistics are much less informative of scene class distributions than the mean gradients, and can even degrade scene classification performance. We then argue that this is due to the inability of the standard GMM of diagonal covariances to provide a good approximation to the non-linear manifold of CNN responses. This leads to the adoption of a richer generative model, the mixture of factor analyzers (MFA) [4, 22], which locally approximates the scene class manifold by low-dimensional linear spaces. Our second contribution is to show that, by locally projecting the feature data into these spaces, the MFA can efficiently model its local covariance structure. For this, we derive the Fisher score of the MFA model, denoted the MFA Fisher score (MFA-FS), a representation similar to the GMM Fisher vector of [13, 17]. We show that, for high dimensional CNN features, the MFA-FS captures highly discriminative covariance statistics, which were previously unavailable in [6, 2], producing significantly improved scene classification over the conventional GMM Fisher vector. The third contribution is a detailed experimental investigation of the MFA-FS. Since this can be seen as a second order pooling mechanism, we compare it to a number of recent methods for second order pooling of CNN features [21, 3]. Although these methods describe global covariance structure, they lack the ability of the MFA-FS to capture that information along locally linear approximations of the highly non-linear CNN feature manifold. This is shown to be important, as the MFA-FS is shown to outperform all these representations by non-trivial margins. Finally, we show that the MFA-FS enables effective task transfer, by showing that MFA-FS vectors extracted from deep CNNs trained for ImageNet object recognition [8, 18], achieve state-of-the-art results on challenging scene recognition benchmarks, such as SUN [25] and MIT Indoor Scenes [14]. 2 2 Fisher scores In computer vision, an image I is frequently interpreted as a set of descriptors D = {x1, . . . , xn} sampled from some generative model p(x; θ). Since most classifiers require fixed-length inputs, it is common to map the set D into a fixed-length vector. A popular mapping consists of computing the gradient (with respect to θ) of the log-likelihood ∇θL(θ) = ∂ ∂θ log p(D; θ) for a model θb. This is known as the Fisher score of θ. This gradient vector is often normalized by the square root of the Fisher information matrix F, according to F−1 2 ∇θL(θ). This is referred to as the Fisher vector (FV) [7] representation of I. While the Fisher vector is frequently used with a Gaussian mixture model (GMM) [13, 17], any generative model p(x; θ) can be used. However, the information matrix is not always easy to compute. When this is case, it is common to rely on the simpler representation of I by the score ∇θL(θ). This is, for example, the case with the sparse coded gradient vectors in [11]. We next show that, for models with hidden variables, the Fisher score can be obtained trivially from the steps of the expectation maximization (EM) algorithm commonly used to learn such models. 2.1 Fisher Scores from EM Consider the log-likelihood of D under a latent-variable model log p(D; θ) = log R p(D, z; θ)dz of hidden variable z. Since the left-hand side does not depend on the hidden variable, this can be written in an alternate form, which is widely used in the EM literature, log p(D; θ) = Z q(z) log p(D, z; θ)dz − Z q(z) log q(z)dz + Z q(z) log q(z) p(z|D; θ)dz = Q(q; θ) + H(q) + KL(q||p; θ) (1) where Q(q; θ) is the “Q” function, q(z) a general probability distribution, H(q) its differential entropy and KL(q||p; θ) the Kullback Liebler divergence between the posterior p(z|D; θ) and q(z). Hence, ∂ ∂θ log p(D; θ) = ∂ ∂θQ(q; θ) + ∂ ∂θKL(q||p; θ) (2) where ∂ ∂θKL(q||p; θ) = − Z q(z) p(z|D; θ) ∂ ∂θp(z|D; θ)dz. (3) In each iteration of the EM algorithm the q distribution is chosen as q(z) = p(z|D; θb), where θb is a reference parameter vector (the parameter estimates from the previous EM iteration) and Q(q; θ) = Z p(z|D; θb) log p(D, z; θ)dz = Ez|D;θb[log p(D, z; θ)]. (4) It follows that ∂ ∂θKL(q||p; θ) θ=θb = − Z p(z|D; θb) p(z|D; θb) ∂ ∂θp(z|D; θ) θ=θb dz = −∂ ∂θ Z p(z|D; θ) θ=θb dz = 0 and ∂ ∂θ log p(D; θ) θ=θb = ∂ ∂θQ(p(z|D; θb); θ) θ=θb . (5) In summary, the Fisher score ∇θL(θ)|{θ=θb} of background model θb is the gradient of the Q-function of EM evaluated at reference model θb. The computation of the score thus simplifies into the two steps of EM. First, the E step computes the Q function Q(p(z|x; θb); θ) at the reference θb. Second, the M-step evaluates the gradient of the Q function with respect to θ at θ = θb. This interpretation of the Fisher score is particularly helpful when efficient implementations of the EM algorithm are available, e.g. the recursive Baum-Welch computations commonly used to learn hidden Markov models [15]. For more tractable distributions, such as the GMM, it enables the simple reuse of the EM equations, which are always required to learn the reference model θb, to compute the Fisher score. 3 2.2 Bag of features Fisher scores are usually combined with the bag-of-features representation, where an image is described as an orderless collection of localized descriptors D = {x1, x2, . . . xn}. These were traditionally SIFT descriptors, but have more recently been replaced with responses of object recognition CNNs [6, 1, 2]. In this work we use the semantic features proposed in [2], which are obtained by transforming softmax probability vectors pi, obtained for image patches, into their natural parameter form. These features were shown to perform better than activations of other CNN layers [2]. 2.3 Gaussian Mixture Fisher Vectors A GMM is a model with a discrete hidden variable that determines the mixture component which explains the observed data. The generative process is as follows. A mixture component zi is first sampled from a multinomial distribution p(z = k) = wk. An observation xi is then sampled from the Gaussian component p(x|z = k) ∼G(x, µk, σk) of mean µk and variance σk. Both the hidden and observed variables are sampled independently, and the Q function simplifies to Q(p(z|D; θb); θ) = X i Ezi|xi;θb hX k I(zi, k) log p(xi, k; θ) i = X i,k hik log p(xi|zi = k; θ)wk (6) where I(.) is the indicator function and hik is the posterior probability p(k|xi; θb). The probability vectors hi are the only quantities computed in the E-step. In the Fisher vector literature [13, 17], the GMM is assumed to have diagonal covariances. This is denoted as the variance-GMM. Substituting the expressions of p(xi|zi = k; θ) and differentiating the Q function with respect to parameters θ = {µk, σk} leads to the two components of the Fisher score Gµd k(I) = ∂ ∂µd k L(θ) = X i p(k|xi) xd i −µd k (σd k)2  (7) Gσd k(I) = ∂ ∂σd k L(θ) = X i p(k|xi) (xd i −µd k)2 (σd k)3 −1 σd k  . (8) These quantities are evaluated using a reference model θb = {µb k, σb k} learned (with EM) from all training data. To compute the Fisher vectors, scores in (7) and (8) are often scaled by an approximate Fisher information matrix, as detailed in [17]. When used with SIFT descriptors, these mean and variance scores usually capture complimentary discriminative information, useful for image classification [13]. Yet, FVs computed from CNN features only use the mean gradients similar to (7), ignoring second-order statistics [6, 2]. In the experimental section, we show that the variance statistics of CNN features perform poorly compared to the mean gradients. This is perhaps due to the inability of the variance-GMM to accurately model data in high dimensions. We test this hypothesis by considering a model better suited for this task. 2.4 Fisher Scores for the Mixture of Factor Analyzers A factor analyzer (FA) is a type of a Gaussian distribution that models high dimensional observations x ∈RD in terms of latent variables or “factors” z ∈RR defined on a low-dimensional subspace R << D [4]. The process can be written as x = Λz + ϵ, where Λ is known as the factor loading matrix and ϵ models the additive noise in dimensions of x. Factors z are assumed distributed as G(z, 0, I) and the noise is assumed to be G(ϵ, 0, ψ), where ψ is a diagonal matrix. It can be shown that x has full covariance S = ΛΛT + ψ, making the FA better suited for high dimensional modeling than a Gaussian of diagonal covariance. A mixture of factor analyzers (MFA) is an extension of the FA that allows a piece-wise linear approximation of a non-linear data manifold. Unlike the GMM, it has two hidden variables: a discrete variable s, p(s = k) = wk, which determines the mixture assignments and a continuous latent variable z ∈RR, p(z|s = k) = G(z, 0, I), which is a low dimensional projection of the observation variable x ∈RD, p(x|z, s = k) = G(x, Λkz + µk, ψ). Hence, the kth MFA component is a FA of mean µk and subspace defined by Λk. Overall, the MFA components approximate the distribution of 4 the observations x by a set of sub-spaces in observation space. The Q function is Q(p(s, z|D; θb); θ) = X i Ezi,si|xi;θb hX k I(si, k) log p(xi, zi, si = k; θ) i (9) = X i,k hikEzi|xi;θb [log G(xi, Λkzi + µk, ψ) + log G(zi, 0, I) + log wk] . (10) where hik = p(si = k|xi; θb). After some simplifications, the E step reduces to computing hik = p(k|xi; θb) ∝wb kN(xi, µb k, Sb k) (11) Ezi|xi;θb[zi] = βb k(xi −µb k) (12) Ezi|xi;θb[zizT i ] =  I −βb kΛb k + βb k(xi −µb k)(xi −µb k)T βbT k  (13) with Sb k = Λb kΛbT k + ψb and βb k = ΛbT k Sb k −1. The M-step then evaluates the Fisher score of θ = {µb k, Λb k}. With some algebraic manipulations, this can be shown to have components Gµk(I) = X i p(k|xi; θb)ψb−1 I −Λb kβb k  xi −µb k  (14) GΛk(I) = X i p(k|xi; θb)ψb−1(Λb kβb k −I) h (xi −µb k)(xi −µb k)T βbT k −Λb k i . (15) For a detailed discussion of the Q function, the reader is referred to the EM derivation in [4]. Note that the scores with respect to the means are functionally similar to the first order residuals in (7). However, the scores with respect to the factor loading matrices Λk account for covariance statistics of the observations xi, not just variances. We refer to the representations (14) and (15) as MFA Fisher scores (MFA-FS). Note that these are not FVs due to the absence of normalization by the Fisher information, which is more complex to compute than for the variance-GMM. 3 Related work The most popular approach to transfer object scores (usually from an ImageNet CNN) into a feature vector for scene classification is to rely on FV-style pooling. Although most classifiers default to the GMM-FV embedding [6, 1, 2, 24], some recent works have explored different encoding [11] and pooling schemes [21, 3] with promising results. Liu et al. [11] derived an FV like representation from sparse coding. Their model can be described as a factor analyzer with Gaussian observations p(x|z) ∼ N(Λz, σ2I) conditioned on Laplace factors p(z) ∝Q r exp(−|zr|). While the sparse FA marginal p(x) is intractable, it can be approximated by an evidence lower bound p(x) ≥ R q(z) p(x,z) q(z) dz derived from a suitable variational posterior q(z). In [11], q is a point posterior δ(z −z∗) and the MAP inference simplifies into sparse coding. The image representation is obtained using gradients of the sparse coding objective evaluated at the MAP factors z∗, with respect to the factor loadings Λ. [21] proposed an alternative bilinear pooling mechanism P i xixT i . Similar to the MFA-FS, this captures second order statistics of CNN feature space, albeit globally. Due to its simplicity, this mechanism supports fine-tuning of the object CNN to scene classes. Gao et al. [3] have recently shown that this representation can be compressed with minimal performance loss. 4 Experiments The MFA-FS was evaluated on the scene classification problem, using the 67 class MIT Indoor scenes dataset [14] and the 397 class MIT SUN dataset [25]. For Indoor scenes, a single training set of 80 images per class is provided by the authors. The test set consists of 20 images per class. Results are reported as average per class classification accuracy. The authors of SUN provide multiple train/test splits, each test set containing 50 images per class. Results are reported as mean average per class classification accuracy over splits. Three object recognition CNNs, pre-trained on ImageNet, were used to extract features: the 8 layer network of [8] (denoted as AlexNet) and the deeper 16 and 19 layer networks of [18] (denoted VGG-16 and VGG-19, respectively). These CNNs assign 1000 dimensional object recognition probabilities to P × P patches (sampled on a grid of fixed spacing) of the scene images, with P ∈{128, 160, 96}. Patch probability vectors were converted into their natural parameter form and PCA-reduced to 500 dimensions as in [2]. Each image was mapped into a 5 Table 1: Classification accuracy (K = 50, R = 10). MIT Indoor GMM FV (µ) 66.08 GMM FV (σ) 53.86 MFA FS (µ) 67.68 MFA FS (Λ) 71.11 SUN GMM FV (µ) 50.01 GMM FV (σ) 37.71 MFA FS (µ) 51.43 MFA FS (Λ) 53.38 0 0.5 1 1.5 2 2.5 3 x 10 5 0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 Descriptor Dimensions Accuracy MFA Grad (Factor Loading) GMM FV (Variance) K = 200 K = 300 K = 400 K = 500 K = 50 R = 2 K = 50 R = 5 K = 50 R = 10 K = 50 R = 1 K = 50 K = 100 0 0.5 1 1.5 2 2.5 3 x 10 5 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0.55 Descriptor Dimensions Accuracy MFA Grad (Factor Loading) GMM FV (Variance) K = 50 R = 2 K = 50 R = 1 K = 50 R = 5 K = 50 R = 10 K = 500 K = 400 K = 300 K = 200 K = 100 K = 50 Figure 1: Classification accuracy vs. descriptor size for MFA-FS(Λ) of K = 50 components and R factor dimensions and GMM-FV(σ) of K components. Left: MIT Indoor. Right: SUN. GMM-FV [13] using a background GMM, and an MFA-FS, using (14), (15) and a background MFA. As usual in the FV literature, these vectors were power normalized, L2 normalized, and classified with a cross-validated linear SVM. These classifiers were compared to scene CNNs, trained on the large scale Places dataset. In this case, the features from the penultimate CNN layer were used as a holistic scene representation and classified with a linear SVM, as in [26]. We used the places CNNs with the AlexNet and VGG-16 architectures provided by the authors. 4.1 Impact of Covariance Modeling We begin with an experiment to compare the modeling power of MFAs to variance-GMMs. This was based on AlexNet features, mixtures of K = 50 components, and an MFA latent space dimension of R = 10. Table 1 presents the classification accuracy of a GMM-FV that only considers the mean - GMM-FV(µ) - or variance - GMM-FV(σ) - parameters and a MFA-FS that only considers the mean - MFA-FS(µ) - or covariance - MFA-FS(Λ) - parameters. The most interesting observation is the complete failure of the GMM-FV (σ), which under-performs the GMM-FV(µ) by more than 10%. The difference between the two components of the GMM-FV is not as startling for lower dimensional SIFT features [13]. However, for CNN features, the discriminative power of variance statistics is exceptionally low. This explains why previous FV representations for CNNs [6, 2] only consider gradients with respect to the means. A second observation of importance is that the improved modeling of covariances by the MFA eliminates this problem. In fact, MFA-FS(Λ) is significantly better than both GMM-FVs. It could be argued that a fair comparison requires an increase in the GMM modeling capacity. Fig. 1 tests this hypothesis by comparing GMM-FVs(σ) and MFA-FS (Λ) for various numbers of GMM components (K ∈{50, . . . , 500}) and MFA hidden sub-spaces dimensions (R ∈{1, . . . , 10}). For comparable vector dimensions, the covariance based scores always significantly outperforms the variance statistics on both datasets. A final observation is that, due to covariance modeling in MFAs, the MFA-FS(µ) performs better the GMM-FV(µ). The first order residuals pooled to obtain the MFA-FS(µ) (14) are scaled by covariance matrices instead of variances. This local de-correlation provides a non-trivial improvement for the MFA-FS(µ) over the GMM-FV(µ)(∼1.5% points). Covariance modeling was previously used in [19] to obtain FVs w.r.t. Gaussian means and local subspace variances (eigen-values of covariance). Their subspace variance FV, derived with our MFAs, performs much better than the variance GMM-FV (σ), due to a better underlying model (60.7% v 53.86% on Indoor). It is, however, still inferior to the MFA-FS(Λ) which captures full covariance within local subspaces. While a combination of the MFA-FS(µ) and MFA-FS(Λ) produces a small improvement (∼1%), we restrict to using the latter in the remainder of this work. 4.2 Multi-scale learning and Deep CNNs Recent works have demonstrated value in combining deep CNN features extracted at multiple-scales. Table 2 presents the classification accuracies of the MFA-FS (Λ) based on AlexNet, and 16 and 19 layer VGG features extracted from 96x96, 128x128 and 160x160 pixel image patches, as well as their concatenation (3 scales), as suggested by [2]. These results confirm the benefits of multi-scale feature combination, which achieves the best performance for all CNNs and datasets. 6 Table 2: MFA-FS classification accuracy as a function of patch scale. MIT SUN Indoor AlexNet 160x160 69.83 52.36 128x128 71.11 53.38 96x96 70.51 53.54 3 scales 73.58 55.95 VGG-16 160x160 77.26 59.77 128x128 77.28 60.99 96x96 79.57 61.71 3 scales 80.1 63.31 VGG-19 160x160 77.21 128x128 79.39 96x96 79.9 3 scales 81.43 Table 3: Performance of scene classification methods. *combination of patch scales (128, 96, 160). Method MIT Indoor SUN MFA-FS + Places (VGG) 87.23 71.06 MFA-FS + Places (AlexNet) 79.86 63.16 MFA-FS (VGG) 81.43 63.31 MFA-FS (AlexNet) 73.58 55.95 Full BN (VGG) [3] 77.55 Compact BN (VGG) [3] 76.17 H-Sparse (VGG) [12] 79.5 Sparse Coding (VGG) [12] 77.6 Sparse Coding (AlexNet) [11] 68.2 MetaClass (AlexNet) + Places [24] 78.9 58.11 FV (AlexNet)(4 scales) + Places [2] 79.0 61.72 FV (AlexNet)(3 scales) + Places [2] 78.5∗ FV (AlexNet) (4 scales) [2] 72.86 54.4 FV (Alexnet)(3 scales) [2] 71.24 53.0 VLAD (AlexNet) [6] 68.88 51.98 FV+FC (VGG) [1] 81.0 Mid Level [10] 70.46 4.3 Comparison with ImageNet based Classifiers We next compared the MFA-FS to state of the art scene classifiers also based on transfer from ImageNet CNN features [11, 1–3]. Since all these methods only report results for MIT Indoor, we limited the comparison to this dataset, with the results of Table 4. The GMM-FV of [2] operates on AlexNet CNN semantics extracted from image patches of multiple sizes (96, 128, 160, 80). The FV in [1] is computed using convolutional features from AlexNet or VGG-16 extracted in a large multi-scale setting. Liu et al. proposed a gradient representation based on sparse codes. Their initial results were reported on a single patch scale of 128x128 using AlexNet features [11]. More recently, they have proposed an improved H-Sparse representation, combined multiple patch scales and used VGG features in [12]. The recently proposed bilinear (BN) descriptor pooling of [21] is similar to the MFA-FS in the sense that it captures global second order descriptor statistics. The simplicity of these descriptors enables the fine-tuning of the CNN layers to the scene classification task. However, their results, reproduced in [3] for VGG-16 features, are clearly inferior to those of the MFA-FS without fine-tuning. Gao et al. [3] propose a way to compress these bilinear statistics with trainable transformations. For a compact image representation of size 8K, their accuracy is inferior to a representation of 5K dimensions obtained by combining the MFA-FS with a simple PCA. These experiments show that the MFA-FS is a state of the art procedure for task transfer from object recognition (on ImageNet) to scene classification (e.g. on MIT Indoor or SUN). Its closest competitor is the classifier of [1], which combines CNN features in a massive multiscale setting ( 10 image sizes). While MFA-FS outperforms [1] with only 3 image scales, its performance improves even further with addition of more scales (82% with VGG, 4 patch sizes). 4.4 Task transfer performance The next question is how object-to-scene transfer compares to the much more intensive process, pursued by [26], of collecting a large scale labeled dataset and training a deep CNN from it. Their scene dataset, known as Places, consists of 2.4M images, from which both AlexNet and VGG Net CNNs were trained for scene classification. The fully connected features from the networks are used as scene representations and classified with linear SVMs on Indoor scenes and SUN. The Places CNN features are a direct alternatives to the MFA-FS. While the use of the former is an example of dataset transfer (features trained on scenes to classify scenes) the use of the latter is an example of task transfer (features trained on objects to classify scenes). A comparison between the two transfer approaches is shown in table 5. Somewhat surprisingly, task transfer with the MFA-FS outperformed dataset transfer with the Places CNN, on both MIT Indoors and SUN and for both the AlexNet and VGG architectures. This supports the hypothesis that the variability of configurations of most scenes makes scene classification much harder than object recognition, to the point where CNN architectures that have close-to or above human performance for 7 Table 4: Comparison to task transfer methods (ImageNet CNNs) on MIT Indoor. Method 1 scale mscale AlexNet MFA-FS 71.11 73.58 GMM FV [2] 68.5 72.86 FV+FC [1] 71.6 Sparse Coding [11] 68.2 VGG MFA-FS 79.9 81.43 Sparse Coding [12] 77.6 H-Sparse [12] 79.5 BN [3] 77.55 FV+FC [1] 81.0 VGG + dim. reduction MFA-FS + PCA (5k) 79.3 BN (8k) [3] 76.17 Table 5: Comparison with the Places trained Scene CNNs. Method SUN Indoor AlexNet MFA-FS 55.95 73.58 Places 54.3 68.24 Combined 63.16 79.86 VGG MFA-FS 63.31 81.43 Places 61.32 79.47 Combined 71.06 87.23 AlexNet + VGG Places (VGG + Alex) 65.91 81.29 MFA-FS(Alex) + Places(VGG) 68.8 85.6 MFA-FS(VGG) + Places(Alex) 67.34 82.82 object recognition are much less effective for scenes. It is, instead, preferable to pool object detections across the scene image, using a pooling mechanism such as the MFA-FS. This observation is in line with an interesting result of [2], showing that the object-based and scene-based representations are complementary, by concatenating ImageNet- and Places-based feature vectors. By replacing the the GMM-FV of [2] with the MFA-FS now proposed, we improve upon these results. For both the AlexNet and VGG CNNs, the combination of the ImageNet-based MFA-FS and the Places CNN feature vector outperformed both the MFA-FS and the Places CNN features by themselves, in both SUN and MIT Indoor. To the best of our knowledge, no method using these or deeper CNNs has reported better results than the combined MFA-FS and Places VGG features of Table 5. It could be argued that this improvement is just an effect of the often observed benefits of fusing different classifiers. Many works even resort to “bagging” of multiple CNNs to achieve performance improvements [18]. To test this hypothesis we also implemented a classifier that combines two Places CNNs with the AlexNet and VGG architectures. This is shown as Places (VGG+AlexNet) in the last section of Table 5. While improving on the performance of both MFA-FS and Places, its performance is not as good as that of the combination of the object-based and scene-based representations (MFAFS + Places). As shown in the remainder of the last section of the table, any combination of an object CNN with MFA-FS based transfer and a scene CNN outperforms this classifier. Finally, table 3 compares results to the best recent scene classification methods in the literature. This comparison shows that MFA-FS + Places combination is a state-of-the-art classifier with substantial gains over all other proposals. The results of 71.06% on SUN and 87.23% on Indoor scenes substantially outperform the previous best results of 61.7% and 81.7%, respectively. 5 Conclusion It is now well established that deep CNNs can be transferred across datasets that address similar tasks. It is less clear, however, whether they are robust to transfer across tasks. In this work, we have considered a class of problems that involve this type of transfer, namely problems that benefit from transferring object detections into holistic scene level inference, eg. scene classification. While such problems have been addressed with FV-like representations in the past, we have shown that these are not very effective for the high-dimensional CNN features. The reason is their reliance on a model, the variance-GMM, with a limited flexibility. We have addressed this problem by adopting a better model, the MFA, which approximates the non-linear data manifold by a set of local sub-spaces. We then introduced the Fisher score with respect to this model, denoted as the MFA-FS. Through extensive experiments, we have shown that the MFA-FS has state of the art performance for object-to-scene transfer and this transfer actually outperforms a scene CNN trained on a large scene dataset. These results are significant given that 1) MFA training takes only a few hours versus training a CNN, and 2) transfer requires a much smaller scene dataset. 8 References [1] M. Cimpoi, S. Maji, I. Kokkinos, and A. Vedaldi. Deep filter banks for texture recognition, description, and segmentation. International Journal of Computer Vision, 2015. [2] Mandar Dixit, Si Chen, Dashan Gao, Nikhil Rasiwasia, and Nuno Vasconcelos. Scene classification with semantic fisher vectors. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2015. [3] Yang Gao, Oscar Beijbom, Ning Zhang, and Trevor Darrell. Compact bilinear pooling. CoRR, abs/1511.06062, 2015. [4] Zoubin Ghahramani and Geoffrey E. Hinton. The em algorithm for mixtures of factor analyzers. Technical report, 1997. [5] Ross Girshick, Jeff Donahue, Trevor Darrell, and Jitendra Malik. Rich feature hierarchies for accurate object detection and semantic segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2014. [6] Yunchao Gong, Liwei Wang, Ruiqi Guo, and Svetlana Lazebnik. Multi-scale orderless pooling of deep convolutional activation features. In Computer Vision ECCV 2014, volume 8695, pages 392–407, 2014. [7] Tommi S. Jaakkola and David Haussler. Exploiting generative models in discriminative classifiers. In Proceedings of the 1998 conference on Advances in neural information processing systems II, pages 487–493, 1999. [8] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E. Hinton. Imagenet classification with deep convolutional neural networks. In Advances in Neural Information Processing Systems 25, pages 1097–1105, 2012. [9] Y. LeCun, L. Bottou, Y. Bengio, and P. Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278–2324, November 1998. [10] Yao Li, Lingqiao Liu, Chunhua Shen, and Anton van den Hengel. Mid-level deep pattern mining. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2015. [11] Lingqiao Liu, Chunhua Shen, Lei Wang, Anton Hengel, and Chao Wang. Encoding high dimensional local features by sparse coding based fisher vectors. In Advances in Neural Information Processing Systems 27, pages 1143–1151. 2014. [12] Lingqiao Liu, Peng Wang, Chunhua Shen, Lei Wang, Anton van den Hengel, Chao Wang, and Heng Tao Shen. Compositional model based fisher vector coding for image classification. CoRR, abs/1601.04143, 2016. [13] Florent Perronnin, Jorge Sánchez, and Thomas Mensink. Improving the fisher kernel for large-scale image classification. In Proceedings of the 11th European conference on Computer vision: Part IV, ECCV’10, pages 143–156, 2010. [14] A. Quattoni and A. Torralba. Recognizing indoor scenes. 2012 IEEE Conference on Computer Vision and Pattern Recognition, 0:413–420, 2009. doi: http://doi.ieeecomputersociety.org/10.1109/CVPRW.2009. 5206537. [15] L. R. Rabiner. A tutorial on hidden markov models and selected applications in speech recognition. Proceedings of the IEEE, 77(2):257–286, Feb 1989. ISSN 0018-9219. doi: 10.1109/5.18626. [16] Shaoqing Ren, Kaiming He, Ross Girshick, and Jian Sun. Faster R-CNN: Towards real-time object detection with region proposal networks. In Neural Information Processing Systems (NIPS), 2015. [17] Jorge Sánchez, Florent Perronnin, Thomas Mensink, and Jakob J. Verbeek. Image classification with the fisher vector: Theory and practice. International Journal of Computer Vision, 105(3):222–245, 2013. [18] K. Simonyan and A. Zisserman. Very deep convolutional networks for large-scale image recognition. CoRR, abs/1409.1556, 2014. [19] Masayuki Tanaka, Akihiko Torii, and Masatoshi Okutomi. Fisher vector based on full-covariance gaussian mixture model. IPSJ Transactions on Computer Vision and Applications, 5:50–54, 2013. doi: 10.2197/ ipsjtcva.5.50. [20] Antonio Torralba and Alexei A. Efros. Unbiased look at dataset bias. In CVPR’11, June 2011. [21] Aruni RoyChowdhury Tsung-Yu Lin and Subhransu Maji. Bilinear cnn models for fine-grained visual recognition. In International Conference on Computer Vision (ICCV), 2015. [22] Jakob Verbeek. Learning nonlinear image manifolds by global alignment of local linear models. IEEE Transactions on Pattern Analysis and Machine Intelligence, 28(8):1236–1250, August 2006. [23] Oriol Vinyals, Alexander Toshev, Samy Bengio, and Dumitru Erhan. Show and tell: A neural image caption generator. CoRR, abs/1411.4555, 2014. [24] Ruobing Wu, Baoyuan Wang, Wenping Wang, and Yizhou Yu. Harvesting discriminative meta objects with deep cnn features for scene classification. In The IEEE International Conference on Computer Vision (ICCV), December 2015. [25] Jianxiong Xiao, J. Hays, K.A. Ehinger, A. Oliva, and A. Torralba. Sun database: Large-scale scene recognition from abbey to zoo. In Computer Vision and Pattern Recognition (CVPR), 2010 IEEE Conference on, pages 3485–3492, 2010. [26] B. Zhou, A. Lapedriza, J. Xiao, A. Torralba, and A. Oliva. Learning Deep Features for Scene Recognition using Places Database. NIPS, 2014. 9
2016
310
6,229
Architectural Complexity Measures of Recurrent Neural Networks Saizheng Zhang1,∗, Yuhuai Wu2,∗, Tong Che4, Zhouhan Lin1, Roland Memisevic1,5, Ruslan Salakhutdinov3,5 and Yoshua Bengio1,5 1MILA, Université de Montréal, 2University of Toronto, 3Carnegie Mellon University, 4Institut des Hautes Études Scientifiques, France, 5CIFAR Abstract In this paper, we systematically analyze the connecting architectures of recurrent neural networks (RNNs). Our main contribution is twofold: first, we present a rigorous graph-theoretic framework describing the connecting architectures of RNNs in general. Second, we propose three architecture complexity measures of RNNs: (a) the recurrent depth, which captures the RNN’s over-time nonlinear complexity, (b) the feedforward depth, which captures the local input-output nonlinearity (similar to the “depth” in feedforward neural networks (FNNs)), and (c) the recurrent skip coefficient which captures how rapidly the information propagates over time. We rigorously prove each measure’s existence and computability. Our experimental results show that RNNs might benefit from larger recurrent depth and feedforward depth. We further demonstrate that increasing recurrent skip coefficient offers performance boosts on long term dependency problems. 1 Introduction Recurrent neural networks (RNNs) have been shown to achieve promising results on many difficult sequential learning problems [1, 2, 3, 4, 5]. There is also much work attempting to reveal the principles behind the challenges and successes of RNNs, including optimization issues [6, 7], gradient vanishing/exploding related problems [8, 9], analysing/designing new RNN transition functional units like LSTMs, GRUs and their variants [10, 11, 12, 13]. This paper focuses on another important theoretical aspect of RNNs: the connecting architecture. Ever since [14, 15] introduced different forms of “stacked RNNs”, researchers have taken architecture design for granted and have paid less attention to the exploration of other connecting architectures. Some examples include [16, 1, 17] who explored the use of skip connections; [18] who pointed out the distinction of constructing a “deep” RNN from the view of the recurrent paths and the view of the input-to-hidden and hidden-to-output maps. However, they did not rigorously formalize the notion of “depth” and its implications in “deep” RNNs. Besides “deep” RNNs, there still remains a vastly unexplored field of connecting architectures. We argue that one barrier for better understanding the architectural complexity is the lack of a general definition of the connecting architecture. This forced previous researchers to mostly consider the simple cases while neglecting other possible connecting variations. Another barrier is the lack of quantitative measurements of the complexity of different RNN connecting architectures: even the concept of “depth” is not clear with current RNNs. In this paper, we try to address these two barriers. We first introduce a general formulation of RNN connecting architectures, using a well-defined graph representation. Observing that the RNN undergoes multiple transformations not only feedforwardly (from input to output within a time step) but also recurrently (across multiple time steps), we carry out a quantitative analysis of the number of transformations in these two orthogonal directions, which results in the definitions of recurrent depth ∗Equal contribution. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. and feedforward depth. These two depths can be viewed as general extensions of the work of [18]. We also explore a quantity called the recurrent skip coefficient which measures how quickly information propagates over time. This quantity is strongly related to vanishing/exploding gradient issues, and helps deal with long term dependency problems. Skip connections crossing different timescales have also been studied by [19, 15, 20, 21]. Instead of specific architecture design, we focus on analyzing the graph-theoretic properties of recurrent skip coefficients, revealing the fundamental difference between the regular skip connections and the ones which truly increase the recurrent skip coefficients. We rigorously prove each measure’s existence and computability under the general framework. We empirically evaluate models with different recurrent/feedforward depths and recurrent skip coefficients on various sequential modelling tasks. We also show that our experimental results further validate the usefulness of the proposed definitions. 2 General Formulations of RNN Connecting Architectures RNNs are learning machines that recursively compute new states by applying transition functions to previous states and inputs. Its connecting architecture describes how information flows between different nodes. In this section, we formalize the concept of the connecting architecture by extending the traditional graph-based illustration to a more general definition with a finite directed multigraph and its unfolded version. Let us first define the notion of the RNN cyclic graph Gc that can be viewed as a cyclic graphical representation of RNNs. We attach “weights” to the edges in the cyclic graph Gc that represent time delay differences between the source and destination node in the unfolded graph. Definition 2.1. Let Gc = (Vc, Ec) be a weighted directed multigraph 2, in which Vc = Vin ∪Vout ∪ Vhid is a finite nonempty set of nodes, Ec ⊂Vc × Vc × Z is a finite set of directed edges. Each e = (u, v, σ) ∈Ec denotes a directed weighted edge pointing from node u to node v with an integer weight σ. Each node v ∈Vc is labelled by an integer tuple (i, p). i ∈{0, 2, · · · m −1} denotes the time index of the given node, where m is the period number of the RNN, and p ∈S, where S is a finite set of node labels. We call the weighted directed multigraph Gc = (Vc, Ec) an RNN cyclic graph, if (1) For every edge e = (u, v, σ) ∈Ec, let iu and iv denote the time index of node u and v, then σ = iv −iu + k · m for some k ∈Z. (2) There exists at least one directed cycle 3 in Gc. (3) For any closed walk ω, the sum of all the σ along ω is not zero. Condition (1) assures that we can get a periodic graph (repeating pattern) when unfolding the RNN through time. Condition (2) excludes feedforward neural networks in the definition by forcing to have at least one cycle in the cyclic graph. Condition (3) simply avoids cycles after unfolding. The cyclic representation can be seen as a time folded representation of RNNs, as shown in Figure 1(a). Given an RNN cyclic graph Gc, we unfold Gc over time t ∈Z by the following procedure: Definition 2.2 (Unfolding). Given an RNN cyclic graph Gc = (Vc, Ec, σ), we define a new infinite set of nodes Vun = {(i + km, p)|(i, p) ∈V, k ∈Z}. The new set of edges Eun ∈Vun × Vun is constructed as follows: ((t, p), (t′, p′)) ∈Eun if and only if there is an edge e = ((i, p), (i′, p′), σ) ∈ E such that t′ −t = σ, and t ≡i(mod m). The new directed graph Gun = (Vun, Eun) is called the unfolding of Gc. Any infinite directed graph that can be constructed from an RNN cyclic graph through unfolding is called an RNN unfolded graph. Lemma 2.1. The unfolding Gun of any RNN cyclic graph Gc is a directed acyclic graph (DAG). Figure 1(a) shows an example of two graph representations Gun and Gc of a given RNN. Consider the edge from node (1, 7) going to node (0, 3) in Gc. The fact that it has weight 1 indicates that the corresponding edge in Gun travels one time step, ((t+1, 7), (t+2, 3)). Note that node (0, 3) also has a loop with weight 2. This loop corresponds to the edge ((t, 3), (t + 2, 3)). The two kinds of graph representations we presented above have a one-to-one correspondence. Also, any graph structure θ on Gun is naturally mapped into a graph structure ¯θ on Gc. Given an edge tuple ¯e = (u, v, σ) in Gc, σ stands for the number of time steps crossed by ¯e’s covering edges in Eun, i.e., for every corresponding edge e ∈Gun, e must start from some time index t to t + σ. Hence σ corresponds to the “time delay” associated with e. In addition, the period number m in Definition 2.1 can be interpreted as the time length of the entire non-repeated recurrent structure in its unfolded RNN graph Gun. In other words, shifting the Gun through time by km time steps will result in a DAG which is 2A directed multigraph is a directed graph that allows multiple directed edges connecting two nodes. 3A directed cycle is a closed walk with no repetitions of edges. 2 Figure 1: (a) An example of an RNN’s Gc and Gun. Vin is denoted by square, Vhid is denoted by circle and Vout is denoted by diamond. In Gc, the number on each edge is its corresponding σ. The longest path is colored in red. The longest input-output path is colored in yellow and the shortest path is colored blue. The value of three measures are dr = 3 2, df = 7 2 and s = 2. (b) 5 more examples. (1) and (2) have dr = 2, 3 2, (3) has df = 5, (4) and (5) has s = 2, 3 2. identical to Gun, and m is the smallest number that has such property for Gun. Most traditional RNNs have m = 1, while some special structures like hierarchical or clockwork RNN [15, 21] have m > 1. For example, Figure 1(a) shows that the period number of this specific RNN is 2. The connecting architecture describes how information flows among RNN units. Assume ¯v ∈Vc is a node in Gc, let In(¯v) denotes the set of incoming nodes of ¯v, In(¯v) = {¯u|(¯u, ¯v) ∈Ec}. In the forward pass of the RNN, the transition function F¯v takes outputs of nodes In(¯v) as inputs and computes a new output. For example, vanilla RNNs units with different activation functions, LSTMs and GRUs can all be viewed as units with specific transition functions. We now give the general definition of an RNN: Definition 2.3. An RNN is a tuple (Gc, Gun, {F¯v}¯v∈Vc), in which Gun = (Vun, Eun) is the unfolding of RNN cyclic graph Gc, and {F¯v}¯v∈Vc is the set of transition functions. In the forward pass, for each hidden and output node v ∈Vun, the transition function F¯v takes all incoming nodes of v as the input to compute the output. An RNN is homogeneous if all the hidden nodes share the same form of the transition function. 3 Measures of Architectural Complexity In this section, we develop different measures of RNNs’ architectural complexity, focusing mostly on the graph-theoretic properties of RNNs. To analyze an RNN solely from its architectural aspect, we make the mild assumption that the RNN is homogeneous. We further assume the RNN to be unidirectional. For a bidirectional RNN, it is more natural to measure the complexities of its unidirectional components. 3.1 Recurrent Depth Unlike feedforward models where computations are done within one time frame, RNNs map inputs to outputs over multiple time steps. In some sense, an RNN undergoes transformations along both feedforward and recurrent dimensions. This fact suggests that we should investigate its architectural complexity from these two different perspectives. We first consider the recurrent perspective. The conventional definition of depth is the maximum number of nonlinear transformations from inputs to outputs. Observe that a directed path in an unfolded graph representation Gun corresponds to a sequence of nonlinear transformations. Given an unfolded RNN graph Gun, ∀i, n ∈Z, let Di(n) be the length of the longest path from any node at starting time i to any node at time i + n. From the recurrent perspective, it is natural to investigate how Di(n) changes over time. Generally speaking, Di(n) increases as n increases for all i. Such increase is caused by the recurrent structure of the RNN which keeps adding new nonlinearities over time. Since Di(n) approaches ∞as n approaches ∞,4 to measure the complexity of Di(n), we consider its asymptotic behaviour, i.e., the limit of Di(n) n as n →∞. Under a mild assumption, this limit exists. The following theorem prove such limit’s computability and well-definedness: Theorem 3.2 (Recurrent Depth). Given an RNN and its two graph representation Gun and Gc, we denote C(Gc) to be the set of directed cycles in Gc. For ϑ ∈C(Gc), let l(ϑ) denote the length of ϑ 4Without loss of generality, we assume the unidirectional RNN approaches positive infinity. 3 and σs(ϑ) denote the sum of edge weights σ along ϑ. Under a mild assumption5, dr = lim n→+∞ Di(n) n = max ϑ∈C(Gc) l(ϑ) σs(ϑ). (1) More intuitively, dr is a measure of the average maximum number of nonlinear transformations per time step as n gets large. Thus, we call it recurrent depth: Definition 3.1 (Recurrent Depth). Given an RNN and its two graph representations Gun and Gc, we call dr, defined in Eq.(1), the recurrent depth of the RNN. In Figure 1(a), one can easily verify that Dt(1) = 5, Dt(2) = 6, Dt(3) = 8, Dt(4) = 9 . . . Thus Dt(1) 1 = 5, Dt(2) 2 = 3, Dt(3) 3 = 8 3, Dt(4) 4 = 9 4 . . . ., which eventually converges to 3 2 as n →∞. As n increases, most parts of the longest path coincides with the path colored in red. As a result, dr coincides with the number of nodes the red path goes through per time step. Similarly in Gc, observe that the red cycle achieves the maximum ( 3 2) in Eq.(1). Usually, one can directly calculate dr from Gun. It is easy to verify that simple RNNs and stacked RNNs share the same recurrent depth which is equal to 1. This reveals the fact that their nonlinearities increase at the same rate, which suggests that they will behave similarly in the long run. This fact is often neglected, since one would typically consider the number of layers as a measure of depth, and think of stacked RNNs as “deep” and simple RNNs as “shallow”, even though their discrepancies are not due to recurrent depth (which regards time) but due to feedforward depth, defined next. 3.3 Feedforward Depth Recurrent depth does not fully characterize the nature of nonlinearity of an RNN. As previous work suggests [3], stacked RNNs do outperform shallow ones with the same hidden size on problems where a more immediate input and output process is modeled. This is not surprising, since the growth rate of Di(n) only captures the number of nonlinear transformations in the time direction, not in the feedforward direction. The perspective of feedforward computation puts more emphasis on the specific paths connecting inputs to outputs. Given an RNN unfolded graph Gun, let D∗ i (n) be the length of the longest path from any input node at time step i to any output node at time step i + n. Clearly, when n is small, the recurrent depth cannot serve as a good description for D∗ i (n). In fact. it heavily depends on another quantity which we call feedforward depth. The following proposition guarantees the existence of such a quantity and demonstrates the role of both measures in quantifying the nonlinearity of an RNN. Proposition 3.3.1 (Input-Output Length Least Upper Bound). Given an RNN with recurrent depth dr, we denote df = supi,n∈Z D∗ i (n) −n · dr, the supremum df exists and thus we have the following upper bound for D∗ i (n): D∗ i (n) ≤n · dr + df. The above upper bound explicitly shows the interplay between recurrent depth and feedforward depth: when n is small, D∗ i (n) is largely bounded by df; when n is large, dr captures the nature of the bound (≈n · dr). These two measures are equally important, as they separately capture the maximum number of nonlinear transformations of an RNN in the long run and in the short run. Definition 3.2. (Feedforward Depth) Given an RNN with recurrent depth dr and its two graph representations Gun and Gc, we call df, defined in Proposition 3.3.1, the feedforward depth6 of the RNN. The following theorem proves df’s computability: Theorem 3.4 (Feedforward Depth). Given an RNN and its two graph representations Gun and Gc, we denote ξ(Gc) the set of directed paths that start at an input node and end at an output node in Gc. For γ ∈ξ(Gc), denote l(γ) the length and σs(γ) the sum of σ along γ. Then we have: df = sup i,n∈Z D∗ i (n) −n · dr = max γ∈ξ(Gc) l(γ) −σs(γ) · dr, where m is the period number and dr is the recurrent depth of the RNN. For example, in Figure 1(a), one can easily verify that df = D∗ t (0) = 3. Most commonly, df is the same as D∗ t (0), i.e., the maximum length from an input to its current output. 5See a full treatment of the limit in general cases in Theorem A.1 and Proposition A.1.1 in Appendix. 6Conventionally, an architecture with depth 1 is a three-layer architecture containing one hidden layer. But in our definition, since it goes through two transformations, we count the depth as 2 instead of 1. This should be particularly noted with the concept of feedforward depth, which can be thought as the conventional depth plus 1. 4 3.5 Recurrent Skip Coefficient Depth provides a measure of the complexity of the model. But such a measure is not sufficient to characterize behavior on long-term dependency tasks. In particular, since models with large recurrent depths have more nonlinearities through time, gradients can explode or vanish more easily. On the other hand, it is known that adding skip connections across multiple time steps may help improve the performance on long-term dependency problems [19, 20]. To measure such a “skipping” effect, we should instead pay attention to the length of the shortest path from time i to time i + n. In Gun, ∀i, n ∈Z, let di(n) be the length of the shortest path. Similar to the recurrent depth, we consider the growth rate of di(n). Theorem 3.6 (Recurrent Skip Coefficient). Given an RNN and its two graph representations Gun and Gc, under mild assumptions7 j = lim n→+∞ di(n) n = min ϑ∈C(Gc) l(ϑ) σs(ϑ). (2) Since it is often the case that j is smaller or equal to 1, it is more intuitive to consider its reciprocal. Definition 3.3. (Recurrent Skip Coefficient)8. Given an RNN and corresponding Gun and Gc, we define s = 1 j , whose reciprocal is defined in Eq.(2), as the recurrent skip coefficient of the RNN. With a larger recurrent skip coefficient, the number of transformations per time step is smaller. As a result, the nodes in the RNN are more capable of “skipping” across the network, allowing unimpeded information flow across multiple time steps, thus alleviating the problem of learning long term dependencies. In particular, such effect is more prominent in the long run, due to the network’s recurrent structure. Also note that not all types of skip connections can increase the recurrent skip coefficient. We will consider specific examples in our experimental results section. 4 Experiments and Results In this section we conduct a series of experiments to investigate the following questions: (1) Is recurrent depth a trivial measure? (2) Can increasing depth yield performance improvements? (3) Can increasing the recurrent skip coefficient improve the performance on long term dependency tasks? (4) Does the recurrent skip coefficient suggest something more compared to simply adding skip connections? We show our evaluations on both tanh RNNs and LSTMs. 4.1 Tasks and Training Settings PennTreebank dataset: We evaluate our models on character level language modelling using the PennTreebank dataset [22]. It contains 5059k characters for training, 396k for validation and 446k for test, and has a alphabet size of 50. We set each training sequence to have the length of 50. Quality of fit is evaluated by the bits-per-character (BPC) metric, which is log2 of perplexity. text8 dataset: Another dataset used for character level language modelling is the text8 dataset9, which contains 100M characters from Wikipedia with an alphabet size of 27. We follow the setting from [23] and each training sequence has length of 180. adding problem: The adding problem (and the following copying memory problem) was introduced in [10]. For the adding problem, each input has two sequences with length of T where the first sequence are numbers sampled from uniform[0, 1] and the second sequence are all zeros except two elements which indicates the position of the two elements in the first sequence that should be summed together. The output is the sum. We follow the most recent results and experimental settings in [24] (same for copying memory). copying memory problem: Each input sequence has length of T + 20, where the first 10 values are random integers between 1 to 8. The model should remember them after T steps. The rest of the sequence are all zeros, except for the last 11 entries in the sequence, which starts with 9 as a marker indicating that the model should begin to output its memorized values. The model is expected to give zero outputs at every time step except the last 10 entries, where it should generate (copy) the 10 values in the same order as it has seen at the beginning of the sequence. The goal is to minimize the average cross entropy of category predictions at each time step. 7See Proposition A.3.1 in Appendix. 8One would find this definition very similar to the definition of the recurrent depth. Therefore, we refer readers to examples in Figure 1 for some illustrations. 9http://mattmahoney.net/dc/textdata. 5 (a) (b) (a) (b) (1) (2) (3) (4) Figure 2: Left: (a) The architectures for sh, st, bu and td, with their (dr, df) equal to (1, 2), (1, 3), (1, 3) and (2, 3), respectively. The longest path in td are colored in red. (b) The 9 architectures denoted by their (df, dr) with dr = 1, 2, 3 and df = 2, 3, 4. In both (a) and (b), we only plot hidden states at two adjacent time steps and the connections between them (the period number is 1). Right: (a) Various architectures that we consider in Section 4.4. From top to bottom are baseline s = 1, and s = 2, s = 3. (b) Proposed architectures that we consider in Section 4.5 where we take k = 3 as an example. The shortest paths in (a) and (b) that correspond to the recurrent skip coefficients are colored in blue. DATASET MODELS\ARCHS sh st bu td PENNTREEBANK tanh RNN 1.54 1.59 1.54 1.49 tanh RNN-SMALL 1.80 1.82 1.80 1.77 TEXT8 tanh RNN-LARGE 1.69 1.67 1.64 1.59 LSTM-SMALL 1.65 1.66 1.65 1.63 LSTM-LARGE 1.52 1.53 1.52 1.49 df \dr dr = 1 dr = 2 dr = 3 df = 2 1.88 1.86 1.86 df = 3 1.86 1.84 1.86 df = 4 1.85 1.86 1.88 Table 1: Left: Test BPCs of sh, st, bu, td for tanh RNNs and LSTMs. Right: Test BPCs of tanh RNNs with recurrent depth dr = 1, 2, 3 and feedforward depth df = 2, 3, 4 respectively. sequential MNIST dataset: Each MNIST image data is reshaped into a 784 × 1 sequence, turning the digit classification task into a sequence classification one with long-term dependencies [25, 24]. A slight modification of the dataset is to permute the image sequences by a fixed random order beforehand (permuted MNIST). Results in [25] have shown that both tanh RNNs and LSTMs did not achieve satisfying performance, which also highlights the difficulty of this task. For all of our experiments we use Adam [26] for optimization, and conduct a grid search on the learning rate in {10−2, 10−3, 10−4, 10−5}. For tanh RNNs, the parameters are initialized with samples from a uniform distribution. For LSTM networks we adopt a similar initialization scheme, while the forget gate biases are chosen by the grid search on {−5, −3, −1, 0, 1, 3, 5}. We employ early stopping and the batch size was set to 50. 4.2 Recurrent Depth is Non-trivial To investigate the first question, we compare 4 similar connecting architectures: 1-layer (shallow) “sh”, 2-layers stacked “st”, 2-layers stacked with an extra bottom-up connection “bu”, and 2-layers stacked with an extra top-down connection “td”, as shown in Figure 2(a), left panel. Although the four architectures look quite similar, they have different recurrent depths: sh, st and bu have dr = 1, while td has dr = 2. Note that the specific construction of the extra nonlinear transformations in td is not conventional. Instead of simply adding intermediate layers in hidden-to-hidden connection, as reported in [18], more nonlinearities are gained by a recurrent flow from the first layer to the second layer and then back to the first layer at each time step (see the red path in Figure 2a, left panel). We first evaluate our architectures using tanh RNN on PennTreebank, where sh has hidden-layer size of 1600. Next, we evaluate four different models for text8 which are tanh RNN-small, tanh RNN-large, LSTM-small, LSTM large, where the model’s sh architecture has hidden-layer size of 512, 2048, 512, 1024 respectively. Given the architecture of the sh model, we set the remaining three architectures to have the same number of parameters. Table 1, left panel, shows that the td architecture outperforms all the other architectures for all the different models. Specifically, td in tanh RNN achieves a test BPC of 1.49 on PennTreebank, which is comparable to the BPC of 1.48 reported in [27] using stabilization techniques. Similar improvements are shown for LSTMs, where td architecture in LSTM-large achieves BPC of 1.49 on text8, outperforming the BPC of 1.54 reported in [23] with Multiplicative RNN (MRNN). It is also interesting to note the improvement we obtain when switching from bu to td. The only difference between these two architectures lies in changing the direction of one connection (see Figure 2(a)), which also increases the recurrent depth. Such a fundamental difference is by no means self-evident, but this result highlights the necessity of the concept of recurrent depth. 6 4.3 Comparing Depths From the previous experiment, we found some evidence that with larger recurrent depth, the performance might improve. To further investigate various implications of depths, we carry out a systematic analysis for both recurrent depth dr and feedforward depth df on text8 and sequential MNIST datasets. We build 9 models in total with dr = 1, 2, 3 and df = 2, 3, 4, respectively (as shown in Figure 2(b)). We ensure that all the models have roughly the same number of parameters (e.g., the model with dr = 1 and df = 2 has a hidden-layer size of 360). Table 1, right panel, displays results on the text8 dataset. We observed that when fixing feedforward depth df = 2, 3 (or fixing recurrent depth dr = 1, 2), increasing recurrent depth dr from 1 to 2 (or increasing feedforward depth df from 2 to 3) does improve the model performance. The best test BPC is achieved by the architecture with df = 3, dr = 2. This suggests that reasonably increasing dr and df can aid in better capturing the over-time nonlinearity of the input sequence. However, for too large dr (or df) like dr = 3 or df = 4, increasing df (or dr) only hurts models performance. This can potentially be attributed to the optimization issues when modelling large input-to-output dependencies (see Appendix B.4 for more details). With sequential MNIST dataset, we next examined the effects of df and dr when modelling long term dependencies (more in Appendix B.4). In particular, we observed that increasing df does not bring any improvement to the model performance, and increasing dr might even be detrimental for training. Indeed, it appears that df only captures the local nonlinearity and has less effect on the long term prediction. This result seems to contradict previous claims [17] that stacked RNNs (df > 1, dr = 1) could capture information in different time scales and would thus be more capable of dealing with learning long-term dependencies. On the other hand, a large dr indicates multiple transformations per time step, resulting in greater gradient vanishing/exploding issues [18], which suggests that dr should be neither too small nor too large. 4.4 Recurrent Skip Coefficients To investigate whether increasing a recurrent skip coefficient s improves model performance on long term dependency tasks, we compare models with increasing s on the adding problem, the copying memory problem and the sequential MNIST problem (without/with permutation, denoted as MNIST and pMNIST). Our baseline model is the shallow architecture proposed in [25]. To increase the recurrent skip coefficient s, we add connections from time step t to time step t + k for some fixed integer k, shown in Figure 2(a), right panel. By using this specific construction, the recurrent skip coefficient increases from 1 (i.e., baseline) to k and the new model with extra connection has 2 hidden matrices (one from t to t + 1 and the other from t to t + k). For the adding problem, we follow the same setting as in [24]. We evaluate the baseline LSTM with 128 hidden units and an LSTM with s = 30 and 90 hidden units (roughly the same number of parameters as the baseline). The results are quite encouraging: as suggested in [24] baseline LSTM works well for input sequence lengths T = 100, 200, 400 but fails when T = 750. On the other hand, we observe that the LSTM with s = 30 learns perfectly when T = 750, and even if we increase T to 1000, LSTM with s = 30 still works well and the loss reaches to zero. For the copying memory problem, we use a single layer RNN with 724 hidden units as our basic model, and 512 hidden units with skip connections. So they have roughly the same number of parameters. Models with a higher recurrent skip coefficient outperform those without skip connections by a large margin. When T = 200, test set cross entropy (CE) of a basic model only yields 0.2409, but with s = 40 it is able to reach a test set cross entropy of 0.0975. When T = 300, a model with s = 30 yields a test set CE of 0.1328, while its baseline could only reach 0.2025. We varied the sequence length (T) and recurrent skip coefficient (s) in a wide range (where T varies from 100 up to 300, and s from 10 up to 50), and found that this kind of improvement persists. For the sequential MNIST problem, the hidden-layer size of the baseline model is set to 90 and models with s > 1 have hidden-layer sizes of 64. The results in Table 2, top-left panel, show that tanh RNNs with recurrent skip coefficient s larger than 1 could improve the model performance dramatically. Within a reasonable range of s, test accuracy increases quickly as s becomes larger. We note that our model is the first tanh RNN model that achieves good performance on this task, even improving upon the method proposed in [25]. In addition, we also formally compare with the previous results reported in [25, 24], where our model (referred to as stanh) has a hidden-layer size of 95, which is about the same number of parameters as in the tanh model of [24]. Table 2, bottom-left panel, shows that our simple architecture improves upon the uRNN by 2.6% on pMNIST, 7 stanh s = 1 s = 5 s = 9 s = 13 s = 21 MNIST 34.9 46.9 74.9 85.4 87.8 s = 1 s = 3 s = 5 s = 7 s = 9 pMNIST 49.8 79.1 84.3 88.9 88.0 LSTM s = 1 s = 3 s = 5 s = 7 s = 9 MNIST 56.2 87.2 86.4 86.4 84.8 s = 1 s = 3 s = 4 s = 5 s = 6 pMNIST 28.5 25.0 60.8 62.2 65.9 Model MNIST pMNIST iRNN[25] 97.0 ≈82.0 uRNN[24] 95.1 91.4 LSTM[24] 98.2 88.0 RNN(tanh)[25] ≈35.0 ≈35.0 stanh(s = 21, 11) 98.1 94.0 Architecture, s (1), 1 (2), 1 (3), k 2 (4), k MNIST k = 17 39.5 39.4 54.2 77.8 k = 21 39.5 39.9 69.6 71.8 pMNIST k = 5 55.5 66.6 74.7 81.2 k = 9 55.5 71.1 78.6 86.9 Table 2: Results for MNIST/pMNIST. Top-left: Test accuracies with different s for tanh RNN. Top-right: Test accuracies with different s for LSTM. Bottom-left: Compared to previous results. Bottom-right: Test accuracies for architectures (1), (2), (3) and (4) for tanh RNN. and achieves almost the same performance as LSTM on the MNIST dataset with only 25% number of parameters [24]. Note that obtaining good performance on sequential MNIST requires a larger s than that for pMNIST (see Appendix B.4 for more details). LSTMs also showed performance boost and much faster convergence speed when using larger s, as displayed in Table 2, top-right panel. LSTM with s = 3 already performs quite well and increasing s did not result in any significant improvement, while in pMNIST, the performance gradually improves as s increases from 4 to 6. We also observed that the LSTM network performed worse on permuted MNIST compared to a tanh RNN. Similar result was also reported in [25]. 4.5 Recurrent Skip Coefficients vs. Skip Connections We also investigated whether the recurrent skip coefficient can suggest something more than simply adding skip connections. We design 4 specific architectures shown in Figure 2(b), right panel. (1) is the baseline model with a 2-layer stacked architecture, while the other three models add extra skip connections in different ways. Note that these extra skip connections all cross the same time length k. In particular, (2) and (3) share quite similar architectures. However, ways in which the skip connections are allocated makes big differences on their recurrent skip coefficients: (2) has s = 1, (3) has s = k 2 and (4) has s = k. Therefore, even though (2), (3) and (4) all add extra skip connections, the fact that their recurrent skip coefficients are different might result in different performance. We evaluated these architectures on the sequential MNIST and pMNIST datasets. The results show that differences in s indeed cause big performance gaps regardless of the fact that they all have skip connections (see Table 2, bottom-right panel). Given the same k, the model with a larger s performs better. In particular, model (3) is better than model (2) even though they only differ in the direction of the skip connections. It is interesting to see that for MNIST (unpermuted), the extra skip connection in model (2) (which does not really increase the recurrent skip coefficient) brings almost no benefits, as model (2) and model (1) have almost the same results. This observation highlights the following point: when addressing the long term dependency problems using skip connections, instead of only considering the time intervals crossed by the skip connection, one should also consider the model’s recurrent skip coefficient, which can serve as a guide for introducing more powerful skip connections. 5 Conclusion In this paper, we first introduced a general formulation of RNN architectures, which provides a solid framework for the architectural complexity analysis. We then proposed three architectural complexity measures: recurrent depth, feedforward depth, and recurrent skip coefficients capturing both short term and long term properties of RNNs. We also found empirical evidences that increasing recurrent depth and feedforward depth might yield performance improvements, increasing feedforward depth might not help on long term dependency tasks, while increasing the recurrent skip coefficient can largely improve performance on long term dependency tasks. These measures and results can provide guidance for the design of new recurrent architectures for particular learning tasks. Acknowledgments The authors acknowledge the following agencies for funding and support: NSERC, Canada Research Chairs, CIFAR, Calcul Quebec, Compute Canada, Samsung, ONR Grant N000141310721, ONR Grant N000141512791 and IARPA Raytheon BBN Contract No. D11PC20071. The authors thank the developers of Theano [28] and Keras [29], and also thank Nicolas Ballas, Tim Cooijmans, Ryan Lowe, Mohammad Pezeshki, Roger Grosse and Alex Schwing for their insightful comments. 8 References [1] Alex Graves. Generating sequences with recurrent neural networks. arXiv preprint arXiv:1308.0850, 2013. [2] Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. arXiv preprint arXiv:1409.0473, 2014. [3] Ilya Sutskever, Oriol Vinyals, and Quoc VV Le. Sequence to sequence learning with neural networks. In Advances in neural information processing systems, pages 3104–3112, 2014. [4] Nitish Srivastava, Elman Mansimov, and Ruslan Salakhutdinov. Unsupervised learning of video representations using LSTMs. In ICML, 2015. [5] Ryan Kiros, Yukun Zhu, Ruslan Salakhutdinov, Richard S. Zemel, Antonio Torralba, Raquel Urtasun, and Sanja Fidler. Skip-thought vectors. In NIPS, 2015. [6] James Martens and Ilya Sutskever. Learning recurrent neural networks with hessian-free optimization. In Proceedings of the 28th International Conference on Machine Learning (ICML-11), pages 1033–1040, 2011. [7] Razvan Pascanu, Tomas Mikolov, and Yoshua Bengio. On the difficulty of training recurrent neural networks. In Proceedings of The 30th International Conference on Machine Learning, pages 1310–1318, 2013. [8] Sepp Hochreiter. Untersuchungen zu dynamischen neuronalen netzen. Diploma, Technische Universität München, 1991. [9] Yoshua Bengio, Patrice Simard, and Paolo Frasconi. Learning long-term dependencies with gradient descent is difficult. Neural Networks, IEEE Transactions on, 5(2):157–166, 1994. [10] Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural computation, 9(8):1735–1780, 1997. [11] Klaus Greff, Rupesh Kumar Srivastava, Jan Koutník, Bas R Steunebrink, and Jürgen Schmidhuber. Lstm: A search space odyssey. arXiv preprint arXiv:1503.04069, 2015. [12] Kyunghyun Cho, Bart Van Merriënboer, Caglar Gulcehre, Dzmitry Bahdanau, Fethi Bougares, Holger Schwenk, and Yoshua Bengio. Learning phrase representations using rnn encoder-decoder for statistical machine translation. arXiv preprint arXiv:1406.1078, 2014. [13] Rafal Jozefowicz, Wojciech Zaremba, and Ilya Sutskever. An empirical exploration of recurrent network architectures. In Proceedings of the 32nd International Conference on Machine Learning (ICML-15), pages 2342–2350, 2015. [14] Jürgen Schmidhuber. Learning complex, extended sequences using the principle of history compression. Neural Computation, 4(2):234–242, 1992. [15] Salah El Hihi and Yoshua Bengio. Hierarchical recurrent neural networks for long-term dependencies. In Advances in Neural Information Processing Systems, pages 493–499, 1996. [16] Tapani Raiko, Harri Valpola, and Yann LeCun. Deep learning made easier by linear transformations in perceptrons. In International Conference on Artificial Intelligence and Statistics, pages 924–932, 2012. [17] Michiel Hermans and Benjamin Schrauwen. Training and analysing deep recurrent neural networks. In Advances in Neural Information Processing Systems, pages 190–198, 2013. [18] Razvan Pascanu, Caglar Gulcehre, Kyunghyun Cho, and Yoshua Bengio. How to construct deep recurrent neural networks. arXiv preprint arXiv:1312.6026, 2013. [19] T. Lin, B. G. Horne, P. Tino, and C. L. Giles. Learning long-term dependencies is not as difficult with NARX recurrent neural networks. IEEE Transactions on Neural Networks, 7(6):1329–1338, November 1996. [20] Ilya Sutskever and Geoffrey Hinton. Temporal-kernel recurrent neural networks. Neural Networks, 23(2):239–243, 2010. [21] Jan Koutnik, Klaus Greff, Faustino Gomez, and Juergen Schmidhuber. A clockwork rnn. In Proceedings of The 31st International Conference on Machine Learning, pages 1863–1871, 2014. [22] Mitchell P Marcus, Mary Ann Marcinkiewicz, and Beatrice Santorini. Building a large annotated corpus of english: The penn treebank. Computational linguistics, 19(2):313–330, 1993. [23] Tomáš Mikolov, Ilya Sutskever, Anoop Deoras, Hai-Son Le, and Stefan Kombrink. Subword language modeling with neural networks. preprint, (http://www.fit.vutbr.cz/imikolov/rnnlm/char.pdf), 2012. [24] Martin Arjovsky, Amar Shah, and Yoshua Bengio. Unitary evolution recurrent neural networks. arXiv preprint arXiv:1511.06464, 2015. [25] Quoc V Le, Navdeep Jaitly, and Geoffrey E Hinton. A simple way to initialize recurrent networks of rectified linear units. arXiv preprint arXiv:1504.00941, 2015. [26] Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. [27] David Krueger and Roland Memisevic. Regularizing rnns by stabilizing activations. arXiv preprint arXiv:1511.08400, 2015. [28] The Theano Development Team, Rami Al-Rfou, Guillaume Alain, Amjad Almahairi, Christof Angermueller, Dzmitry Bahdanau, Nicolas Ballas, Frédéric Bastien, Justin Bayer, Anatoly Belikov, et al. Theano: A python framework for fast computation of mathematical expressions. arXiv preprint arXiv:1605.02688, 2016. [29] François Chollet. Keras. GitHub repository: https://github.com/fchollet/keras, 2015. 9
2016
311
6,230
Interaction Screening: Efficient and Sample-Optimal Learning of Ising Models Marc Vuffray1, Sidhant Misra2, Andrey Y. Lokhov1,3, and Michael Chertkov1,3,4 1Theoretical Division T-4, Los Alamos National Laboratory, Los Alamos, NM 87545, USA 2Theoretical Division T-5, Los Alamos National Laboratory, Los Alamos, NM 87545, USA 3Center for Nonlinear Studies, Los Alamos National Laboratory, Los Alamos, NM 87545, USA 4Skolkovo Institute of Science and Technology, 143026 Moscow, Russia {vuffray, sidhant, lokhov, chertkov}@lanl.gov Abstract We consider the problem of learning the underlying graph of an unknown Ising model on p spins from a collection of i.i.d. samples generated from the model. We suggest a new estimator that is computationally efficient and requires a number of samples that is near-optimal with respect to previously established informationtheoretic lower-bound. Our statistical estimator has a physical interpretation in terms of “interaction screening”. The estimator is consistent and is efficiently implemented using convex optimization. We prove that with appropriate regularization, the estimator recovers the underlying graph using a number of samples that is logarithmic in the system size p and exponential in the maximum coupling-intensity and maximum node-degree. 1 Introduction A Graphical Model (GM) describes a probability distribution over a set of random variables which factorizes over the edges of a graph. It is of interest to recover the structure of GMs from random samples. The graphical structure contains valuable information on the dependencies between the random variables. In fact, the neighborhood of a random variable is the minimal set that provides us maximum information about this variable. Unsurprisingly, GM reconstruction plays an important role in various fields such as the study of gene expression [1], protein interactions [2], neuroscience [3], image processing [4], sociology [5] and even grid science [6, 7]. The origin of the GM reconstruction problem is traced back to the seminal 1968 paper by Chow and Liu [8], where the problem was posed and resolved for the special case of tree-structured GMs. In this special tree case the maximum likelihood estimator is tractable and is tantamount to finding a maximum weighted spanning-tree. However, it is also known that in the case of general graphs with cycles, maximum likelihood estimators are intractable as they require computation of the partition function of the underlying GM, with notable exceptions of the Gaussian GM, see for instance [9], and some other special cases, like planar Ising models without magnetic field [10]. A lot of efforts in this field has focused on learning Ising models, which are the most general GMs over binary variables with pairwise interaction/factorization. Early attempts to learn the Ising model structure efficiently were heuristic, based on various mean-field approximations, e.g. utilizing empirical correlation matrices [11, 12, 13, 14]. These methods were satisfactory in cases when correlations decrease with graph distance. However it was also noticed that the mean-field methods perform poorly for the Ising models with long-range correlations. This observation is not surprising 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. in light of recent results stating that learning the structure of Ising models using only their correlation matrix is, in general, computationally intractable [15, 16]. Among methods that do not rely solely on correlation matrices but take advantage of higher-order correlations that can be estimated from samples, we mention the approach based on sparsistency of the so-called regularized pseudo-likelihood estimator [17]. This estimator, like the one we propose in this paper, is from the class of M-estimators i.e. estimators that are the minimum of a sum of functions over the sampled data [22]. The regularized pseudo-likelihood estimator is regarded as a surrogate for the intractable likelihood estimator with an additive ℓ1-norm penalty to encourage sparsity of the reconstructed graph. The sparsistency-based estimator offers guarantees for the structure reconstruction, but the result only applies to GMs that satisfy a certain condition that is rather restrictive and hard to verify. It was also proven that the sparsity pattern of the regularized pseudo-likelihood estimator fails to reconstruct the structure of graphs with long-range correlations, even for simple test cases [18]. Principal tractability of structure reconstruction of an arbitrary Ising model from samples was proven only very recently. Bresler, Mossel and Sly in [19] suggested an algorithm which reconstructs the graph without errors in polynomial time. They showed that the algorithm requires number of samples that is logarithmic in the number of variables. Although this algorithm is of a polynomial complexity, it relies on an exhaustive neighborhood search, and the degree of the polynomial is equal to the maximal node degree. Prior to the work reported in this manuscript the best known procedure for perfect reconstruction of an Ising model was through a greedy algorithm proposed by Bresler in [20]. Bresler’s algorithm is based on the observation that the mutual information between neighboring nodes in an Ising model is lower bounded. This observation allows to reconstruct the Ising graph perfectly with only a logarithmic number of samples and in time quasi-quadratic in the number of variables. On the other hand, Bresler’s algorithm suffers from two major practical limitations. First, the number of samples, hence the running time as well, scales double exponentially with respect to the largest node degree and with respect to the largest coupling intensity between pairs of variables. This scaling is rather far from the information-theoretic lower-bound reported in [21] predicting instead a single exponential dependency on the two aforementioned quantities. Second, Bresler’s algorithm requires prior information on the maximum and minimum coupling intensities as well as on the maximum node degree, guarantees which, in reality, are not necessarily available. In this paper we propose a novel estimator for the graph structure of an arbitrary Ising model which achieves perfect reconstruction in quasi-quartic time (although we believe it can be provably reduced to quasi-quadratic time) and with a number of samples logarithmic in the system size. The algorithm is near-optimal in the sense that the number of samples required to achieve perfect reconstruction, and the run time, scale exponentially with respect to the maximum node-degree and the maximum coupling intensity, thus matching parametrically the information-theoretic lower bound of [21]. Our statistical estimator has the structure of a consistent M-estimator implemented via convex optimization with an additional thresholding procedure. Moreover it allows intuitive interpretation in terms of what we coin the “interaction screening”. We show that with a proper ℓ1-regularization our estimator reconstructs couplings of an Ising model from a number of samples that is near-optimal. In addition, our estimator does not rely on prior information on the model characteristics, such as maximum coupling intensity and maximum degree. The rest of the paper is organized as follows. In Section 2 we give a precise definition of the structure estimation problem for the Ising models and we describe in detail our method for structure reconstruction within the family of Ising models. The main results related to the reconstruction guarantees are provided by Theorem 1 and Theorem 2. In Section 3 we explain the strategy and the sequence of steps that we use to prove our main theorems. Proofs of Theorem 1 and Theorem 2 are summarized at the end of this Section. Section 4 illustrates performance of our reconstruction algorithm via simulations. Here we show on a number of test cases that the sample complexity of the suggested method scales logarithmically with the number of variables and exponentially with the maximum coupling intensity. In Section 5 we discuss possible generalizations of the algorithm and future work. 2 2 Main Results Consider a graph G = (V, E) with p vertexes where V = {1, . . . , p} is the vertex set and E ⊂V ×V is the undirected edge set. Vertexes i ∈V are associated with binary random variables σi ∈{−1, +1} that are called spins. Edges (i, j) ∈E are associated with non-zero real parameters θ∗ ij ̸= 0 that are called couplings. An Ising model is a probability distribution µ over spin configurations σ = {σ1, . . . , σp} that reads as follows: µ (σ) = 1 Z exp  X (i,j)∈E θ∗ ijσiσj  , (1) where Z is a normalization factor called the partition function. Z = X σ exp  X (i,j)∈E θ∗ ijσiσj  . (2) Notice that even though the main innovation of this paper – the efficient “interaction screening” estimator – can be constructed for the most general Ising models, we restrict our attention in this paper to the special case of the Ising models with zero local magnetic-field. This simplification is not necessary and is done solely to simplify (generally rather bulky) algebra. Later in the text we will thus refer to the zero magnetic field model (2) simply as the Ising model. 2.1 Structure-Learning of Ising Models Suppose that n sequences/samples of p spins  σ(k) k=1,...,n are observed. Let us assume that each observed spin configuration σ(k) = {σ(k) 1 , . . . , σ(k) p } is i.i.d. from (1). Based on these measurements/samples we aim to construct an estimator bE of the edge set that reconstructs the structure exactly with high probability, i.e. P h bE = E i = 1 −ϵ, (3) where ϵ ∈ 0, 1 2  is a prescribed reconstruction error. We are interested to learn structures of Ising models in the high-dimensional regime where the number of observations/samples is of the order n = O (ln p). A necessary condition on the number of samples is given in [21, Thm. 1]. This condition depends explicitly on the smallest and largest coupling intensity α := min (i,j)∈E|θ ∗ ij|, β := max (i,j)∈E|θ ∗ ij|, (4) and on the maximal node degree d := max i∈V |∂i| , (5) where the set of neighbors of a node i ∈V is denoted by ∂i := {j | (i, j) ∈E}. According to [21], in order to reconstruct the structure of the Ising model with minimum coupling intensity α, maximum coupling intensity β, and maximum degree d, the required number of samples should be at least n ≥max   eβd ln  pd 4 −1  4dαeα , ln p 2α tanh α  . (6) We see from Eq. (6) that the exponential dependence on the degree and the maximum coupling intensity are both unavoidable. Moreover, when the minimal coupling is small, the number of samples should scale at least as α−2. It remains unknown if the inequality (6) is achievable. It is shown in [21, Thm. 3] that there exists a reconstruction algorithm with error probability ϵ ∈ 0, 1 2  if the number of samples is greater than n ≥ βd 3e2βd + 1  sinh2 (α/4) !2 (16 log p + 4 ln (2/ϵ)) . (7) 3 Unfortunately, the existence proof presented in [21] is based on an exhaustive search with the intractable maximum likelihood estimator and thus it does not guarantee actual existence of an algorithm with low computational complexity. Notice also that the number of samples in (7) scales as exp (4βd) when d and β are asymptotically large and as α−4 when α is asymptotically small. 2.2 Regularized Interaction Screening Estimator The main contribution of this paper consists in presenting explicitly a structure-learning algorithm that is of low complexity and which is near-optimal with respect to bounds (6) and (7). Our algorithm reconstructs the structure of the Ising model exactly, as stated in Eq. (3), with an error probability ϵ ∈ 0, 1 2  , and with a number of samples which is at most proportional to exp (6βd) and α−2. (See Theorem 1 and Theorem 2 below for mathematically accurate statements.) Our algorithm consists of two steps. First, we estimate couplings in the vicinity of every node. Then, on the second step, we threshold the estimated couplings that are sufficiently small to zero. Resulting zero coupling means that the corresponding edge is not present. Denote the set of couplings around node u ∈V by the vector θ∗ u ∈Rp−1. In this, slightly abusive notation, we use the convention that if a coupling is equal to zero it reads as absence of the edge, i.e. θ∗ ui = 0 if and only if (u, i) /∈E. Note that if the node degree is bounded by d, it implies that the vector of couplings θ∗ u is non-zero in at most d entries. Our estimator for couplings around node u ∈V is based on the following loss function coined the Interaction Screening Objective (ISO): Sn (θu) = 1 n n X k=1 exp  − X i∈V \u θuiσ(k) u σ(k) i  . (8) The ISO is an empirical weighted-average and its gradient is the vector of weighted pair-correlations involving σu. At θu = θ∗ u the exponential weight cancels exactly with the corresponding factor in the distribution (1). As a result, weighted pair-correlations involving σu vanish as if σu was uncorrelated with any other spins or completely “screened” from them, which explains our choice for the name of the loss function. This remarkable “screening” feature of the ISO suggests the following choice of the Regularized Interaction Screening Estimator (RISE) for the interaction vector around node u: bθu (λ) = argmin θu∈Rp−1 Sn (θu) + λ ∥θu∥1 , (9) where λ > 0 is a tunable parameter promoting sparsity through the additive ℓ1-penalty. Notice that the ISO is the empirical average of an exponential function of θu which implies it is convex. Moreover, addition of the ℓ1-penalty preserves the convexity of the minimization objective in Eq. (9). As expected, the performance of RISE does depend on the choice of the penalty parameter λ. If λ is too small bθu (λ) is too sensitive to statistical fluctuations. On the other hand, if λ is too large bθu (λ) has too much of a bias towards zero. In general, the optimal value of λ is hard to guess. Luckily, the following theorem provides strong guarantees on the square error for the case when λ is chosen to be sufficiently large. Theorem 1 (Square Error of RISE). Let  σ(k) k=1,...,n be n realizations of p spins drawn i.i.d. from an Ising model with maximum degree d and maximum coupling intensity β. Then for any node u ∈V and for any ϵ1 > 0, the square error of the Regularized Interaction Screening Estimator (9) with penalty parameter λ = 4 q ln(3p/ϵ1) n is bounded with probability at least 1 −ϵ1 by bθu (λ) −θ∗ u 2 ≤28√ d (d + 1) e3βd s ln 3p ϵ1 n , (10) whenever n ≥214d2 (d + 1)2 e6βd ln 3p2 ϵ1 . Our structure estimator (for the second step of the algorithm), Structure-RISE, takes RISE output and thresholds couplings whose absolute value is less than α/2 to zero: bE (λ, α) = n (i, j) ∈V × V | bθij (λ) + bθji (λ) ≥α o . (11) Performance of the Structure-RISE is fully quantified by the following Theorem. 4 Theorem 2 (Structure Learning of Ising Models). Let  σ(k) k=1,...,n be n realizations of p spins drawn i.i.d. from an Ising model with maximum degree d, maximum coupling intensity β and minimal coupling intensity α. Then for any ϵ2 > 0, Structure-RISE with penalty parameter λ = 4 q ln(3p2/ϵ2) n reconstructs the edge-set perfectly with probability P  bE (λ, α) = E  ≥1 −ϵ2, (12) whenever n ≥max d/16, α−2 218d (d + 1)2 e6βd ln 3p3 ϵ2 . Proofs of Theorem 1 and Theorem 2 are given in Subsection 3.3. Theorem 1 states that RISE recovers not only the structure but also the correct value of the couplings up to an error based on the available samples. It is possible to improve the square-error bound (10) even further by first, running Structure-RISE to recover edges, and then re-running RISE with λ = 0 for the remaining non-zero couplings. The computational complexity of RISE is equal to the complexity of minimizing the convex ISO and, as such, it scales at most as O np3 . Therefore, computational complexity of Structure-RISE scales at most as O np4 simply because one has to call RISE at every node. We believe that this runningtime estimate can be proven to be quasi-quadratic when using first-order minimization-techniques, in the spirit of [23]. We have observed through numerical experiments that such techniques implement Structure-RISE with running-time O np2 . Notice that in order to implement RISE there is no need for prior knowledge on the graph parameters. This is a considerable advantage in practical applications where the maximum degree or bounds on couplings are often unknown. 3 Analysis The Regularized Interaction Screening Estimator (9) is from the class of the so-called regularized M-estimators. Negahban et al. proposed in [22] a framework to analyze the square error of such estimators. As per [22], enforcing only two conditions on the loss function is sufficient to get a handle on the square error of an ℓ1-regularized M-estimator. The first condition links the choice of the penalty parameter to the gradient of the objective function. Condition 1. The ℓ1-penalty parameter strongly enforces regularization if it is greater than any partial derivatives of the objective function at θu = θ∗ u, i.e. λ ≥2 ∥∇Sn (θ∗ u)∥∞. (13) Condition 1 guarantees that if the vector of couplings θ∗ u has at most d non-zero entries, then the estimation difference bθu (λ) −θ∗ u lies within the set K := n ∆∈Rp−1 | ∥∆∥1 ≤4 √ d ∥∆∥2 o . (14) The second condition ensure that the objective function is strongly convex in a restricted subset of Rp−1. Denote the reminder of the first-order Taylor expansion of the objective function by δSn (∆u, θ∗ u) := Sn (θ∗ u + ∆u) −Sn (θ∗ u) −⟨∇Sn (θ∗ u) , ∆u⟩, (15) where ∆u ∈Rp−1 is an arbitrary vector. Then the second condition reads as follows. Condition 2. The objective function is restricted strongly convex with respect to K on a ball of radius R centered at θu = θ∗ u, if for all ∆u ∈K such that ∥∆u∥2 ≤R, there exists a constant κ > 0 such that δSn (∆u, θ∗ u) ≥κ ∥∆u∥2 2 . (16) Strong regularization and restricted strong convexity enables us to control that the minimizer bθu of the full objective (9) lies in the vicinity of the sparse vector of parameters θ∗ u. The precise formulation is given in the proposition following from [22, Thm. 1]. Proposition 1. If the ℓ1-regularized M-estimator of the form (9) satisfies Condition 1 and Condition 2 with R > 3 √ d λ κ then the square-error is bounded by bθu −θ∗ u 2 ≤3 √ dλ κ. (17) 5 3.1 Gradient Concentration Like the ISO (8), its gradient in any component l ∈V \ u is an empirical average ∂ ∂θul Sn (θu) = 1 n n X k=1 X(k) ul (θu) , (18) where the random variables X(k) ul (θu) are i.i.d and they are related to the spin configurations according to Xul (θu) = −σuσl exp  − X i∈V \u θuiσuσi  . (19) In order to prove that the ISO gradient concentrates we have to state few properties of the support, the mean and the variance of the random variables (19), expressed in the following three Lemmas. The first of the Lemmas states that at θu = θ∗ u, the random variable Xul (θ∗ u) has zero mean. Lemma 1. For any Ising model with p spins and for all l ̸= u ∈V E [Xul (θ∗ u)] = 0. (20) As a direct corollary of the Lemma 1, θu = θ∗ u is always a minimum of the averaged ISO (8). The second Lemma proves that at θu = θ∗ u, the random variable Xul (θ∗ u) has a variance equal to one. Lemma 2. For any Ising model with p spins and for all l ̸= u ∈V E h Xul (θ∗ u)2i = 1. (21) The next lemma states that at θu = θ∗ u, the random variable Xul (θ∗ u) has a bounded support. Lemma 3. For any Ising model with p spins, with maximum degree d and maximum coupling intensity β, it is guaranteed that for all l ̸= u ∈V |Xul (θ∗ u)| ≤exp (βd) . (22) With Lemma 1, 2 and 3, and using Berstein’s inequality we are now in position to prove that every partial derivative of the ISO concentrates uniformly around zero as the number of samples grows. Lemma 4. For any Ising model with p spins, with maximum degree d and maximum coupling intensity β. For any ϵ3 > 0, if the number of observation satisfies n ≥exp (2βd) ln 2p ϵ3 , then the following bound holds with probability at least 1 −ϵ3: ∥∇Sn (θ∗ u)∥∞≤2 s ln 2p ϵ3 n . (23) 3.2 Restricted Strong-Convexity The remainder of the first-order Taylor-expansion of the ISO, defined in Eq. (15) is explicitly computed δSn (∆u, θ∗) = 1 n n X k=1 exp − X i∈∂u θ∗ uiσ(k) u σ(k) i ! f  X i∈V \u ∆uiσ(k) u σ(k) i  , (24) where f (z) := e−z −1 + z. In the following lemma we prove that Eq. (24) is controlled by a much simpler expression using a lower-bound on f (z). Lemma 5. For all ∆u ∈Rp−1, the remainder of the first-order Taylor expansion admits the following lower-bound δSn (∆u, θ∗) ≥ e−βd 2 + ∥∆u∥1 ∆⊤ u Hn∆u (25) where Hn is an empirical covariance matrix with elements Hn ij = 1 n Pn k=1 σ(k) i σ(k) j for i, j ∈V \ u. 6 Lemma 5 enables us to control the randomness in δSn (∆u, θ∗) through the simpler matrix Hn that is independent of ∆u. This last point is crucial as we show in the next lemma that Hn concentrates independently of ∆u towards its mean. Lemma 6. Consider an Ising model with p spins, with maximum degree d and maximum coupling intensity β. Let δ > 0, ϵ4 > 0 and n ≥ 2 δ2 ln p2 ϵ4 . Then with probability greater than 1 −ϵ4, we have for all i, j ∈V \ u Hn ij −Hij ≤δ, (26) where the matrix H is the covariance matrix with elements Hij = E [σiσj], for i, j ∈V \ u. The last ingredient that we need is a proof that the smallest eigenvalue of the covariance matrix H is bounded away from zero independently of the dimension p. Equivalently the next lemma shows that the quadratic form associated with H is non-degenerate regardless of the value of p. Lemma 7. Consider an Ising model with p spins, with maximum degree d and maximum coupling intensity β. For all ∆u ∈Rp−1 the following bound holds ∆⊤ u H∆u ≥e−2βd d + 1 ∥∆u∥2 2 . (27) We stress that Lemma 7 is a deterministic result valid for all ∆u ∈Rp−1. We are now in position to prove the restricted strong convexity of the ISO. Lemma 8. Consider an Ising model with p spins, with maximum degree d and maximum coupling intensity β. For all ϵ4 > 0 and R > 0, when n ≥211d2 (d + 1)2 e4βd ln p2 ϵ4 the ISO (8) satisfies, with probability at least 1 −ϵ4, the restricted strong convexity condition δSn (∆u, θ∗ u) ≥ e−3βd 4 (d + 1)  1 + 2 √ dR  ∥∆u∥2 2 , (28) for all ∆u ∈Rp−1 such that ∥∆u∥1 ≤4 √ d ∥∆u∥2 and ∥∆u∥2 ≤R. 3.3 Proof of the main Theorems Proof of Theorem 1 (Square Error of RISE). We seek to apply Proposition 1 to the Regularized Interaction Screening Estimator (9). Using ϵ3 = 2ϵ1 3 in Lemma 4 and letting λ = 4 q 1 n ln 3p/ϵ1, it follows that Condition 1 is satisfied with probability greater than 1 −2ϵ1/3, whenever n ≥e2βd ln 3p ϵ1 . Using ϵ4 = ϵ1/3 in Lemma 8, and observing that 12 √ dλe3βd(d + 1)(1 + 2 √ dR) < R, for R = 2/ √ d and n ≥214d2 (d + 1)2 e6βd ln 3p2 ϵ1 , we conclude that condition 2 is satisfied with probability greater than 1 −ϵ1 3 . Theorem 1 then follows by using a union bound and then applying Proposition 1. The proof of Theorem 2 becomes an immediate application of Theorem 1 for achieving an estimation of couplings at each node with squared-error of α/2 and with probability 1 −ϵ1 = 1 −ϵ2/p. 4 Numerical Results We test performance of the Struct-RISE, with the strength of the l1-regularization parametrized by λ = 4 q 1 n ln(3p2/ϵ), on Ising models over two-dimensional grid with periodic boundary conditions (thus degree of every node in the graph is 4). We have observed that this topology is one of the hardest for the reconstruction problem. We are interested to find the minimal number of samples, nmin, such that the graph is perfectly reconstructed with probability 1 −ϵ ≥0.95. In our numerical experiments, we recover the value of nmin as the minimal n for which Struct-RISE outputs the perfect structure 45 times from 45 different trials with n samples, thus guaranteeing that the probability of perfect reconstruction is greater than 0.95 with a statistical confidence of at least 90%. We first verify the logarithmic scaling of nmin with respect to the number of spins p. The couplings are chosen uniform and positive θ∗ ij = 0.7. This choice ensures that samples generated by Glauber 7 Figure 1: Left: Linear-exponential plot showing the observed relation between nmin and p. The graph is a √p × √p two-dimensional grid with uniform and positive couplings θ∗= 0.7. Right: Linearexponential plot showing the observed relation between nmin and β. The graph is the two-dimensional 4 × 4 grid. In red the couplings are uniform and positive and in blue the couplings have uniform intensity but random sign. dynamics are i.i.d. according to (1). Values of nmin for p ∈{9, 16, 25, 36, 49, 64} are shown on the left in Figure 1. Empirical scaling is, ≈1.1 × 105 ln p, which is orders of magnitude better than the rather conservative prediction of the theory for this model, 3.2 × 1015 ln p. We also test the exponential scaling of nmin with respect to the maximum coupling intensity β. The test is conducted over two different settings both with p = 16 spins: the ferromagnetic case where all couplings are uniform and positive, and the spin glass case where the sign of couplings is assigned uniformly at random. In both cases the absolute value of the couplings, θ∗ ij , is uniform and equal to β. To ensure that the samples are i.i.d, we sample directly from the exhaustive weighted list of the 216 possible spin configurations. The structure is recovered by thresholding the reconstructed couplings at the value α/2 = β/2. Experimental values of nmin for different values of the maximum coupling intensity, β, are shown on the right in Fig. 1. Empirically observed exponential dependence on β is matched best by, exp (12.8β), in the ferromagnetic case and by, exp (5.6β), in the case of the spin glass. Theoretical bound for d = 4 predicts exp (24β). We observe that the difference in sample complexity depends significantly on the type of interaction. An interesting observation one can make based on these experiments is that the case which is harder from the sample-generating perspective is easier for learning and vice versa. 5 Conclusions and Path Forward In this paper we construct and analyze the Regularized Interaction Screening Estimator (9). We show that the estimator is computationally efficient and needs an optimal number of samples for learning Ising models. The RISE estimator does not require any prior knowledge about the model parameters for implementation and it is based on the minimization of the loss function (8), that we call the Interaction Screening Objective. The ISO is an empirical average (over samples) of an objective designed to screen an individual spin/variable from its factor-graph neighbors. Even though we focus in this paper solely on learning pair-wise binary models, the “interaction screening” approach we introduce here is generic. The approach extends to learning other Graphical Models, including those over higher (discrete, continuous or mixed) alphabets and involving highorder (beyond pair-wise) interactions. These generalizations are built around the same basic idea pioneered in this paper – the interaction screening objective is (a) minimized over candidate GM parameters at the actual values of the parameters we aim to learn; and (b) it is an empirical average over samples. In the future, we plan to explore further theoretical and experimental power, characteristics and performance of the generalized screening estimator. Acknowledgment: We are thankful to Guy Bresler and Andrea Montanari for valuable discussions, comments and insights. The work was supported by funding from the U.S. Department of Energy’s Office of Electricity as part of the DOE Grid Modernization Initiative. 8 References [1] D. Marbach, J. C. Costello, R. Kuffner, N. M. Vega, R. J. Prill, D. M. Camacho, K. R. Allison, M. Kellis, J. J. Collins, and G. Stolovitzky, “Wisdom of crowds for robust gene network inference,” Nat Meth, vol. 9, pp. 796–804, Aug 2012. [2] F. Morcos, A. Pagnani, B. Lunt, A. Bertolino, D. S. Marks, C. Sander, R. Zecchina, J. N. Onuchic, T. Hwa, and M. Weigt, “Direct-coupling analysis of residue coevolution captures native contacts across many protein families,” Proceedings of the National Academy of Sciences, vol. 108, no. 49, pp. E1293–E1301, 2011. [3] E. Schneidman, M. J. Berry, R. Segev, and W. Bialek, “Weak pairwise correlations imply strongly correlated network states in a neural population,” Nature, vol. 440, pp. 1007–1012, Apr 2006. [4] S. Roth and M. J. Black, “Fields of experts: a framework for learning image priors,” in Computer Vision and Pattern Recognition, 2005. CVPR 2005. IEEE Computer Society Conference on, vol. 2, pp. 860–867 vol. 2, June 2005. [5] N. Eagle, A. S. Pentland, and D. Lazer, “Inferring friendship network structure by using mobile phone data,” Proceedings of the National Academy of Sciences, vol. 106, no. 36, pp. 15274–15278, 2009. [6] M. He and J. Zhang, “A dependency graph approach for fault detection and localization towards secure smart grid,” IEEE Transactions on Smart Grid, vol. 2, pp. 342–351, June 2011. [7] D. Deka, S. Backhaus, and M. Chertkov, “Structure learning and statistical estimation in distribution networks,” submitted to IEEE Control of Networks; arXiv:1501.04131; arXiv:1502.07820, 2015. [8] C. Chow and C. Liu, “Approximating discrete probability distributions with dependence trees,” IEEE Transactions on Information Theory, vol. 14, pp. 462–467, May 1968. [9] A. d’Aspremont, O. Banerjee, and L. E. Ghaoui, “First-order methods for sparse covariance selection,” SIAM Journal on Matrix Analysis and Applications, vol. 30, no. 1, pp. 56–66, 2008. [10] J. K. Johnson, D. Oyen, M. Chertkov, and P. Netrapalli, “Learning planar ising models,” Journal of Machine Learning, in press; arXiv:1502.00916, 2015. [11] T. Tanaka, “Mean-field theory of Boltzmann machine learning,” Phys. Rev. E, vol. 58, pp. 2302–2310, Aug 1998. [12] H. J. Kappen and F. d. B. Rodríguez, “Efficient learning in Boltzmann machines using linear response theory,” Neural Computation, vol. 10, no. 5, pp. 1137–1156, 1998. [13] Y. Roudi, J. Tyrcha, and J. Hertz, “Ising model for neural data: Model quality and approximate methods for extracting functional connectivity,” Phys. Rev. E, vol. 79, p. 051915, May 2009. [14] F. Ricci-Tersenghi, “The Bethe approximation for solving the inverse Ising problem: a comparison with other inference methods,” Journal of Statistical Mechanics: Theory and Experiment, vol. 2012, no. 08, p. P08015, 2012. [15] G. Bresler, D. Gamarnik, and D. Shah, “Hardness of parameter estimation in graphical models,” in Advances in Neural Information Processing Systems 27 (Z. Ghahramani, M. Welling, C. Cortes, N. D. Lawrence, and K. Q. Weinberger, eds.), pp. 1062–1070, Curran Associates, Inc., 2014. [16] A. Montanari, “Computational implications of reducing data to sufficient statistics,” Electron. J. Statist., vol. 9, no. 2, pp. 2370–2390, 2015. [17] P. Ravikumar, M. J. Wainwright, and J. D. Lafferty, “High-dimensional Ising model selection using ℓ1-regularized logistic regression,” Ann. Statist., vol. 38, pp. 1287–1319, 06 2010. [18] A. Montanari and J. A. Pereira, “Which graphical models are difficult to learn?,” in Advances in Neural Information Processing Systems 22 (Y. Bengio, D. Schuurmans, J. D. Lafferty, C. K. I. Williams, and A. Culotta, eds.), pp. 1303–1311, Curran Associates, Inc., 2009. [19] G. Bresler, E. Mossel, and A. Sly, “Reconstruction of Markov random fields from samples: Some observations and algorithms,” SIAM Journal on Computing, vol. 42, no. 2, pp. 563–578, 2013. [20] G. Bresler, “Efficiently learning Ising models on arbitrary graphs,” in Proceedings of the Forty-Seventh Annual ACM on Symposium on Theory of Computing, pp. 771–782, ACM, 2015. [21] N. P. Santhanam and M. J. Wainwright, “Information-theoretic limits of selecting binary graphical models in high dimensions,” IEEE Transactions on Information Theory, vol. 58, pp. 4117–4134, July 2012. [22] S. N. Negahban, P. Ravikumar, M. J. Wainwright, and B. Yu, “A unified framework for high-dimensional analysis of M-estimators with decomposable regularizers,” Statist. Sci., vol. 27, pp. 538–557, 11 2012. [23] A. Agarwal, S. Negahban, and M. J. Wainwright, “Fast global convergence of gradient methods for high-dimensional statistical recovery,” Ann. Statist., vol. 40, pp. 2452–2482, 10 2012. 9
2016
312
6,231
Community Detection on Evolving Graphs Aris Anagnostopoulos Sapienza University of Rome aris@dis.uniroma1.it Jakub Ł ˛acki Sapienza University of Rome j.lacki@mimuw.edu.pl Silvio Lattanzi Google silviol@google.com Stefano Leonardi Sapienza University of Rome leonardi@dis.uniroma1.it Mohammad Mahdian Google mahdian@google.com Abstract Clustering is a fundamental step in many information-retrieval and data-mining applications. Detecting clusters in graphs is also a key tool for finding the community structure in social and behavioral networks. In many of these applications, the input graph evolves over time in a continual and decentralized manner, and, to maintain a good clustering, the clustering algorithm needs to repeatedly probe the graph. Furthermore, there are often limitations on the frequency of such probes, either imposed explicitly by the online platform (e.g., in the case of crawling proprietary social networks like twitter) or implicitly because of resource limitations (e.g., in the case of crawling the web). In this paper, we study a model of clustering on evolving graphs that captures this aspect of the problem. Our model is based on the classical stochastic block model, which has been used to assess rigorously the quality of various static clustering methods. In our model, the algorithm is supposed to reconstruct the planted clustering, given the ability to query for small pieces of local information about the graph, at a limited rate. We design and analyze clustering algorithms that work in this model, and show asymptotically tight upper and lower bounds on their accuracy. Finally, we perform simulations, which demonstrate that our main asymptotic results hold true also in practice. 1 Introduction This work studies the problem of detecting the community structure of a dynamic network according to the framework of evolving graphs [3]. In this model the underlying graph evolves over time, subject to a probabilistic process that modifies the vertices and the edges of the graph. The algorithm can learn the changes that take place in the network only by probing the graph at a limited rate. The main question for the evolving graph model is to design strategies for probing the graph, such as to obtain information that is sufficient to maintain a solution that is competitive with a solution that can be computed if the entire underlying graph is known. The motivation for studying this model comes from the the inadequacy of the classical computational paradigm, which assumes perfect knowledge of the input data and an algorithm that terminates. The evolving graph model captures the evolving and decentralized nature of large-scale online social networks. An important part of the model is that only a limited number of probes can be made at each time step. This assumption is motivated by the limitations imposed by many social network platforms such as Twitter or Facebook, where the network is constantly evolving and the access to the structure is possible through an API that implements a rate-limited oracle. Even in cases where such rate-limits are not exogenously imposed (e.g., when the network under consideration is the Web), 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. resource constraints often prohibit us from making too many probes in each time step (probing a large graphs stored across many machines is a costly operation). The evolving graph model has been considered for PageRank computation [4] and connectivity problems [3]. This work is the first to address the problem of community detection in the evolving graph model. Our probabilistic model of the evolution of the community structure of a network is based on the stochastic block model (SBM) [1, 2, 5, 10]. It is a widely accepted model of probabilistic networks for the study of community-detection methods, which generates graphs with an embodied community structure. In the basic form of the model, vertices of a graph are first partitioned into k disjoint communities in a probabilistic manner. Then, two nodes of the same community are linked with probability p, and two nodes of distinct communities are linked with probability q, where p > q. All the connections are mutually independent. We make a first step in the study of community detection in the evolving-graph model by considering an evolving stochastic block model, which allows nodes to change their communities according to a given stochastic process. 1.1 Our Contributions Our first step is to define a meaningful model for community detection on evolving graphs. We do this by extending the stochastic block model to the evolving setting. The evolving stochastic block model generates an n-node graph, whose nodes are partitioned into k communities. At each time step, some nodes may change their communities in a random fashion. Namely, with probability 1/n each node is reassigned; when this happens it is moved to the ith community Ci (which we also call a cluster Ci) with probability αi, where {αi}k i=1 form a probability distribution. After being reassigned, the neighborhood of the node is updated accordingly. While these changes are being performed, we are unaware of them. Yet, at each step, we have a budget of β queries that we can perform to the graph (later we will specify values for β that allow us to obtain meaningful results—a value of β that is too small may not allow the algorithm to catch up with the changes; a value that is too large makes the problem trivial and unrealistic). A query of the algorithm consists in choosing a single node. The result of the query is the list of neighbors of the chosen node at the moment of the query. Our goal is to design an algorithm that is able to issue queries over time in such a way that at each step it may report a partitioning { ˆC1, . . . , ˆCk} that is as close as possible to the real one {C1, . . . , Ck}. A difficulty of the evolving-graph model is that, because we observe the process for an infinite amount of time, even events with negligible probability will take place. Thus we should design algorithms that are able to provide guarantees for most of the time and recover even after highly unlikely events take place. Let us now present our results at a high level. For simplicity of the description, let us assume that p = 1, q = 0 and that the query model is slightly different, namely the algorithm can discover the entire contents of a given cluster with one query.1 We first study algorithms that at each step pick the cluster to query independently at random from some predefined distribution. One natural idea is to pick a cluster proportionally to its size (which is essentially the same as querying the cluster of a node chosen uniformly at random). However, we show that a better strategy is to query a cluster proportionally to the square root of its size. While the two strategies are equivalent if the cluster probabilities {αi}k i=1 are uniform, the latter becomes better in the case of skewed distributions. For example, if we have n1/3 clusters, and the associated probabilities are αi ∼1/i2, the first strategy incorrectly classifies O(n1/3) nodes in each step (in expectation), compared to only O(log2 n) nodes misclassified by the second strategy. Furthermore, our experimental analysis suggests that the the strategy of probing a cluster with a frequency proportional to the square root of its size is not only efficient in theory, but it may be a good choice for practical application as well. We later improve this result and give an algorithm that uses a mixture of cluster and node queries. In the considered example when αi ∼1/i2, at each step it reports clusterings with only O(1) misclassified nodes (in expectation). Although the query strategy and the error bound expressed in 1In our analysis we show that the assumption about the query model can be dropped at the cost of increasing the number of queries that we perform at each time step by a constant factor. 2 terms of {αi}k i=1 are both quite complex, we are able show that the algorithm is optimal, by giving a matching lower bound. Finally, we also show how to deal with the case when 1 ≥p > q ≥0. In this case querying node v provides us with only partial information about its cluster: it is connected to only a subset of the nodes in C. In this case we impose some assumptions on p and q, and we provide an algorithm that given a node can discover the entire contents of its cluster with O(log n/p) node queries. This algorithm allows us to extend the previous results to the case when p > q > 0 (and p and q are sufficiently far from each other), at the cost of performing β = O(log n/p) queries per step. Even though the evolving graph model requires the algorithm to issue a low number of queries, our analysis shows that (under reasonable assumptions on p and q) this small number of queries is sufficient to maintain a high-quality clustering. Our theoretical results hold for large enough n. Therefore, we also perform simulations, which demonstrate that our final theoretically optimal algorithm is able to beat the other algorithms even for small values of n. 2 Related Work Clustering and community-detection techniques have been studied by hundreds of researchers. In social networks, detecting the clustering structure is a basic primitive for finding communities of users, that is, sets of users sharing similar interests or affiliations [12, 16]. In recommendation networks cluster discovery is often used to improve the quality of recommendation systems [13]. Other relevant applications of clustering can be found in image processing, bioinformatics, image analysis and text classification. Prior to the evolving model, a number of dynamic computation models have been studied, such as online computation (the input data are revealed step by step), dynamic algorithms and data structures (the input data are modified dynamically), and streaming computation (the input data are revealed step by step while the algorithm is space constrained). Hartamann et al. [9] presented a survey of results for clustering dynamic networks in some of the previously mentioned models. However, none of the aforementioned models capture the relevant features of the dynamic evolution of large-scale data sets: the data evolves at a slow pace and an algorithm can learn the data changes only by probing specific portions of the graph at some cost. The stochastic block model, used by sociologists [10], has recently received a growing attention in computer science, machine learning, and statistics [1, 2, 5, 6, 17]. At the theoretical level, most work has studied the range of parameters, for which the communities can be recovered from the generated graph, both in the case of two [1, 7, 11, 14, 15] or more [2, 5] communities. Another line of research focused on studying different dynamic versions of the stochastic block model [8, 18, 19, 20]. Yet, there is a lack of theoretical work on modeling and analyzing stochastic block models, and more generally community detection on evolving graph. This paper makes the first step in this direction. 3 Model In this paper we analyze an evolving extension of the stochastic block model [10]. We call this new model the evolving stochastic block model. In this model we consider a graph of n nodes, which are assigned to one of k clusters, and the probability that two nodes have an edge between them depends on the clusters to which they are assigned. More formally, consider a probability distribution α1, . . . , αk (i.e., αi > 0 and P i αi = 1). Without loss of generality, throughout the paper we assume α1 ≥. . . ≥αk. Also, for each 1 ≤i ≤k we also assume that αi < 1 −ϵα for some constant 0 < ϵα < 1. At the beginning, each node independently picks one of the k clusters. The probability that the node picks cluster i is αi. We denote this clustering of the nodes by C. Nodes that pick the same cluster i are connected with a fixed probability pi (which may depend on n), whereas pairs of nodes that pick two different clusters i and j are connected with probability qij (also possibly dependent on n). Note that qij = qji and the edges are independent of each other. We denote p := min1≤i≤k pi and q := max1≤i,j≤k qi,j. 3 So far, our model is very similar to the classic stochastic block model. Now we introduce its main distinctive property, namely the evolution dynamics. Evolution model: In our analysis, we assume that the graph evolves in discrete time steps indexed by natural numbers. The nodes change their cluster in a random manner. At each time step, every node v is reassigned with probability 1/n (independently from other nodes). When this happens, v first deletes all the edges to its neighbors, then selects a new cluster i with probability αi and finally adds new edges with probability pi to nodes in cluster i and with probability qij to nodes in cluster j, for every j ̸= i. For 1 ≤i ≤k and t ∈N, we denote by Ct i the set of nodes assigned to cluster i just after the reassignments in time step t. Note that we use Ci to denote the cluster itself, but Ct i to denote its contents. Query model: We assume that the algorithm may gather information about the clusters by issuing queries. In a single query the algorithm chooses a single node v and learns the list of current neighbors of v. In each time step, the graph is probed after all reassignments are made. We study algorithms that learn the cluster structure of the graph. The goal of our algorithm is to report an approximate clustering ˆC of the graph at the end of each time step, that is close to the true clustering C. We define the distance between two clusterings (partitions) C = {C1, C2, . . . , Ck} and ˆC = { ˆC1, ˆC2, . . . , ˆCk} of the nodes as d(C, ˆC) = min π k X i=1 |Ci△ˆCπ(i)|, where the minimum is taken over all the permutations π of {1, . . . , k}, and △denotes the symmetric difference between two sets, i.e., A△B = (A \ B) ∪(B \ A).2 The distance d(C, ˆC) is called the error of the algorithm (or of the returned clustering). Finally, in our analysis we assume that p and q are far apart, more formally we assume that: Assumption 1. For every i ∈[k], and parameters K, λ and λ′ that we fix later, we have: (i) pαi > Kq, (ii) p2αin ≥λ log n and (iii) pαin ≥λ′ log n. Let us now discuss the above assumptions. Observe that (iii) follows from (ii). However, we prefer to make them separate, as we mostly rely only on (iii). Assumption (iii) is necessary to assure that most of the nodes in the cluster have at least a single edge to another node in the same cluster. In the analysis, we set λ′ to be large enough (yet, still constant), to assure that for every given time t each node has Ω(log n) edges to nodes of the same cluster, with high probability. We use Assumption 1 in an algorithm that, given a node v, finds all nodes of the cluster of v (correctly with high probability3) and issues only O(log n/p) queries. Our algorithm also uses (ii), which is slightly stronger than (iii) (it implies that two nodes from the same cluster have many neighbors in common), as well as (i), which guarantees that (on average) most neighbors of a node v belong to the cluster of v. Discussion: The assumed graph model is relatively simple—certainly not complex enough to claim that it accurately models real-world graphs. Nevertheless, this work is the first attempt to formally study clustering in dynamic graphs and several simplifying assumptions are necessary to obtain provable guarantees. Even with this basic model, the analysis is rather involved. Dealing with difficult features of a more advanced model would overshadow our main findings. We believe that if we want to keep the number of queries low, that is, O(log n/p), Assumption 1 cannot be relaxed considerably, that is, p and q cannot be too close to each other. At the same time, recovery of clusters in the (nonevolving) stochastic block model has also been studied for stricter ranges of parameters. However, the known algorithms in such settings inspect considerably more nodes and require that the cluster probabilities {αi}k i=1 are close to being uniform [5]. The results that apply to the case with many clusters with nonuniform sizes require that p and q are relatively far apart. We note that in studying the classic stochastic block model it is a standard assumption to know p and q, so we also assume it in this work for the sake of simplicity. 2Note that we can extend this definition to pairs of clusterings with different numbers of clusters just by adding empty clusters to the clustering with a smaller number of clusters. 3We define the term with high probability in Section 4. 4 Our model assumes that (in expectation) only one node changes its cluster at every time step. However, we believe that the analysis can be extended to the case when c > 1 nodes change their cluster every step (in expectation) at the cost of using c times more queries. Generalizing the results of this paper to more general models is a challenging open problem. Some interesting directions are, for example, using graphs models with overlapping communities or analyzing a more general model of moving nodes between clusters. 4 Algorithms and Main Results In this section we outline our main results. For simplicity, we omit some technical details, mostly concerning probability. In particular, we say that an event happens with high probability, if it happens with probability at least 1 −1/nc, for some constant c > 1, but in this section we do not specify how this constant is defined.4 We are interested in studying the behavior of the algorithm in an arbitrary time step. We start by stating a lemma showing that to obtain an algorithm that can run indefinitely long, it suffices to designing an algorithm that uses β queries per step, initializes in O(n log n) steps and works with high probability for n2 steps. Lemma 1. Assume that there exists an algorithm for clustering evolving graphs that issues β queries per step and that at each time step t such that t = Ω(n log n) and t ≤n2 it reports a clustering of expected error E correctly with high probability. Then, there exists an algorithm for clustering evolving graphs that issues 2β queries per step and at each time step t such that t = Ω(n log n) it reports a clustering of expected error O(E). To prove this lemma, we show that it suffices to run a new instance of the assumed algorithm every n2 steps. In this way, when the first instance is no longer guaranteed to work, the second one has finished initializing and can be used to report clusterings. 4.1 Simulating Node Queries We now show how to reduce the problem to the setting in which an algorithm can query for the entire contents of a cluster. This is done in two steps. As a first step, we give an algorithm for detecting the cluster of a given node v by using only O(log n/p) node queries. This algorithm maintains score of each node in the graph. Initially, the scores are all equal to 0. The algorithm queries O(log n/p) neighbors of v and adds a score of 1 to every neighbor of neighbor of v. We use Assumption 1 to prove that after this step, with high probability there is a gap between the minimum score of a node inside the cluster of v and the maximum score of a node outside it. Lemma 2. Suppose that Assumption 1 holds. Then, there exists an algorithm that, given a node v, correctly identifies all nodes in the cluster of v with high probability. It issues O(log n/p) queries. Observe that Lemma 2 effectively reduces our problem to the case when p = 1 and q = 0: a single execution of the algorithm gives us the entire cluster of a node, just like a single query for this node in the case when p = 1 and q = 0. In the second step, we give a data structure that maintains an approximate clustering of the nodes and detects the number of cluster k together with (approximate) cluster probabilities. Internally, it uses the algorithm of Lemma 2. Lemma 3. Suppose that Assumption 1 holds. Then there exists a data structure that at each time step t = Ω(n) may answer the following queries: 1. Given a cluster number i, return a node v, such that Pr(v ∈Ct i) ≥1/2. 2. Given Ct i (the contents of cluster Ci) return i. 3. Return k and a sequence α′ 1, . . . , α′ k, such that for each 1 ≤i ≤k, we have αi/2 ≤α′ i ≤ 3αi/2. 4Usually, the constant c can be made arbitrarily large, by tuning the constants of Assumption 1. 5 The data structure runs correctly for n2 steps with high probability and issues O(log n/p) queries per step. Furthermore if p = 1 and q = 0, it makes only 1 query per step. Note that because the data structure can only use node queries to access the graph, it imposes its own numbering on the clusters that it uses consistently. Let us now describe the high-level idea behind it. In each step the data structure selects a node uniformly at random and discovers its entire cluster using the algorithm of Lemma 2. We show that this implies that within any n/16 time steps each cluster is queried at least once with high probability. The main challenge lies in refreshing the knowledge about the clusters. The data structure internally maintains a clustering D1, . . . , Dk. However, when it queries some cluster C, it is not clear which of D1, . . . , Dk does C correspond to. To deal with that we show that the number of changes in each cluster within n/16 time steps is so low (again, with high probability), that there is a single cluster D ∈{D1, . . . , Dk}, for which |D ∩C| > |C| /2. The data structure of Lemma 3 can be used to simulate queries for cluster in the following way. Assume we want to discover the contents of cluster i. First, we use the data structure to get a node v, such that Pr(v ∈Ct i) ≥1/2. Then, we can use algorithm of Lemma 2 to get the entire cluster C′ of node v. Finally, we may use the data structure again to verify whether C′ is indeed Ct i. This is the case with probability more at least 1/2. Moreover, the data structure allows us to assume that the algorithms are initially only given the number of nodes n and the values of p and q, because the data structure can provide to the algorithms both the number of clusters k and their (approximate) probabilities. 4.2 Clustering Algorithms Using the results of Section 4.1, we may now assume that algorithms may query the clusters directly. This allows us to give a simple clustering algorithm. The algorithm first computes a probability distribution ρ1, . . . , ρk on the clusters, which is a function of the cluster probability distribution α1, . . . , αk. Although the cluster probability distribution is not a part of the input data, we may use an approximate distribution α′ 1, . . . , α′ k given by the data structure of Lemma 3—this increases the error of the algorithm only by a constant factor. In each step the algorithm picks a cluster independently at random from the distribution ρ1, . . . , ρk and queries it. In order to determine the probability distribution ρ1, . . . , ρk, we express the upper bound on the error in terms of this distribution and then find the sequence ρ1, . . . , ρk that minimizes this error. Theorem 4. Suppose that Assumption 1 holds. Then there exists an algorithm for clustering evolving graphs that issues O(log n/p) queries per step and that for each time step t = Ω(n) reports a clustering of expected error O Pk i=1 √αi 2 . Furthermore if p = 1 and q = 0, it issues only O(1) queries per step. The clusterings given by this algorithm already have low error, but still we are able to give a better result. Whenever the algorithm of Theorem 4 queries some cluster Ci, it finds the correct cluster assignment for all nodes that have been reassigned to Ci since it has last been queried. These nodes are immediately assigned to the right cluster. However, by querying Ci the algorithm also discovers which nodes have been recently reassigned from Ci (they used to be in Ci when it was last queried, but are not there now). Our improved algorithm maintains a queue of such nodes and in each step removes two nodes from this queue and locates them. In order to locate a single node v, we first discover its cluster C(v) (using algorithm of Lemma 2) and then use the data structure of Lemma 3 to find the cluster number of C(v). Once we do that, we can assign v to the right cluster immediately. This results in a better bound on the error. Theorem 5. Assume that α1 ≥. . . ≥αk. Suppose that Assumption 1 holds. Then there exists an algorithm for clustering evolving graphs that issues O(log n/p) queries per step and that for each time step t = Ω(n log n) reports a clustering of expected error O P 1≤i≤k q αi P i<j≤k αj 2 . Furthermore if p = 1 and q = 0, it issues only O(1) queries per step. 6 Note that the assumption that α1 ≥. . . ≥αk is not needed for the theorem to be true. However, this particular ordering minimizes the value of the bound in the theorem statement. Let us compare the upper bounds of Theorems 4 and 5. For uniform distributions, where α1 = . . . = αk = 1/k, both analyses give an upper bound of O(k), which means that on average only a constant number of nodes per cluster contribute to the error. Now consider a distribution, where k = Θ( p n/ log n) and ai = Θ(1/i2) for 1 ≤i ≤k. The error of the first algorithm is O(log2 n), whereas the second one has only O(1) expected error. Furthermore in some cases, the difference can be even bigger. Namely, let us define the distribution as follows. Let k = ⌊(n/ log n)2/3⌋+ 2 and ϵ = ((log n)/n)1/3. We set a1 = a2 = (1 −ϵ)/2 and ai = ϵ/(k −2) for 3 ≤i ≤k. Then, the error of the first algorithm is O  n log n 1/3 , but for the second it is still O(1). 4.3 Lower Bound Finally, we provide a lower bound for the problem of detecting clusters in evolving stochastic block model. In particular, it implies that in the case when p = 1 and q = 0 the algorithm of Theorem 5 is optimal (up to constant factor). Theorem 6. Every algorithm that issues one query per time step for detecting clusters in the evolving stochastic block model and runs for n/ log n steps has average expected error Ω      k X i=1 v u u tαi k X j=i+1 αj   2   We note here that Theorem 6 can be extended also to algorithms that are allowed β queries by losing a multiplicative factor 1/β. The proof is based on the observation that if the algorithm has not queried some clusters long enough, it is unaware of the nodes that have been reassigned between them. In particular, if a node v moves from Ci to Cj at time t and the algorithm does not query one of the two clusters after time t it has small chances of guessing the cluster of v. Some nontrivial analysis is needed to show that a sufficiently large number of such nodes exist, regardless of the choices of the algorithm. 5 Experiments In this section we compare our optimal algorithm with some benchmarks and show experimentally its effectiveness. More precisely, we compare three different strategies to select the node to explore in each step of our algorithm: • the optimal algorithm of Theorem 5, • the strategy that probes a random node, • the strategy that selects first a random cluster and then probes a random node in the cluster. To compare these three probing strategies we construct a synthetic instance of our model as follows. We build a graph with 10000 nodes with communities of expected size between 50 and 250. The number of communities with expected size ℓis proportional to ℓ−c for c = 0, 1, 2, 3. So the distribution of communities’ size follows a power-law distribution with parameter c ∈{0, 1, 2, 3}. To generate random communities in our experiment we use p = 0.5 and q = 0.001. Note that in our experiments the number of communities depends on the various parameters. For simplicity in the remaining of the section we use k to denote the number of communities in a specific experiment instance. In the first step of the experiment we generate a random graph with the parameters described above. Then the random evolution starts and in each step a single node changes its cluster. In the first 10k evolution steps, we construct the data structure described in Lemma 3 by exploring the clusters of a single random node per step. Finally, we run the three different strategies for 25k additional steps in which we update the clusterings by exploring a single node in each step and by retrieving its cluster. 7 (a) c=0 (b) c=1 (c) c=2 (d) c=3 Figure 1: Comparing the performance of different algorithms on graphs with different community distributions. At any point during the execution of the algorithm we compute the cluster of a node by exploring at most 30 of its neighbors. In Figure 1 we show the experimental results for different values of c ∈{0, 1, 2, 3}. We repeat all the experiments 5 times and we show the average value and the standard deviation. It is interesting to note that the optimal queue algorithm outperforms significantly all the other strategies. It is also interesting to note that the quality of the clustering worsens with time, this is probably because of the fact that after many steps the data structure become less reliable. Finally, notice that as c decreases and the communities’ size distribution becomes less skewed, the performance of the 3 algorithms worsens and becomes closer to one another, as suggested by our theoretical analysis. Acknowledgments We would like to thank Marek Adamczyk for helping in some mathematical derivations. This work is partly supported by the EU FET project MULTIPLEX no. 317532 and the Google Focused Award on “Algorithms for Large-scale Data Analysis.” References [1] Emmanuel Abbe, Afonso S. Bandeira, and Georgina Hall. Exact recovery in the stochastic block model. IEEE Transactions on Information Theory, 62(1):471–487, 2016. [2] Emmanuel Abbe and Colin Sandon. Community detection in general stochastic block models: Fundamental limits and efficient algorithms for recovery. In IEEE 56th Annual Symposium on Foundations of Computer Science, FOCS 2015, Berkeley, CA, USA, 17-20 October, 2015, pages 670–688, 2015. [3] Aris Anagnostopoulos, Ravi Kumar, Mohammad Mahdian, Eli Upfal, and Fabio Vandin. Algorithms on evolving graphs. In Proceedings of the 3rd Innovations in Theoretical Computer Science Conference, ITCS ’12, pages 149–160, 2012. 8 [4] Bahman Bahmani, Ravi Kumar, Mohammad Mahdian, and Eli Upfal. Pagerank on an evolving graph. In The 18th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, KDD ’12, Beijing, China, August 12-16, 2012, pages 24–32, 2012. [5] Nader H. Bshouty and Philip M. Long. Finding planted partitions in nearly linear time using arrested spectral clustering. In Proceedings of the 27th International Conference on Machine Learning (ICML-10), June 21-24, 2010, Haifa, Israel, pages 135–142, 2010. [6] D. S. Choi, P. J. Wolfe, and E. M. Airoldi. Stochastic blockmodels with a growing number of classes. Biometrika, pages 1 – 12, 2012. [7] Amin Coja-Oghlan. Graph partitioning via adaptive spectral techniques. Combinatorics, Probability & Computing, 19(2):227–284, 2010. [8] Qiuyi Han, Kevin S. Xu, and Edoardo Airoldi. Consistent estimation of dynamic and multi-layer block models. In Proceedings of the 32nd International Conference on Machine Learning, ICML 2015, Lille, France, 6-11 July 2015, pages 1511–1520, 2015. [9] Tanja Hartmann, Andrea Kappes, and Dorothea Wagner. Clustering evolving networks. CoRR, abs/1401.3516, 2014. [10] P.W. Holland, K. Laskey, and S. Leinhardt. Stochastic block models: First steps. Social Networks, 5:109–137, 1983. [11] Adel Javanmard, Andrea Montanari, and Federico Ricci-Tersenghi. Phase transitions in semidefinite relaxations. Proceedings of the National Academy of Sciences, 113(16):E2218–E2223, 2016. [12] Ravi Kumar, Jasmine Novak, and Andrew Tomkins. Structure and evolution of online social networks. In Proceedings of the 12th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, KDD ’06, pages 611–617, New York, NY, USA, 2006. ACM. [13] Greg Linden, Brent Smith, and Jeremy York. Amazon.com recommendations: Item-to-item collaborative filtering. IEEE Internet Computing, 7(1):76–80, January 2003. [14] Laurent Massoulié. Community detection thresholds and the weak ramanujan property. In Symposium on Theory of Computing, STOC 2014, New York, NY, USA, May 31 - June 03, 2014, pages 694–703, 2014. [15] Elchanan Mossel, Joe Neeman, and Allan Sly. Consistency thresholds for the planted bisection model. In Proceedings of the Forty-Seventh Annual ACM on Symposium on Theory of Computing, STOC 2015, Portland, OR, USA, June 14-17, 2015, pages 69–75, 2015. [16] Mark Newman. Networks: An Introduction. Oxford University Press, Inc., New York, NY, USA, 2010. [17] K. Rohe, S. Chatterjee, and B. Yu. Spectral clustering and the high-dimensional stochastic block model. The Annals of Statistics, 39(4):1878 – 1915, 2011. [18] Kevin S. Xu. Stochastic block transition models for dynamic networks. CoRR, abs/1411.5404, 2014. [19] Kevin S. Xu and Alfred O. Hero III. Dynamic stochastic blockmodels: Statistical models for timeevolving networks. In Social Computing, Behavioral-Cultural Modeling and Prediction - 6th International Conference, SBP 2013, Washington, DC, USA, April 2-5, 2013. Proceedings, pages 201–210, 2013. [20] Rawya Zreik, Pierre Latouche, and Charles Bouveyron. The dynamic random subgraph model for the clustering of evolving networks. Computational Statistics, pages 1–33, 2016. 9
2016
313
6,232
Preference Completion from Partial Rankings Suriya Gunasekar University of Texas, Austin, TX, USA suriya@utexas.edu Oluwasanmi Koyejo University of Illinois, Urbana-Champaign, IL, USA sanmi@illinois.edu Joydeep Ghosh University of Texas,Austin, TX, USA ghosh@ece.utexas.edu Abstract We propose a novel and efficient algorithm for the collaborative preference completion problem, which involves jointly estimating individualized rankings for a set of entities over a shared set of items, based on a limited number of observed affinity values. Our approach exploits the observation that while preferences are often recorded as numerical scores, the predictive quantity of interest is the underlying rankings. Thus, attempts to closely match the recorded scores may lead to overfitting and impair generalization performance. Instead, we propose an estimator that directly fits the underlying preference order, combined with nuclear norm constraints to encourage low–rank parameters. Besides (approximate) correctness of the ranking order, the proposed estimator makes no generative assumption on the numerical scores of the observations. One consequence is that the proposed estimator can fit any consistent partial ranking over a subset of the items represented as a directed acyclic graph (DAG), generalizing standard techniques that can only fit preference scores. Despite this generality, for supervision representing total or blockwise total orders, the computational complexity of our algorithm is within a log factor of the standard algorithms for nuclear norm regularization based estimates for matrix completion. We further show promising empirical results for a novel and challenging application of collaboratively ranking of the associations between brain–regions and cognitive neuroscience terms. 1 Introduction Collaborative preference completion is the task of jointly learning bipartite (or dyadic) preferences of set of entities for a shared list of items, e.g., user–item interactions in a recommender system [14; 22]. It is commonly assumed that such entity–item preferences are generated from a small number of latent or hidden factors, or equivalently, the underlying preference value matrix is assumed to be low rank. Further, if the observed affinity scores from various explicit and implicit feedback are treated as exact (or mildly perturbed) entries of the unobserved preference value matrix, then the preference completion task naturally fits in the framework of low rank matrix completion [22; 38]. More generally, low rank matrix completion involves predicting the missing entries of a low rank matrix from a vanishing fraction of its entries observed through a noisy channel. Several low rank matrix completion estimators and algorithms have been developed in the literature, many with strong theoretical guarantees and empirical performance [6; 32; 21; 28; 38; 10]. Recent research in the preference completion literature have noted that using a matrix completion estimator for collaborative preference estimation may be misguided [11; 33; 23] as the observed entity–item affinity scores from implicit/explicit feedback are potentially subject to systematic monotonic transformations arising from limitations in feedback collection, e.g., quantization and 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. inherent biases. While simple user biases and linear transofmations can be handled within a low rank matrix framework, more complex transformations like quantization can potentially increase the rank of the observed preference score matrix significantly, thus adversely affecting recovery using standard low rank matrix completion [13]. Further, despite the common practice of measuring preferences using numerical scores, predictions are most often deployed or evaluated based on the item ranking e.g. in recommender systems, user recommendations are often presented as a ranked list of items without the underlying scores. Indeed several authors have shown that favorable empirical/theoretical performance in mean square error for the preference matrix often does not translate to better performance when performance is measured using ranking metrics [11; 33; 23]. Thus, collaborative preference estimation may be better posed as a collection of coupled learning to rank (LETOR) problems [25], where we seek to jointly learn the preference rankings of a set of entities, by exploiting the low dimensional latent structure of the underlying preference values. This paper considers preference completion in a general collaborative LETOR setting. Importantly, while the observations are assumed to be reliable indicators for relative preference ranking, their numerical scores may be quite deviant from the ground truth low rank preference matrix. Therefore, we aim at addressing preference completion under the following generalizations: 1. In a simple setting, for each entity, a score vector representing the its observed affinity interactions is assumed to be generated from an arbitrary monotonic transformation of the corresponding entries of the ground truth preference matrix. We make no further generative assumptions on observed scores beyond monotonicity with respect to the underlying low rank preference matrix. 2. We also consider a more general setting, where observed preferences of each entity represent specifications of a partial ranking in the form of a directed acyclic graph (DAG) – the nodes represent a subset of items, and each edge represents a strict ordering between a pair of nodes. Such rankings may be encountered when the preference scores are consolidated from multiple sources of feedback, e.g., comparative feedback (pairwise or listwise) solicited for independent subsets of items. This generalized setting cannot be handled by standard matrix completion without some way of transforming the DAG orderings into a score vector. Our work is in part motivated by an application to neuroimaging meta-analysis as outlined in the following. Cognitive neuroscience aims to quantify the link between brain function with behavior. This interaction is most often measured in humans using Functional Magnetic Resonance Imaging (fMRI) experiments that measure brain activity in response to behavioral tasks. After analysis, the conclusions are often summarized in neuroscience publications which include a table of brain locations that are most actively activated in response to an experimental stimulus. These results can then be synthesized using meta-analysis techniques to derive accurate predictions of brain activity associated with cognitive terms (also known as forward inference) and prediction of cognitive terms associated with brain regions (also known as reverse inference). For our study, we used data from neurosynth [36] - a public repository1 which automatically scrapes information on published associations between brain regions and terms in cognitive neuroscience experiments. The key contributions of the paper are summarized below. • We propose a convex estimator for low rank preference completion using limited supervision, addressing: (a) arbitrary monotonic transformations of preference scores; and (b) partial rankings over items (Section 3.1). We derive generalization error bounds for a surrogate ranking loss that quantifies the trade–off between data–fit and regularization (Section 5). • We propose efficient algorithms for the estimate under total and partially ordered observations. In the case of total orders, in spite of increased generality, the computational complexity of our algorithm is within a log factor of the standard convex algorithms for matrix completion (Section 4). • The proposed algorithm is evaluated for a novel application of identifying associations between brain–regions and cognitive terms from the neurosynth dataset [37] (Section 6). Such a large scale meta-analysis synthesizing information from the literature and related tasks has the potential to lead to novel insights into the role of brain regions in cognition and behavior. 1.1 Notation For a matrix M ∈Rd1×d2, let σ1 ≥σ2 ≥. . . be singular values of M. Then, nuclear norm ∥M∥∗= P i σi, operator norm ∥M∥op = σ1, and Frobenius norm ∥M∥F = pP i σ2 i . Let 1http://neurosynth.org/ 2 [N] = {1, 2, . . . , N}. A vector or a set x indexed by j ∈[N] is sometimes denoted as (xj)N j=1 or simply (xj) whenever N is unambiguous. Let Ω⊂[d1] × [d2] denote a subset of indices of a matrix in Rd1×d2. For j ∈[d2], let Ωj = {(i′, j′) ∈Ω: j′ = j} ⊂Ωdenotes the subset of entries in Ω from the jth column. Given Ω= {(is, js) : s = 1, 2, . . . , |Ω|}, PΩ: X →(Xisjs)|Ω| s=1 ∈R|Ω| is the linear subsampling operator, and P∗ Ω: R|Ω| →Rd1×d2 is its adjoint, i.e ⟨y, PΩ(X)⟩= ⟨X, P∗ Ω(y)⟩. For conciseness, we sometimes use the notation XΩto denote PΩ(X). 2 Related Work Matrix Completion: Low rank matrix completion has an extensive literature; a few examples include [22; 6; 21; 28] among several others. However, the bulk of these works including those in the context of ranking/recommendation applications focus on (a) fitting the observed numerical scores using squared loss, and (b) evaluating the results on parameter/rating recovery metrics such as root mean squared error (RMSE). The shortcomings of such estimators and results using squared loss in ranking applications have been studied in some recent research [12; 11]. Motivated by collaborative ranking applications, there has been growing interest in addressing matrix completion within an explicit LETOR framework. Weimer et al. [35] and Koyejo et al. [23] propose estimators that involve non–convex optimization problems and their algorithmic convergence and generalization behavior are not well understood. Some recent works provide parameter recovery guarantees for pairwise/listwise ranking observations under specific probabilistic distributional assumptions on the observed rankings [31; 26; 29]. In comparison, the estimators and algorithms in this paper are agnostic to the generative distribution, and hence have much wider applicability. Learning to rank (LETOR): LETOR is a structured prediction task of rank ordering relevance of a list of items as a function of pre–selected features [25]. Currently, leading algorithms for LETOR are listwise methods [9] (as is the approach taken in this paper), which fully exploit the ranking structure of ordered observations, and offer better modeling flexibility compared to the pointwise [24] and pairwise methods [16; 18]. A recent listwise LETOR algorithm proposed the idea of monotone retargeting (MR) [2], which elegantly addresses listwise learning to rank (LETOR) task while maintaining the relative simplicity and scalability of pointwise estimation. MR was further extended to incorporate margins in the margin equipped monotonic retargeting (MEMR) formulation [1] to preclude trivial solutions that arise from scale invariance of the initial MR estimate in Acharyya et al. [2]. The estimator proposed in the paper is inspired from the the idea of MR and will be revisited later in the paper. In collaborative preference completion, rather than learning a functional mapping from features to ranking, we seek to exploit the low rank structure in jointly modeling the preferences of a collection of entities without access to preference indicative features. Single Index Models (SIMs) Finally, literature on monotonic single index models (SIMs) also considers estimation under unknown monotonic transformations [17; 20]. However, algorithms for SIMs are designed to solve a harder problem of exactly estimating the non–parametric monotonic transformation and are evaluated for parameter recovery rather than the ranking performance. In general, with no further assumptions, sample complexity of SIM estimators lends them unsuitable for high dimensional estimation. The existing high dimensional estimators for learning SIMs typically assume Lipschitz continuity of the monotonic transformation which explicitly uses the observed score values in bounding the Lipsciptz constant of the monotonic transformation [19; 13]. In comparison, our proposed model is completely agnostic to the numerical values of the preference scores. 3 Preference Completion from Partial Rankings Let the unobserved true preference scores of d2 entities for d1 items be denoted by a rank r ≪ min {d1, d2} matrix Θ∗∈Rd1×d2. For each entity j ∈[d2], we observe a partial or total ordering of preferences for a subset of items denoted by Ij ⊂[d1]. Let nj = |Ij| denotes the number of items over which relative preferences of entity j are observed, so that Ωj = {(i, j) : i ∈Ij} denotes the entity-item index set for j, and Ω= S j Ωj denotes the index set collected across entities. Let PΩ denote the sampling distribution for Ω. The observed preferences of entity j are typically represented by a listwise preference score vector y(j) ∈Rnj. ∀j ∈[d2], y(j) = gj(PΩj(Θ∗+ W)), (1) 3 where each (gj) are an arbitrary and unknown monotonic transformations, and W ∈Rd1×d2 is some non–adversarial noise matrix sampled from the distribution PW . The preference completion task is to estimate a unseen rankings within each column of Θ∗from a subset of orderings (Ωj, y(j))j∈[d2]. As (gj) are arbitrary, the exact values of (y(j)) are inconsequential, and the observed preference order can be specified by a constraint set parameterized by a margin parameter ϵ as follows: Definition 1 (ϵ–margin Isotonic Set) The following set of vectors are isotonic to y ∈Rn with an ϵ > 0 margin parameter: Rn ↓ϵ(y) = {x ∈Rn : ∀i, k ∈[n], yi < yk ⇒xi ≤xk −ϵ}. In addition to score vectors, isotonic sets of the form Rn ↓ϵ(y) are equivalently defined for any DAG y = G([n], E) which denotes a partial ranking among the vertices, with the convention that (i, k) ∈E ⇒∀x ∈Rn ↓ϵ(y), xi ≤xk −ϵ. We note from Definition 1 that ties are not broken at random, e.g., if yi1 = yi2 < yk, then ∀x ∈Rn ↓ϵ(y), xi1 ≤xk −ϵ, xi2 ≤xk −ϵ, but no particular ordering between xi1 and xi2 is specified. Let y(k) denote the kth smallest entry of y ∈Rn. We distinguish between three special cases of an observation y representing a partial ranking over [n]. (A) Strict Total Order: y(1) < y(2) < . . . < y(n). (B) Blockwise Total Order: y(1) ≤y(2) ≤. . . ≤y(n), with K ≤n unique values. (C) Arbitrary DAG: Partial order induced by a DAG y = G([n], E). 3.1 Monotone Retargeted Low Rank Estimator Consider any scalable pointwise learning algorithm that fits a model to exact preferences scores. Since no generative model (besides monotonicity) is assumed for the raw numerical scores in the observations, in principle, the scores y(j) for entity j can be replaced or retargeted to any rankingpreserving scores, i.e., by any vector in Rnj ↓ϵ (y(j)). Monotone Retargeting (MR) [2] exploits this observation to address the combinatorial listwise ranking problem [25] while maintaining the relative simplicity and scalability of pointwise estimates (regression). The key idea in MR is to alternately fit a pointwise algorithm to current relevance scores, and retarget the scores by searching over the space of all monotonic transformations of the scores. Our approach extends and generalizes monotone retargeting for the preference prediction task. We begin by motivating an algorithm for the noise free setting, where it is clear that Θ∗ Ωj ∈Rnj ↓ϵ (y(j)), so we seek to estimate a candidate preference matrix X that is in the intersection of (a) the data constraints from the observed preference rankings {XΩj ∈Rnj ↓ϵ (y(j))}, and (b) the model constraints – in this case low rankness induced by constraining the nuclear norm ∥X∥∗. For robust estimation in the presence of noise, we may extend the noise free approach by incorporating a soft penalty on constraint violations. Let z ∈R|Ω|, and with slight abuse of notation, let zΩj ∈Rnj denote vector of the entries of z ∈R|Ω| corresponding to Ωj ⊂Ω. Upon incorporating the soft penalties, the monotone retargeted low rank estimator is given by: b X = Argmin X min z∈R|Ω|λ∥X∥∗+ 1 2∥z −PΩ(X)∥2 2 s.t.∀j, zΩj ∈Rnj ↓ϵ (y(j)), (2) where the parameter λ controls the trade–off between nuclear norm regularization and data fit, and b X is the set of minimizers of (2). We note that Rn ↓ϵ(y) is convex, and ∀λ ≥1, the scaling λRn ↓ϵ(y) = {λx ∀x ∈Rn ↓ϵ(y)} ⊆Rn ↓ϵ(y). The above estimate can be computed using efficient convex optimization algorithms and can handle arbitrary monotonic transformation of the preference scores, thus providing higher flexibility compared to the standard matrix completion. Although (2) is specified in terms of two parameters, due to the geometry of the problem, it turns out that λ and ϵ are not jointly identifiable, as discussed in the following proposition. Proposition 1 The optimization in (2) is jointly convex in (X, z). Further, ∀γ > 0, (λ, γϵ) and (γ−1λ, ϵ) lead to equivalent estimators, specifically b X(λ, γϵ) = γ−1 b X(γ−1λ, ϵ). Since, positive scaling of b X preserves the resultant preference order, using Proposition 1 without loss of generality, only one of ϵ or λ requires tuning with the other remaining fixed. 4 4 Optimization Algorithm The optimization problem in (2) is jointly convex in (X, z). Further, we later show that the proximal operator of the non–differential component of the estimate λ∥X∥∗+ P j I(zΩj ∈Rnj ↓ϵ (y(j))) is efficiently computable. This motivates using the proximal gradient descent algorithm [30] to jointly update (X, z). For an appropriate step size α = 1/2 and the resulting updates are as follows: • X Update: Singular Value Thresholding The proximal operator for τ∥.∥∗is the singular value thresholding operator Sτ. For X with singular value decomposition X = UΣV and τ ≥0, Sτ(X) = Usτ(Σ)V, where sτ is the soft thresholding operator given by sτ(x)i = max{xi −τ, 0}. • z Update: Parallel Projections For hard constraints on z, the proximal operator at v is the Euclidean projection on the constraints given by z ←argminz∥z−v∥2 2, s.t. zΩj ∈Rnj ↓ϵ (y(j)) ∀j ∈ [d2]. These updates decouple along each entity (column) zΩj and can be trivially parallelized. Efficient projections onto Rnj ↓ϵ (y(j)) are discussed Section 4.1. Algorithm 1 Proximal Gradient Descent for (2) with input Ω, {y(j) j }, ϵ and paramter λ for k = 0, 1, 2, . . . , Until (stopping criterion) X(k+1) =Sλ/2  X(k) + 1 2(P∗ Ω(z(k) −X(k) Ω)  , (3) ∀j, z(k+1) Ωj = ProjR nj ↓ϵ (yj)  z(k) Ωj +X(k) Ωj 2  . (4) 4.1 Projection onto Rn ↓ϵ(y) We begin with the following definitions that are used in characterizing Rn ↓ϵ(y). Definition 2 (Adjacent difference operator) The adjacent difference operator in Rn, denoted by Dn : Rn →Rn−1 is defined as (Dnx)i = xi −xi+1, for i ∈[n −1]. Definition 3 (Incidence Matrix) For a directed graph G(V, E), the incidence matrix AG ∈R|V |×|E| is such that: if the jth directed edge ej ∈E is from ith node to kth node, then (AG)ij = 1, (AG)kj = −1, and (AG)lj = 0, ∀l ̸= i or k. Projection onto Rn ↓ϵ(y) is closely related to the isotonic regression problem of finding a univariate least squares fit under consistent order constraints (without margins). This isotonic regression problem in Rn can be solved exactly in O(n) complexity using the classical Pool of Adjacent Violators (PAV) algorithm [15; 4] as: PAV(v) = argmin z′∈Rn ||z′ −v||2 s.t. z′ i −z′ i+1 ≤0. (5) As we discuss, simple adaptations of isotonic regression can be used for projection onto ϵ-margin isotonic sets for the three special cases of interest as summarized in Table 1. (A) Strict Total Order: y(1) < y(2) < . . . y(n) In this setting, the constraint set can be characterized as Rn ↓ϵ(y) = {x : Dnx ≤−ϵ1}, where 1 is a vector of ones. For this case projection onto Rn ↓ϵ(y) differs from (5) only in requiring an ϵ–separation and a straight forward extension of the PAV algorithm [4] can be used. Let dsl ∈Rn be any vector such that 1 = −Dndsl, then by simple substitutions, ProjRn ↓ϵ(y)(x) = PAV(x −ϵdsl) + ϵdsl. (B) Blockwise Total Order: y(1) ≤y(2) ≤. . . ≤y(n) This is a common setting for supervision in many preference completion applications, where the listwise ranking preferences obtained from ratings over discrete quantized levels 1, 2, . . . , K, with K ≪n are prevalent. Let y be partitioned into K ≤n blocks P = {P1, P2, . . . PK}, such that the entries of y within each partition are equal, and the blocks themselves are strictly ordered, i.e., ∀k ∈[K], sup y(Pk−1)< inf y(Pk) = sup y(Pk) < inf y(Pk+1), where P0 = PK+1 = φ, and y(P) = {yi : i ∈P}. 5 Let dbl ∈ Rn be such that dbl i = PK k=1 k Ii∈Pk is a vector of block indices dbl = [1, 1, .. 2, 2, .. K, K, .., K]⊤. Let ΠP be a set of valid permutations that permute entries only within blocks {Pk ∈P}, then Rn ↓ϵ(y) = {x:∃π ∈ΠP , Dnπ(x) ≤−ϵDndbl}. We propose the following steps to compute bz = ProjRn ↓ϵ(y)(x) in this case: Step 1. π∗(x) s.t. ∀k ∈[K], π∗(x)Pk = sort(xPk) Step 2. bz = PAV (π∗(x) −ϵdbl) + ϵdbl. (6) The correctness of (6) is summarized by the following Lemma. Lemma 2 Estimate bz from (6) is the unique minimizer for argmin z ∥z −x∥2 2 s.t. ∃π ∈ΠP : Dnπ(z) ≤−ϵDndbl. (C) Arbitrary DAG: y = G([n], E) An arbitrary DAG (not necessarily connected) can be used to represent any consistent order constraints over its vertices, e.g., partial rankings consolidated from multiple listwise/pairwise scores. In this case, the ϵ–margin isotonic set is given by Rn ↓ϵ(y) = {x : A⊤ G x ≤−ϵ1} (c.f. Definition 3). Consider dDAG ∈Rn such that ith entry dDAG i is the length of the longest directed chain connecting the topological descendants of the node i. It can be easily verified that, the isotonic regression algorithm for arbitrary DAGs applied on x −ϵdDAG gives the projection onto Rn ↓ϵ(y). In this most general setting, the best isotonic regression algorithm for exact solution requires O(nm2 + n3 log n2) computation [34], where m is the number of edges in G. While even in the best case of m = o(n), the computation can be prohibitive, we include this case for completeness. We also note that this case of partial DAG ordering cannot be handled in the standard matrix completion setting without consolidating the partial ranks to total order. Rn ↓ϵ(y) ProjRn ↓ϵ(y)(x) Computation (A) {x : Dnx ≤−ϵ1} PAV(x −ϵdsl) + ϵdsl O(n) (B) {x:∃π ∈ΠP , Dnπ(x) ≤−ϵ1} π∗−1 P PAV(π∗ P (x) −ϵdbl) + ϵdbl) O(n log n) (C) {x : A⊤ G x ≤−ϵ1} IsoReg(x −ϵdDAG, G)+ϵdDAG[34] O(n2m + n3 log n) Table 1: Summary of algorithms for ProjRn ↓ϵ(y)(x) 4.2 Computational Complexity It can be easily verified that gradient of 1 2∥PΩ(X) −z∥2 2 is 2–Lipschitz continuous. Thus, from standard results on convegence proximal gradient descent [30], Algorithm 1,converges to within an ϵ error in objective in O(1/ϵ) iterations. Compared to proximal algorithms for standard matrix completion [5; 27], the additional complexity in Algorithm 1 arises in the z update (4), which is a simple substitution z(k) = X(k) Ω in standard matrix completion. For total orders, the z update of (4) is highly efficient and is asymptotically within an additional log |Ω| factor of the computational costs for standard matrix completion. 5 Generalization Error Recall that yj are (noisy) partial rankings of subset of items for each user, obtained from gj(Θ∗ j +Wj) where W is a noise matrix and gj are unknown and arbitrary transformations that only preserve that ranking order within each column. The estimator and the algorithms described so far are independent of the sampling distribution generating (Ω, {yj}). In this section we quantify simple generalization error bounds for (2). Assumption 1 (Sampling (PΩ)) For a fixed W and Θ∗, we assume the following sampling distribution. Let be c0 a fixed constant and R be pre–specified parameter denoting the length of single listwise observation. For s = 1, 2, . . . , |S| = c0d2 log d2, j(s) ∼uniform[d2], I(s) ∼randsample([d1], R), Ω(s) = {(i, j(s)) : i ∈I(s)}, y(s) = gj(s)(PΩ(s)(Θ∗+ W)). (7) 6 Further, we define the notation: ∀j, Ij = S s:j(s)=j I(s), Ωj = S s:j(s)=j Ω(s), and nj = |Ωj|. For each column j, the listwise scores {y(s) : j(s) = j} jointly define a consistent partial ranking of Ij as the scores are subsets of a monotonically transformed preference vector gj(Θ∗ j + Wj). This consistent ordering is represented by a DAG y(j) = PartialOrder({y(s) : j(s) = j}). We also note that O(d2 log d2) samples ensures that each column is included in the sampling with high probability. Definition 4 (Projection Loss) Let y = G([n], E) or y ∈Rn define a partial ordering or total order in Rn, respectively. We define the following convex surrogate loss over partial rankings. Φ(x, y) = minz∈Rn ↓ϵ(y) ∥x −z∥2 Theorem 3 (Generalization Bound) Let b X be an estimate from (2). With appropriate scaling let ∥b X∥F = 1 , then for constants K1 K2, the following holds with probability greater than 1 −δ over all observed rankings {y(j), Ωj : j ∈[d2]} drawn from (7) with |S| ≥c0d2 log d2: Ey(s),Ω(s)Φ( b XΩ(s), y(s)) ≤1 |S| |S| X s=1 Φ( b XΩ(s), y(s)) + K1 ∥b X∥∗log1/4 d √d1d2 s d log d R|S| + K2 s log 2/δ |S| . Theorem 3 quantifies the test projection loss over a random R length items I(s) drawn for a random entity/user j(s). The bound provides a trade–off between observable training error and complexity defined by nuclear norm of the estimate. 6 Experiments We evaluate our model on two collaborative preference estimation tasks: (a) a standard user-item recommendataion task on a benchmarked dataset from Movielens, and (b) identifying associations between brain–regions and cognitive terms using the neurosynth dataset [37]. Baselines: The following baseline models are compared in our experiments: • Retargeted Matrix Completion (RMC): the estimator proposed in (2). • Standard Matrix Completion (SMC) [8]: We primarily compare our estimator with the standard convex estimator for matrix completion using nuclear norm minimization. • Collaborative Filtering Ranking CoFi-Rank [35]: This work addresses collaborative filtering task in a listwise ranking setting. For SMC and MRPC, the hyperparameters were tuned using grid search on a logarithmic scale. Due to high computational cost with tuning parameters in CofiRank, we use the code and default parameters provided by the authors. Evaluation metrics: The performance on preference estimation tasks are evaluated on four ranking metrics: (a) Normalized Discounted Cummulative Gains (NDCG@N), (b) Precision@N, (c) Spearmann Rho, and (d) Kendall Tau, where the later two metrics measure the correlation of the complete ordering of the list, while the former two metrics primarily evaluate the correctness of ranking in the top of the list (see Liu et. al. [25] for further details on these metrics). Movielens dataset (blockwise total order) Movielens is a movie recommendation website administered by GroupLens Research. We used competitive benchmarked movielens 100K dataset. We used the 5–fold train/test splits provided with the dataset (the test splits are non-overlapping). We discarded a small number of users that had less than 10 ratings in any of 5 training data splits. The resultant dataset consists of 923 users and 1682 items. The ratings are blockwise ordered – taking one of 5 values in the set {1, 2, . . . , 5}. During testing, for each user, the competing models return a ranking of the test-items, and the performance is averaged across test-users. Table 2 presents the results of our evaluation averaged across 5 train/test splits on the Movielens dataset, along with the standard deviation. We see that the proposed retargeted matrix completion (RMC) significantly and consistently outperforms SMC and CoFi-Rank [35] across ranking metrics. 7 NDCG@5 Precision@5 Spearman Rho Kendall Tau RMC 0.7984(0.0213) 0.7546(0.0320) 0.4137(0.0099) 0.3383(0.0117) SMC 0.7863(0.0243) 0.7429(0.0295) 0.3722(0.0106) 0.3031(0.0117) CoFi-Rank 0.7731(0.0213) 0.7314(0.0293) 0.3681(0.0082) 0.2993(0.0110) Table 2: Ranking performance for recommendations in Movielens 100K. Table shows mean and standard deviation over 5 fold train/test splits. For all reported metrics, higher values are better [25]. Neurosynth Dataset (almost total order) Neurosynth[37] is a publicly available database consisting of data automatically extracted from a large collection of functional magnetic resonance imaging (fMRI) publications (11,362 publications in current version). For each publication , the database contains the abstract text and all reported 3-dimensional peak activation coordinates in the study. The text is pre-processed to remove common stop-words, and any text with less than .1% frequency, leaving a total of 3169 terms. We applied the standard brain map to the activations, removing voxels outside of the grey matter. Next the activations were downsampled from 2mm3 voxels to 10mm3 voxels using the nilearn python package, resulting in a total of 1231 dense voxels. The affinity measure between 3169 terms and 1231 consolidated voxels is obtained by multiplying the term × publication and the publication × voxels matrices. The resulting data is dense high-rank preference matrix. With very few tied preference values, this setting best fits the case of total ordered observations (case A in Section 4.1). Using this data, we consider the reverse inference task of ranking cognitive concepts (terms) for each brain region (voxel) [37]. Train-val-test: We used 10% of randomly sampled entries of the matrix as test data and a another 10% for validation. We created training datasets at various sample sizes by subsampling from the remaining 80% of the data. This random split is replicated multiple times to obtain 3 bootstrapped datasplits (note that unlike cross validation, the test datasets here can have some overlapping entries). The results in Fig. 1 show that the proposed estimate from (2) outperforms standard matrix completion in terms of popular ranking metrics. Figure 1: Ranking performance for reverse inference in Neurosynth data. x-axis denotes the fraction of the affinity matrix entries used as observations in training. Plots show mean with errorbars for standard deviation over 3 bootstrapped train/test splits. For all the reported ranking metrics, higher values are better[25]. 7 Conclusion Our work addresses the problem of collaboratively ranking; a task of growing importance to modern problems in recommender systems, large scale meta-analysis, and related areas. We proposed a novel convex estimator for collaborative LETOR from sparsely observed preferences, where the observations could be either score vectors representing total order, or more generally directed acyclic graphs representing partial orders. Remarkably, in the case of complete order, the complexity of our algorithm is within a log factor of the state–of–the–art algorithms for standard matrix completion. Our estimator was empirically evaluated on real data experiments. Acknowledgments SG and JG acknowledge funding from NSF grants IIS-1421729 and SCH 1418511. 8 References [1] S. Acharyya and J. Ghosh. MEMR: A margin equipped monotone retargeting framework for ranking. In UAI, 2013. [2] S. Acharyya, O. Koyejo, and J. Ghosh. Learning to rank with bregman divergences and monotone retargeting. In UAI, 2012. [3] P. L. Bartlett and S. Mendelson. Rademacher and Gaussian complexities: Risk bounds and structural results. JMLR, 2003. [4] M. J. Best and N. Chakravarti. Active set algorithms for isotonic regression; a unifying framework. Math. Program., 1990. [5] J. F. Cai, E. J. Candes, and Z. Shen. A singular value thresholding algorithm for matrix completion. SIAM J. Optim., 2010. [6] E. J. Candés and Y. Plan. Matrix completion with noise. Proc. IEEE, 2010. [7] E. J. Candés and B. Recht. Exact matrix completion via convex optimization. FoCM, 2009. [8] E. J. Candés, J. Romberg, and T. Tao. Robust uncertainty principles: Exact signal reconstruction from highly incomplete frequency information. IEEE Trans. Inf. Theory, 2006. [9] Z. Cao, T. Qin, T. Y. Liu, M. F. Tsai, and H. Li. Learning to rank: from pairwise approach to listwise approach. In ICML, 2007. [10] E. Chi, H. Zhou, G. Chen, D. O. Del Vecchyo, and K. Lange. Genotype imputation via matrix completion. Genome Res., 2013. [11] P. Cremonesi, Y. Koren, and R. Turrin. Performance of recommender algorithms on top-n recommendation tasks. In RecSys. ACM, 2010. [12] J. C. Duchi, L. W Mackey, and M. I. Jordan. On the consistency of ranking algorithms. In ICML, 2010. [13] R. Ganti, L. Balzano, and R. Willett. Matrix completion under monotonic single index models. In NIPS, 2015. [14] D. Goldberg, D. Nichols, B. Oki, and D. Terry. Using collaborative filtering to weave an information tapestry. Commun. ACM, 1992. [15] S.J. Grotzinger and C. Witzgall. Projections onto order simplexes. Appl. Math. Optim., 1984. [16] R. Herbrich, T. Graepel, and K. Obermayer. Large margin rank boundaries for ordinal regression. In NIPS, 1999. [17] J. L. Horowitz. Semiparametric and nonparametric methods in econometrics, volume 12. Springer, 2009. [18] T. Joachims. Optimizing search engines using clickthrough data. In SIGKDD, 2002. [19] S. M. Kakade, V. Kanade, O. Shamir, and A. Kalai. Efficient learning of generalized linear and single index models with isotonic regression. In NIPS, 2011. [20] A. T. Kalai and R. Sastry. The isotron algorithm: High-dimensional isotonic regression. In COLT, 2009. [21] R. H. Keshavan, A. Montanari, and S. Oh. Matrix completion from a few entries. IEEE Transactions on IT, 2010. [22] Y. Koren, R. Bell, and C. Volinsky. Matrix factorization techniques for recommender systems. IEEE Computer, 2009. [23] O. Koyejo, S. Acharyya, and J. Ghosh. Retargeted matrix factorization for collaborative filtering. In RecSys, 2013. [24] P. Li, Q. Wu, and C. J. Burges. Mcrank: Learning to rank using multiple classification and gradient boosting. In NIPS, 2007. [25] T. Y. Liu. Learning to rank for information retrieval. Foundations and Trends in IR, 2009. [26] Y. Lu and S. N. Negahban. Individualized rank aggregation using nuclear norm regularization. In Annual Allerton Conference on Communication, Control, and Computing (Allerton), 2015. [27] S. Ma, D. Goldfarb, and L. Chen. Fixed point and bregman iterative methods for matrix rank minimization. Math. Program., 2011. [28] A. Mnih and R. Salakhutdinov. Probabilistic matrix factorization. In NIPS, 2007. [29] S. Oh, K. K. Thekumparampil, and J. Xu. Collaboratively learning preferences from ordinal data. In NIPS, 2015. [30] N. Parikh and S. P. Boyd. Proximal algorithms. Foundations and Trends in optimization, 2014. [31] D. Park, J. Neeman, J. Zhang, S. Sanghavi, and I. Dhillon. Preference completion: Large-scale collaborative ranking from pairwise comparisons. In ICML, 2015. [32] B. Recht. A simpler approach to matrix completion. JMLR, 2011. [33] H. Steck. Training and testing of recommender systems on data missing not at random. In KDD. ACM, 2010. [34] Q. F. Stout. Isotonic regression via partitioning. Algorithmica, 2013. [35] M. Weimer, A. Karatzoglou, Q. V. Le, and A. J. Smola. COFIRANK - maximum margin matrix factorization for collaborative ranking. In NIPS, 2008. [36] T. Yarkoni, R. A. Poldrack, T. E. Nichols, D. C. Van Essen, and T. D. Wager. Large-scale automated synthesis of human functional neuroimaging data. Nat. Methods, 2011. [37] Tal Yarkoni. http://neurosynth.org/. http://neurosynth.org/, 2011. [38] Y. Zhou, D. Wilkinson, R. Schreiber, and R. Pan. Large-scale parallel collaborative filtering for the netflix prize. In Algorithmic Aspects in Information and Management, LNCS 5034, 2008. 9
2016
314
6,233
“Congruent” and “Opposite” Neurons: Sisters for Multisensory Integration and Segregation Wen-Hao Zhang1,2 ∗, He Wang1, K. Y. Michael Wong1, Si Wu2 wenhaoz@ust.hk, hwangaa@connect.ust.hk, phkywong@ust.hk, wusi@bnu.edu.cn 1Department of Physics, Hong Kong University of Science and Technology, Hong Kong. 2State Key Lab of Cognitive Neuroscience and Learning, and IDG/McGovern Institute for Brain Research, Beijing Normal University, China. Abstract Experiments reveal that in the dorsal medial superior temporal (MSTd) and the ventral intraparietal (VIP) areas, where visual and vestibular cues are integrated to infer heading direction, there are two types of neurons with roughly the same number. One is “congruent" cells, whose preferred heading directions are similar in response to visual and vestibular cues; and the other is “opposite" cells, whose preferred heading directions are nearly “opposite" (with an offset of 180◦) in response to visual vs. vestibular cues. Congruent neurons are known to be responsible for cue integration, but the computational role of opposite neurons remains largely unknown. Here, we propose that opposite neurons may serve to encode the disparity information between cues necessary for multisensory segregation. We build a computational model composed of two reciprocally coupled modules, MSTd and VIP, and each module consists of groups of congruent and opposite neurons. In the model, congruent neurons in two modules are reciprocally connected with each other in the congruent manner, whereas opposite neurons are reciprocally connected in the opposite manner. Mimicking the experimental protocol, our model reproduces the characteristics of congruent and opposite neurons, and demonstrates that in each module, the sisters of congruent and opposite neurons can jointly achieve optimal multisensory information integration and segregation. This study sheds light on our understanding of how the brain implements optimal multisensory integration and segregation concurrently in a distributed manner. 1 Introduction Our brain perceives the external world with multiple sensory modalities, including vision, audition, olfaction, tactile, vestibular perception and so on. These sensory systems extract information about the environment via different physical means, and they generate complementary cues (neural representations) about external objects to the multisensory areas. Over the past years, a large volume of experimental and theoretical studies have focused on investigating how the brain integrates multiple sensory cues originated from the same object in order to perceive the object reliably in an ambiguous environment, the so-called multisensory integration. They found that the brain can integrate multiple cues optimally in a manner close to Bayesian inference, e.g., integrating visual and vestibular cues to infer heading direction [1] and so on [2–4]. Neural circuit models underlying optimal multisensory integration have been proposed, including a centralized model in which a dedicated processor receives and integrates all sensory cues [5, 6], and a decentralized model in which multiple local processors exchange cue information via reciprocal connections, so that optimal cue integration is achieved at each local processor [7]. ∗Current address: Center for the Neural Basis of Cognition, Carnegie Mellon University. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. ° 40 30 20 10 Firing rate (spikes s–1) 0 8 1 0 8 1 – ±180° –90° 90 0° –90 90 0 0 Vestibular Visual Heading direction (°) 60 20 0 8 1 0 8 1 – –90 90 0 80 40 0 Heading direction (°) B C A Number of Neurons 0 60 90 120 180 0 10 20 30 40 50 | ∆ Preferred direction (°)| Visual vs. vestibular Congruent neuron Opposite neuron Congruent Opposite Figure 1: Congruent and opposite neurons in MSTd. Similar results were found in VIP [12]. (A-B) Tuning curves of a congruent neuron (A) and an opposite neuron (B). The preferred visual and vestibular directions are similar in (A) but are nearly opposite by 180◦in (B). (C) The histogram of neurons according to their difference between preferred visual and vestibular directions. Congruent and opposite neurons are comparable in numbers. (A-B) adapted from [1], (C) from [13]. However, multisensory integration is only half of the story of multisensory information processing, which works well when the sensory cues are originated from the same object. In cases where the sensory cues originate from different objects, the brain should segregate, rather than integrate, the cues. In a noisy environment, however, the brain is unable to differentiate the two situations at first sight. The brain faces a “chicken vs. egg" dilemma in multisensory integration: without first integrating multiple cues to eliminate uncertainty, the brain is unable to estimate the objects reliably to differentiate whether the cues are from the same or different objects; but once the cues are integrated, the disparity information between the cues is lost, and the brain can no longer discriminate objects clearly when the cues actually come from different objects. To solve this dilemma, here we argue that the brain needs to carry out multisensory integration and segregation concurrently in the early stage of information processing, that is, a group of neurons integrates sensory cues while another group of neurons extracts the cue disparity information, and the interplay between two networks determines the final action: integration vs. segregation. Concurrent processing has the advantage of achieving rapid object perception if the cues are indeed from the same object, and avoiding information loss if the cues are from different objects. Psychophysical data tends to support this idea, which shows that the brain can still sense the difference between cues in multisensory integration [8, 9]. What are the neural substrates of the brain to implement concurrent multisensory integration and segregation? In the experiments of integrating visual and vestibular cues to infer heading direction, it was found that in the dorsal medial superior temporal area (MSTd) and the ventral intraparietal area (VIP) which primarily receive visual and vestibular cues respectively, there exist two types of neurons displaying different cue integrative behaviors [1, 10]. One of them is called “congruent" cells, since their preferred heading directions are similar in response to either a visual or a vestibular cue (Fig. 1A); and the other type is called “opposite" cells, since their preferred visual and vestibular directions are nearly “opposite" (with an offset of 180◦, half of the period of direction, Fig. 1B). Data analyses and modelling studies revealed that congruent neurons are responsible for cue integration [1, 10, 6, 7]. However, the computational role of opposite neurons remains largely unknown, despite the fact that congruent and opposite neurons are comparably numerous in MSTd and VIP (Fig. 1C). Notably, the responses of opposite neurons hardly vary when a single cue is replaced by two congruent cues (i.e., no cue integration behavior), whereas their responses increase significantly when the disparity between visual and vestibular cues increases [11], indicating that opposite neurons may serve to extract the cue disparity information necessary for multisensory segregation. Motivated by the above experimental findings, we explore how multisensory integration and segregation are concurrently implemented in a neural system via sisters of congruent and opposite cells. 2 Probabilistic Model of Multisensory Information Processing In reality, because of noise, the brain estimates stimulus information relying on ambiguous cues in a probabilistic manner. Thus, we formulate multisensory information processing in the framework of probabilistic inference. The present study mainly focuses on information processing at MSTd and VIP, where visual and vestibular cues are integrated/segregated to infer heading direction. However, the main results of this work are applicable to the processing of cues of other modalities. 2 2.1 The von Mises distribution for circular variables Because heading direction is a circular variable whose values are in range (−π, π], we adopt the von Mises distribution [14] (Supplementary Information Sec. 1). Compared with the Gaussian distribution, the von Mises distribution is more suitable and also more accurate to describe the probabilistic inference of circular variables, and furthermore, it gives a clear geometrical interpretation of multisensory information processing (see below). Suppose there are two stimuli s1 and s2, each of which generates a sensory cue xm, for m = 1, 2 (visual or vestibular), independently. We call xm the direct cue of sm, and xl (l ̸= m) the indirect cue to sm. Denote as p(xm|sm) the likelihood function, whose form in von Mises distribution is p(xm|sm) = 1 2πI0(κm) exp [κm cos(xm −sm)] ≡M(xm −sm, κm), (1) where I0(κ) = (2π)−1 R 2π 0 eκ cos(θ)dθ is the modified Bessel function of the first kind and order zero. sm is the mean of the von Mises distribution, i.e., the mean value of xm. κm is a positive number characterizing the concentration of the distribution, which is analogous to the inverse of the variance (σ−2) of Gaussian distribution. In the limit of large κm, a von Mises distribution M[xm −sm, κm] approaches to a Gaussian distribution N[xm −sm, κ−1 m ] (SI Sec. 1.2). For small κm, the von Mises distribution deviates from the Gaussian one (Fig.2A). 2.2 Multisensory integration We introduce first a probabilistic model of Bayes-optimal multisensory integration. Experimental data revealed that our brain integrates sensory cues optimally in a manner close to Bayesian inference [2]. Assuming that noises in different channels are independent, the posterior distribution of two stimuli can be written according to Bayes’ theorem as p(s1, s2|x1, x2) ∝p(x1|s1)p(x2|s2)p(s1, s2), (2) where p(s1, s2) is the prior of the stimuli, which specifies the concurrence probability of a stimulus pair. As an example in the present study, we choose the prior to be p(s1, s2) = 1 2π M(s1 −s2, κs) = 1 (2π)2I0(κs) exp [κs cos(s1 −s2)] . (3) This form of prior favors the tendency for two stimuli to have similar values. Such a tendency has been modeled in multisensory integration [7, 15–17]. κs determines the correlation between two stimuli, i.e., how informative one cue is about the other, and it regulates the extent to which two cues should be integrated. The fully integrated case, in which the prior becomes a delta function in the limit κs →∞, has been modeled in e.g., [4, 5]. Since the results for two stimuli are exchangeable, hereafter, we will only present the result for s1, unless stated specifically. Noting that p(sm) = p(xm) = 1/2π are uniform distributions, the posterior distribution of s1 given two cues becomes p(s1|x1, x2) ∝p(x1|s1) Z p(x2|s2)p(s2|s1)ds2 ∝p(s1|x1)p(s1|x2). (4) The indirect cue x2 is informative to s1 via the prior p(s1, s2). By using Eqs. (1,3) and under reasonable approximations (SI Sec. 1.4), we obtain p(s1|x2) ∝ Z p(x2|s2)p(s2|s1)ds2 ≃M (s1 −x2, κ12) , (5) where A(κ12) = A(κ2)A(κs) with A(κ) ≡ R π −π cos(θ)eκ cos θdθ/ R π −π eκ cos θdθ. Finally, utilizing Eqs. (1,5), Eq. (4) is written as p(s1|x1, x2) ∝ M(s1 −x1, κ1)M(s1 −x2, κ12) = M(s1 −ˆs1, ˆκ1), (6) where the mean and concentration of the posterior given two cues are (SI Sec. 1.3) ˆs1 = atan2(κ1 sin x1 + κ12 sin x2, κ1 cos x1 + κ12 cos x2), (7) ˆκ1 =  κ2 1 + κ2 12 + 2κ1κ12 cos(x1 −x2) 1/2 , (8) 3 where atan2 is the arctangent function of two arguments (SI Eq. S17). Eqs. (7,8) are the results of Bayesian integration in the form of von Mises distribution, and they are the criteria for us to judge whether optimal cue integration is achieved in a neural system. To understand these optimality criteria intuitively, it is helpful to see their equivalence of the Gaussian distribution in the limit of large κ1, κ2 and κs. Under the condition x1 ≈x2, Eq. (8) is approximated to be ˆκ1 ≈κ1 + κ12 (SI Sec. 2). Since κ ≈1/σ2 when von Mises distribution is approximated as Gaussian one, Eq. (8) becomes 1/ˆσ2 1 ≈1/σ2 1 + 1/σ2 12, which is the Bayesian prediction on Gaussian variance conventionally used in the literature [4]. Similarly, Eq. (7) is associated with the Bayesian prediction on the Gaussian mean [4]. 2.3 Multisensory segregation We introduce next the probabilistic model of multisensory segregation. Inspired by the observation in multisensory integration that the posterior of a stimulus given combined cues is the product of the posteriors given each cue (Eq.4), we propose that in multisensory segregation, the disparity D(s1|x1; s1|x2) between two cues is measured by the ratio of the posteriors given each cue, that is, D(s1|x1; s1|x2) ≡p(s1|x1)/p(s1|x2), (9) By taking the expectation of log D over the distribution p(s1|x1), we get the Kullback-Leibler divergence between the two posteriors given each cue. This disparity measure was also used to discriminate alternative moving directions in [18]. Interestingly, by utilizing the property of von Mises distributions and the condition cos(s1+π−x2) = −cos(s1 −x2), Eq. (9) can be rewritten as D(s1|x1; s1|x2) ∝p(s1|x1)p(s1 + π|x2), (10) that is, the disparity information between two cues is proportional to the product of the posterior given the direct cue and the posterior given the indirect cue but with the stimulus value shifted by π. By utilizing Eqs. (1,5), we obtain D(s1|x1; s1|x2) ∝M(s1 −x1, κ1)M(s1 + π −x2, κ12) = M (s1 −∆ˆs1, ∆ˆκ1) , (11) where the mean and concentration of the von Mises distribution are ∆ˆs1 = atan2(κ1 sin x1 −κ12 sin x2, κ1 cos x1 −κ12 cos x2), (12) ∆ˆκ1 =  κ2 1 + κ2 12 −2κ1κ12 cos(x1 −x2) 1/2 . (13) The above equations are the criteria for us to judge whether the disparity information between two cues is optimally encoded in a neural system. 3 Geometrical Interpretation of Multisensory Information Processing A benefit of using the von Mises distribution is that it gives us a clear geometrical interpretation of multisensory information processing. A von Mises distribution M (s −x, κ) can be interpreted as a vector in a two-dimensional space with its mean x and concentration κ representing respectively the angle and length of the vector (Fig. 2B-C). This fits well with the circular property of heading direction. When the posterior of a stimulus is interpreted as a vector, the vector length represents the confidence of inference. Interestingly, under such a geometrical interpretation, the product of two von Mises distributions equals summation of their corresponding vectors, and the ratio of two von Mises distributions equals subtraction of the two vectors. Thus, from Eq. (4), we see that multisensory integration is equivalent to vector summation, with each vector representing the posterior of the stimulus given a single cue, and from Eq. (9), multisensory segregation is equivalent to vector subtraction (see Fig. 2D). Overall, multisensory integration and segregation transform the original two vectors, the posteriors given each cue, into two new vectors, the posterior given combined cues and the disparity between the two cues. The original two vectors can be recovered from their linear combinations. Hence, there is no information loss. The geometrical interpretation also helps us to understand multisensory information processing intuitively. For instance, if two vectors have a small intersection angle, i.e., the 4 0 L p(s1|x2) p(s1|x2)-1 p(s1|x1,x2) p(s1|x1) D(s1|x1;s1|x2) D(s1|x1;s1|x2) Geometric representation of integration and segregation 0 x k L Geometric representation of a von Mises distribution 0.005 0.01 0.015 90° 270° 180° 0° von Mises distribution (polar coordinate) −180 −90 0 90 180 0 0.004 0.008 0.012 x Probability density von Mises M(x,k) Gaussian N(x,k-1) k=1 k=3 A B C D Figure 2: Geometrical interpretation of multisensory information processing in von Mises distribution. (A) The difference between von Mises and Gaussian distributions. For large concentration κ, their difference becomes small. (B) A von Mises distribution in the polar coordinate. (C) A von Mises distribution M (s −x, κ) can be represented as a vector in a 2D space with its angle given by x and length by κ. (D) Geometrical interpretations of multisensory integration and segregation. The posteriors of s1 given each cue are represented by two vectors (blue). Inverse of a posterior corresponds to rotating it by 180◦. Multisensory integration corresponds to the summation of two vectors (green), and multisensory segregation the subtraction of two vectors (red). posteriors given each cue tend to support each other, the length of summed vector is long, implying that the posterior of cue integration has strong confidence; and the length of subtracting vector is short, implying that the disparity between two cues is small. If the two vectors have a large intersection angle, the interpretation becomes the opposite. 4 Neural Implementation of Multisensory Information Processing 4.1 The model Structure We adopt a decentralized architecture to model multisensory information processing in the brain [7, 19]. Compared with the centralized architecture in which a dedicated processor carries out all computations, the decentralized architecture considers a number of local processors communicating with each other via reciprocal connections, so that optimal information processing is achieved at each local processor distributively [7]. This architecture was supported by a number of experimental findings, including the involvement of multiple, rather than a single, brain areas in visual-vestibular integration [1, 10], the existence of intensive reciprocal connections between MTSd and VIP [20, 21], and the robustness of multisensory integration against the inactivation of a single module [22]. In a previous work [7], Zhang et al. studied a decentralized model for multisensory integration at MSTd and VIP, and demonstrated that optimal integration can be achieved at both areas simultaneously, agreeing with the experimental data. In their model, MSTd and VIP are congruently connected, i.e., neurons in one module are strongly connected to those having the similar preferred heading directions in the other module. This congruent connection pattern naturally gives rise to congruent neurons. Since the number of opposite neurons is comparable with that of congruent neurons in MSTd and VIP, it is plausible that they also have a computational role. It is instructive to compare the probabilistic models of multisensory integration and segregation, i.e., Eqs. (4) and (10). They have the same form, except that in segregation the stimulus value in the posterior given the indirect cue is shifted by π. Furthermore, since congruent reciprocal connections lead to congruent neurons, we hypothesize that opposite neurons are due to opposite reciprocal connections, and their computational role is to encode the disparity information between two cues. The decentralized model for concurrent multisensory integration and segregation in MSTd and VIP is shown in Fig.3. 5 θ−θ' Connection strength W(θ,θ') −180 0 0 180 Wr(θ,θ'), Wc(θ,θ'), Wo(θ,θ') A B C θ Cue 1 Cue 2 Module 1 (MSTd) Module 2 (VIP) 90° 180° 0° θ Congruent Opposite Inhibitory pool Excitatory connection Inhibitory connection 270° Reliability (concentration of net’s estimate) 0 10 20 30 0 3 6 Peak firing rate (Hz) x103 Figure 3: The model structure. (A) The model is composed of two modules, representing MSTd and VIP respectively. Each module receives the direct cue via feedforward input. In each module, there are two nets of excitatory neurons, each connected recurrently. Net c (blue) consists of congruent neurons. Congruent neurons between modules are connected reciprocally in the congruent manner (blue lines). On the other hand, net o (red) consists of opposite neurons, and opposite neurons between modules are connected in the opposite manner (brown lines). Moreover, to implement competition between information integration and segregation, all neurons in a module are connected to a common inhibitory neuron pool (purple, only shown in module 1). (B) The recurrent, congruent, and opposite connection patterns between neurons. (C) Network’s peak firing rate reflects its estimation reliability. 4.2 The model dynamics Denote as um,n(θ) and rm,n(θ) respectively the synaptic input and firing rate of a n-type neuron in module m whose preferred heading direction with respect to the direct cue m is θ. n = c, o represents the congruent and opposite cells respectively, and m = 1, 2 represents respectively MSTd and VIP. For simplicity, we assume that the two modules are symmetric, and only present the dynamics of module 1. The dynamics of a congruent neuron in module 1 is given by τ ∂u1,c(θ, t) ∂t = −u1,c(θ, t) + π X θ′=−π Wr(θ, θ′)r1,c(θ′, t) + π X θ′=−π Wc(θ, θ′)r2,c(θ′, t) + I1,c(θ, t), (14) where I1,c(θ, t) is the feedforward input to the neuron. Wr(θ, θ′) is the recurrent connection between neurons in the same module, which is set to be Wr(θ, θ′) = Jr( √ 2πa)−1 exp  −(θ −θ′)2/(2a2)  with periodic condition imposed, where a controls the tuning width of the congruent neurons. Wc(θ, θ′) is the reciprocal connection between congruent cells in two modules, which is set to be Wc(θ, θ′) = Jc( √ 2πa)−1 exp  −(θ −θ′)2/(2a2)  . The reciprocal connection strength Jc controls the extent to which cues are integrated between modules and is associated with the correlation parameter κs in the stimulus prior (see SI Sec. 3.3). The dynamics of an opposite neuron in module 1 is given by τ ∂u1,o(θ, t) ∂t = −u1,o(θ, t) + π X θ′=−π Wr(θ, θ′)r1,o(θ′, t) + π X θ′=−π Wo(θ, θ′)r2,o(θ′, t) + I1,o(θ, t). (15) It has the same form as that of a congruent neuron except that the pattern of reciprocal connections are given by Wo(θ, θ′) = Jc( √ 2πa)−1 exp  −(θ + π −θ′)2/(2a2)  = Wc(θ + π, θ′), that is, opposite neurons between modules are oppositely connected by an offset of π. We choose the strength and width of the connection pattern Wo to be the same as that of Wc. This is based on the finding that the tuning functions of congruent and opposite neurons have similar tuning width and strength [12]. Note that all connections are imposed with periodic conditions. In the model, we include the effect of inhibitory neurons through a divisive normalization to the responses of excitatory neurons [23], given by r1,n(θ, t) = 1 Du [u1,n(θ, t)]2 + , (16) 6 Combined Cue 1 (0°) Cue 2 (-60°) A B C D E F G H I J 0 90 180 0 90 180 Predicted mean of disparity D(sm|xm;sm|xℓ) (°) Measured mean (°) Opposite (Module 1) Opposite (Module 2) R2=0.99 0 90 180 0 90 180 Predicted mean of posterior p(sm|x1,x2) (°) Measured mean (°) Congruent (Module 1) Congruent (Module 2) R2=0.99 1 2 3 1 2 3 Predicted concentration of disparity D(sm|xm;sm|xℓ) Measured concentration x103 x103 R2=0.89 1 2 3 1 2 3 Predicted concentration of posterior p(sm|x1,x2) Measured concentration x103 x103 R2=0.91 Estimates of congruent neurons Estimates of opposite neurons −180 0 180 0 10 20 Neuron index θ −90 90 −180 0 180 0 10 20 Neuron index θ −90 90 −180 0 180 0 10 20 Firing rate (Hz) Neuron index θ Congruent Opposite −90 90 Cue 1 Cue 2 Firing rate (Hz) 0 10 20 −180 −90 0 180 90 Cue direction xm (°) Congruent neuron 0 10 20 Opposite neuron −180 0 180 Cue direction xm (°) −90 90 Tuning curves Bump height Population activities in module 1 Cue disparity x2-x1 (°) 0 90 180 16 18 20 Firing rate (Hz) Congruent Opposite Figure 4: Bayes-optimal multisensory integration and segregation with congruent and opposite neurons. (A-B) Tuning curves of an example congruent neuron and an example opposite neuron in module 1. The preferred direction of the congruent neuron in response to two single cues are the same at −90◦, but the preferred direction of the opposite neuron under two single cues are opposite by 180◦. (C-E) The neuronal population activities at module 1 under three cuing conditions: only the direct cue 1 (C), only the indirect cue 2 (D), and combination of the two cues (E). (F) The activity levels of the congruent and opposite neuronal networks (measured by the corresponding bump heights) vs. the cue disparity. (G-H). Comparing the mean and concentration of the stimulus posterior given two cues estimated by the congruent neuronal network with that predicted by Bayesian inference, Eqs. (7,8). Each dot is a result obtained under a parameter set. (I-J). Comparing the mean and concentration of the cue disparity information estimated by the opposite neuronal network with that predicted by probabilistic inference, Eqs. (12,13). Parameters: Jr = 0.4 ¯J, Jc = Jo ∈[0.1, 0.5]Jr, α1 = α2 ∈[0.8, 1.6]U 0 m, Ib = 1, F = 0.5. (G-J) x1 = 0◦, x2 ∈[0◦, 180◦]. where Du ≡1+ω P n′=c,o Pπ θ′=−π [u1,n′(θ′, t)]2 +. [x]+ ≡max(x, 0), and the parameter ω controls the magnitude of divisive normalization. The feedforward input conveys the direct cue information to a module (e.g., the feedforward input to MSTd is from area MT which extracts the heading direction from optical flow), which is set to be I1,n(θ, t) =α1 exp  −(θ −x1)2 4a2  + p Fα1 exp  −(θ −x1)2 8a2  ξ1(θ, t)+Ib+ p FIbϵ1,n(θ, t), (17) where α1 is the signal strength, Ib the mean of background input, and F the Fano factor. ξ1(θ, t) and ϵ1,n(θ, t) are Gaussian white noises of zero mean with variance satisfying ⟨ξm(θ, t)ξm′(θ′, t′)⟩= δmm′δ(θ−θ′)δ(t−t′), ⟨ϵm,n(θ, t)ϵm′,n′(θ′, t′)⟩= δmm′δnn′δ(θ−θ′)δ(t−t′). The signal-associated noises ξ1(θ, t) to congruent and opposite neurons are exactly the same, while the background noises ϵ1,n(θ, t) to congruent and opposite neurons are independent of each other. At the steady state, the signal drives the network state to center at the cue value x1, whereas noises induce fluctuations of the network state. Since we consider multiplicative noise with a constant Fano factor, the signal strength αm controls the reliability of cue m [5]. The exact form of the feedforward input is not crucial, as long as it has a uni-modal shape. 4.3 Results We first verify that our model reproduces the characteristics of congruent and opposite neurons. Figs. 4A&B show the tuning curves of a congruent and an opposite neuron with respect to either visual or vestibular cues, which demonstrate that neurons in our model indeed exhibit the congruent or opposite direction selectivity similar to Fig. 1. We then investigate the mean population activities of our model under different cuing conditions. When only cue x1 is applied to module 1, both the congruent and opposite neuronal networks in 7 module 1 receive the feedforward input and generate bumps at x1 (Fig. 4C). When only cue x2 is applied to module 2, the congruent neuronal network at module 1 receives a reciprocal input and generates a bump at x2, whereas the opposite neuronal network receives an offset reciprocal input and generates a bump at x2 + π (Fig. 4D). For the indirect cue x2, the neural activities it induces at module 1 is lower than that induced by the direct cue x1 (Fig. 4C). When both cues are presented, the congruent neuronal network integrates the feedforward and reciprocal inputs, whereas the opposite neuronal network computes their disparity by integrating the feedforward inputs and the offset reciprocal inputs shifted by π (Fig. 4E). The two networks compete with each other via divisive normalization. Fig. 4F shows that when the disparity between cues is small, the activity of congruent neurons is higher than that of opposite neurons. With the increase of cue disparity, the activity of the congruent neuronal network decreases, whereas the activity of the opposite neurons increases. These complementary changes in activities of congruent and opposite neurons provide a clue for other parts of the brain to evaluate whether the cues are from the same or different objects [24]. Finally, to verify whether Bayes-optimal multisensory information processing is achieved in our model, we check the validity of Eqs. (7-8) for multisensory integration p(sm|x1, x2) by congruent neurons in module m, and Eqs. (12-13) for multisensory segregation D(sm|xm; sm|xl) (l ̸= m) by opposite neurons in module m. Take the verification of the congruent neuronal network in module m as an example. When a pair of cues are simultaneously applied, the actual mean and concentration of the networks’s estimates (bump position) are measured through population vector [25] (SI Sec. 4.2). To obtain the Bayesian predictions for the network’s estimate under combined cue condition (details in SI Sec. 4.3), the mean and concentration of that network’s estimates under either single cue conditions are also measured, and then are substituted into Eqs. (7-8). Comparisons between the measured mean and concentration of congruent networks in two modules and the corresponding theoretical predictions are shown in Fig. 4G&H, indicating an excellent fit, where each dot is the result under a particular set of parameters. Similarly, comparisons between the measured mean and concentration of opposite networks and the theoretical predictions (SI Sec. 4.3) are shown in Fig. 4I&J, indicating opposite neurons indeed implement multisensory segregation. 5 Conclusion and Discussion Over the past years, multisensory integration has received large attention in modelling studies, but the equally important issue of multisensory segregation has been rarely explored. The present study proposes that opposite neurons, which is widely observed at MSTd and VIP, encode the disparity information between sensory cues. We built a computational model composed of reciprocally coupled MSTd and VIP, and demonstrated that the characteristics of congruent and opposite cells naturally emerge from the congruent and opposite connection patterns between modules, respectively. Using the von Mises distribution, we derived the optimal criteria for integration and segregation of circular variables and found they have clear geometrical meanings: integration corresponds to vector summation while segregation corresponds to vector subtraction. We further showed that such a decentralized system can realize optimal cue integration and segregation at each module distributively. To our best knowledge, this work is the first modelling study unveiling the functional role of opposite cells. It has a far-reaching implication on multisensory information processing, that is, the brain can exploit sisters of congruent and opposite neurons to implement cue integration and segregation concurrently. For simplicity, only perfectly congruent or perfectly opposite neurons are considered, but in reality, there are some portions of neurons whose differences of preferred visual and vestibular heading directions are in between 0◦and 180◦(Fig. 1C). We checked that those neurons can arise from adding noises in the reciprocal connections. As long as the distribution in Fig. 1C is peaked at 0◦and 180◦, the model can implement concurrent integration and segregation. Also, we have only pointed out that the competition between congruent and opposite neurons provides a clue for the brain to judge whether the cues are likely to originate from the same or different objects, without exploring how the brain actually does this. These issues will be investigated in our future work. Acknowledgments This work is supported by the Research Grants Council of Hong Kong (N_HKUST606/12 and 605813) and National Basic Research Program of China (2014CB846101) and the Natural Science Foundation of China (31261160495). 8 References [1] Yong Gu, Dora E Angelaki, and Gregory C DeAngelis. Neural correlates of multisensory cue integration in macaque mstd. Nature Neuroscience, 11(10):1201–1210, 2008. [2] Marc O Ernst and Heinrich H Bülthoff. Merging the senses into a robust percept. Trends in Cognitive Sciences, 8(4):162–169, 2004. [3] David Alais and David Burr. The ventriloquist effect results from near-optimal bimodal integration. Current Biology, 14(3):257–262, 2004. [4] Marc O Ernst and Martin S Banks. Humans integrate visual and haptic information in a statistically optimal fashion. Nature, 415(6870):429–433, 2002. [5] Wei Ji Ma, Jeffrey M Beck, Peter E Latham, and Alexandre Pouget. Bayesian inference with probabilistic population codes. Nature Neuroscience, 9(11):1432–1438, 2006. [6] Tomokazu Ohshiro, Dora E Angelaki, and Gregory C DeAngelis. A normalization model of multisensory integration. Nature Neuroscience, 14(6):775–782, 2011. [7] Wen-Hao Zhang, Aihua Chen, Malte J Rasch, and Si Wu. Decentralized multisensory information integration in neural systems. The Journal of Neuroscience, 36(2):532–547, 2016. [8] Mark T Wallace, GE Roberson, W David Hairston, Barry E Stein, J William Vaughan, and Jim A Schirillo. Unifying multisensory signals across time and space. Experimental Brain Research, 158(2):252–258, 2004. [9] Ahna R Girshick and Martin S Banks. Probabilistic combination of slant information: weighted averaging and robustness as optimal percepts. Journal of Vision, 9(9):8–8, 2009. [10] Aihua Chen, Gregory C DeAngelis, and Dora E Angelaki. Functional specializations of the ventral intraparietal area for multisensory heading discrimination. The Journal of Neuroscience, 33(8):3567–3581, 2013. [11] Michael L Morgan, Gregory C DeAngelis, and Dora E Angelaki. Multisensory integration in macaque visual cortex depends on cue reliability. Neuron, 59(4):662–673, 2008. [12] Aihua Chen, Gregory C DeAngelis, and Dora E Angelaki. Representation of vestibular and visual cues to self-motion in ventral intraparietal cortex. The Journal of Neuroscience, 31(33):12036–12052, 2011. [13] Yong Gu, Paul V Watkins, Dora E Angelaki, and Gregory C DeAngelis. Visual and nonvisual contributions to three-dimensional heading selectivity in the medial superior temporal area. The Journal of Neuroscience, 26(1):73–85, 2006. [14] Richard F Murray and Yaniv Morgenstern. Cue combination on the circle and the sphere. Journal of vision, 10(11):15–15, 2010. [15] Jean-Pierre Bresciani, Franziska Dammeier, and Marc O Ernst. Vision and touch are automatically integrated for the perception of sequences of events. Journal of Vision, 6(5):2, 2006. [16] Neil W Roach, James Heron, and Paul V McGraw. Resolving multisensory conflict: a strategy for balancing the costs and benefits of audio-visual integration. Proceedings of the Royal Society of London B: Biological Sciences, 273(1598):2159–2168, 2006. [17] Yoshiyuki Sato, Taro Toyoizumi, and Kazuyuki Aihara. Bayesian inference explains perception of unity and ventriloquism aftereffect: identification of common sources of audiovisual stimuli. Neural Computation, 19(12):3335–3355, 2007. [18] Mehrdad Jazayeri and J Anthony Movshon. Optimal representation of sensory information by neural populations. Nature Neuroscience, 9(5):690–696, 2006. [19] Wen-Hao Zhang and Si Wu. Reciprocally coupled local estimators implement bayesian information integration distributively. In Advances in Neural Information Processing Systems, pages 19–27, 2013. [20] Driss Boussaoud, Leslie G Ungerleider, and Robert Desimone. Pathways for motion analysis: cortical connections of the medial superior temporal and fundus of the superior temporal visual areas in the macaque. Journal of Comparative Neurology, 296(3):462–495, 1990. [21] Joan S Baizer, Leslie G Ungerleider, and Robert Desimone. Organization of visual inputs to the inferior temporal and posterior parietal cortex in macaques. The Journal of Neuroscience, 11(1):168–190, 1991. [22] Yong Gu, Gregory C DeAngelis, and Dora E Angelaki. Causal links between dorsal medial superior temporal area neurons and multisensory heading perception. The Journal of Neuroscience, 32(7):2299– 2313, 2012. [23] Matteo Carandini and David J Heeger. Normalization as a canonical neural computation. Nature Reviews Neuroscience, 13(1):51–62, 2012. [24] Tatiana A Engel and Xiao-Jing Wang. Same or different? a neural circuit mechanism of similarity-based pattern match decision making. The Journal of Neuroscience, 31(19):6982–6996, 2011. [25] Apostolos P Georgopoulos, Andrew B Schwartz, and Ronald E Kettner. Neuronal population coding of movement direction. Science, 233(4771):1416–1419, 1986. 9
2016
315
6,234
A Consistent Regularization Approach for Structured Prediction Carlo Ciliberto ∗,1 cciliber@mit.edu Alessandro Rudi ∗,1,2 ale_rudi@mit.edu Lorenzo Rosasco 1,2 lrosasco@mit.edu 1 Laboratory for Computational and Statistical Learning - Istituto Italiano di Tecnologia, Genova, Italy & Massachusetts Institute of Technology, Cambridge, MA 02139, USA. 2 Università degli Studi di Genova, Genova, Italy. ∗Equal contribution Abstract We propose and analyze a regularization approach for structured prediction problems. We characterize a large class of loss functions that allows to naturally embed structured outputs in a linear space. We exploit this fact to design learning algorithms using a surrogate loss approach and regularization techniques. We prove universal consistency and finite sample bounds characterizing the generalization properties of the proposed method. Experimental results are provided to demonstrate the practical usefulness of the proposed approach. 1 Introduction Many machine learning applications require dealing with data-sets having complex structures, e.g. natural language processing, image segmentation, reconstruction or captioning, pose estimation, protein folding prediction to name a few [1, 2, 3]. Structured prediction problems pose a challenge for classic off-the-shelf learning algorithms for regression or binary classification. This has motivated the extension of methods such as support vector machines to structured problems [4]. Dealing with structured prediction problems is also a challenge for learning theory. While the theory of empirical risk minimization provides a very general statistical framework, in practice it needs to be complemented with an ad-hoc analysis for each specific setting. Indeed, in the last few years, an effort has been made to analyze specific structured problems, such as multiclass classification [5], multi-labeling [6], ranking [7] or quantile estimation [8]. A natural question is whether a unifying learning framework can be developed to address a wide range of problems from theory to algorithms. This paper takes a step in this direction, proposing and analyzing a general regularization approach to structured prediction. Our starting observation is that for a large class of these problems, we can define a natural embedding of the associated loss functions into a linear space. This allows to define a (least squares) surrogate problem of the original structured one, that is cast within a multi-output regularized learning framework [9, 10, 11]. We prove that by solving the surrogate, we are able to recover the exact solution of the original structured problem. The corresponding algorithm essentially generalizes approaches considered in [12, 13, 14, 15, 16]. We study the generalization properties of the proposed approach, establishing universal consistency as well as finite sample bounds. The rest of this paper is organized as follows: in Sec. 2 we introduce the structured prediction problem in its generality and present our algorithm to approach it. In Sec. 3 we introduce and discuss a surrogate framework for structured prediction, from which we derive our algorithm. In Sec. 4, we analyze the theoretical properties of the proposed algorithm. In Sec. 5 we draw connections with previous work in structured prediction. Sec. 6 reports promising experimental results on a variety of structured prediction problems. Sec. 7 concludes the paper outlining relevant directions for future research. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. 2 A Regularization Approach to Structured prediction The goal of supervised learning is to learn functional relations f : X →Y between two sets X, Y, given a finite number of examples. In particular in this work we are interested to structured prediction, namely the case where Y is a set of structured outputs (such as histograms, graphs, time sequences, points on a manifold, etc.). Moreover, structure on Y can be implicitly induced by a suitable loss △: Y × Y →R (such as edit distance, ranking error, geodesic distance, indicator function of a subset, etc.). Then, the problem of structured prediction becomes minimize f:X→Y E(f), with E(f) = Z X×Y △(f(x), y) dρ(x, y) (1) and the goal is to find a good estimator for the minimizer of the above equation, given a finite number of (training) points {(xi, yi)}n i=1 sampled from a unknown probability distribution ρ on X × Y. In the following we introduce an estimator ˆf : X →Y to approach Eq. (1). The rest of this paper is devoted to prove that ˆf it a consistent estimator for a minimizer of Eq. (1). Our Algorithm for Structured Prediction. In this paper we propose and analyze the following estimator ˆf(x) = argmin y∈Y n X i=1 αi(x) △(y, yi) with α(x) = (K + nλI)−1Kx ∈Rn (Alg. 1) given a positive definite kernel k : X ×X →R and training set {(xi, yi)}n i=1. In the above expression, αi(x) is i-th entry in α(x), K ∈Rn×n is the kernel matrix Ki,j = k(xi, xj), Kx ∈Rn the vector with entires (Kx)i = k(x, xi), λ > 0 a regularization parameter and I the identity matrix. From a computational perspective, the procedure in Alg. 1 is divided in two steps: a learning step where input-dependents weights αi(·) are computed (which essentially consists in solving a kernel ridge regression problem) and a prediction step where the αi(x)-weighted linear combination in Alg. 1 is optimized, leading to a prediction ˆf(x) given an input x. The idea of a similar two-steps strategy goes back to standard approaches for structured prediction and was originally proposed in [17], where a “score” function F(x, y) was learned to estimate the “likelihood” of a pair (x, y) sampled from ρ, and then used in ˆf(x) = argminy∈Y −F(x, y), to predict the best ˆf(x) ∈Y given x ∈X. This strategy was extended in [4] for the popular SVMstruct and adopted also in a variety of approaches for structured prediction [1, 12, 14]. Intuition. While providing a principled derivation of Alg. 1 for a large class of loss functions is a main contribution of this work, it is useful to first consider the special case where △is induced by a reproducing kernel h : Y × Y →R on the output set, such that △(y, y′) = h(y, y) −2h(y, y′) + h(y′, y′). (2) This choice of △was originally considered in Kernel Dependency Estimation (KDE) [18]. In particular, for the special case of normalized kernels (i.e. h(y, y) = 1 ∀y ∈Y), Alg. 1 essentially reduces to [12, 13, 14] and recalling their derivation is insightful. Note that, since a kernel can be written as h(y, y′) = ⟨ψ(y), ψ(y′)⟩HY, with ψ : Y →HY a non-linear map into a feature space HY [19], then Eq. (2) can be rewritten as △(f(x), y′) = ∥ψ(f(x)) −ψ(y′)∥2 HY. (3) Directly minimizing the equation above with respect to f is generally challenging due to the non linearity ψ. A possibility is to replace ψ ◦f by a function g : X →HY that is easier to optimize. We can then consider the regularized problem minimize g∈G 1 n n X i=1 ∥g(xi) −ψ(yi)∥2 HY + λ∥g∥2 G (4) with G a space of functions1 g : X →HY of the form g(x) = P i=1 k(x, xi)ci with ci ∈HY and k a reproducing kernel. Indeed, in this case the solution to Eq. (4) is ˆg(x) = n X i=1 αi(x)ψ(yi) with α(x) = (K + nλI)−1Kx ∈Rn (5) 1G is the reproducing kernel Hilbert space for vector-valued functions [9] with inner product ⟨k(xi, ·)ci, k(xj, ·)cj⟩G = k(xi, xj)⟨ci, cj⟩HY 2 where the αi are the same as in Alg. 1. Since we replaced △(f(x), y) by ∥g(x)−ψ(y)∥2 HY, a natural question is how to recover an estimator ˆf from ˆg. In [12] it was proposed to consider ˆf(x) = argmin y∈Y ∥ψ(y) −ˆg(x)∥2 HY = argmin y∈Y h(y, y) −2 n X i=1 αi(x)h(y, yi), (6) which corresponds to Alg. 1 when h is a normalized kernel. The discussion above provides an intuition on how Alg. 1 is derived but raises also a few questions. First, it is not clear if and how the same strategy could be generalized to loss functions that do not satisfy Eq. (2). Second, the above reasoning hinges on the idea of replacing ˆf with ˆg (and then recovering ˆf by Eq. (6)), however it is not clear whether this approach can be justified theoretically. Finally, we can ask what are the statistical properties of the resulting algorithm. We address the first two questions in the next section, while the rest of the paper is devoted to establish universal consistency and generalization bounds for algorithm Alg. 1. 3 Surrogate Framework and Derivation To derive Alg. 1 we consider ideas from surrogate approaches [20, 21, 7] and in particular [5]. The idea is to tackle Eq. (1) by substituting △(f(x), y) with a “relaxation” L(g(x), y) on a space HY, that is easy to optimize. The corresponding surrogate problem is minimize g:X→HY R(g), with R(g) = Z X×Y L(g(x), y) dρ(x, y), (7) and the question is how a solution g∗for the above problem can be related to a minimizer f ∗of Eq. (1). This is made possible by the requirement that there exists a decoding d : HY →Y, such that Fisher Consistency: E(d ◦g∗) = E(f ∗), (8) Comparison Inequality: E(d ◦g) −E(f ∗) ≤ϕ(R(g) −R(g∗)), (9) hold for all g : X →HY, where ϕ : R →R is such that ϕ(s) →0 for s →0. Indeed, given an estimator ˆg for g∗, we can “decode” it considering ˆf = d ◦ˆg and use the excess risk R(ˆg) −R(g∗) to control E( ˆf) −E(f ∗) via the comparison inequality in Eq. (9). In particular, if ˆg is a datadependent predictor trained on n points and R(ˆg) →R(g∗) when n →+∞, we automatically have E( ˆf) →E(f ∗). Moreover, if ϕ in Eq. (9) is known explicitly, generalization bounds for ˆg are automatically extended to ˆf. Provided with this perspective on surrogate approaches, here we revisit the discussion of Sec. 2 for the case of a loss function induced by a kernel h. Indeed, by assuming the surrogate L(g(x), y) = ∥g(x) −ψ(y)∥2 HY, Eq. (4) becomes the empirical version of the surrogate problem at Eq. (7) and leads to an estimator ˆg of g∗as in Eq. (5). Therefore, the approach in [12, 14] to recover ˆf(x) = argminy L(g(x), y) can be interpreted as the result ˆf(x) = d ◦ˆg(x) of a suitable decoding of ˆg(x). An immediate question is whether the above framework satisfies Eq. (8) and (9). Moreover, we can ask if the same idea could be applied to more general loss functions. In this work we identify conditions on △that are satisfied by a large family of functions and moreover allow to design a surrogate framework for which we prove Eq. (8) and (9). The first step in this direction is to introduce the following assumption. Assumption 1. There exists a separable Hilbert space HY with inner product ⟨·, ·⟩HY, a continuous embedding ψ : Y →HY and a bounded linear operator V : HY →HY, such that △(y, y′) = ⟨ψ(y), V ψ(y′)⟩HY ∀y, y′ ∈Y (10) Asm. 1 is similar to Eq. (3) and in particular to the definition of a reproducing kernel. Note however that by not requiring V to be positive semidefinite (or even symmetric), we allow for a surprisingly wide range of functions beyond kernel functions. Indeed, below we give some examples of functions that satisfy Asm. 1 (see supplementary material Sec. C for more details): Example 1. The following functions of the form △: Y × Y →R satisfy Asm. 1: 3 1. Any loss on Y of finite cardinality. Several problems belong to this setting, such as MultiClass Classification, Multi-labeling, Ranking, predicting Graphs (e.g. protein foldings). 2. Regression and Classification Loss Functions. Least-squares, Logistic, Hinge, ϵ-insensitive, τ-Pinball. 3. Robust Loss Functions. Most loss functions used for robust estimation [22] such as the absolute value, Huber, Cauchy, German-McLure, “Fair” and L2 −L1. See [22] or the supplementary material for their explicit formulation. 4. KDE. Loss functions △induced by a kernel such as in Eq. (2). 5. Distances on Histograms/Probabilities. The χ2 and the Hellinger distances. 6. Diffusion distances on Manifolds. The squared diffusion distance induced by the heat kernel (at time t > 0) on a compact Reimannian manifold without boundary [23]. The Least Squares Loss Surrogate Framework. Asm. 1 implicitly defines the space HY similarly to Eq. (3). The following result motivates the choice of the least squares surrogate and moreover suggests a possible choice for the decoding. Lemma 1. Let △: Y × Y →R satisfy Asm. 1 with ψ : Y →HY bounded. Then the expected risk in Eq. (1) can be written as E(f) = Z X ⟨ψ(f(x)), V g∗(x)⟩HY dρX (x) (11) for all f : X →Y, where g∗: X →HY minimizes R(g) = Z X×Y ∥g(x) −ψ(y)∥2 HY dρ(x, y). (12) Lemma 1 shows how Eq. (12) arises naturally as surrogate problem. In particular, Eq. (11) suggests to choose the decoding d(h) = argmin y∈Y ⟨ψ(y) , V h ⟩HY ∀h ∈HY, (13) since d ◦g∗(x) = arg miny∈Y⟨ψ(y), V g∗(x)⟩and therefore E(d ◦g∗) ≤E(f) for any measurable f : X →Y, leading to Fisher Consistency. We formalize this in the following result. Theorem 2. Let △: Y × Y →R satisfy Asm. 1 with Y a compact set. Then, for every measurable g : X →HY and d : HY →Y satisfying Eq. (13), the following holds E(d ◦g∗) = E(f ∗) (14) E(d ◦g) −E(f ∗) ≤c△ p R(g) −R(g∗). (15) with c△= ∥V ∥maxy∈Y ∥ψ(y)∥HY. Thm. 2 shows that for all △satisfying Asm. 1, the corresponding surrogate framework identified by the surrogate in Eq. (12) and decoding Eq. (13) satisfies Fisher consistency Eq. (14) and the comparison inequality in Eq. (15). We recall that a finite set Y is always compact, and moreover, assuming the discrete topology on Y, we have that any ψ : Y →HY is continuous. Therefore, Thm. 2 applies in particular to any structured prediction problem on Y with finite cardinality. Thm. 2 suggest to approach structured prediction by first learning ˆg and then decoding it to recover ˆf = d ◦ˆg. A natural question is how to choose ˆg in order to compute ˆf in practice. In the rest of this section we propose an approach to this problem. Derivation for Alg. 1. Minimizing R in Eq. (12) corresponds to a vector-valued regression problem [9, 10, 11]. In this work we adopt an empirical risk minimization approach to learn ˆg as in Eq. (4). The following result shows that combining ˆg with the decoding in Eq. (13) leads to the ˆf in Alg. 1. Lemma 3. Let △: Y × Y →R satisfy Asm. 1 with Y a compact set. Let ˆg : X →HY be the minimizer of Eq. (4). Then, for all x ∈X d ◦ˆg(x) = argmin y∈Y n X i=1 αi(x) △(y, yi) α(x) = (K + nλI)−1Kx ∈Rn (16) 4 Lemma 3 concludes the derivation of Alg. 1. An interesting observation is that computing ˆf does not require explicit knowledge of the embedding ψ and the operator V , which are implicitly encoded within the loss △by Asm. 1. In analogy to the kernel trick [24] we informally refer to such assumption as the “loss trick”. We illustrate this effect with an example. Example 2 (Ranking). In ranking problems the goal is to predict ordered sequences of a fixed number ℓof labels. For these problems, Y corresponds to the set of all ordered sequences of ℓlabels and has cardinality |Y| = ℓ!, which is typically dramatically larger than the number n of training examples (e.g. for ℓ= 15, ℓ! ≃1012). Therefore, given an input x ∈X, directly computing ˆg(x) ∈R|Y| is impractical. On the opposite, the loss trick allows to express d ◦ˆg(x) only in terms of the n weights αi(x) in Alg. 1, making the computation of the argmin easier to approach in general. For details on the rank loss △rank and the corresponding optimization over Y, we refer to the empirical analysis of Sec. 6. In this section we have shown a derivation for the structured prediction algorithm proposed in this work. In Thm. 2 we have shown how the expected risk of the proposed estimator ˆf is related to an estimator ˆg via a comparison inequality. In the following we will make use of these results to prove consistency and generalization bounds for Alg. 1. 4 Statistical Analysis In this section we study the statistical properties of Alg. 1 exploiting of the relation between the structured and surrogate problems characterized be the comparison inequality in Thm. 2. We begin our analysis by proving that Alg. 1 is universally consistent. Theorem 4 (Universal Consistency). Let △: Y × Y →R satisfy Asm. 1, X and Y be compact sets and k : X ×X →R a continuous universal reproducing kernel2. For any n ∈N and any distribution ρ on X × Y let ˆfn : X →Y be obtained by Alg. 1 with {(xi, yi)}n i=1 training points independently sampled from ρ and λn = n−1/4. Then, lim n→+∞E( ˆfn) = E(f ∗) with probability 1 (17) Thm. 4 shows that, when the △satisfies Asm. 1, Alg. 1 approximates a solution f ∗to Eq. (1) arbitrarily well, given a sufficient number of training examples. To the best of our knowledge this is the first consistency result for structured prediction in the general setting considered in this work and characterized by Asm. 1, in particular for the case of Y with infinite cardinality (dense or discrete). The No Free Lunch Theorem [25] states that it is not possible to prove uniform convergence rates for Eq. (17). However, by imposing suitable assumptions on the regularity of g∗it is possible to prove generalization bounds for ˆg and then, using Thm. 2, extend them to ˆf. To show this, it is sufficient to require that g∗belongs to G the reproducing kernel Hilbert space used in the ridge regression of Eq. (4). Note that in the proofs of Thm. 4 and Thm. 5, our analysis on ˆg borrows ideas from [10] and extends their result to our setting for the case of HY infinite dimensional (i.e. when Y has infinite cardinality). Indeed, note that in this case [10] cannot be applied to the estimator ˆg considered in this work (see supplementary material Sec. B.3, Lemma 18 for details). Theorem 5 (Generalization Bound). Let △: Y × Y →R satisfy Asm. 1, Y be a compact set and k : X × X →R a bounded continuous reproducing kernel. Let ˆfn denote the solution of Alg. 1 with n training points and λ = n−1/2. If the surrogate risk R defined in Eq. (12) admits a minimizer g∗∈G, then E( ˆfn) −E(f ∗) ≤cτ 2 n−1 4 (18) holds with probability 1 −8e−τ for any τ > 0, with c a constant not depending on n and τ. The bound in Thm. 5 is of the same order of the generalization bounds available for the least squares binary classifier [26]. Indeed, in Sec. 5 we show that in classification settings Alg. 1 reduces to least squares classification. This opens the way to possible improvements, as we discuss in the following. 2This is a standard assumption for universal consistency (see [21]). An example of continuous universal kernel is the Gaussian k(x, x′) = exp(−γ∥x −x′∥2), with γ > 0. 5 Remark 1 (Better Comparison Inequality). The generalization bounds for the least squares classifier can be improved by imposing regularity conditions on ρ via the Tsybakov condition [26]. This was observed in [26] for binary classification with the least squares surrogate, where a tighter comparison inequality than the one in Thm. 2 was proved. Therefore, a natural question is whether the inequality of Thm. 2 could be similarly improved, consequently leading to better rates for Thm. 5. Promising results in this direction can be found in [5], where the Tsybakov condition was generalized to the multi-class setting and led to a tight comparison inequality analogous to the one for the binary setting. However, this question deserves further investigation. Indeed, it is not clear how the approach in [5] could be further generalized to the case where Y has infinite cardinality. Remark 2 (Other Surrogate Frameworks). In this paper we focused on a least squares surrogate loss function and corresponding framework. A natural question is to ask whether other loss functions could be considered to approach the structured prediction problem, sharing the same or possibly even better properties. This question is related also to Remark 1, since different surrogate frameworks could lead to sharper comparison inequalities. This seems an interesting direction for future work. 5 Connection with Previous Work Binary and Multi-class Classification. It is interesting to note that in classification settings, Alg. 1 corresponds to the least squares classifier [26]. Indeed, let Y = {1, . . . , ℓ} be a set of labels and consider the misclassification loss △(y, y′) = 1 for y ̸= y′ and 0 otherwise. Then △(y, y′) = e⊤ y V ey′ with ei ∈Rℓthe i-the element of the canonical basis of Rℓand V = 1 −I, where I is the ℓ× ℓidentity matrix and 1 the matrix with all entries equal to 1. In the notation of surrogate methods adopted in this work, HY = Rℓand ψ(y) = ey. Note that both Least squares classification and our approach solve the surrogate problem at Eq. (4) 1 n n X i=1 ∥g(xi) −eyi∥2 Rℓ+ λ ∥g∥2 G (19) to obtain a vector-valued predictor ˆg : X →Rℓas in Eq. (5). Then, the least squares classifier ˆc and the decoding ˆf = d ◦ˆg are respectively obtained by ˆc(x) = argmax i=1,...,ℓ ˆg(x) ˆf(x) = argmin i=1,...,ℓ V ˆg(x). (20) However, since V = 1 −I, it is easy to see that ˆc(x) = ˆf(x) for all x ∈X. Kernel Dependency Estimation. In Sec. 2 we discussed the relation between KDE [18, 12] and Alg. 1. In particular, we have observed that if △is induced by a kernel h : Y × Y →R as in Eq. (2) and h is normalized, i.e. h(y, y) = κ ∀y ∈Y, with κ > 0, then algorithm Eq. (6) proposed in [12] leads to the same predictor as Alg. 1. Therefore, we can apply Thm. 4 and 5 to prove universal consistency and generalization bounds for methods such as [12, 14]. Some theoretical properties of KDE have been previously studied in [15] from a PAC Bayesian perspective. However, the obtained bounds do not allow to control the excess risk or establish consistency of the method. Moreover, note that when the kernel h is not normalized, the “decoding” in Eq. (6) is not equivalent to Alg. 1. In particular, given the surrogate solution g∗, applying Eq. (6) leads to predictors that do not minimize Eq. (1). As a consequence, approaches in [12, 13, 14] are not consistent in the general case. Support Vector Machines for Structured Output. A popular approach to structured prediction is the Support Vector Machine for Structured Outputs (SVMstruct) [4] that extends ideas from the well-known SVM algorithm to the structured setting. One of the main advantages of SVMstruct is that it can be applied to a variety of problems since it does not impose strong assumptions on the loss. In this view, our approach shares similar properties, and in particular allows to consider Y of infinite cardinality. Moreover, we note that generalization studies for SVMstruct are available [3] (Ch. 11). However, it seems that these latter results do not allow to derive universal consistency of the method. 6 Experiments In this section we report on preliminary experiments showing the performance of the proposed approach on simulated as well as real structured prediction problems. 6 Rank Loss Linear [7] 0.430 ± 0.004 Hinge [27] 0.432 ± 0.008 Logistic [28] 0.432 ± 0.012 SVM Struct [4] 0.451 ± 0.008 Alg. 1 0.396 ± 0.003 Table 1: Normalized △rank for ranking methods on the MovieLens dataset [29]. Loss KDE [18] (Gaussian) Alg. 1 (Hellinger) △G 0.149 ± 0.013 0.172 ± 0.011 △H 0.736 ± 0.032 0.647 ± 0.017 △R 0.294 ± 0.012 0.193 ± 0.015 Table 2: Digit reconstruction using Gaussian (KDE [18]) and Hellinger loss. Ranking Movies. We considered the problem of ranking movies in the MovieLens dataset [29] (ratings (from 1 to 5) of 1682 movies by 943 users). The goal was to predict preferences of a given user, i.e. an ordering of the 1682 movies, according to the user’s partial ratings. We applied Alg. 1 to the ranking problem using the rank loss [7] △rank(y, y′) = 1 2 M X i,j=1 γ(y′)ij (1 −sign(yi −yj)), (21) where M is the number of movies, y is a re-ordering of the sequence 1, . . . , M. The scalar γ(y)ij denotes the costs (or reward) of having movie j ranked higher than movie i. Similarly to [7], we set γ(y)ij equal to the difference of ratings provided by user associated to y (from 1 to 5). We chose as k in Alg. 1, a linear kernel on features similar to those proposed in [7], which were computed based on users’ profession, age, similarity of previous ratings, etc. Since solving Alg. 1 for △rank is NP-hard (see [7]) we adopted the Feedback Arc Set approximation (FAS) proposed in [30] to approximate the ˆf(x) of Alg. 1. Results are reported in Tab. 1 comparing Alg. 1 (Ours) with surrogate ranking methods using a Linear [7], Hinge [27] or Logistic [28] loss and Struct SVM [4]. We randomly sampled n = 643 users for training and tested on the remaining 300. We performed 5-fold cross-validation for model selection. We report the normalized △rank, averaged over 10 trials to account for statistical variability. Interestingly, our approach appears to outperform all competitors, suggesting that Alg. 1 is a viable approach to ranking. Image Reconstruction with Hellinger Distance. We considered the USPS digits reconstruction experiment originally proposed in [18]. The goal is to predict the lower half of an image depicting a digit, given the upper half of the same image in input. The standard approach is to use a Gaussian kernel kG on images in input and adopt KDE methods such as [18, 12, 14] with loss △G(y, y′) = 1 −kG(y, y′). Here we take a different approach and, following [31], we interpret an image depicting a digit as an histogram and normalize it to sum up to 1. Therefore, Y is the unit simplex in R128 (16 × 16 images) and we adopt the Hellinger distance △H △H(y, y′) = M X i=1 |(yi)1/2 −(y′ i)1/2| for y = (yi)M i=1 (22) to measure distances on Y. We used the kernel kG on the input space and compared Alg. 1 using respectively △H and △G. For △G Alg. 1 correpsponds to [12]. We performed digit reconstruction experiments by training on 1000 examples evenly distributed among the 10 digits of USPS and tested on 5000 images. We performed 5-fold cross-validation for model selection. Tab. 2 reports the performance of Alg. 1 and the KDE methods averaged over 10 runs. Performance are reported according to the Gaussian loss △G and Hellinger loss △H. Unsurprisingly, methods trained with respect to a specific loss perform better than the competitor with respect to such loss. Therefore, as a further measure of performance we also introduced the “Recognition” loss △R. This loss has to be intended as a measure of how “well” a predictor was able to correctly reconstruct an image for digit recognition purposes. To this end, we trained an automatic digit classifier and defined △R to be the misclassification error of such classifier when tested on images reconstructed by the two prediction algorithms. This automatic classifier was trained using a standard SVM [24] on a separate subset of USPS images and achieved an average 0.04% error rate on the true 5000 test sets. In this case a clear difference in performance can be observed between using two different loss functions, suggesting that △H is more suited for the reconstruction problem. 7 −1 −0.8 −0.6 −0.4 −0.2 0 0.2 0.4 0.6 0.8 1 −2 0 2 4 Alg. 1 RNW KRLS n Alg. 1 RNW KRR 50 0.39 ± 0.17 0.45 ± 0.18 0.62 ± 0.13 100 0.21 ± 0.04 0.29 ± 0.04 0.47 ± 0.09 200 0.12 ± 0.02 0.24 ± 0.03 0.33 ± 0.04 500 0.08 ± 0.01 0.22 ± 0.02 0.31 ± 0.03 1000 0.07 ± 0.01 0.21 ± 0.02 0.19 ± 0.02 Figure 1: Robust estimation on the regression problem in Sec. 6 by minimizing the Cauchy loss with Alg. 1 (Ours) or Nadaraya-Watson (Nad). KRLS as a baseline predictor. Left. Example of one run of the algorithms. Right. Average distance of the predictors to the actual function (without noise and outliers) over 100 runs with respect to training sets of increasing dimension. Robust Estimation. We considered a regression problem with many outliers and evaluated Alg. 1 using the Cauchy loss (see Example 1 - (3)) for robust estimation. Indeed, in this setting, Y = [−M, M] ⊂R is not structured, but the non-convexity of △can be an obstacle to the learning process. We generated a dataset according to the model y = sin(6πx) + ϵ + ζ, where x was sampled uniformly on [−1, 1] and ϵ according to a zero-mean Gaussian with variance 0.1. ζ modeled the outliers and was sampled according to a zero-mean random variable that was 0 with probability 0.90 and a value uniformly at random in [−3, 3] with probability 0.1. We compared Alg. 1 with the Nadaraya-Watson robust estimator (RNW) [32] and kernel ridge regression (KRR) with a Gaussian kernel as baseline. To train Alg. 1 we used a Gaussian kernel on the input and performed predictions (i.e. solved Eq. (16)) using Matlab FMINUNC function for unconstrained minimization. Experiments were performed with training sets of increasing dimension (100 repetitions each) and test set of 1000 examples. 5-fold cross-validation for model selection. Results are reported in Fig. 1, showing that our estimator significantly outperforms the others. Moreover, our method appears to greatly benefit from training sets of increasing size. 7 Conclusions and Future Work In this work we considered the problem of structured prediction from a Statistical Learning Theory perspective. We proposed a learning algorithm for structured prediction that is split into a learning and prediction step similarly to previous methods in the literature. We studied the statistical properties of the proposed algorithm by adopting a strategy inspired to surrogate methods. In particular, we identified a large family of loss functions for which it is natural to identify a corresponding surrogate problem. This perspective allows to prove a derivation of the algorithm proposed in this work. Moreover, by exploiting a comparison inequality relating the original and surrogate problems we were able to prove universal consistency and generalization bounds under mild assumption. In particular, the bounds proved in this work recover those already known for least squares classification, of which our approach can be seen as a generalization. We supported our theoretical analysis with experiments showing promising results on a variety of structured prediction problems. A few questions were left opened. First, we ask whether the comparison inequality can be improved (under suitable hypotheses) to obtain faster generalization bounds for our algorithm. Second, the surrogate problem in our work consists of a vector-valued regression (in a possibly infinite dimensional Hilbert space), we solved this problem by plain kernel ridge regression but it is natural to ask whether approaches from the multi-task learning literature could lead to substantial improvements in this setting. Finally, an interesting question is whether alternative surrogate frameworks could be derived for the setting considered in this work, possibly leading to tighter comparison inequalities. We will investigate these questions in the future. References [1] Pedro F Felzenszwalb, Ross B Girshick, David McAllester, and Deva Ramanan. Object detection with discriminatively trained part-based models. PAMI, IEEE Transactions on, 32(9):1627–1645, 2010. [2] Andrej Karpathy and Li Fei-Fei. Deep visual-semantic alignments for generating image descriptions. In Proceedings of the IEEE Conference on CVPR, pages 3128–3137, 2015. [3] Thomas Hofmann Bernhard Schölkopf Alexander J. Smola Ben Taskar Bakir, Gökhan and S.V.N Vishwanathan. Predicting structured data. MIT press, 2007. 8 [4] Ioannis Tsochantaridis, Thorsten Joachims, Thomas Hofmann, and Yasemin Altun. Large margin methods for structured and interdependent output variables. In JMLR, pages 1453–1484, 2005. [5] Youssef Mroueh, Tomaso Poggio, Lorenzo Rosasco, and Jean-Jacques Slotine. Multiclass learning with simplex coding. In NIPS, pages 2798–2806, 2012. [6] Wei Gao and Zhi-Hua Zhou. On the consistency of multi-label learning. Artificial Intelligence, 2013. [7] John C Duchi, Lester W Mackey, and Michael I Jordan. On the consistency of ranking algorithms. In Proceedings of the 27th International Conference on Machine Learning (ICML-10), pages 327–334, 2010. [8] Ingo Steinwart, Andreas Christmann, et al. Estimating conditional quantiles with the help of the pinball loss. Bernoulli, 17(1):211–225, 2011. [9] Charles A Micchelli and Massimiliano Pontil. Kernels for multi–task learning. In Advances in Neural Information Processing Systems, pages 921–928, 2004. [10] Andrea Caponnetto and Ernesto De Vito. Optimal rates for the regularized least-squares algorithm. Foundations of Computational Mathematics, 7(3):331–368, 2007. [11] M. Álvarez, N. Lawrence, and L. Rosasco. Kernels for vector-valued functions: a review. Foundations and Trends in Machine Learning, 4(3):195–266, 2012. see also http://arxiv.org/abs/1106.6251. [12] Corinna Cortes, Mehryar Mohri, and Jason Weston. A general regression technique for learning transductions. In Proceedings of the 22nd international conference on Machine learning, 2005. [13] P. Geurts, L. Wehenkel, and F. d’Alché Buc. Kernelizing the output of tree-based methods. In ICML, 2006. [14] H. Kadri, M. Ghavamzadeh, and P. Preux. A generalized kernel approach to structured output learning. Proc. International Conference on Machine Learning (ICML), 2013. [15] S. Giguère, M. M., K. Sylla, and F. Laviolette. Risk bounds and learning algorithms for the regression approach to structured output prediction. In ICML. JMLR Workshop and Conference Proceedings, 2013. [16] C. Brouard, M. Szafranski, and F. d’Alché Buc. Input output kernel regression: Supervised and semisupervised structured output prediction with operator-valued kernels. JMLR, 17(176):1–48, 2016. [17] Michael Collins. Discriminative training methods for hidden markov models: Theory and experiments with perceptron algorithms. In Proceedings of the ACL-02 conference on Empirical methods in natural language processing-Volume 10, pages 1–8. Association for Computational Linguistics, 2002. [18] Jason Weston, Olivier Chapelle, Vladimir Vapnik, André Elisseeff, and Bernhard Schölkopf. Kernel dependency estimation. In Advances in neural information processing systems, pages 873–880, 2002. [19] Alain Berlinet and Christine Thomas-Agnan. Reproducing kernel Hilbert spaces in probability and statistics. Springer Science & Business Media, 2011. [20] Peter L Bartlett, Michael I Jordan, and Jon D McAuliffe. Convexity, classification, and risk bounds. Journal of the American Statistical Association, 101(473):138–156, 2006. [21] Ingo Steinwart and Andreas Christmann. Support Vector Machines. Information Science and Statistics. Springer New York, 2008. [22] Peter J Huber and Elvezio M Ronchetti. Robust statistics. Springer, 2011. [23] Richard Schoen and Shing-Tung Yau. Lectures on differential geometry, volume 2. International press Boston, 1994. [24] Bernhard Schölkopf and Alexander J Smola. Learning with kernels: support vector machines, regularization, optimization, and beyond. MIT press, 2002. [25] David H Wolpert. The lack of a priori distinctions between learning algorithms. Neural computation, 8(7):1341–1390, 1996. [26] Yuan Yao, Lorenzo Rosasco, and Andrea Caponnetto. On early stopping in gradient descent learning. Constructive Approximation, 26(2):289–315, 2007. [27] Ralf Herbrich, Thore Graepel, and Klaus Obermayer. Large margin rank boundaries for ordinal regression. Advances in neural information processing systems, pages 115–132, 1999. [28] Ofer Dekel, Yoram Singer, and Christopher D Manning. Log-linear models for label ranking. In Advances in neural information processing systems, page None, 2004. [29] F Maxwell Harper and Joseph A Konstan. The movielens datasets: History and context. ACM Transactions on Interactive Intelligent Systems (TiiS), 5(4):19, 2015. [30] Peter Eades, Xuemin Lin, and William F Smyth. A fast and effective heuristic for the feedback arc set problem. Information Processing Letters, 47(6):319–323, 1993. [31] Marco Cuturi. Sinkhorn distances: Lightspeed computation of optimal transport. In Advances in Neural Information Processing Systems, pages 2292–2300, 2013. [32] Wolfgang Härdle. Robust regression function estimation. Journal of Multivariate Analysis, 14(2):169–180, 1984. 9
2016
316
6,235
Fast recovery from a union of subspaces Chinmay Hegde Iowa State University Piotr Indyk MIT Ludwig Schmidt MIT Abstract We address the problem of recovering a high-dimensional but structured vector from linear observations in a general setting where the vector can come from an arbitrary union of subspaces. This setup includes well-studied problems such as compressive sensing and low-rank matrix recovery. We show how to design more efficient algorithms for the union-of-subspace recovery problem by using approximate projections. Instantiating our general framework for the low-rank matrix recovery problem gives the fastest provable running time for an algorithm with optimal sample complexity. Moreover, we give fast approximate projections for 2D histograms, another well-studied low-dimensional model of data. We complement our theoretical results with experiments demonstrating that our framework also leads to improved time and sample complexity empirically. 1 Introduction Over the past decade, exploiting low-dimensional structure in high-dimensional problems has become a highly active area of research in machine learning, signal processing, and statistics. In a nutshell, the general approach is to utilize a low-dimensional model of relevant data in order to achieve better prediction, compression, or estimation compared to a “black box” treatment of the ambient high-dimensional space. For instance, the seminal work on compressive sensing and sparse linear regression has shown how to estimate a sparse, high-dimensional vector from a small number of linear observations that essentially depends only on the small sparsity of the vector, as opposed to its large ambient dimension. Further examples of low-dimensional models are low-rank matrices, groupstructured sparsity, and general union-of-subspaces models, all of which have found applications in problems such as matrix completion, principal component analysis, compression, and clustering. These low-dimensional models have a common reason for their success: they capture important structure present in real world data with a formal concept that is suitable for a rigorous mathematical analysis. This combination has led to statistical performance improvements in several applications where the ambient high-dimensional space is too large for accurate estimation from a limited number of samples. However, exploiting the low-dimensional structure also comes at a cost: incorporating the structural constraints into the statistical estimation procedure often results in a more challenging algorithmic problems. Given the growing size of modern data sets, even problems that are solvable in polynomial time can quickly become infeasible. This leads to the following important question: Can we design efficient algorithms that combine (near)-optimal statistical efficiency with good computational complexity? In this paper, we make progress on this question in the context of recovering a low-dimensional vector from noisy linear observations, which is the fundamental problem underlying both low-rank matrix recovery and compressive sensing / sparse linear regression. While there is a wide range of algorithms for these problems, two approaches for incorporating structure tend to be most common: (i) convex relaxations of the low-dimensional constraint such as the `1- or the nuclear norm [19], and (ii) iterative methods based on projected gradient descent, e.g., the IHT (Iterative Hard Thresholding) or SVP (Singular Value Projection) algorithms [5, 15]. Since the convex relaxations are often also solved with first order methods (e.g., FISTA or SVT [6]), the low-dimensional constraint enters both 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. approaches through a structure-specific projection or proximal operator. However, this projection / proximal operator is often computationally expensive and dominates the overall time complexity (e.g., it requires a singular value decomposition for the low-rank matrix recovery problem). In this work, we show how to reduce the computational bottleneck of the projection step by using approximate projections. Instead of solving the structure-specific projection exactly, our framework allows us to employ techniques from approximation algorithms without increasing the sample complexity of the recovery algorithm. While approximate projections have been used in prior work, our framework is the first to yield provable algorithms for general union-of-subspaces models (such as low-rank matrices) that combine better running time with no loss in sample complexity compared to their counterparts utilizing exact projections. Overall, we make three contributions: 1. We introduce an algorithmic framework for recovering vectors from linear observations given an arbitrary union-of-subspaces model. Our framework only requires approximate projections, which leads to recovery algorithms with significantly better time complexity. 2. We instantiate our framework for the well-studied low-rank matrix recovery problem, which yields a provable algorithm combining the optimal sample complexity with the best known time complexity for this problem. 3. We also instantiate our framework for the problem of recovering 2D-histograms (i.e., piecewise constant matrices) from linear observations, which leads to a better empirical sample complexity than the standard approach based on Haar wavelets. Our algorithmic framework generalizes recent results for structured sparse recovery [12, 13] and shows that approximate projections can be employed in a wider context. We believe that these notions of approximate projections are useful in further constrained estimation settings and have already obtained preliminary results for structured sparse PCA. For conciseness, we focus on the union-of-subspaces recovery problem in this paper. Outline of the paper. In Section 2, we formally introduce the union-of-subspaces recovery problem and state our main results. Section 3 then explains our algorithmic framework in more detail and Section 4 instantiates the framework for low-rank matrix recovery. Section 5 concludes with experimental results. Due to space constraints, we address our results for 2D histograms mainly in Appendix C of the supplementary material. 2 Our contributions We begin by defining our problem of interest. Our goal is to recover an unknown, structured vector ✓⇤2 Rd from linear observations of the form y = X✓⇤+ e , (1) where the vector y 2 Rn contains the linear observations / measurements, the matrix X 2 Rn⇥d is the design / measurement matrix, and the vector e 2 Rn is an arbitrary noise vector. The formal goal is to find an estimate ˆ✓2 Rd such that kˆ✓−✓⇤k2 C · kek2, where C is a fixed, universal constant and k·k2 is the standard `2-norm (for notational simplicity, we omit the subscript on the `2-norm in the rest of the paper). The structure we assume is that the vector ✓⇤belongs to a subspace model: Definition 1 (Subspace model). A subspace model U is a set of linear subspaces. The set of vectors associated with the subspace model U is M(U) = {✓| ✓2 U for some U 2 U}. A subspace model is a natural framework generalizing many of the low-dimensional data models mentioned above. For example, the set of sparse vectors with s nonzeros can be represented with !d s " subspaces corresponding to the !d s " possible sparse support sets. The resulting problem of recovering ✓⇤from observations of the form (1) then is the standard compressive sensing / sparse linear regression problem. Structured sparsity is a direct extension of this formulation in which we only include a smaller set of allowed supports, e.g., supports corresponding to group structures. Our framework also includes the case where the union of subspaces is taken over an infinite set: we can encode the low-rank matrix recovery problem by letting U be the set of rank-r matrix subspaces, i.e., each subspace is given by a set of r orthogonal rank-one matrices. By considering the singular 2 value decomposition, it is easy to see that every rank-r matrix can be written as the linear combination of r orthogonal rank-one matrices. Next, we introduce related notation. For a linear subspace U of Rd, let PU 2 Rd⇥d be the orthogonal projection onto U. We denote the orthogonal complement of the subspace U with U ? so that ✓= PU✓+PU ?✓. We extend the notion of adding subspaces (i.e., U +V = {u+v | u 2 U and v 2 V }) to subspace models: the sum of two subspace models U and V is U⊕V = {U +V | U 2 U and V 2 V}. We denote the k-wise sum of a subspace model with ⊕k U = U ⊕U ⊕. . . ⊕U. Finally, we introduce a variant of the well-known restricted isometry property (RIP) for subspace models. The RIP is a common regularity assumption for the design matrix X that is often used in compressive sensing and low-rank matrix recovery in order to decouple the analysis of algorithms from concrete sampling bounds.1 Formally, we have: Definition 2 (Subspace RIP). Let X 2 Rn⇥d, let U be a subspace model, and let δ ≥0. Then X satisfies the (U, δ)-subspace RIP if for all ✓2 M(U) we have (1 −δ)k✓k2 kX✓k2 (1 + δ)k✓k2. 2.1 A framework for recovery algorithms with approximate projections Considering the problem (1) and the goal of estimating under the `2-norm, a natural algorithm is projected gradient descent with the constraint set M(U). This corresponds to iterations of the form ˆ✓i+1 PU(ˆ✓i −⌘· XT (X ˆ✓i −y)) (2) where ⌘2 R is the step size and we have extended our notation so that PU denotes a projection onto the set M(U). Hence we require an oracle that projects an arbitrary vector b 2 Rd into a subspace model U, which corresponds to finding a subspace U 2 U so that kb −PUbk is minimized. Recovery algorithms of the form (2) have been proposed for various instances of the union-of-subspaces recovery problem and are known as Iterative Hard Thresholding (IHT) [5], model-IHT [1], and Singular Value Projection (SVP) [15]. Under regularity conditions on the design matrix X such as the RIP, these algorithms find accurate estimates ˆ✓from an asymptotically optimal number of samples. However, for structures more complicated than plain sparsity (e.g., group sparsity or a low-rank constraint), the projection oracle is often the computational bottleneck. To overcome this barrier, we propose two complementary notions of approximate subspace projections. Note that for an exact projection, we have that kbk2 = kb −PUbk2 + kPUbk2. Hence minimizing the “tail” error kb −PUbk is equivalent to maximizing the “head” quantity kPUbk. Instead of minimizing / maximizing these quantities exactly, the following definitions allow a constant factor approximation: Definition 3 (Approximate tail projection). Let U and UT be subspace models and let cT ≥0. Then T : Rd ! UT is a (cT , U, UT )-approximate tail projection if the following guarantee holds for all b 2 Rd: The returned subspace U = T (b) satisfies kb −PUbk cT kb −PUbk. Definition 4 (Approximate head projection). Let U and UH be subspace models and let cH > 0. Then H : Rd ! UH is a (cH, U, UH)-approximate head projection if the following guarantee holds for all b 2 Rd: The returned subspace U = H(b) satisfies kPUbk ≥cHkPUbk. It is important to note that the two definitions are distinct in the sense that a constant-factor head approximation does not imply a constant-factor tail approximation, or vice versa (to see this, consider a vector with a very large or very small tail error, respectively). Another feature of these definitions is that the approximate projections are allowed to choose subspaces from a potentially larger subspace model, i.e., we can have U ( UH (or UT ). This is a useful property when designing approximate head and tail projection algorithms as it allows for bicriterion approximation guarantees. We now state the main result for our new recovery algorithm. In a nutshell, we show that using both notions of approximate projections achieves the same statistical efficiency as using exact projections. As we will see in later sections, the weaker approximate projection guarantees allow us to design algorithms with a significantly better time complexity than their exact counterparts. To simplify the following statement, we defer the precise trade-off between the approximation ratios to Section 3. 1Note that exact recovery from arbitrary linear observations is already an NP-hard problem in the noiseless case, and hence regularity conditions on the design matrix X are necessary for efficient algorithms. While there are more general regularity conditions such as the restricted eigenvalue property, we state our results here under the RIP assumption in order to simplify the presentation of our algorithmic framework. 3 Theorem 5 (informal). Let H and T be approximate head and tail projections with constant approximation ratios, and let the matrix X satisfy the (⊕c U, δ)-subspace RIP for a sufficiently large constant c and a sufficiently small constant δ. Then there is an algorithm AS-IHT that returns an estimate ˆ✓such that kˆ✓−✓⇤k Ckek. The algorithm requires O(logk✓k/kek) multiplications with X and XT , and O(logk✓k/kek) invocations of H and T . Up to constant factors, the requirements on the RIP of X in Theorem 5 are the same as for exact projections. As a result, our sample complexity is only affected by a constant factor through the use of approximate projections, and our experiments in Section 5 show that the empirical loss in sample complexity is negligible. Similarly, the number of iterations O(logk✓k/kek) is also only affected by a constant factor compared to the use of exact projections [5, 15]. Finally, it is worth mentioning that using two notions of approximate projections is crucial: prior work in the special case of structured sparsity has already shown that only one type of approximate projection is not sufficient for strong recovery guarantees [13]. 2.2 Low-rank matrix recovery We now instantiate our new algorithmic framework for the low-rank matrix recovery problem. Variants of this problem are widely studied in machine learning, signal processing, and statistics, and are known under different names such as matrix completion, matrix sensing, and matrix regression. As mentioned above, we can incorporate the low-rank matrix structure into our general union-ofsubspaces model by considering the union of all low-rank matrix subspaces. For simplicity, we state the following bounds for the case of square matrices, but all our results also apply to rectangular matrices. Formally, we assume that ✓⇤2 Rd is the vectorized form of a rank-r matrix ⇥⇤2 Rd1⇥d1 where d = d2 1 and typically r ⌧d1. Seminal results have shown that it is possible to achieve the subspace-RIP for low-rank matrices with only n = O(r · d1) linear observations, which can be much smaller than the total dimensionality of the matrix d2 1. However, the bottleneck in recovery algorithms is often the singular value decomposition (SVD), which is necessary for both exact projections and soft thresholding operators and has a time complexity of O(d3 1). Our new algorithmic framework for approximate projections allows us to leverage recent results on approximate SVDs. We show that it is possible to compute both head and tail projections for low-rank matrices in eO(r · d2 1) time, which is significantly faster than the O(d3 1) time for an exact SVD in the relevant regime where r ⌧d1. Overall, we get the following result. Theorem 6. Let X 2 Rn⇥d be a matrix with subspace-RIP for low-rank matrices, and let TX denote the time to multiply a d-dimensional vector with X or XT . Then there is an algorithm that recovers an estimate ˆ✓such that kˆ✓−✓⇤k Ckek. Moreover, the algorithm runs in time eO(TX + r · d2 1). In the regime where multiplication with the matrix X is fast, the time complexity of the projection dominates the time complexity of the recovery algorithms. For instance, structured observations such as a subsampled Fourier matrix achieve TX = eO(d2 1); see Appendix D for details. Here, our algorithm runs in time eO(r · d2 1), which is the first provable running time faster than the O(d3 1) bottleneck given by a single exact SVD. While prior work has suggested the use of approximate SVDs in low-rank matrix recovery [9], our results are the first that give a provably better time complexity for this combination of projected gradient descent and approximate SVDs. Hence Theorem 6 can be seen as a theoretical justification for the heuristic use of approximate SVDs. Finally, we remark that Theorem 6 does not directly cover the low-rank matrix completion case because the subsampling operator does not satisfy the low-rank RIP [9]. To clarify our use of approximate SVDs, we focus on the RIP setting in our proofs, similar to recent work on low-rank matrix recovery [7, 22]. We believe that similar results as for SVP [15] also hold for our algorithm, and our experiments in Section 5 show that our algorithm works well for low-rank matrix completion. 2.3 2D-histogram recovery Next, we instantiate our new framework for 2D-histograms, another natural low-dimensional model. As before, we think of the vector ✓⇤2 Rd as a matrix ⇥2 Rd1⇥d1 and assume the square case for simplicity (again, our results also apply to rectangular matrices). We say that ⇥is a k-histogram if the coefficients of ⇥can be described as k axis-aligned rectangles on which ⇥is constant. This definition 4 is a generalization of 1D-histograms to the two-dimensional setting and has found applications in several areas such as databases and density estimation. Moreover, the theoretical computer science community has studied sketching and streaming algorithms for histograms, which is essentially the problem of recovering a histogram from linear observations. While the wavelet tree model with Haar wavelets give the correct sample complexity of n = O(k log d) for 1D-histograms, the wavelet tree approach incurs a suboptimal sample complexity of O(k log2 d) for 2D-histograms. It is possible to achieve the optimal sample complexity O(k log d) also for 2D-histograms, but the corresponding exact projection requires a complicated dynamic program (DP) with time complexity O(d5 1k2), which is impractical for all but very small problem dimensions [18]. We design significantly faster approximate projection algorithms for 2D histograms. Our approach is based on an approximate DP [18] that we combine with a Lagrangian relaxation of the k-rectangle constraint. Both algorithms have parameters for controlling the trade-off between the size of the output histogram, the approximation ratio, and the running time. As mentioned above, the bicriterion nature of our approximate head and tail guarantees becomes useful here. In the following two theorems, we let Uk be the subspace model of 2D histograms consisting of k-rectangles. Theorem 7. Let ⇣> 0 and " > 0 be arbitrary. Then there is an (1 + ", Uk, Uc·k)-approximate tail projection for 2D histograms where c = O(1/⇣2"). Moreover, the algorithm runs in time eO(d1+⇣). Theorem 8. Let ⇣> 0 and " > 0 be arbitrary. Then there is an (1 −", Uk, Uc·k)-approximate head projection for 2D histograms where c = O(1/⇣2"). Moreover, the algorithm runs in time eO(d1+⇣). Note that both algorithms offer a running time that is almost linear, and the small polynomial gap to a linear running time can be controlled as a trade-off between computational and statistical efficiency (a larger output histogram requires more samples to recover). While we provide rigorous proofs for the approximation algorithms as stated above, we remark that we do not establish an overall recovery result similar to Theorem 6. The reason is that the approximate head projection is competitive with respect to k-histograms, but not with the space Uk ⊕Uk, i.e., the sum of two k-histogram subspaces. The details are somewhat technical and we give a more detailed discussion in Appendix C.3. However, under a natural structural conjecture about sums of k-histogram subspaces, we obtain a similar result as Theorem 6. Moreover, we experimentally demonstrate that the sample complexity of our algorithms already improves over wavelets for k-histograms of size 32 ⇥32. Finally, we note that our DP approach also generalizes to γ-dimensional histograms for any constant γ ≥2. As the dimension of the histogram structure increases, the gap in sample complexity between our algorithm and the prior wavelet-based approach becomes increasingly wide and scales as O(kγ log d) vs O(k logγ d). For simplicity, we limit our attention to the 2D case described above. 2.4 Related work Recently, there have been several results on approximate projections in the context of recovering low-dimensional structured vectors. (see [12, 13] for an overview). While these approaches also work with approximate projections, they only apply to less general models such as dictionary sparsity [12] or structured sparsity [13] and do not extend to the low-rank matrix recovery problem we address. Among recovery frameworks for general union-of-subspaces models, the work closest to ours is [4], which also gives a generalization of the IHT algorithm. It is important to note that [4] addresses approximate projections, but requires additive error approximation guarantees instead of the weaker relative error approximation guarantees required by our framework. Similar to the structured sparsity case in [13], we are not aware of any algorithms for low-rank or histogram projections that offer additive error guarantees faster than an exact projection. Overall, our recovery framework can be seen as a generalization of the approaches in [13] and [4]. Low-rank recovery has received a tremendous amount of attention over the past few years, so we refer the reader to the recent survey [9] for an overview. When referring to prior work on low-rank recovery, it is important to note that the fastest known running time for an exact low-rank SVD (even for rank 1) of a d1 ⇥d2 matrix is O(d1d2 min(d1, d2)). Several papers provide rigorous proofs for low-rank recovery using exact SVDs and then refer to Lanczos methods such as PROPACK [16] while accounting a time complexity of O(d1d2r) for a rank-r SVD. While Lanczos methods can be faster than exact SVDs in the presence of singular value gaps, it is important to note that all rigorous results for Lanczos SVDs either have a polynomial dependence on the approximation ratio or singular 5 value gaps [17, 20]. No prior work on low-rank recovery establishes such singular value gaps for the inputs to the SVD subroutines (and such gaps would be necessary for all iterates in the recovery algorithm). In contrast, we utilize recent work on gap-independent approximate SVDs [17], which enables us to give rigorous guarantees for the entire recovery algorithm. Our results can be seen as justification for the heuristic use of Lanczos methods in prior work. The paper [2] contains an analysis of an approximate SVD in combination with an iterative recovery algorithm. However, [2] only uses an approximate tail projection, and as a result the approximation ratio cT must be very close to 1 in order to achieve a good sample complexity. Overall, this leads to a time complexity that does not provide an asymptotic improvement over using exact SVDs. Recently, several papers have analyzed a non-convex approach to low-rank matrix recovery via factorized gradient descent [3, 7, 22–24]. While these algorithms avoid SVDs in the iterations of the gradient method, the overall recovery proofs still require an exact SVD in the initialization step. In order to match the sample complexity of our algorithm or SVP, the factorized gradient methods require multiple SVDs for this initialization [7, 22]. As a result, our algorithm offers a better provable time complexity. We remark that [7, 22] use SVP for their initialization, so combining our faster version of SVP with factorized gradient descent might give the best overall performance. As mentioned earlier, 1D and 2D histograms have been studied extensively in several areas such as databases [8, 14] and density estimation. They are typically used to summarize “count vectors”, with each coordinate of the vector ✓corresponding the number of items with a given value in some data set. Computing linear sketches of such vectors, as well as efficient methods for recovering histogram approximations from those sketches, became key tools for designing space efficient dynamic streaming algorithms [10, 11, 21]. For 1D histograms it is known how to achieve the optimal sketch length bound of n = O(k log d): it can be obtained by representing k-histograms using a tree of O(k log d) wavelet coefficients as in [10] and then using the structured sparse recovery algorithm of [1]. However, applying this approach to 2D histograms leads to a sub-optimal bound of O(k log2 d). 3 An algorithm for recovery with approximate projections We now introduce our algorithm for recovery from general subspace models using only approximate projections. The pseudo code is formally stated in Algorithm 1 and can be seen as a generalization of IHT [5]. Similar to IHT, we give a version without step size parameter here in order to simplify the presentation (it is easy to introduce a step size parameter in order to fine-tune constant factors). To clarify the connection with projected gradient descent as stated in Equation (2), we use H(b) (or T (b)) as a function from Rd to Rd here. This function is then understood to be b 7! PH(b)b, i.e., the orthogonal projection of b onto the subspace identified by H(b). Algorithm 1 Approximate Subspace-IHT 1: function AS-IHT(y, X, t) 2: ˆ✓0 0 3: for i 0, . . . , t do 4: bi XT (y −X ˆ✓i) 5: ˆ✓i+1 T (ˆ✓i + H(bi)) 6: return ˆ✓ ˆ✓t+1 The main difference to “standard” projected gradient descent is that we apply a projection to both the gradient step and the new iterate. Intuitively, the head projection ensures two points: (i) The result of the head projection on bi still contains a constant fraction of the residual ✓⇤−ˆ✓i (see Lemma 13 in Appendix A). (ii) The input to the tail approximation is close enough to the constraint set U so that the tail approximation does not prevent the overall convergence. In a nutshell, the head projection “denoises” the gradient so that we can then safely apply an approximate tail projection (as pointed out in [13], only applying an approximate tail projection fails precisely because of “noisy” updates). Formally, we obtain the following theorem for each iteration of AS-IHT (see Appendix A.1 for the corresponding proof): 6 Theorem 9. Let ˆ✓i be the estimate computed by AS-IHT in iteration i and let ri+1 = ✓⇤−ˆ✓i+1 be the corresponding residual. Moreover, let U be an arbitrary subspace model. We also assume: • y = X✓⇤+ e as in Equation (1) with ✓⇤2 M(U). • T is a (cT , U, UT )-approximate tail projection. • H is a (cH, U ⊕UT , UH)-approximate head projection. • The matrix X satisfies the (U ⊕UT ⊕UH, δ)-subspace RIP. Then the residual error of the next iterate, i.e., ri+1 = ✓⇤−ˆ✓i+1 satisfies $$ri+1$$ ⌘ $$ri$$ + ⇢kek , where ⌘= (1 + cT ) ✓ δ + q 1 −⌘2 0 ◆ , ⇢= (1 + cT ) ⌘0⇢0 p 1 −⌘2 0 + p 1 + δ ! , ⌘0 = cH(1 −δ) −δ , and ⇢0 = (1 + cH) p 1 + δ . The important conclusion of Theorem 9 is that AS-IHT still achieves linear convergence when the approximation ratios cT , cH are sufficiently close to 1 and the RIP-constant δ is sufficiently small. For instance, our approximation algorithms for both low-rank matrices offer such approximation guarantees. We can also achieve a sufficiently small value of δ by using a larger number of linear observations in order to strengthen the RIP guarantee (see Appendix D). Hence the use of approximate projections only affects the theoretical sample complexity bounds by constant factors. Moreover, our experiments show that approximate projections achieve essentially the same empirical sample complexity as exact projections (see Section 5). Given sufficiently small / large constants cT , cH, and δ, it is easy to see that the linear convergence implied by Theorem 9 directly gives the recovery guarantee and bound on the number of iterations stated in Theorem 5 (see Appendix A.1). However, in some cases it might not be possible to design approximation algorithms with constants cT and cH sufficiently close to 1 (in constrast, increasing the sample complexity by a constant factor in order to improve δ is usually a direct consequence of the RIP guarantee or similar statistical regularity assumptions). In order to address this issue, we show how to “boost” an approximate head projection so that the new approximation ratio is arbitrarily close to 1. While this also increases the size of the resulting subspace model, this increase usually affects the sample complexity only by constant factors as before. Note that for any fixed cT , setting cH sufficiently close to 1 and δ sufficiently small leads to a convergence rate ⌘< 1 (c.f. Theorem 9). Hence head boosting enables a linear convergence result for any initial combinations of cT and cH while only increasing the sample complexity by a constant factor (see Appendix A.3). Formally, we have the following theorem for head boosting, the proof of which we defer to Appendix A.2. Theorem 10. Let H be a (cH, U, UH)-approximate head projection running in time O(T), and let " > 0. Then there is a constant c = c",cH that depends only on " and cH such that we can construct a (1 −", U, ⊕c UH)-approximate head projection running in time O(c(T + T 0 1 + T 0 2)) where T 0 1 is the time needed to apply a projection onto a subspace in ⊕c UH, and T 0 2 is the time needed to find an orthogonal projector for the sum of two subspaces in ⊕c UH. We note that the idea of head boosting has already appeared in the context of structured sparse recovery [13]. However, the proof of Theorem 10 is more involved because the subspace in a general subspace model can have arbitrary angles (for structured sparsity, the subspaces are either parallel or orthogonal in each coordinate). 4 Low-rank matrix recovery We now instantiate our framework for recovery from a subspace model to the low-rank matrix recovery problem. Since we already have proposed the top-level recovery algorithm in the previous section, we only have to provide the problem-specific head and tail approximation algorithms here. We use the following result from prior work on approximate SVDs. Fact 11 ([17]). There is an algorithm APPROXSVD with the following guarantee. Let A 2 Rd1⇥d2 be an arbitrary matrix, let r 2 N be the target rank, and let " > 0 be the desired accuracy. Then with probability 1 − , APPROXSVD(A, r, ") returns an orthonormal set of vectors z1, . . . , zr 2 Rd1 such that for all i 2 [r], we have ++zT i AAT zi −σ2 i ++ "σ2 r+1 , (3) 7 1 1.5 2 2.5 3 0 0.2 0.4 0.6 0.8 1 Oversampling ratio n/r(d1 + d2) Probability of recovery Matrix recovery Exact SVD PROPACK Krylov (1 iters) Krylov (8 iters) 5 6 7 8 9 10 0 50 100 150 200 Oversampling ratio n/rd1 Running time (sec) Matrix completion PROPACK LinearTimeSVD Krylov (2 iters) Figure 1: Left: Results for a low-rank matrix recovery experiment using subsampled Fourier measurements. SVP / IHT with one iteration of a block Krylov SVD achieves the same phase transition as SVP with an exact SVD. Right: Results for a low-rank matrix completion problem. SVP / IHT with a block Krylov SVD achieves the best running time and is about 4 – 8 times faster than PROPACK. where σi is the i-th largest singular value of A. Furthermore, let Z 2 Rd1⇥r be the matrix with columns zi. Then we also have $$A −ZZT A $$ F (1 + ")kA −ArkF , (4) where Ar is the best rank-r Frobenius-norm approximation of A. Finally, the algorithm runs in time O ⇣ d1d2r log(d2/ ) p" + d1r2 log2(d2/ ) " + r3 log3(d2/ ) "3/2 ⌘ . It is important to note that the above results hold for any input matrix and do not require singular value gaps. The guarantee (4) directly gives a tail approximation guarantee for the subspace corresponding to the matrix ZZT A. Moreover, we can convert the guarantee (3) to a head approximation guarantee (see Theorem 18 in Appendix B for details). Since the approximation " only enters the running time in the approximate SVD, we can directly combine these approximate projections with Theorem 9, which then yields Theorem 6 (see Appendix B.1 for details).2 Empirically, we show in the next section that a very small number of iterations in APPROXSVD already suffices for accurate recovery. 5 Experiments We now investigate the empirical performance of our proposed algorithms. We refer the reader to Appendix E for more details about the experiments and results for 2D histograms. Considering our theoretical results on approximate projections for low-rank recovery, one important empirical question is how the use of approximate SVDs such as [17] affects the sample complexity of low-rank matrix recovery. For this, we perform a standard experiment and use several algorithms to recover an image of the MIT logo from subsampled Fourier measurements (c.f. Appendix D). The MIT logo has also been used in prior work [15, 19]; we use an image with dimensions 200 ⇥133 and rank 6 (see Appendix E). We limit our attention here to variants of SVP because the algorithm has good empirical performance and has been used as baseline in other works on low-rank recovery. Figure 1 shows that SVP / IHT combined with a single iteration of a block Krylov SVD [17] achieves the same phase transition as SVP with exact SVDs. This indicates that the use of approximate projections for low-rank recovery is not only theoretically sound but can also lead to practical algorithms. In Appendix E we also show corresponding running time results demonstrating that the block Krylov SVD also leads to the fastest recovery algorithm. We also study the performance of approximate SVDs for the matrix completion problem. We generate a symmetric matrix of size 2048 ⇥2048 with rank r = 50 and observe a varying number of entries of the matrix. The approximation errors of the various algorithms are again comparable and reported in Appendix E. Figure 1 shows the resulting running times for several sampling ratios. Again, SVP combined with a block Krylov SVD [17] achieves the best running time. Depending on the oversampling ratio, the block Krylov approach (now with two iterations) is 4 to 8 times faster than SVP with PROPACK. 2We remark that our definitions require head and tail projections to be deterministic, while the approximate SVD is randomized. However, the running time of APPROXSVD depends only logarithmically on the failure probability, and it is straightforward to apply a union bound over all iterations of AS-IHT. Hence we ignore these details here to simplify the presentation. 8 References [1] Richard G. Baraniuk, Volkan Cevher, Marco F. Duarte, and Chinmay Hegde. Model-based compressive sensing. IEEE Transactions on Information Theory, 56(4):1982–2001, 2010. [2] Stephen Becker, Volkan Cevher, and Anastasios Kyrillidis. Randomized low-memory singular value projection. In SampTA (Conference on Sampling Theory and Applications), 2013. [3] Srinadh Bhojanapalli, Anastasios Kyrillidis, and Sujay Sanghavi. Dropping convexity for faster semidefinite optimization. arXiv preprint 1509.03917, 2015. [4] Thomas Blumensath. Sampling and reconstructing signals from a union of linear subspaces. IEEE Transactions on Information Theory, 57(7):4660–4671, 2011. [5] Thomas Blumensath and Mike E. Davies. Iterative hard thresholding for compressive sensing. Applied and Computational Harmonic Analysis, 27(3):265–274, 2009. [6] Jian-Feng Cai, Emmanuel J. Candès, and Zuowei Shen. A singular value thresholding algorithm for matrix completion. SIAM Journal on Optimization, 20(4):1956–1982, 2010. [7] Yudong Chen and Martin J. Wainwright. Fast low-rank estimation by projected gradient descent: General statistical and algorithmic guarantees. arXiv preprint arXiv:1509.03025, 2015. [8] Graham Cormode, Minos Garofalakis, Peter J. Haas, and Chris Jermaine. Synopses for massive data: Samples, histograms, wavelets, sketches. Foundations and Trends in Databases, 4(1–3):1–294, 2012. [9] Mark Davenport and Justin Romberg. An overview of low-rank matrix recovery from incomplete observations. arXiv preprint 1601.06422, 2016. [10] Anna C. Gilbert, Sudipto Guha, Piotr Indyk, Yannis Kotidis, S. Muthukrishnan, and Martin J. Strauss. Fast, small-space algorithms for approximate histogram maintenance. In STOC, 2002. [11] Anna C. Gilbert, Yannis Kotidis, S Muthukrishnan, and Martin J. Strauss. Surfing wavelets on streams: One-pass summaries for approximate aggregate queries. In VLDB, volume 1, pages 79–88, 2001. [12] Raja Giryes and Deanna Needell. Greedy signal space methods for incoherence and beyond. Applied and Computational Harmonic Analysis, 39(1):1 – 20, 2015. [13] Chinmay Hegde, Piotr Indyk, and Ludwig Schmidt. Approximation algorithms for model-based compressive sensing. IEEE Transactions on Information Theory, 61(9):5129–5147, 2015. [14] Yannis Ioannidis. The history of histograms (abridged). In Proceedings of the 29th international conference on Very large data bases-Volume 29, pages 19–30. VLDB Endowment, 2003. [15] Prateek Jain, Raghu Meka, and Inderjit S. Dhillon. Guaranteed rank minimization via singular value projection. In NIPS, 2010. [16] Rasmus M. Larsen. Propack. http://sun.stanford.edu/~rmunk/PROPACK/. [17] Cameron Musco and Christopher Musco. Randomized block Krylov methods for stronger and faster approximate singular value decomposition. In NIPS, 2015. [18] S. Muthukrishnan, Viswanath Poosala, and Torsten Suel. On rectangular partitionings in two dimensions: Algorithms, complexity and applications. In ICDT, pages 236–256, 1999. [19] Benjamin Recht, Maryam Fazel, and Pablo A. Parrilo. Guaranteed minimum-rank solutions of linear matrix equations via nuclear norm minimization. SIAM Review, 52(3):471–501, 2010. [20] Yousef Saad. On the rates of convergence of the Lanczos and the block-Lanczos methods. SIAM Journal on Numerical Analysis, 17(5):687–706, 1980. [21] Nitin Thaper, Sudipto Guha, Piotr Indyk, and Nick Koudas. Dynamic multidimensional histograms. In SIGMOD, 2002. [22] Stephen Tu, Ross Boczar, Max Simchowitz, Mahdi Soltanolkotabi, and Benjamin Recht. Low-rank solutions of linear matrix equations via Procrustes Flow. In ICML, 2016. [23] Tuo Zhao, Zhaoran Wang, and Han Liu. Nonconvex low rank matrix factorization via inexact first order oracle. https://www.princeton.edu/~zhaoran/papers/LRMF.pdf. [24] Qinqing Zheng and John Lafferty. A convergent gradient descent algorithm for rank minimization and semidefinite programming from random linear measurements. In NIPS. 2015. 9
2016
317
6,236
Improved Techniques for Training GANs Tim Salimans tim@openai.com Ian Goodfellow ian@openai.com Wojciech Zaremba woj@openai.com Vicki Cheung vicki@openai.com Alec Radford alec@openai.com Xi Chen peter@openai.com Abstract We present a variety of new architectural features and training procedures that we apply to the generative adversarial networks (GANs) framework. Using our new techniques, we achieve state-of-the-art results in semi-supervised classification on MNIST, CIFAR-10 and SVHN. The generated images are of high quality as confirmed by a visual Turing test: our model generates MNIST samples that humans cannot distinguish from real data, and CIFAR-10 samples that yield a human error rate of 21.3%. We also present ImageNet samples with unprecedented resolution and show that our methods enable the model to learn recognizable features of ImageNet classes. 1 Introduction Generative adversarial networks [1] (GANs) are a class of methods for learning generative models based on game theory. The goal of GANs is to train a generator network G(z; θ(G)) that produces samples from the data distribution, pdata(x), by transforming vectors of noise z as x = G(z; θ(G)). The training signal for G is provided by a discriminator network D(x) that is trained to distinguish samples from the generator distribution pmodel(x) from real data. The generator network G in turn is then trained to fool the discriminator into accepting its outputs as being real. Recent applications of GANs have shown that they can produce excellent samples [2, 3]. However, training GANs requires finding a Nash equilibrium of a non-convex game with continuous, highdimensional parameters. GANs are typically trained using gradient descent techniques that are designed to find a low value of a cost function, rather than to find the Nash equilibrium of a game. When used to seek for a Nash equilibrium, these algorithms may fail to converge [4]. In this work, we introduce several techniques intended to encourage convergence of the GANs game. These techniques are motivated by a heuristic understanding of the non-convergence problem. They lead to improved semi-supervised learning peformance and improved sample generation. We hope that some of them may form the basis for future work, providing formal guarantees of convergence. All code and hyperparameters may be found at https://github.com/openai/improved-gan. 2 Related work Several recent papers focus on improving the stability of training and the resulting perceptual quality of GAN samples [2, 3, 5, 6]. We build on some of these techniques in this work. For instance, we use some of the “DCGAN” architectural innovations proposed in Radford et al. [3], as discussed below. One of our proposed techniques, feature matching, discussed in Sec. 3.1, is similar in spirit to approaches that use maximum mean discrepancy [7, 8, 9] to train generator networks [10, 11]. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. Another of our proposed techniques, minibatch features, is based in part on ideas used for batch normalization [12], while our proposed virtual batch normalization is a direct extension of batch normalization. One of the primary goals of this work is to improve the effectiveness of generative adversarial networks for semi-supervised learning (improving the performance of a supervised task, in this case, classification, by learning on additional unlabeled examples). Like many deep generative models, GANs have previously been applied to semi-supervised learning [13, 14], and our work can be seen as a continuation and refinement of this effort. In concurrent work, Odena [15] proposes to extend GANs to predict image labels like we do in Section 5, but without our feature matching extension (Section 3.1) which we found to be critical for obtaining state-of-the-art performance. 3 Toward Convergent GAN Training Training GANs consists in finding a Nash equilibrium to a two-player non-cooperative game. Each player wishes to minimize its own cost function, J(D)(θ(D), θ(G)) for the discriminator and J(G)(θ(D), θ(G)) for the generator. A Nash equilibirum is a point (θ(D), θ(G)) such that J(D) is at a minimum with respect to θ(D) and J(G) is at a minimum with respect to θ(G). Unfortunately, finding Nash equilibria is a very difficult problem. Algorithms exist for specialized cases, but we are not aware of any that are feasible to apply to the GAN game, where the cost functions are non-convex, the parameters are continuous, and the parameter space is extremely high-dimensional. The idea that a Nash equilibrium occurs when each player has minimal cost seems to intuitively motivate the idea of using traditional gradient-based minimization techniques to minimize each player’s cost simultaneously. Unfortunately, a modification to θ(D) that reduces J(D) can increase J(G), and a modification to θ(G) that reduces J(G) can increase J(D). Gradient descent thus fails to converge for many games. For example, when one player minimizes xy with respect to x and another player minimizes −xy with respect to y, gradient descent enters a stable orbit, rather than converging to x = y = 0, the desired equilibrium point [16]. Previous approaches to GAN training have thus applied gradient descent on each player’s cost simultaneously, despite the lack of guarantee that this procedure will converge. We introduce the following techniques that are heuristically motivated to encourage convergence: 3.1 Feature matching Feature matching addresses the instability of GANs by specifying a new objective for the generator that prevents it from overtraining on the current discriminator. Instead of directly maximizing the output of the discriminator, the new objective requires the generator to generate data that matches the statistics of the real data, where we use the discriminator only to specify the statistics that we think are worth matching. Specifically, we train the generator to match the expected value of the features on an intermediate layer of the discriminator. This is a natural choice of statistics for the generator to match, since by training the discriminator we ask it to find those features that are most discriminative of real data versus data generated by the current model. Letting f(x) denote activations on an intermediate layer of the discriminator, our new objective for the generator is defined as: ||Ex∼pdataf(x) −Ez∼pz(z)f(G(z))||2 2. The discriminator, and hence f(x), are trained in the usual way. As with regular GAN training, the objective has a fixed point where G exactly matches the distribution of training data. We have no guarantee of reaching this fixed point in practice, but our empirical results indicate that feature matching is indeed effective in situations where regular GAN becomes unstable. 3.2 Minibatch discrimination One of the main failure modes for GAN is for the generator to collapse to a parameter setting where it always emits the same point. When collapse to a single mode is imminent, the gradient of the discriminator may point in similar directions for many similar points. Because the discriminator processes each example independently, there is no coordination between its gradients, and thus no mechanism to tell the outputs of the generator to become more dissimilar to each other. Instead, all outputs race toward a single point that the discriminator currently believes is highly realistic. After collapse has occurred, the discriminator learns that this single point comes from the generator, but gradient descent is unable to separate the identical outputs. The gradients of the discriminator 2 then push the single point produced by the generator around space forever, and the algorithm cannot converge to a distribution with the correct amount of entropy. An obvious strategy to avoid this type of failure is to allow the discriminator to look at multiple data examples in combination, and perform what we call minibatch discrimination. The concept of minibatch discrimination is quite general: any discriminator model that looks at multiple examples in combination, rather than in isolation, could potentially help avoid collapse of the generator. In fact, the successful application of batch normalization in the discriminator by Radford et al. [3] is well explained from this perspective. So far, however, we have restricted our experiments to models that explicitly aim to identify generator samples that are particularly close together. One successful specification for modelling the closeness between examples in a minibatch is as follows: Let f(xi) ∈RA denote a vector of features for input xi, produced by some intermediate layer in the discriminator. We then multiply the vector f(xi) by a tensor T ∈RA×B×C, which results in a matrix Mi ∈RB×C. We then compute the L1-distance between the rows of the resulting matrix Mi across samples i ∈{1, 2, . . . , n} and apply a negative exponential (Fig. 1): cb(xi, xj) = exp(−||Mi,b −Mj,b||L1) ∈ R. Figure 1: Figure sketches how minibatch discrimination works. Features f(xi) from sample xi are multiplied through a tensor T, and cross-sample distance is computed. The output o(xi) for this minibatch layer for a sample xi is then defined as the sum of the cb(xi, xj)’s to all other samples: o(xi)b = n X j=1 cb(xi, xj) ∈R o(xi) = h o(xi)1, o(xi)2, . . . , o(xi)B i ∈RB o(X) ∈Rn×B Next, we concatenate the output o(xi) of the minibatch layer with the intermediate features f(xi) that were its input, and we feed the result into the next layer of the discriminator. We compute these minibatch features separately for samples from the generator and from the training data. As before, the discriminator is still required to output a single number for each example indicating how likely it is to come from the training data: The task of the discriminator is thus effectively still to classify single examples as real data or generated data, but it is now able to use the other examples in the minibatch as side information. Minibatch discrimination allows us to generate visually appealing samples very quickly, and in this regard it is superior to feature matching (Section 6). Interestingly, however, feature matching was found to work much better if the goal is to obtain a strong classifier using the approach to semi-supervised learning described in Section 5. 3.3 Historical averaging When applying this technique, we modify each player’s cost to include a term ||θ −1 t Pt i=1 θ[i]||2, where θ[i] is the value of the parameters at past time i. The historical average of the parameters can be updated in an online fashion so this learning rule scales well to long time series. This approach is loosely inspired by the fictitious play [17] algorithm that can find equilibria in other kinds of games. We found that our approach was able to find equilibria of low-dimensional, continuous non-convex games, such as the minimax game with one player controlling x, the other player controlling y, and value function (f(x) −1)(y −1), where f(x) = x for x < 0 and f(x) = x2 otherwise. For these same toy games, gradient descent fails by going into extended orbits that do not approach the equilibrium point. 3.4 One-sided label smoothing Label smoothing, a technique from the 1980s recently independently re-discovered by Szegedy et. al [18], replaces the 0 and 1 targets for a classifier with smoothed values, like .9 or .1, and was recently shown to reduce the vulnerability of neural networks to adversarial examples [19]. Replacing positive classification targets with α and negative targets with β, the optimal discriminator becomes D(x) = αpdata(x)+βpmodel(x) pdata(x)+pmodel(x) . The presence of pmodel in the numerator is problematic because, in areas where pdata is approximately zero and pmodel is large, erroneous samples from 3 pmodel have no incentive to move nearer to the data. We therefore smooth only the positive labels to α, leaving negative labels set to 0. 3.5 Virtual batch normalization Batch normalization greatly improves optimization of neural networks, and was shown to be highly effective for DCGANs [3]. However, it causes the output of a neural network for an input example x to be highly dependent on several other inputs x′ in the same minibatch. To avoid this problem we introduce virtual batch normalization (VBN), in which each example x is normalized based on the statistics collected on a reference batch of examples that are chosen once and fixed at the start of training, and on x itself. The reference batch is normalized using only its own statistics. VBN is computationally expensive because it requires running forward propagation on two minibatches of data, so we use it only in the generator network. 4 Assessment of image quality Generative adversarial networks lack an objective function, which makes it difficult to compare performance of different models. One intuitive metric of performance can be obtained by having human annotators judge the visual quality of samples [2]. We automate this process using Amazon Mechanical Turk (MTurk), using the web interface in figure Fig. 2 (live at http://infinite-chamber-35121.herokuapp.com/ cifar-minibatch/), which we use to ask annotators to distinguish between generated data and real data. The resulting quality assessments of our models are described in Section 6. Figure 2: Web interface given to annotators. Annotators are asked to distinguish computer generated images from real ones. A downside of using human annotators is that the metric varies depending on the setup of the task and the motivation of the annotators. We also find that results change drastically when we give annotators feedback about their mistakes: By learning from such feedback, annotators are better able to point out the flaws in generated images, giving a more pessimistic quality assessment. The left column of Fig. 2 presents a screen from the annotation process, while the right column shows how we inform annotators about their mistakes. As an alternative to human annotators, we propose an automatic method to evaluate samples, which we find to correlate well with human evaluation: We apply the Inception model1 [20] to every generated image to get the conditional label distribution p(y|x). Images that contain meaningful objects should have a conditional label distribution p(y|x) with low entropy. Moreover, we expect the model to generate varied images, so the marginal R p(y|x = G(z))dz should have high entropy. Combining these two requirements, the metric that we propose is: exp(ExKL(p(y|x)||p(y))), where we exponentiate results so the values are easier to compare. Our Inception score is closely related to the objective used for training generative models in CatGAN [14]: Although we had less success using such an objective for training, we find it is a good metric for evaluation that correlates very well with human judgment. We find that it’s important to evaluate the metric on a large enough number of samples (i.e. 50k) as part of this metric measures diversity. 5 Semi-supervised learning Consider a standard classifier for classifying a data point x into one of K possible classes. Such a model takes in x as input and outputs a K-dimensional vector of logits {l1, . . . , lK}, that can be turned into class probabilities by applying the softmax: pmodel(y = j|x) = exp(lj) PK k=1 exp(lk). In supervised learning, such a model is then trained by minimizing the cross-entropy between the observed labels and the model predictive distribution pmodel(y|x). 1We use the pretrained Inception model from http://download.tensorflow.org/models/image/ imagenet/inception-2015-12-05.tgz. Code to compute the Inception score with this model will be made available by the time of publication. 4 We can do semi-supervised learning with any standard classifier by simply adding samples from the GAN generator G to our data set, labeling them with a new “generated” class y = K + 1, and correspondingly increasing the dimension of our classifier output from K to K + 1. We may then use pmodel(y = K + 1 | x) to supply the probability that x is fake, corresponding to 1 −D(x) in the original GAN framework. We can now also learn from unlabeled data, as long as we know that it corresponds to one of the K classes of real data by maximizing log pmodel(y ∈{1, . . . , K}|x). Assuming half of our data set consists of real data and half of it is generated (this is arbitrary), our loss function for training the classifier then becomes L = −Ex,y∼pdata(x,y)[log pmodel(y|x)] −Ex∼G[log pmodel(y = K + 1|x)] = Lsupervised + Lunsupervised, where Lsupervised = −Ex,y∼pdata(x,y) log pmodel(y|x, y < K + 1) Lunsupervised = −{Ex∼pdata(x) log[1 −pmodel(y = K + 1|x)] + Ex∼G log[pmodel(y = K + 1|x)]}, where we have decomposed the total cross-entropy loss into our standard supervised loss function Lsupervised (the negative log probability of the label, given that the data is real) and an unsupervised loss Lunsupervised which is in fact the standard GAN game-value as becomes evident when we substitute D(x) = 1 −pmodel(y = K + 1|x) into the expression: Lunsupervised = −{Ex∼pdata(x) log D(x) + Ez∼noise log(1 −D(G(z)))}. The optimal solution for minimizing both Lsupervised and Lunsupervised is to have exp[lj(x)] = c(x)p(y=j, x)∀j<K+1 and exp[lK+1(x)] = c(x)pG(x) for some undetermined scaling function c(x). The unsupervised loss is thus consistent with the supervised loss in the sense of Sutskever et al. [13], and we can hope to better estimate this optimal solution from the data by minimizing these two loss functions jointly. In practice, Lunsupervised will only help if it is not trivial to minimize for our classifier and we thus need to train G to approximate the data distribution. One way to do this is by training G to minimize the GAN game-value, using the discriminator D defined by our classifier. This approach introduces an interaction between G and our classifier that we do not fully understand yet, but empirically we find that optimizing G using feature matching GAN works very well for semi-supervised learning, while training G using GAN with minibatch discrimination does not work at all. Here we present our empirical results using this approach; developing a full theoretical understanding of the interaction between D and G using this approach is left for future work. Finally, note that our classifier with K + 1 outputs is over-parameterized: subtracting a general function f(x) from each output logit, i.e. setting lj(x) ←lj(x) −f(x)∀j, does not change the output of the softmax. This means we may equivalently fix lK+1(x) = 0∀x, in which case Lsupervised becomes the standard supervised loss function of our original classifier with K classes, and our discriminator D is given by D(x) = Z(x) Z(x)+1, where Z(x) = PK k=1 exp[lk(x)]. 5.1 Importance of labels for image quality Besides achieving state-of-the-art results in semi-supervised learning, the approach described above also has the surprising effect of improving the quality of generated images as judged by human annotators. The reason appears to be that the human visual system is strongly attuned to image statistics that can help infer what class of object an image represents, while it is presumably less sensitive to local statistics that are less important for interpretation of the image. This is supported by the high correlation we find between the quality reported by human annotators and the Inception score we developed in Section 4, which is explicitly constructed to measure the “objectness” of a generated image. By having the discriminator D classify the object shown in the image, we bias it to develop an internal representation that puts emphasis on the same features humans emphasize. This effect can be understood as a method for transfer learning, and could potentially be applied much more broadly. We leave further exploration of this possibility for future work. 5 6 Experiments We performed semi-supervised experiments on MNIST, CIFAR-10 and SVHN, and sample generation experiments on MNIST, CIFAR-10, SVHN and ImageNet. We provide code to reproduce the majority of our experiments. 6.1 MNIST Figure 3: (Left) samples generated by model during semi-supervised training. Samples can be clearly distinguished from images coming from MNIST dataset. (Right) Samples generated with minibatch discrimination. Samples are completely indistinguishable from dataset images. The MNIST dataset contains 60, 000 labeled images of digits. We perform semi-supervised training with a small randomly picked fraction of these, considering setups with 20, 50, 100, and 200 labeled examples. Results are averaged over 10 random subsets of labeled data, each chosen to have a balanced number of examples from each class. The remaining training images are provided without labels. Our networks have 5 hidden layers each. We use weight normalization [21] and add Gaussian noise to the output of each layer of the discriminator. Table 1 summarizes our results. Samples generated by the generator during semi-supervised learning using feature matching (Section 3.1) do not look visually appealing (left Fig. 3). By using minibatch discrimination instead (Section 3.2) we can improve their visual quality. On MTurk, annotators were able to distinguish samples in 52.4% of cases (2000 votes total), where 50% would be obtained by random guessing. Similarly, researchers in our institution were not able to find any artifacts that would allow them to distinguish samples. However, semi-supervised learning with minibatch discrimination does not produce as good a classifier as does feature matching. Model Number of incorrectly predicted test examples for a given number of labeled samples 20 50 100 200 DGN [22] 333 ± 14 Virtual Adversarial [23] 212 CatGAN [14] 191 ± 10 Skip Deep Generative Model [24] 132 ± 7 Ladder network [25] 106 ± 37 Auxiliary Deep Generative Model [24] 96 ± 2 Our model 1677 ± 452 221 ± 136 93 ± 6.5 90 ± 4.2 Ensemble of 10 of our models 1134 ± 445 142 ± 96 86 ± 5.6 81 ± 4.3 Table 1: Number of incorrectly classified test examples for the semi-supervised setting on permutation invariant MNIST. Results are averaged over 10 seeds. 6.2 CIFAR-10 Model Test error rate for a given number of labeled samples 1000 2000 4000 8000 Ladder network [25] 20.40±0.47 CatGAN [14] 19.58±0.46 Our model 21.83±2.01 19.61±2.09 18.63±2.32 17.72±1.82 Ensemble of 10 of our models 19.22±0.54 17.25±0.66 15.59±0.47 14.87±0.89 Table 2: Test error on semi-supervised CIFAR-10. Results are averaged over 10 splits of data. CIFAR-10 is a small, well studied dataset of 32 × 32 natural images. We use this data set to study semi-supervised learning, as well as to examine the visual quality of samples that can be achieved. For the discriminator in our GAN we use a 9 layer deep convolutional network with dropout and weight normalization. The generator is a 4 layer deep CNN with batch normalization. Table 2 summarizes our results on the semi-supervised learning task. 6 Figure 4: Samples generated during semi-supervised training on CIFAR-10 with feature matching (Section 3.1, left) and minibatch discrimination (Section 3.2, right). When presented with 50% real and 50% fake data generated by our best CIFAR-10 model, MTurk users correctly categorized 78.7% of images correctly. However, MTurk users may not be sufficiently familiar with CIFAR-10 images or sufficiently motivated; we ourselves were able to categorize images with > 95% accuracy. We validated the Inception score described above by observing that MTurk accuracy drops to 71.4% when the data is filtered by using only the top 1% of samples according to the Inception score. We performed a series of ablation experiments to demonstrate that our proposed techniques improve the Inception score, presented in Table 3. We also present images for these ablation experiments—in our opinion, the Inception score correlates well with our subjective judgment of image quality. Samples from the dataset achieve the highest value. All the models that even partially collapse have relatively low scores. We caution that the Inception score should be used as a rough guide to evaluate models that were trained via some independent criterion; directly optimizing Inception score will lead to the generation of adversarial examples [26]. Samples Model Real data Our methods -VBN+BN -L+HA -LS -L -MBF Score ± std. 11.24 ± .12 8.09 ± .07 7.54 ± .07 6.86 ± .06 6.83 ± .06 4.36 ± .04 3.87 ± .03 Table 3: Table of Inception scores for samples generated by various models for 50, 000 images. Score highly correlates with human judgment, and the best score is achieved for natural images. Models that generate collapsed samples have relatively low score. This metric allows us to avoid relying on human evaluations. “Our methods” includes all the techniques described in this work, except for feature matching and historical averaging. The remaining experiments are ablation experiments showing that our techniques are effective. “-VBN+BN” replaces the VBN in the generator with BN, as in DCGANs. This causes a small decrease in sample quality on CIFAR. VBN is more important for ImageNet. “-L+HA” removes the labels from the training process, and adds historical averaging to compensate. HA makes it possible to still generate some recognizable objects. Without HA, sample quality is considerably reduced (see ”-L”). “-LS” removes label smoothing and incurs a noticeable drop in performance relative to “our methods.” “-MBF” removes the minibatch features and incurs a very large drop in performance, greater even than the drop resulting from removing the labels. Adding HA cannot prevent this problem. 6.3 SVHN For the SVHN data set, we used the same architecture and experimental setup as for CIFAR-10. Figure 5 compares against the previous state-of-the-art, where it should be noted that the model 7 of [24] is not convolutional, but does use an additional data set of 531131 unlabeled examples. The other methods, including ours, are convolutional and do not use this data. Model Percentage of incorrectly predicted test examples for a given number of labeled samples 500 1000 2000 Virtual Adversarial [23] 24.63 Stacked What-Where Auto-Encoder [27] 23.56 DCGAN [3] 22.48 Skip Deep Generative Model [24] 16.61±0.24 Our model 18.44 ± 4.8 8.11 ± 1.3 6.16 ± 0.58 Ensemble of 10 of our models 5.88 ± 1.0 Figure 5: (Left) Error rate on SVHN. (Right) Samples from the generator for SVHN. 6.4 ImageNet We tested our techniques on a dataset of unprecedented scale: 128 × 128 images from the ILSVRC2012 dataset with 1,000 categories. To our knowledge, no previous publication has applied a generative model to a dataset with both this large of a resolution and this large a number of object classes. The large number of object classes is particularly challenging for GANs due to their tendency to underestimate the entropy in the distribution. We extensively modified a publicly available implementation of DCGANs2 using TensorFlow [28] to achieve high performance, using a multi-GPU implementation. DCGANs without modification learn some basic image statistics and generate contiguous shapes with somewhat natural color and texture but do not learn any objects. Using the techniques described in this paper, GANs learn to generate objects that resemble animals, but with incorrect anatomy. Results are shown in Fig. 6. Figure 6: Samples generated from the ImageNet dataset. (Left) Samples generated by a DCGAN. (Right) Samples generated using the techniques proposed in this work. The new techniques enable GANs to learn recognizable features of animals, such as fur, eyes, and noses, but these features are not correctly combined to form an animal with realistic anatomical structure. 7 Conclusion Generative adversarial networks are a promising class of generative models that has so far been held back by unstable training and by the lack of a proper evaluation metric. This work presents partial solutions to both of these problems. We propose several techniques to stabilize training that allow us to train models that were previously untrainable. Moreover, our proposed evaluation metric (the Inception score) gives us a basis for comparing the quality of these models. We apply our techniques to the problem of semi-supervised learning, achieving state-of-the-art results on a number of different data sets in computer vision. The contributions made in this work are of a practical nature; we hope to develop a more rigorous theoretical understanding in future work. 2https://github.com/carpedm20/DCGAN-tensorflow 8 References [1] Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, et al. Generative adversarial nets. In NIPS, 2014. [2] Emily Denton, Soumith Chintala, Arthur Szlam, and Rob Fergus. Deep generative image models using a laplacian pyramid of adversarial networks. arXiv preprint arXiv:1506.05751, 2015. [3] Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. arXiv preprint arXiv:1511.06434, 2015. [4] Ian J Goodfellow. On distinguishability criteria for estimating generative models. arXiv preprint arXiv:1412.6515, 2014. [5] Daniel Jiwoong Im, Chris Dongjoo Kim, Hui Jiang, and Roland Memisevic. Generating images with recurrent adversarial networks. arXiv preprint arXiv:1602.05110, 2016. [6] Donggeun Yoo, Namil Kim, Sunggyun Park, Anthony S Paek, and In So Kweon. Pixel-level domain transfer. arXiv preprint arXiv:1603.07442, 2016. [7] Arthur Gretton, Olivier Bousquet, Alex Smola, and Bernhard Sch¨olkopf. Measuring statistical dependence with hilbert-schmidt norms. In Algorithmic learning theory, pages 63–77. Springer, 2005. [8] Kenji Fukumizu, Arthur Gretton, Xiaohai Sun, and Bernhard Sch¨olkopf. Kernel measures of conditional dependence. In NIPS, volume 20, pages 489–496, 2007. [9] Alex Smola, Arthur Gretton, Le Song, and Bernhard Sch¨olkopf. A hilbert space embedding for distributions. In Algorithmic learning theory, pages 13–31. Springer, 2007. [10] Yujia Li, Kevin Swersky, and Richard S. Zemel. Generative moment matching networks. CoRR, abs/1502.02761, 2015. [11] Gintare Karolina Dziugaite, Daniel M Roy, and Zoubin Ghahramani. Training generative neural networks via maximum mean discrepancy optimization. arXiv preprint arXiv:1505.03906, 2015. [12] Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167, 2015. [13] Ilya Sutskever, Rafal Jozefowicz, Karol Gregor, et al. Towards principled unsupervised learning. arXiv preprint arXiv:1511.06440, 2015. [14] Jost Tobias Springenberg. Unsupervised and semi-supervised learning with categorical generative adversarial networks. arXiv preprint arXiv:1511.06390, 2015. [15] Augustus Odena. Semi-supervised learning with generative adversarial networks. arXiv preprint arXiv:1606.01583, 2016. [16] Ian Goodfellow, Yoshua Bengio, and Aaron Courville. Deep Learning. 2016. MIT Press. [17] George W Brown. Iterative solution of games by fictitious play. Activity analysis of production and allocation, 13(1):374–376, 1951. [18] C. Szegedy, V. Vanhoucke, S. Ioffe, J. Shlens, and Z. Wojna. Rethinking the Inception Architecture for Computer Vision. ArXiv e-prints, December 2015. [19] David Warde-Farley and Ian Goodfellow. Adversarial perturbations of deep neural networks. In Tamir Hazan, George Papandreou, and Daniel Tarlow, editors, Perturbations, Optimization, and Statistics, chapter 11. 2016. Book in preparation for MIT Press. [20] Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jonathon Shlens, and Zbigniew Wojna. Rethinking the inception architecture for computer vision. arXiv preprint arXiv:1512.00567, 2015. [21] Tim Salimans and Diederik P Kingma. Weight normalization: A simple reparameterization to accelerate training of deep neural networks. arXiv preprint arXiv:1602.07868, 2016. [22] Diederik P Kingma, Shakir Mohamed, Danilo Jimenez Rezende, and Max Welling. Semi-supervised learning with deep generative models. In Neural Information Processing Systems, 2014. [23] Takeru Miyato, Shin-ichi Maeda, Masanori Koyama, Ken Nakae, and Shin Ishii. Distributional smoothing by virtual adversarial examples. arXiv preprint arXiv:1507.00677, 2015. [24] Lars Maaløe, Casper Kaae Sønderby, Søren Kaae Sønderby, and Ole Winther. Auxiliary deep generative models. arXiv preprint arXiv:1602.05473, 2016. [25] Antti Rasmus, Mathias Berglund, Mikko Honkala, Harri Valpola, and Tapani Raiko. Semi-supervised learning with ladder networks. In Advances in Neural Information Processing Systems, 2015. [26] Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, et al. Intriguing properties of neural networks. arXiv preprint arXiv:1312.6199, 2013. [27] Junbo Zhao, Michael Mathieu, Ross Goroshin, and Yann Lecun. Stacked what-where auto-encoders. arXiv preprint arXiv:1506.02351, 2015. [28] Mart´ın Abadi, Ashish Agarwal, Paul Barham, et al. TensorFlow: Large-scale machine learning on heterogeneous systems, 2015. Software available from tensorflow.org. 9
2016
318
6,237
Coordinate-wise Power Method Qi Lei 1 Kai Zhong 1 Inderjit S. Dhillon 1,2 1 Institute for Computational Engineering & Sciences 2 Department of Computer Science University of Texas at Austin {leiqi, zhongkai}@ices.utexas.edu, inderjit@cs.utexas.edu Abstract In this paper, we propose a coordinate-wise version of the power method from an optimization viewpoint. The vanilla power method simultaneously updates all the coordinates of the iterate, which is essential for its convergence analysis. However, different coordinates converge to the optimal value at different speeds. Our proposed algorithm, which we call coordinate-wise power method, is able to select and update the most important k coordinates in O(kn) time at each iteration, where n is the dimension of the matrix and k n is the size of the active set. Inspired by the “greedy” nature of our method, we further propose a greedy coordinate descent algorithm applied on a non-convex objective function specialized for symmetric matrices. We provide convergence analyses for both methods. Experimental results on both synthetic and real data show that our methods achieve up to 23 times speedup over the basic power method. Meanwhile, due to their coordinate-wise nature, our methods are very suitable for the important case when data cannot fit into memory. Finally, we introduce how the coordinatewise mechanism could be applied to other iterative methods that are used in machine learning. 1 Introduction Computing the dominant eigenvectors of matrices and graphs is one of the most fundamental tasks in various machine learning problems, including low-rank approximation, principal component analysis, spectral clustering, dimensionality reduction and matrix completion. Several algorithms are known for computing the dominant eigenvectors, such as the power method, Lanczos algorithm [14], randomized SVD [2] and multi-scale method [17]. Among them, the power method is the oldest and simplest one, where a matrix A is multiplied by the normalized iterate x(l) at each iteration, namely, x(l+1) = normalize(Ax(l)). The power method is popular in practice due to its simplicity, small memory footprint and robustness, and particularly suitable for computing the dominant eigenvector of large sparse matrices [14]. It has applied to PageRank [7], sparse PCA [19, 9], private PCA [4] and spectral clustering [18]. However, its convergence rate depends on |λ2|/|λ1|, the ratio of magnitude of the top two dominant eigenvalues [14]. Note that when |λ2| ⇡|λ1|, the power method converges slowly. In this paper, we propose an improved power method, which we call coordinate-wise power method, to accelerate the vanilla power method. Vanilla power method updates all n coordinates of the iterate simultaneously even if some have already converged to the optimal. This motivates us to develop new algorithms where we select and update a set of important coordinates at each iteration. As updating each coordinate costs only 1 n of one power iteration, significant running time can be saved when n is very large. We raise two questions for designing such an algorithm. The first question: how to select the coordinate? A natural idea is to select the coordinate that will change the most, namely, 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. argmaxi|ci|, where c = Ax xT Ax −x, (1) where Ax xT Ax is a scaled version of the next iterate given by power method, and we will explain this special scaling factor in Section 2. Note that ci denotes the i-th element of the vector c. Instead of choosing only one coordinate to update, we can also choose k coordinates with the largest k changes in {|ci|}n i=1. We will justify this selection criterion by connecting our method with greedy coordinate descent algorithm for minimizing a non-convex function in Section 3. With this selection rule, we are able to show that our method has global convergence guarantees and faster convergence rate compared to vanilla power method if k satisfies certain conditions. Another key question: how to choose these coordinates without too much overhead? How to efficiently select important elements to update is of great interest in the optimization community. For example, [1] leveraged nearest neighbor search for greedy coordinate selection, while [11] applied partially biased sampling for stochastic gradient descent. To calculate the changes in Eq (1) we need to know all coordinates of the next iterate. This violates our previous intention to calculate a small subset of the new coordinates. We show, by a simple trick, we can use only O(kn) operations to update the most important k coordinates. Experimental results on dense as well as sparse matrices show that our method is up to 8 times faster than vanilla power method. Relation to optimization. Our method reminds us of greedy coordinate descent method. Indeed, we show for symmetric matrices our coordinate-wise power method is similar to greedy coordinate descent for rank-1 matrix approximation, whose variants are widely used in matrix completion [8] and non-negative matrix factorization [6]. Based on this interpretation, we further propose a faster greedy coordinate descent method specialized for symmetric matrices. This method achieves up to 23 times speedup over the basic power method and 3 times speedup over the Lanczos method on large real graphs. For this non-convex problem, we also provide convergence guarantees when the initial iterate lies in the neighborhood of the optimal solution. Extensions. With the coordinate-wise nature, our methods are very suitable to deal with the case when data cannot fit into memory. We can choose a k such that k rows of A can fit in memory, and then fully process those k rows of data before loading the RAM (random access memory) with a new partition of the matrix. This strategy helps balance the data processing and data loading time. The experimental results show our method is 8 times faster than vanilla power method for this case. The paper is organized as follows. Section 2 introduces coordinate-wise power method for computing the dominant eigenvector. Section 3 interprets our strategy from an optimization perspective and proposes a faster algorithm. Section 4 provides theoretical convergence guarantee for both algorithms. Experimental results on synthetic or real data are shown in Section 5. Finally Section 6 presents the extensions of our methods: dealing with out-of-core cases and generalizing the coordinate-wise mechanism to other iterative methods that are useful for the machine learning community. 2 Coordinate-wise Power Method The classical power method (PM) iteratively multiplies the iterate x 2 Rn by the matrix A 2 Rn⇥n, which is inefficient since some coordinates may converge faster than others. To illustrate this (a) The percentage of unconverged coordinates versus the number of operations (b) Number of updates of each coordinate Figure 1: Motivation for the Coordinate-wise Power Method. Figure 1(a) shows how the percentage of unconverged coordinates decreases with the number of operations. The gradual decrease demonstrates the unevenness of each coordinate as the iterate converges to the dominant eigenvector. In Figure 1(b), the X-axis is the coordinate indices of iterate x sorted by their frequency of updates, which is shown on the Y-axis. The area below each curve approximately equals the total number of operations.The given matrix is synthetic with |λ2|/|λ1| = 0.5, and terminating accuracy ✏is set to be 1e-5. 2 phenomenon, we conduct an experiment with the power method; we set the stopping criterion as kx −v1k1 < ✏, where ✏is the threshold for error, and let vi denote the i-th dominant eigenvector (associated with the eigenvalue of the i-th largest magnitude) of A in this paper. During the iterative process, even if some coordinates meet the stopping criterion, they still have to be updated at every iteration until uniform convergence. In Figure 1(a), we count the number of unconverged coordinates, which we define as {i : i 2 [n] !!|xi −v1,i| > ✏}, and see it gradually decreases with the iterations, which implies that the power method makes a large number of unnecessary updates. In this paper, for computing the dominant eigenvector, we exhibit a coordinate selection scheme that has the ability to select and update ”important” coordinates with little overhead. We call our method Coordinate-wise Power Method (CPM). As shown in Figure 1(a) and 1(b), by selecting important entries to update, the number of unconverged coordinates drops much faster, leading to an overall fewer flops. Algorithm 1 Coordinate-wise Power Method 1: Input: Symmetric matrix A 2 Rn⇥n, number of selected coordinates k, and number of iterations, L. 2: Initialize x(0) 2 Rn and set z(0) = Ax(0). Set coordinate selecting criterion c(0) = x(0) − z(0) (x(0))T z(0) . 3: for l = 1 to L do 4: Let ⌦(l) be a set containing k coordinates of c(l−1) with the largest magnitude. Execute the following updates: y(l) j = 8 < : z(l−1) j (x(l−1))T z(l−1) , j 2 ⌦(l) x(l−1) j , j /2 ⌦(l) (2) z(l) = z(l−1) + A(y(l) ⌦(l) −x(l−1) ⌦(l) ) (3) z(l) = z(l)/ky(l)k, x(l) = y(l)/ky(l)k c(l) = x(l) − z(l) (x(l−1))T z(l−1) 5: Output: Approximate dominant eigenvector x(L) Algorithm 1 describes our coordinate-wise power method that updates k entries at a time for computing the dominant eigenvector for a symmetric input matrix, while a generalization to asymmetric cases is straightforward. The algorithm starts from an initial vector x(0), and iteratively performs updates xi aT i x/xT Ax with i in a selected set of coordinates ⌦✓[n] defined in step 4, where ai is the i-th row of A. The set of indices ⌦is chosen to maximize the difference between the current coordinate value xi and the next coordinate value aT i x/xT Ax. z(l) and c(l) are auxiliary vectors. Maintaining z(l) ⌘Ax(l) saves much time, while the magnitude of c represents importance of each coordinate and is used to select ⌦. We use the Rayleigh Quotient xT Ax (x is normalized) for scaling, different from kAxk in the power method. Our intuition is as follows: on one hand, it is well known that Rayleigh Quotient is the best estimate for eigenvalues. On the other hand, the limit point using xT Ax scaling will satisfy ¯x = A¯x/¯xT A¯x, which allows both negative or positive dominant eigenvectors, while the scaling kAxk is always positive, so its limit point only lies in the eigenvectors associated with positive eigenvalues, which rules out the possibility of converging to the negative dominant eigenvector. 2.1 Coordinate Selection Strategy An initial understanding for our coordinate selection strategy is that we select coordinates with the largest potential change. With a current iterate x and an arbitrary active set ⌦, let y⌦be a potential next iterate with only coordinates in ⌦updated, namely, (y⌦)i = ⇢ aT i x xT Ax, i 2 ⌦ xi, i /2 ⌦ According to our algorithm, we select active set ⌦to maximize the iterate change. Therefore: ⌦= arg max I⇢[n],|I|=k ($$$$(x − Ax xT Ax)I $$$$ 2 = kyI −xk2 ) = arg min I⇢[n],|I|=k ($$$$ Ax xT Ax −yI $$$$ 2 def = kgk2 ) This is to say, with our updating rule, our goal of maximizing iteration gap is equivalent to minimizing the difference between the next iterate y(l+1) and Ax(l)/(x(l))T Ax(l), where this difference could be interpreted as noise g(l). A good set ⌦ensures a sufficiently small noise g(l), thus achieving a 3 similar convergence rate in O(kn) time (analyzed later) as the power method does in O(n2) time. More formal statement for the convergence analysis is given in Section 4. Another reason for this selection rule is that it incurs little overhead. For each iteration, we maintain a vector z ⌘Ax with kn flops by the updating rule in Eq.(3). And the overhead consists of calculating c and choosing ⌦. Both parts cost O(n) operations. Here ⌦is chosen by Hoare’s quick selection algorithm [5] to find the kth largest entry in |c|. Thus the overhead is negligible compared with O(kn). Thus CPM spends as much time on each coordinate as PM does on average, while those updated k coordinates are most important. For sparse matrices, the time complexity is O(n + k nnnz(A)) for each iteration, where nnz(A) is the number of nonzero elements in matrix A. Although the above analysis gives us a good intuition on how our method works, it doesn’t directly show that our coordinate selection strategy has any optimal properties. In next section, we give another interpretation of our coordinate-wise power method and establish its connection with the optimization problem for low-rank approximation. 3 Optimization Interpretation The coordinate descent method [12, 6] was popularized due to its simplicity and good performance. With all but one coordinates fixed, the minimization of the objective function becomes a sequence of subproblems with univariate minimization. When such subproblems are quickly solvable, coordinate descent methods can be efficient. Moreover, in different problem settings, a specific coordinate selecting rule in each iteration makes it possible to further improve the algorithm’s efficiency. The power method reminds us of the rank-one matrix factorization arg min x2Rn,y2Rd ! f(x, y) = kA −xyT k2 F (4) With alternating minimization, the update for x becomes x Ay kyk2 and vice versa for y. Therefore for symmetric matrix, alternating minimization is exactly PM apart from the normalization constant. Meanwhile, the above similarity between PM and alternating minimization extends to the similarity between CPM and greedy coordinate descent. A more detailed interpretation is in Appendix A.5, where we show the equivalence in the following coordinate selecting rules for Eq.(4): (a) largest coordinate value change, denoted as |δxi|; (b) largest partial gradient (Gauss-Southwell rule), |rif(x)|; (c) largest function value decrease, |f(x + δxiei) −f(x)|. Therefore, the coordinate selection rule is more formally testified in optimization viewpoint. 3.1 Symmetric Greedy Coordinate Descent (SGCD) We propose an even faster algorithm based on greedy coordinate descent. This method is designed for symmetric matrices and additionally requires to know the sign of the most dominant eigenvalue. We also prove its convergence to the global optimum with a sufficiently close initial point. A natural alternative objective function specifically for the symmetric case would be arg min x2Rn ! f(x) = kA −xxT k2 F . (5) Notice that the stationary points of f(x), which require rf(x) = 4(kxk2x −Ax) = 0, are obtained at eigenvectors: x⇤ i = pλivi, if the eigenvalue λi is positive. The global minimum for Eq. (5) is the eigenvector corresponding to the largest positive eigenvalue, not the one with the largest magnitude. For most applications like PageRank we know λ1 is positive, but if we want to calculate the negative eigenvalue with the largest magnitude, just optimize on f = kA + xxT k2 F instead. Now we introduce Algorithm 2 that optimizes Eq. (5). With coordinate descent, we update the i-th coordinate by x(l+1) i arg min↵f(x(l) + (↵−x(l) i )ei), which requires the partial derivative of f(x) in i-th coordinate to be zero, i.e., rif(x) = 4(xikxk2 2 −aT i x) = 0. (6) () x3 i + pxi + q = 0, where p = kxk2 −x2 i −aii, and q = −aT i x + aiixi (7) Similar to CPM, the most time consuming part comes from maintaining z (⌘Ax), as the calculation for selecting the criterion c and the coefficient q requires it. Therefore the overall time complexity for one iteration is the same as CPM. 4 Notice that c from Eq.(6) is the partial gradient of f, so we are using the Gauss-Southwell rule to choose the active set. And it is actually the only effective and computationally cheap selection rule among previously analyzed rules (a), (b) or (c). For calculating the iterate change |δxi|, one needs to obtain roots for n equations. Likewise, the function decrease |∆fi| requires even more work. Remark: for an unbiased initializer, x(0) should be scaled by a constant ↵such that ↵= arg min a≥0 kA −(ax(0))(ax(0))T kF = s (x(0))T Ax(0) kx(0)k4 Algorithm 2 Symmetric greedy coordinate descent (SGCD) 1: Input: Symmetric matrix A 2 Rn⇥n, number of selected coordinate, k, and number of iterations, L. 2: Initialize x(0) 2 Rn and set z(0) = Ax(0). Set coordinate selecting criterion c(0) = x(0) − z(0) kx(0)k2 . 3: for l = 0 to L −1 do 4: Let ⌦(l) be a set containing k coordinates of c(l) with the largest magnitude. Execute the following updates: x(l+1) j = ( arg min↵f ⇣ x(l) + (↵−x(l) j )ej ⌘ , if j 2 ⌦(l), x(l) j , if j /2 ⌦(l). z(l+1) = z(l) + A(x(l+1) ⌦(l) −x(l) ⌦(l)) c(l+1) = x(l+1) − z(l+1) kx(l+1)k2 5: Output: vector x(L) 4 Convergence Analysis In the previous section, we propose coordinate-wise power method (CPM) and symmetric greedy coordinate descent (SGCD) on a non-convex function for computing the dominant eigenvector. However, it remains an open problem to prove convergence of coordinate descent methods for general non-convex functions. In this section, we show that both CPM and SGCD converge to the dominant eigenvector under some assumptions. 4.1 Convergence of Coordinate-wise Power Method Consider a positive semidefinite matrix A, and let v1 be its leading eigenvector. For any sequence (x(0), x(1), · · · ) generated by Algorithm 1, let ✓(l) to be the angle between vector x(l) and v1, and φ(l)(k) def = min|⌦|=k qP i/2⌦(c(l) i )2/kc(l)k2 = kg(l)k/kc(l)k. The following lemma illustrates convergence of the tangent of ✓(l) . Lemma 4.1. Suppose k is large enough such that φ(l)(k) < λ1 −λ2 (1 + tan ✓(l))λ1 . (8) Then tan ✓(l+1)  tan ✓(l)(λ2 λ1 + φ(l)(k)) cos ✓(l) < tan ✓(l) (9) With the aid of Lemma 4.1, we show the following iteration complexity: Theorem 4.2. For any sequence (x(0), x(1), · · · ) generated by Algorithm 1 with k satisfying φ(l)(k) < λ1−λ2 2λ1(1+tan ✓(l)), if x(0) is not orthogonal to v1, then after T = O( λ1 λ1−λ2 log( tan ✓(0) " )) iterations we have tan ✓(T ) ". The iteration complexity shown is the same as the power method, but since it requires less operations (O(knnz(A)/n) instead of O(nnz(A)) per iteration, we have Corollary 4.2.1. If the requirements in Theorem 4.2 apply and additionally k satisfies: k < n log((λ1 + λ2)/(2λ1))/ log(λ2/λ1), (10) CPM has a better convergence rate than PM in terms of the number of equivalent passes over the coordinates. 5 The RHS of (10) ranges from 0.06n to 0.5n when λ2 λ1 goes from 10−5 to 1 −10−5. Meanwhile, experiments show that the performance of our algorithms isn’t too sensitive to the choice of k. Figure 6 in Appendix A.6 illustrates that a sufficiently large range of k guarantees good performances. Thus we use a prescribed k = n 20 throughout our experiments in this paper, which saves the burden of tuning parameters and is a theoretically and experimentally favorable choice. Part of the proof is inspired by the noisy power method [3] in that we consider the unchanged part g as noise. For the sake of a neat proof we require our target matrix to be positive semidefinite, although experimentally a generalization to regular matrices is also valid for our algorithm. Details can be found in Appendix A.1 and A.3. 4.2 Local Convergence for Optimization on kA −xxT k2 F As the objective in Problem (5) is non-convex, it is hard to show global convergence. Clearly, with exact coordinate descent, Algorithm 2 will converge to some stationary point. In the following, we show that Algorithm 2 converges to the global minimum with a starting point sufficiently close to it. Theorem 4.3. (Local Linear Convergence) For any sequence of iterates (x(0), x(1), · · · ) generated by Algorithm 2, assume the starting point x(0) is in a ball centered by pλ1v1 with radius r = O( λ1−λ2 pλ1 ), or formally, x(0) 2 Br(pλ1v1), then (x0, x1, · · · ) converges to the optima linearly. Specifically, when k = 1, then after T = 14λ1−2λ2+4 maxi |aii| µ log f(x(0))−f ⇤ " iterations, we have f(x(T )) −f ⇤", where f ⇤= f(pλ1v1) is the global minimum of the objective function f, and µ = infx,y2Br(pλ1v1) krf(x)−rf(y)k1 kx−yk1 2 [ 3(λ1−λ2) n , 3(λ1 −λ2)]. We prove this by showing that the objective (5) is strongly convex and coordinate-wise Lipschitz continuous in a neighborhood of the optimum. The proof is given in Appendix A.4. Remark: For real-life graphs, the diagonal values aii = 0, and the coefficient in the iteration complexity could be simplified as 14λ1−2λ2 µ when k = 1. 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 λ2/λ1 10 4 10 5 10 6 10 7 flops/n CPM SGCD PM Lanczos VRPCA (a) Convergence flops vs λ2 λ1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 λ2/λ1 10 0 10 1 10 2 time (sec) CPM SGCD PM Lanczos VRPCA (b) Convergence time vs λ2 λ1 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000 n 10 -1 10 0 10 1 10 2 time (sec) CPM SGCD PM Lanczos VRPCA (c) Convergence time vs dimension Figure 2: Matrix properties affecting performance. Figure 2(a), 2(b) show the performance of five methods with λ2 λ1 ranging from 0.01 to 0.99 and fixed matrix size n = 5000. In Figure 2(a) the measurement is FLOPs while in Figure 2(b) Y-axis is CPU time. Figure 2(c) shows how the convergence time varies with the dimension when fixing λ2 λ1 = 2/3. In all figures Y-axis is in log scale for better observation. Results are averaged over from 20 runs. 5 Experiments In this section, we compared our algorithms with PM, Lanczos method [14], and VRPCA [16] on dense as well as sparse dataset. All the experiments were executed on Intel(R) Xeon(R) E5430 machine with 16G RAM and Linux OS. We implement all the five algorithms in C++ with Eigen library. 5.1 Comparison on Dense and Simulated Dataset We compare PM with our CPM and SGCD methods to show how coordinate-wise mechanism improves the original method. Further, we compared with a state-of-the-art algorithm Lanczos method. Besides, we also include a recent proposed stochastic SVD algorithm, VRPCA, that enjoys exponential convergence rate and shows similar insight in viewing the data in a separable way. With dense and synthetic matrices, we are able to test the condition that our methods are preferable, and how the properties of the matrix, like λ2/λ1 or the dimension, affect the performance. For each algorithm, we start from the same random vector, and set stopping condition to be cos ✓≥1 −✏, ✏= 10−6, where ✓is the angle between the current iterate and the dominant eigenvector. 6 First we compare the performances with number of FLOPs (Floating Point Operations), which could better illustrate how greediness affects the algorithm’s efficiency. From Figure 2(a) we can see our method shows much better performance than PM, especially when λ2/λ1 ! 1, where CPM and SGCD respectively achieve more than 2 and 3 times faster than PM. Figure 2(b) shows running time using five methods under different eigenvalue ratios λ2/λ1. We can see that only in some extreme cases when PM converges in less than 0.1 second, PM is comparable to our methods. In Figure 2(c) the testing factor is the dimension, which shows the performance is independent of the size of n. Meanwhile, in most cases, SGCD is better than Lanczos method. And although VRPCA has better convergence rate, it requires at least 10n2 operations for one data pass. Therefore in real applications, it is not even comparable to PM. 5.2 Comparison on Sparse and Real Dataset Table 1: Six datasets and the performance of three methods on them. Dataset n nnz(A) nnz/n λ2 λ1 Time (sec) PM CPM SGCD Lanczos VRPCA com-Orkut 3.07M 234M 76.3 0.71 109.6 31.5 19.3 63.6 189.7 soc-LiveJournal 4.85M 86M 17.8 0.78 58.5 17.9 13.7 25.8 88.1 soc-Pokec 1.63M 44M 27.3 0.95 118 26.5 5.2 14.2 596.2 web-Stanford 282K 3.99M 14.1 0.95 8.15 1.05 0.54 0.69 7.55 ego-Gplus 108K 30.5M 283 0.51 0.99 0.57 0.61 1.01 5.06 ego-Twitter 81.3K 2.68M 33 0.65 0.31 0.15 0.11 0.19 0.98 To test the scalability of our methods, we further test and compare our methods on large and sparse datasets. We use the following real datasets: 1) com-Orkut: Orkut online social network 2) soc-LiveJournal: On-line community for maintaining journals, individual and group blogs 3) soc-Pokec: Pokec, most popular on-line social network in Slovakia 4) web-Stanford: Pages from Stanford University (stanford.edu) and hyperlinks between them 5) ego-Gplus (Google+): Social circles from Google+ 6) ego-Twitter: Social circles from Twitter The statistics of the datasets are summarized in Table 1, which includes the essential properties of the datasets that affect the performances and the average CPU time for reaching cos ✓x,v1 ≥1 −10−6. Figure 3 shows tan ✓x,v1 against the CPU time for the four methods with multiple datasets. From the statistics in Table 1 we can see that in all the cases, either CPM or SGCD performs the best. CPM is roughly 2-8 times faster than PM, while SGCD reaches up to 23 times and 3 times faster than PM and Lanczos method respectively. Our methods show their privilege in the soc-Pokec(3(c)) and web-Stanford(3(d)), the most ill-conditioned cases (λ2/λ1 ⇡0.95), achieving 15 or 23 times of speedup on PM with SGCD. Meanwhile, when the condition number of the datasets is not too small (see 3(a),3(b),3(e),3(f)), both CPM and SGCD outperform PM as well as Lanczos method. And time (sec) 0 20 40 60 80 100 120 140 160 tanθx,v1 10 -3 10 -2 10 -1 10 0 10 1 CPM SGCD PM Lanczos VRPCA (a) Performance on com-Orkut time (sec) 0 10 20 30 40 50 60 70 tanθx,v1 10 -3 10 -2 10 -1 10 0 10 1 CPM SGCD PM Lanczos VRPCA (b) Performance on LiveJournal time (sec) 0 20 40 60 80 100 120 140 160 tanθx,v1 10 -3 10 -2 10 -1 10 0 10 1 CPM SGCD PM Lanczos VRPCA (c) Performance on soc-Pokec time (sec) 0 1 2 3 4 5 6 7 8 9 tanθx,v1 10 -3 10 -2 10 -1 10 0 10 1 CPM SGCD PM Lanczos VRPCA (d) Performance on web-Stanford time (sec) 0 0.5 1 1.5 2 2.5 3 tanθx,v1 10 -3 10 -2 10 -1 10 0 10 1 CPM SGCD PM Lanczos VRPCA (e) Performance on Google+ time (sec) 0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 tanθx,v1 10 -3 10 -2 10 -1 10 0 10 1 CPM SGCD PM Lanczos VRPCA (f) Performance on ego-Twitter Figure 3: Time comparison for sparse dataset. X-axis shows the CPU time while Y-axis is log scaled tan ✓ between x and v1. The empirical performance shows all three methods have linear convergence. 7 similar to the reasoning in the dense case, although VRPCA requires less iterations for convergence, the overall CPU time is much longer than others in practice. In summary of performances on both dense and sparse datasets, SGCD is the fastest among others. 6 Other Application and Extensions 6.1 Comparison on Out-of-core Real Dataset 0 500 1000 1500 2000 2500 3000 3500 4000 4500 time (sec) 10 -5 10 -4 10 -3 10 -2 10 -1 10 0 10 1 10 2 tanθx,v1 CPM SGCD PM Figure 4: A pseudograph for time comparison of out-of-core dataset from Twitter. Each "staircase" illustrates the performance of one data pass. The flat part indicates the stage of loading data, while the downward part shows the phase of processing data. As we only updated auxiliary vectors instead of the iterate every time we load part of the matrix, we could not test performances until a whole data pass. Therefore for the sake of clear observation, we group together the loading phase and the processing phase in each data pass. An important application for coordinate-wise power method is the case when data can not fit into memory. Existing methods can’t be easily applied to out-of-core dataset. Most existing methods don’t indicate how we can update part of the coordinates multiple times and fully reuse part of the matrix corresponding to those active coordinates. Therefore the data loading and data processing time are highly unbalanced. A naive way of using PM would be repetitively loading part of the matrix from the disk and calculating that part of matrix-vector multiplication. But from Figure 4 we can see reading from the disk costs much more time than the process of computation, therefore we will waste a lot of time if we cannot fully use the data before dumping it. For CPM, as we showed in Theorem 4.1 that updating only k coordinates of iterate x may still enhance the target direction, we could do matrix vector multiplication multiple times after one single loading. As with SGCD, optimization on part of x for several times will also decrease the function value. We did experiments on the dataset from Twitter [10] using out-of-core version of the three algorithms shown in Algorithm 3 in Appendix A.7. The data, which contains 41.7 million user profiles and 1.47 billion social relations, is originally 25.6 GB and then separated into 5 files. In Figure 4, we can see that after data pass, our methods can already reach rather high precision, which compresses hours of processing time to 8 minutes. 6.2 Extension to other linear algebraic methods With the interpretation in optimization, we could apply a coordinate-wise mechanism to PM and get good performance. Meanwhile, for some other iterative methods in linear algebra, if the connection to optimization is valid, or if the update is separable for each coordinate, the coordinate-wise mechanism may also be applicable, like Jacobi method. For diagonal dominant matrices, Jacobi iteration [15] is a classical method for solving linear system Ax = b with linear convergence rate. The iteration procedure is: Initialize: A ! D + R, where D =Diag(A), and R = A −D. Iterations: x+ D−1(b −Rx). This method is similar to the vanilla power method, which includes a matrix vector multiplication −Rx with an extra translation b and a normalization step D−1. Therefore, a potential similar realization of greedy coordinate-wise mechanism is also applicable here. See Appendix A.8 for more experiments and analyses, where we also specify its relation to Gauss-Seidel iteration [15]. 7 Conclusion In summary, we propose a new coordinate-wise power method and greedy coordinate descent method for computing the most dominant eigenvector of a matrix. This problem is critical to many applications in machine learning. Our methods have convergence guarantees and achieve up to 23 times of speedup on both real and synthetic data, as compared to the vanilla power method. Acknowledgements This research was supported by NSF grants CCF-1320746, IIS-1546452 and CCF-1564000. 8 References [1] Inderjit S Dhillon, Pradeep K Ravikumar, and Ambuj Tewari. Nearest neighbor based greedy coordinate descent. In Advances in Neural Information Processing Systems, pages 2160–2168, 2011. [2] Nathan Halko, Per-Gunnar Martinsson, and Joel A Tropp. Finding structure with randomness: Probabilistic algorithms for constructing approximate matrix decompositions. SIAM review, 53(2):217–288, 2011. [3] Moritz Hardt and Eric Price. The noisy power method: A meta algorithm with applications. In Advances in Neural Information Processing Systems, pages 2861–2869, 2014. [4] Moritz Hardt and Aaron Roth. Beyond worst-case analysis in private singular vector computation. In Proceedings of the forty-fifth annual ACM symposium on Theory of computing, pages 331–340. ACM, 2013. [5] Charles AR Hoare. Algorithm 65: find. Communications of the ACM, 4(7):321–322, 1961. [6] Cho-Jui Hsieh and Inderjit S Dhillon. Fast coordinate descent methods with variable selection for non-negative matrix factorization. In Proceedings of the 17th ACM SIGKDD international conference on Knowledge discovery and data mining, pages 1064–1072. ACM, 2011. [7] Ilse Ipsen and Rebecca M Wills. Analysis and computation of google’s pagerank. In 7th IMACS international symposium on iterative methods in scientific computing, Fields Institute, Toronto, Canada, volume 5, 2005. [8] Prateek Jain, Praneeth Netrapalli, and Sujay Sanghavi. Low-rank matrix completion using alternating minimization. In Proceedings of the forty-fifth annual ACM symposium on Theory of computing, pages 665–674. ACM, 2013. [9] Michel Journée, Yurii Nesterov, Peter Richtárik, and Rodolphe Sepulchre. Generalized power method for sparse principal component analysis. The Journal of Machine Learning Research, 11:517–553, 2010. [10] Haewoon Kwak, Changhyun Lee, Hosung Park, and Sue Moon. What is Twitter, a social network or a news media? Proceedings of the 19th international conference on World wide web, pages 591–600, 2010. [11] Deanna Needell, Rachel Ward, and Nati Srebro. Stochastic gradient descent, weighted sampling, and the randomized Kaczmarz algorithm. In Advances in Neural Information Processing Systems, pages 1017–1025, 2014. [12] Yu Nesterov. Efficiency of coordinate descent methods on huge-scale optimization problems. SIAM Journal on Optimization, 22(2):341–362, 2012. [13] Julie Nutini, Mark Schmidt, Issam H Laradji, Michael Friedlander, and Hoyt Koepke. Coordinate descent converges faster with the Gauss-Southwell rule than random selection. In Proceedings of the 32nd International Conference on Machine Learning (ICML-15), pages 1632–1641, 2015. [14] Beresford N Parlett. The Symmetric Eigenvalue Problem, volume 20. SIAM, 1998. [15] Yousef Saad. Iterative methods for sparse linear systems. SIAM, 2003. [16] Ohad Shamir. A stochastic PCA and SVD algorithm with an exponential convergence rate. In Proc. of the 32st Int. Conf. Machine Learning (ICML 2015), pages 144–152, 2015. [17] Si Si, Donghyuk Shin, Inderjit S Dhillon, and Beresford N Parlett. Multi-scale spectral decomposition of massive graphs. In Advances in Neural Information Processing Systems, pages 2798–2806, 2014. [18] Ulrike Von Luxburg. A tutorial on spectral clustering. Statistics and computing, 17(4):395–416, 2007. [19] Xiao-Tong Yuan and Tong Zhang. Truncated power method for sparse eigenvalue problems. The Journal of Machine Learning Research, 14(1):899–925, 2013. 9
2016
319
6,238
Finite-Dimensional BFRY Priors and Variational Bayesian Inference for Power Law Models Juho Lee POSTECH, Korea stonecold@postech.ac.kr Lancelot F. James HKUST, Hong Kong lancelot@ust.hk Seungjin Choi POSTECH, Korea seungjin@postech.ac.kr Abstract Bayesian nonparametric methods based on the Dirichlet Process (DP), gamma process and beta process, have proven effective in capturing aspects of various datasets arising in machine learning. However, it is now recognized that such processes have their limitations in terms of the ability to capture power law behavior. As such there is now considerable interest in models based on the Stable Processs (SP), Generalized Gamma process (GGP) and Stable-Beta Process (SBP). These models present new challenges in terms of practical statistical implementation. In analogy to tractable processes such as the finite-dimensional Dirichlet process, we describe a class of random processes, we call iid finite-dimensional BFRY processes, that enables one to begin to develop efficient posterior inference algorithms such as variational Bayes that readily scale to massive datasets. For illustrative purposes, we describe a simple variational Bayes algorithm for normalized SP mixture models, and demonstrate its usefulness with experiments on synthetic and real-world datasets. 1 Introduction Bayesian non-parametric ideas have played a major role in various intricate applications in statistics and machine learning. The Dirichlet process (DP) [1], due to its remarkable properties and relative tractability, has been the primary choice for many applications. It has also inspired the development of variants such as the HDP [2] which can be seen as an infinite-dimensional extension of latent Dirichlet allocation [3]. While there are many possible descriptions of a DP, a most intuitive one is its view as the limit, as K →∞, of a finite-dimensional Dirichlet process, PK(A) = PK k=1 DkI{Vk∈A}, where one can take (D1, . . . , DK) to be a K-variate symmetric Dirichlet vector on the (K −1)-simplex with parameters (θ/K, . . . , θ/K), for θ > 0 and {Vk} are an arbitrary i.i.d. sequence of variables over a space Ω, with law H(A) = Pr(Vk ∈A). Multiplying by a Gθ, an independent Gamma(θ, 1), variable, leads to a finite-dimensional Gamma process ΓK(A) = PK k=1 GkI{Vk∈A} := GθPK(A), where {Gk} are i.i.d. Gamma(θ/K, 1) variables, and one may set ΓK(Ω) = Gθ. It was shown that limK→∞(PK, ΓK) d= ( ˜F0,θ, ˜µ0,θ), where the limits correspond to a DP and a Gamma process (GP) [4]. While (PK, ΓK) are often viewed as approximations to the DP and Gamma process (GP), the works of [5, 6, 7] and references therein demonstrate the general utility of these models. The relationship between the GP and DP shows that the GP is a more flexible random process. This is borne out by its recognized applicability for a wider range of data structures. As such, it suffices to focus on ΓK as a tractable instance of what we refer to as an i.i.d. finite-dimensional process. In general, we say a random process, µK(·) := PK k=1 JkδVk, is an i.i.d. finite-dimensional process if [(i)] For each fixed K, (J1, . . . , JK) are i.i.d. random variables [(ii)] limK→∞µK d= ˜µ, where ˜µ is a completely random measure (CRM) [8]. In fact, from [9] (Theorem 14), it follows that if the limit exists ˜µ must be a CRM and therefore T := ˜µ(Ω) < ∞is a non-negative infinitely divisible random 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. variable. On the other hand, it is important to note that, {Jk} and TK = µK(Ω) = PK k=1 Jk need not be infinitely divisible. We also point out there are many constructions of µK that converge to the same ˜µ. According to [4], for every CRM ˜µ one can construct special cases of µK that always converge as follow: Let (C1, . . . , CK) denote a disjoint partition of Ωsuch that H(Ck) = 1/K for k = 1, . . . , K, then one can set Jk d= ˜µ(Ck), where the {Jk} are iid infinitely divisible variables and TK d= T. For reference we shall call such µK finite-dimensional Kingman processes or simply Kingman proceses. It is clear that the finite-dimensional gamma process satisfies such a construction with Jk = Gk and TK = Gθ. However, the nice tractable features of this special case, do not carry over in general. This is due to the fact that there are many cases where the distribution of ˜µ(Ck), is not tractable either in the sense of not being easily simulated or having a relatively simple density. The latter is of particular importance if one wants to consider developing inferential techniques for CRM models that scale readily to large or massive data sets. An example of this would be variational Bayes type methods, which would otherwise be well suited to the i.i.d. based models [10]. As such we consider a finer class of i.i.d. finite-dimensional processes as follows: We say µK is ideal if in addition to [(i)] and [(ii)] it satisfies [(iii)] the Jk are easily simulated [(iv)] the density of Jk has an explicit closed form suitable for application of techniques such as variational Bayes. We do not attempt to specify any formal structure on what we mean by ideal, except to note that one can easily recognize a choice of µK that is not ideal. Our focus in this paper is not to explore the generalities of finite-dimensional processes. Rather it is to identify specific ideal processes which are suitable for important cases where ˜µ is a Stable process (SP), or Generalized Gamma process (GGP). Furthermore by a simple transformation we can construct processes that have behaviour similar to a Stable-Beta process (SBP). The SP, GGP, SBP, and processes constructed from them, are now regarded as important alternatives to the DP, GP and beta process (BP), as they, unlike the (DP, GP, BP), are better able to capture power law behavior inherent in many types of datasets [11, 12, 13, 14, 15]. Unfortunately Kingman processes based on SP, GGP or SBP are clearly not ideal. Indeed, if one considers for 0 < α < 1, T = Sα a positive stable random variable, with density fα, then the corresponding stable process ˜µα,0, is such that Jk d= µα,0(Ck) d= K−1/αSα. While it is fairly easy to sample Sα and hence each Jk, it is well-known that the density fα does not have generally a tractable form. Things become worse in the GGP setting as the relevant density is formed by exponentially tilting the density fα. Finally it is neither clear from the literature how to sample T for SBP, and much less have a simple form for its corresponding density. Here we shall construct ideal processes based on various manipulations of a class of µK we call finite-dimensional BFRY [16] processes. We note that BFRY random variables appear in machine learning contexts in recent work [17], albeit in a very different role. Based on finite-dimensional BFRY processes, we provide simple variational Bayes algorithms for mixture models based on normalized SP and GGP. We also derive collapsed variational Bayes algorithms where the jumps are marginalized out. We demonstrate the effectiveness of our approach on both synthetic and real-world datasets. Our intent here is to demonstrate how these processes can be used within the context of variational inference. This in turn hopefully helps to elucidate how to implement such procedures, or other inference techniques that benefit from explicit densities, such as hybrid Monte Carlo [18] or stochastic gradient MCMC algorithms [19]. 2 Background 2.1 Completely random measure and Laplace functionals Let (Ω, F) be a measurable space, A random measure µ on Ωis completely random [8] if for any disjoint A, B ∈F, µ(A) and µ(B) are independent. It is known that any CRM can be written as the sum of a deterministic measure, a measure with fixed atoms, and a random measure represented as a linear functional of the Poisson process [8]. In this paper, we focus on CRMs with only the third component. Let Π be a Poisson process on R+ × Ωwith mean intensity decomposed as ν(ds, dω) = ρ(ds)H(dω). A realization of Π and corresponding CRM is written as Π = Π(R+,Ω) X k=1 δ(sk,ωk), µ = Z ∞ 0 sΠ(ds, dω) = Π(R+,Ω) X k=1 skδωk. (1) 2 We refer to ρ as the Lévy measure of µ and H as the base measure, and write µ ∼CRM(ρ, H). Examples of CRMs include the gamma process GP(θ, H) with Lévy measure ρ(ds) = θs−1e−sds or the beta process BP(c, θ, H) with Lévy measure ρ(du) = θcu−1(1 −u)c−1I{0≤u≤1}du. Stable, generalized gamma, and stable beta are also CRMs, and we will discuss them later. A CRM is identified by its Laplace functional, just as a random variable is identified by its characteristic function [20]. For a random measure µ and a measurable function f, the Laplace functional Lµ(f) is defined as Lµ(f) := E[e−µ(f)], µ(f) := Z Θ f(ω)µ(dω). (2) When µ ∼CRM(ρ, H), the Laplace functional can be computed using the following theorem. Theorem 1. (Lévy-Khintchine Formula [21]) For µ ∼CRM(ρ, H) and measurable f on Ω, Lµ(f) = exp  − Z Ω Z ∞ 0 (1 −e−sf(ω))ρ(ds)H(dω)  . (3) 2.2 Stable and related processes A Stable Process SP(θ, α, H) is a CRM with Lévy measure ρ(ds) = θ Γ(1 −α)s−α−1ds, (4) and a Generalized Gamma Process GGP(θ, α, τ, H) is a CRM with Lévy measure ρ(ds) = θ Γ(1 −α)s−α−1e−τsds, (5) where θ > 0, 0 < α < 1, and τ > 0. GGP is general in the sense that we can get many other processes from it. For example, by letting α →0 we get GP, and by setting τ = 0 we get SP. Furthermore, while it is well-known that the Pitman-Yor process (see [22] and [23]) can be derived from SP, there is also a construction based on GGP as follows. In particular as a consequence of ([23], Proposition 21), if we randomize θ = Gamma(θ′/α, 1) in SP and normalize the jumps, then we get the Pitman-Yor process PYP(θ′, α) for θ′ > 0. The jumps of SP and GGP are known to be heavy-tailed, and this results in power-law behaviour of data drawn from models having those processes as priors. The stable beta process SBP(θ, α, c, H) is a CRM with Lévy measure ρ(du) = θΓ(1 + c) Γ(1 −α)Γ(c + α)u−α−1(1 −u)c+α−1I{0≤u≤1}du, (6) where θ > 0, 0 < α < 1, and c > −α. SBP can be viewed as a heavy-tailed extension of BP, and the special case of c = 0 can be obtained by applying the transformation u = s/(s + 1) in SP. 2.3 BFRY distributions The BFRY distribution with parameter 0 < α < 1, written as BFRY(α), is a random variable with density gα(s) = α Γ(1 −α)s−α−1(1 −e−s). (7) We can simulate S ∼BFRY(α) with S d= G/B, where G ∼Gamma(1−α, 1) and B ∼Beta(α, 1). One can easily verify this by computing the density of the ratio distribution. The name BFRY was coined in [16] after the work of Bertoin, Fujita, Roynette, and Yor [24] who obtained explicit descriptions of the infinitely divisible random variable and subordinator corresponding to the density. However, the density arises much earlier, and can be found in a variety of contexts, for instance in [23] (Proposition 12, Corollary 13 and see also Eq.(124)) and [25]. See 3 [17] for the use of BFRY distributions to induce the closed form Indian buffet process type generative processes that have a type III power law behaviour. We also explain some variations of BFRY distributions needed for the construction of finitedimensional BFRY processes for SP and GGP. First, we can scale the BFRY random variables by some scale c > 0. In that case, we write S ∼BFRY(c, α), and the density is given as gc,α(s) = c Γ(1 −α)s−α−1(1 −e−(α/c)1/αs). (8) We can easily sample S ∼BFRY(c, α) as S d= (α/c)−1/αT where T ∼BFRY(α). We can also exponentially tilt the scaled BFRY random variable, with a parameter τ > 0. For that we write S ∼BFRY(c, τ, α), and the density is given as gc,τ,α(s) = αs−α−1e−τs(1 −e−(α/c)1/αs) Γ(1 −α){(τ + (α/c)1/α)α −τ α}. (9) We can simulate S ∼BFRY(c, τ, α) as S d= GT where G ∼Gamma(1 −α, 1) and T is a random variable with density, h(t) = αt−α−1 (τ + (α/c)1/α)α −τ α I{(τ+(α/c)1/α)−1≤t≤τ −1}, (10) which can easily be sampled using inverse transform sampling. 3 Main Contributions 3.1 A Motivating example Before we jump into our method, we first revisit an example of ideal finite-dimensional processes. Inspired by constructions of DP and GP, the Indian buffet process (IBP, [26]) was developed as a model for feature selection, by considering the limit K →∞of an M × K binary matrix whose entries {Zm,k} are conditionally independent Bern(Uk) variables where {Uk} are i.i.d. Beta(θ/K, 1) variables. Although not explicitly described as such, this leads to the notion of a finite-dimensional beta process µK = PK k=1 UkδVk. In [26], IBP was obtained as the limit of the marginal distribution where µK was marginalized out, and this result coupled with [27] show indirectly that limK→∞µK →µ ∼BP(θ, H). Here, we show another proof of this convergence, by inspecting the Laplace functional of µK. The Laplace functional of µK is computed as follows: LµK(f) = E[e−µK(f)] =  Z Ω Z 1 0 θ K u θ K −1e−uf(ω)duH(dω) K =  1 −1 K Z Ω Z 1 0 θu θ K −1(1 −e−uf(ω))duH(dω) K . (11) Since uθ/K is bounded by 1, the bounded convergence theorem implies lim K→∞LµK(f) = exp  − Z Ω Z ∞ 0 (1 −e−uf(ω))θu−1I{0≤u≤1}duH(dω)  , (12) which exactly matches the Laplace functional of µ computed by Eq. (3). In contrast to the marginal likelihood arguments, in our proof, we illustrate the direct relationship between the random measures and suggest a blueprint that can be applied to other CRMs. Note that the finite-dimensional beta process is not a Kingman process, since the beta variables are not infinitely divisible and the total mass T is a Dickman variable. We can also apply our argument to the case of the finite-dimensional gamma process, the proof of which is given in our supplementary material. 3.2 Finite-dimensional BFRY processes Inspired by the finite-dimensional beta and gamma process examples, we propose finite-dimensional BFRY processes, which converge to SP, GGP, and SBP as K →∞. 4 Theorem 2. (Finite-dimensional BFRY processes) (i) Let µ ∼SP(θ, α, H). Construct µK as follows: J1, . . . , JK i.i.d. ∼BFRY(θ/K, α), V1, . . . , VK i.i.d. ∼H, µK = K X k=1 JkδVk. (13) (ii) Let µ ∼GGP(θ, α, τ, H). Construct µK as follows: J1, . . . , JK i.i.d. ∼BFRY(θ/K, τ, α), V1, . . . , VK i.i.d. ∼H, µK = K X k=1 JkδVk. (14) (iii) Let µ ∼SBP(θ, α, 0, H). Construct µK as follows: S1, . . . , SK i.i.d. ∼BFRY(θ/K, α), Jk = Sk Sk+1 for k = 1, . . . , K, V1, . . . , VK i.i.d. ∼H, µK = K X k=1 JkδVk. (15) For all three cases, limK→∞Lf(µK) = Lf(µ) for an arbitrary measurable f. Proof. We first provide a proof for SP case (i), and the proof for GGP (ii) is almost identical. The Laplace functional of µK is written as LµK(f) =  Z Ω Z ∞ 0 e−sf(ω) θ KΓ(1 −α)s−α−1(1 −e−(αK/θ)1/αs)dsH(dω) K =  1 −1 K Z Ω Z ∞ 0 θ Γ(1 −α)(1 −e−sf(ω))s−α−1(1 −e−(αK/θ)1/αs)dsH(dω) K Since 1 −e−(αK/θ)s is bounded by 1, the bounded convergence theorem implies, lim K→∞LµK(f) = exp  − Z Ω Z ∞ 0 (1 −e−sf(ω)) θ Γ(1 −α)s−α−1dsH(dω)  , which exactly matches the Laplace functional of SP. The proof of (iii) is trivial from (i) and the relationship between SP and SBP. Corollary 1. Let τ = 1 and α →0 in (14). Then µK will converge to µ ∼GP(θ, H). Proof. The result is trivial by letting α →0 in Lf(µK). 1 2 3 4 5 6 atom indices (sorted) -6 -4 -2 0 log (jumps) alpha=0.8 alpha=0.4 alpha=0.2 Figure 1: Log of average jump sizes of NSPs Finite-dimensional BFRY processes are certainly ideal processes, since we can easily sample the jumps {Jk}, and we have explicit closed form densities written as (8) and (9). Hence, based on those processes, we can develop efficient inference algorithms such as variational Bayes for power-law models related to SP, GGP, and SBP that require explicit densities of jumps. Figure 1 illustrates the log of average jump sizes of 100 normalized SPs drawn using finite-dimensional BFRY processes, with θ = 1, K = 1000, and varying α. As expected, the jumps generated with bigger α are more heavy-tailed. 3.3 Finite-dimensional normalized random measure mixture models A normalized random measure (NRM) is obtained by normalizing a CRM by its total mass. A NRM mixture model (NRMM) is then defined as a mixture model with NRM prior, and its generative process is written as follows: µ ∼CRM(ρ, H), φ1, . . . φN i.i.d. ∼µ/µ(Ω), Xn|φn ∼L(φn), (16) where L is a likelihood distribution. One can easily do posterior inferences by marginalizing out µ, with an auxiliary variable. Once µ is marginalized out we can develop a Gibbs sampler [28]. However, this scales poorly as mentioned earlier. On the other hand, one may replace µ with µK, yielding the finite-dimensional NRMM (FNRMM), for which efficient variational Bayes can be developed provided that the finite-dimensional process is ideal. 5 3.4 Variational Bayes for finite-dimensional mixture models We first introduce a variational Bayes algorithm for finite-dimensional normalized SP mixture (FNSPM). The joint likelihood of the model is written as Pr({Xn ∈dxn, zn}, {Jk ∈dsk, Vk ∈dωk}) = s−N · K Y k=1 sNk k gθ/K,α(dsk) Y zn=k L(dxn|ωk)H(dωk), (17) where s· := P k sk, and zn is an indicator variable such that zn = k if φn = ωk. We found it convenient to introduce an auxiliary variable U ∼Gamma(N, s·) as in [20] to remove s−N · : Pr({Xn ∈dxn, zn}, {Jk ∈dsk, Vk ∈dωk}, U ∈du) ∝ uN−1du K Y k=1 sNk k e−uskgθ/K,α(sk)dsk Y zn=k L(dxn|ωk)H(dωk). (18) Now we introduce variational distributions for {z, s, ω, u} and optimize the Evidence Lower BOund (ELBO) with respect to the parameters of the variational distributions. The posterior statistics can be simulated using the optimized variational distributions. We can also optimize the hyperparamters θ and α with ELBO. The detailed optimization procedure is described in the supplementary material. 3.5 Collapsed Gibbs sampler for finite-dimensional mixture models As with the NRMM, we can also marginalize out the jumps {Jk} to get the collapsed model. Marginalizing out s in (18) gives Pr({Xn ∈dxn, zn}, {Vk ∈dωk}, U ∈du) ∝uN−1du K Y k=1 θ(1 −ξNk−α) uNk−α Γ(Nk −α) Γ(1 −α) I{Nk>0} × θuα α (ξ−α −1) I{Nk=0} Y zn=k L(dxn|ωk)H(dωk), (19) where ξ := u u+(αK/θ)1/α . Based on this, we can derive the collapsed Gibbs sampler for FNSPM, and the detailed equations are in the supplementary material. 3.6 Collapsed variational Bayes for finite-dimensional mixture models Based on the marginalized log likelihood (19), we can develop a collapsed variational Bayes algorithm for FNSPM, following the collapsed variational inference algorithm for DPM [29]. We introduce variational distributions for {u, z, ω}, and then the update equation for q(z) is computed using the conditional posterior p(z|x). The hyperparamters can also be optimized, the detailed procedures for which are explained in the supplementary material. 4 Experiments 4.1 Experiments on synthetic datasets 4.1.1 Data generation We generated 10 datasets from PYP mixture models. Each dataset was generated as follows. We first generated cluster labels for 2,000 data points from PYP(θ, α) with θ = 1 and α = 0.7. Given the cluster labels, we generated data points from Mult(M, ω), where the number of trials M was chosen uniformly from [1, 50] and ω was sampled from Dir(0.05 · 1200). We also generated another 10 datasets from CRP mixture models CRP(θ) with θ = 1, to see if FNSPM adapts to the change of the underlying random measure. For each dataset, we used 80% of data points for training and the remaining 20% for testing. 4.1.2 Algorithm settings and performance measure We compared six algorithms - Collapsed Gibbs (CG) for FDPM (CG/D), Variational Bayes (VB) for FDPM (VB/D), Collapsed Variational Bayes (CVB) for FDPM (CVB/D), CG for FNSPM (CG/S), 6 200 400 600 800 1000 dimension K 0 0.5 1 1.5 test log likel diff CGNSPM - CGFNSPM CGNSPM - VBFNSPM CGNSPM - CVBFNSPM 200 400 600 800 1000 dimension K 0 1 2 3 time / iter [sec] CGNSPM CGFNSPM VBFNSPM CVBFNSPM 200 400 600 800 1000 dimension K 0 20 40 iter to converge VBFNSPM CVBFNSPM Figure 2: (Left) comparison between the infinite-dimensional algorithm and the finite dimensional algorithms. (Middle) Average times per iteration of the infinite and the finite dimensional algorithms. (Right) Average number of iterations need to converge for variational algorithms. Table 1: Comparison between six finite-dimensional algorithms on synthetic PYP, synthetic CRP, AP corpus and NIPS corpus. Average test log-likelihood values and α estimates are shown with standard deviations. PYP CRP AP NIPS loglikel α loglikel α loglikel α loglikel α CG/D -33.2078 (1.5557) -25.4076 (1.9081) -157.2228 (0.0189) -352.8909 (0.0070) VB/D -33.4480 (1.6495) -25.4148 (1.9120) -157.2379 (0.0304) -352.9104 (0.0172) CVB/D -33.4278 (1.6525) -25.4150 (1.9115) -157.2302 (0.0280) -352.8692 (0.0321) CG/S -33.1039 (1.5676) 0.6940 (0.0235) -25.4079 (1.9077) 0.2867 (0.0762) -157.1920 (0.0036) 0.5261 (0.0032) -352.7487 (0.0037) 0.5857 (0.0032) VB/S -33.1861 (1.5873) 0.4640 (0.0085) -25.5076 (1.9122) 0.4770 (0.0041) -157.1391 (0.1154) 0.4748 (0.0434) -352.6078 (0.2599) 0.4945 (0.0324) CVB/S -33.2031 (1.5858) 0.7041 (0.0322) -25.4080 (1.9085) 0.2925 (0.0608) -157.2182 (0.0282) 0.5327 (0.0060) -352.7544 (0.0088) 0.5899 (0.0070) VB for FNSPM (VB/S) and CVB for FNSPM (CVB/S). All the algorithms were initialized with a single run of sequential collapsed Gibbs sampling starting from zero clusters, and afterwards ran for 100 iterations. The variational algorithms were terminated if the improvements of the ELBO were smaller than a threshold. The hyperparameters θ and α were initialized as θ = 1 and α = 0.5 for all algorithms. The performances were measured by average test log-likelihood, 1 Ntest Ntest X n=1 log p(xn|xtrain). (20) For CG, we computed the average of samples collected every 10 iterations. For VB and CVB, we computed the log-likelihood using the expectations of the variational distributions. 4.1.3 Effect of K on predictive performance and running time To see the effect of K on predictive performance, we first compared the finite-dimensional algorithms (CG for FNSPM, VB for FNSPM and CVB for FNSPM) to the infinite-dimensional algorithm (CG for NSPM [28]). We tested the four algorithms on 10 synthetic datasets generated from PYP mixtures, with K ∈{200, 400, 600, 800, 1000} for finite algorithms, and measured the difference of average test log likelihood compared to the infinite-dimensional algorithm. We also measured the average running time per iteration of the four algorithms, and the average number of iterations to converge of the variational algorithms. Figure 2 shows the results. As expected, the difference between finite-dimensional algorithms and the infinite-dimensional algorithm decreases as K grows. The finite-dimensional algorithms have O(NK) time complexity per iteration, and the infinitedimensional algorithm has O(N ˜K) where ˜K is the maximum number of clusters created during clustering. However, in practice, variational algorithms can be implemented with efficient matrix multiplications, and this makes them much faster than sampling algorithms. Moreover, as shown in Figure 2, variational algorithms usually converge in 50 iterations. 7 4.1.4 Comparing finite-dimensional algorithms on PYP and CRP datasets We compared six algorithms for finite mixture models (CG/D, VB/D, CVB/D, CG/S, VB/S and CVB/S) on PYP mixture datasets and CRP mixture datasets, with K = 1000. The results are summarized in Table 1. On PYP datasets, in general, FNSPM outperformed FDPM and CG outperformed VB and CVB. CG/S consistently outperformed CG/D, and the same relationship applied to VB/S and VB/D and CVB/S and CVB/D. Even though VB/S and CVB/S were variational algorithms, the performance gap between them and CG/S was not significant. Table 1 shows the estimated α values for CG/S, VB/S and CVB/S. CG/S and CVB/S seemed to recover the true value α = 0.7, but VB/S didn’t. We found that VB/S tends to control the other parameter θ while holding α near its initial value 0.5. On CRP datasets, all the algorithms showed similar performances except for VB/S, which was consistently worse than other algorithms. This is probably due to the bad estimates of α. 4.2 Experiments on real-world documents We compared the six algorithms on real-world document clustering task by clustering AP corpus 1 and NIPS corpus 2. We preprocessed the corpora using latent Dirichlet allocation (LDA) [3]. We ran LDA with 300 topics, and then gave each document a bag-of-words representation of topic assignments to those 300 topics. We assumed that those representations were generated from the multinomialDirichlet model, and clustered them using FDPM and FNSPM. We used 80% of documents for training and the remaining 20% for computing average test log-likelihood. We set K = 2, 000 and ran each algorithm for 200 iterations. We repeated this 10 times to measure the average performance.The results are summarized in Table 1. In general, the algorithms based on FNSPM showed better performance than those of FDPM based ones, implying that FNSPM based algorithms are well capturing the heavy-tailed cluster distributions of the corpora. VB/S performed the best, even though it sometimes converged to poor values. 5 Conclusion In this paper, we proposed finite-dimensional BFRY processes that converge to SP, GGP and SBP. The jumps of the finite-dimensional BFRY processes have nice closed-form densities, and this leads to the efficient posterior inference algorithms. With finite-dimensional BFRY processes, we developed variational Bayes and collapsed variational Bayes for finite-dimensional normalized SP mixture models, and demonstrated its performance both on synthetic and real-world datasets. As mentioned earlier, with finite dimensional BFRY processes one can develop variational Bayes or other posterior inference algorithms for a variety of models with SP, GGP and SBP priors. This fact, along with more theoretical properties of finite-dimensional processes, presents interesting avenues for future research. Acknowledgements: This work was supported by IITP (No. B0101-16-0307, Basic Software Research in Human-Level Lifelong Machine Learning (Machine Learning Center)) and by National Research Foundation (NRF) of Korea (NRF-2013R1A2A2A01067464), and supported in part by the grant RGC-HKUST 601712 of the HKSAR. References [1] T. S. Ferguson. A Bayesian analysis of some nonparametric problems. The Annals of Statistics, 1(2):209– 230, 1973. [2] Y. W. Teh, M. I. Jordan, M. J. Beal, and D. M. Blei. Hierarchical Dirichlet processes. Journal of the American Statistical Association, 101(476):1566–1581, 2006. [3] D. M. Blei, A. Ng, and M. I. Jordan. Latent Dirichlet allocation. Journal of Machine Learning Research, 3:993–1022, 2003. [4] J. F. C. Kingman. Random discrete distributions. Journal of the Royal Statistical Society. Series B (Methodological), 37(1):1–22, 1975. 1http://www.cs.princeton.edu/~blei/lda-c/ 2https://archive.ics.uci.edu/ml/datasets/Bag+of+Words 8 [5] H. Ishwaran and L. F. James. Computational methods for multiplicative intensity models using weighted gamma processes: proportional hazards, marked point processes, and panel count data. Journal of the American Statistical Association, 99:175–190, 2004. [6] H. Ishwaran, L. F. James, and J. Sun. Bayesian model selection in finite mixtures by marginal density decompositions. Journal of the American Statistical Association, 96:1316–1332, 2001. [7] H. Ishwaran and M. Zarepour. Dirichlet prior seives in finite normal mixtures. Statistica Sinica, 12(3):941– 963, 2002. [8] J. F. C. Kingman. Completely random measures. Pacific Journal of Mathematics, 21(1):59–78, 1967. [9] J. Pitman and N. M. Tran. Size-biased permutation of a finite sequence with independent and identically distributed terms. Bernoulli, 21(4):2484–2512, 2015. [10] D. M. Blei, A. Kucukelbir, and J. D. McAuliffe. Variational inference: A review for statisticians. 2016. arXiv:1601.00670. [11] C. Chen, N. Ding, and W. Buntine. Dependent hierarchical normalized random measures for dynamic topic modeling. ICML, 2012. [12] Y. W. Teh and D. Görür. Indian buffet processes with power-law behavior. NIPS, 2009. [13] F. Caron and E. B. Fox. Sparse graphs using exchangeable random measures. 2014. arXiv:1401.1137. [14] F. Caron. Bayesian nonparametric models for bipartite graphs. NIPS, 2012. [15] V. Veitch and D. M. Roy. The class of random graphs arising from exchangeable random measures. 2015. arXiv:1512.03099. [16] L. Devroye and L. F. James. On simulation and properties of the stable law. Statistical Methods and Applications, 23(3):307–343, 2014. [17] L. F. James, P. Orbanz, and Y. W. Teh. Scaled subordinators and generalizations of the Indian buffet process. 2015. arXiv:1510.07309. [18] S. Duane, A. D. Kennedy, B. J. Pendleton, and D. Roweth. Hybrid Monte Carlo. Physics Letters B, 195(2):216–222, 1987. [19] M. Welling and Y. W. Teh. Bayesian learning via stochastic gradient Langevin dynamics. ICML, 2011. [20] L. F. James. Bayesian Poisson process partition calculus with an application to Bayesian Lévy moving averages. The Annals of Statistics, 33(4):1771–1799, 2005. [21] E. Çinlar. Probability and stochastics. 2010. [22] H. Ishwaran and L. F. James. Gibbs sampling methods for stick-breaking priors. Journal of the American Statistical Association, 96(453):161–173, 2001. [23] J. Pitman and M. Yor. The two-parameter Poisson-Dirichlet distribution derived from a stable subordinator. The Annals of Probability, 25(2):855–900, 1997. [24] J. Bertoin, T. Fujita, B. Roynette, and M. Yor. On a particular class of self-decomposable random variables: the durations of Bessel excursions straddling independent exponential times. Probability and Mathematical Statistics, 26:315–366, 2006. [25] M. Winkel. Electronic foreign-exchange markets and passage events of independent subordinators. Journal of Applied Probability, 42(1):138–152, 2005. [26] T. L. Griffiths and Z. Ghahramani. Infinite latent feature models and the Indian buffet process. NIPS, 2006. [27] R. Thibaux and M. I. Jordan. Hierarchcial beta processes and the Indian buffet process. AISTATS, 2007. [28] S. Favaro and Y. W. Teh. MCMC for normalized random measure mixture models. Statistical Science, 28(3):335–359, 2013. [29] K. Kurihara, M. Welling, and Y. W. Teh. Collapsed variational dirichlet process mixture models. IJCAI, 2007. 9
2016
32
6,239
On Mixtures of Markov Chains Rishi Gupta∗ Stanford University Stanford, CA 94305 rishig@cs.stanford.edu Ravi Kumar Google Research Mountain View, CA 94043 ravi.k53@gmail.com Sergei Vassilvitskii Google Research New York, NY 10011 sergeiv@google.com Abstract We study the problem of reconstructing a mixture of Markov chains from the trajectories generated by random walks through the state space. Under mild nondegeneracy conditions, we show that we can uniquely reconstruct the underlying chains by only considering trajectories of length three, which represent triples of states. Our algorithm is spectral in nature, and is easy to implement. 1 Introduction Markov chains are a simple and incredibly rich tool for modeling, and act as a backbone in numerous applications—from Pagerank for web search to language modeling for machine translation. While the true nature of the underlying behavior is rarely Markovian [6], it is nevertheless often a good mathematical assumption. In this paper, we consider the case where we are given observations from a mixture of L Markov chains, each on the same n states, with n ≥2L. Each observation is a series of states, and is generated as follows: a Markov chain and starting state are selected from a distribution S, and then the selected Markov chain is followed for some number of steps. The goal is to recover S and the transition matrices of the L Markov chains from the observations. When all of the observations follow from a single Markov chain (namely, when L = 1), recovering the mixture parameters is easy. A simple calculation shows that the empirical starting distribution and the empirical transition probabilities form the maximum likelihood Markov chain. So we are largely interested in the case when L > 1. As a motivating example, consider the usage of a standard maps app on a phone. There are a number of different reasons one might use the app: to search for a nearby business, to get directions from one point to another, or just to orient oneself. However, the users of the app never specify an explicit intent, rather they swipe, type, zoom, etc., until they are satisfied. Each one of the latent intents can be modeled by a Markov chain on a small state space of actions. If the assignment of each session to an intent were explicit, recovering these Markov chains would simply reduce to several instances of the L = 1 case. Here we are interested in the unsupervised setting of finding the underlying chains when this assignment is unknown. This allows for a better understanding of usage patterns. For example: • Common uses for the app that the designers had not expected, or had not expected to be common. For instance, maybe a good fraction of users (or user sessions) simply use the app to check the traffic. • Whether different types of users use the app differently. For instance, experienced users might use the app differently than first time users, either due to having different goals, or due to accomplishing the same tasks more efficiently. • Undiscoverable flows, with users ignoring a simple, but hidden menu setting, and instead using a convoluted path to accomplish the same goal. ∗Part of this work was done while the author was visiting Google Research. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. The question of untangling mixture models has received a lot of attention in a variety of different situations, particularly in the case of learning mixtures of Gaussians, see for example the seminal work of [8], as well as later work by [5, 11, 15] and the references therein. This is, to the best of our knowledge, the first work that looks at unraveling mixtures of Markov chains. There are two immediate approaches to solving this problem. The first is to use the ExpectationMaximization (EM) algorithm [9]. The EM algorithm starts by guessing an initial set of parameters for the mixture, and then performs local improvements that increase the likelihood of the proposed solution. The EM algorithm is a useful benchmark and will converge to some local optimum, but it may be slow to get there [12], and has are no guarantees on the quality of the final solution. The second approach is to model the problem as a Hidden Markov Model (HMM), and employ the machinery for learning HMMs, particularly the recent tensor decomposition methods [2, 3, 10]. As in our case, this machinery relies on having more observed states than hidden states. Unfortunately, directly modeling a Markov chain mixture as an HMM (or as a mixture of HMMs, as in [13]) requires nL hidden states for n observed states. Given that, one could try adapting the tensor decomposition arguments from [3] to our problem, which is done in Section 4.3 of [14]. However, as the authors note, this requires accurate estimates for the distribution of trajectories (or trails) of length five, whereas our results only require estimates for the distribution of trails of length three. This is a large difference in the amount of data one might need to collect, as one would expect to need Θ(nt) samples to estimate the distribution of trails of length t. An entirely different approach is to assume a Dirichlet prior on the mixture, and model the problem as learning a mixture of Dirichlet distributions [14]. Besides requiring the Dirichlet prior, this method also requires very long trails. Finally, we would like to note a connection to the generic identifiability results for HMMs and various mixture models in [1]. Their results are existential rather than algorithmic, but dimension three also plays a central role. Our contributions. We propose and study the problem of reconstructing a mixture of Markov chains from a set of observations, or trajectories. Let a t-trail be a trajectory of length t: a starting state chosen according to S along with t −1 steps along the appropriate Markov chain. (i) We identify a weak non-degeneracy condition on mixtures of Markov chains and show that under that non-degeneracy condition, 3-trails are sufficient for recovering the underlying mixture parameters. We prove that for random instances, the non-degeneracy condition holds with probability 1. (ii) Under the non-degeneracy condition, we give an efficient algorithm for uniquely recovering the mixture parameters given the exact distribution of 3-trails. (iii) We show that our algorithm outperforms the most natural EM algorithm for the problem in some regimes, despite EM being orders of magnitude slower. Organization. In Section 2 we present the necessary background material that will be used in the rest of the paper. In Section 3 we state and motivate the non-degeneracy condition that is sufficient for unique reconstruction. Using this assumption, in Section 4 we present our four-step algorithm for reconstruction. In Section 5 we present our experimental results on synthetic and real data. In Section 6 we show that random instances are non-degenerate with probability 1. 2 Preliminaries Let [n] = {1, . . . , n} be a state space. We consider Markov chains defined on [n]. For a Markov chain given by its n × n transition matrix M, let M(i, j) denote the probability of moving from state i to state j. By definition, M is a stochastic matrix, M(i, j) ≥0 and P j M(i, j) = 1. (In general we use A(i, j) to denote the (i, j)th entry of a matrix A.) For a matrix A, let A denote its transpose. Every n × n matrix A of rank r admits a singular value decomposition (SVD) of the form A = UΣV where U and V are n × r orthogonal matrices and Σ is an r × r diagonal matrix with non-negative entries. For an L × n matrix B of full rank, its right pseudoinverse B−1 is an n × L matrix of full rank such that BB−1 = I; it is a standard fact that pseudoinverses exist and can be computed efficiently when n ≥L. We now formally define a mixture of Markov chains (M, S). Let L ≥1 be an integer. Let M = {M 1, . . . , M L} be L transition matrices, all defined on [n]. Let S = {s1, . . . , sL} be a 2 corresponding set of positive n-dimensional vectors of starting probabilities such that P ℓ,i sℓ i = 1. Given M and S, a t-trail is generated as follows: first pick the chain ℓand the starting state i with probability sℓ i, and then perform a random walk according to the transition matrix M ℓ, starting from i, for t −1 steps. Throughout, we use i, j, k to denote states in [n] and ℓto denote a particular chain. Let 1n be a column vector of n 1’s. Definition 1 (Reconstructing a Mixture of Markov Chains). Given a (large enough) set of trails generated by a mixture of Markov chains and an L > 1, find the parameters M and S of the mixture. Note that the number of parameters is O(n2 · L). In this paper, we focus on a seemingly restricted version of the reconstruction problem, where all of the given trails are of length three, i.e., every trail is of the form i →j →k for some three states i, j, k ∈[n]. Surprisingly, we show that 3-trails are sufficient for perfect reconstruction. By the definition of mixtures, the probability of generating a given 3-trail i →j →k is X ℓ sℓ i · M ℓ(i, j) · M ℓ(j, k), (1) which captures the stochastic process of choosing a particular chain ℓusing S and taking two steps in M ℓ. Since we only observe the trails, the choice of the chain ℓin the above process is latent. For each j ∈[n], let Oj be an n × n matrix such that Oj(i, k) equals the value in (1). It is easy to see that using O((n3 log n)/ϵ2) sample trails, every entry in Oj for every j is approximated to within an additive ±ϵ. For the rest of the paper, we assume we know each Oj(i, k) exactly, rather than an approximation of it from samples. We now give a simple decomposition of Oj in terms of the transition matrices in M and the starting probabilities in S. Let Pj be the L × n matrix whose (ℓ, i)th entry denotes the probability of using chain ℓ, starting in state i, and transitioning to state j, i.e., Pj(ℓ, i) = sℓ i · M ℓ(i, j). In a similar manner, let Qj be the L × n matrix whose (ℓ, k)th entry denotes the probability of starting in state j, and transitioning to state k under chain ℓ, i.e., Qj(ℓ, k) = sℓ j · M ℓ(j, k). Finally, let Sj = diag(s1 j, . . . , sL j ) be the L × L diagonal matrix of starting probabilities in state j. Then, Oj = Pj · S−1 j · Qj. (2) This decomposition will form the key to our analysis. 3 Conditions for unique reconstruction Before we delve into the details of the algorithm, we first identify a condition on the mixture (M, S) such that there is a unique solution to the reconstruction problem when we consider trails of length three. (To appreciate such a need, consider a mixture where two of the matrices M ℓand M ℓ′ in M are identical. Then for a fixed vector v, any sℓand sℓ′ with sℓ+ sℓ′ = v will give the same observations, regardless of the length of the trails.) To motivate the condition we require, consider again the sets of L × n matrices P = {P1, . . . , Pn} and Q = {Q1, . . . , Qn} as defined in (2). Together these matrices capture the n2L −1 parameters of the problem, namely, n −1 for each of the n rows of each of the L transition matrices M ℓ, and nL −1 parameters defining S. However, together P and Q have 2n2L entries, implying algebraic dependencies between them. Definition 2 (Shuffle pairs). Two ordered sets X = {X1, . . . , Xn} and Y = {Y1, . . . , Yn} of L × n matrices are shuffle pairs if the jth column of Xi is identical to the ith column of Yj for all i, j ∈[n]. Note that P and Q are shuffle pairs. We state an equivalent way of specifying this definition. Consider a 2nL×n2 matrix A(P, Q) that consists of a top and a bottom half. The top half is an nL×n2 block diagonal matrix with Pi as the ith block. The bottom half is a concatenation of n different nL × n block diagonal matrices; the ith block of the jth matrix is the jth column of −Qi. A representation of A is given in Figure 1. As intuition, note that in each column, the two blocks of L entries are the same up to negation. Let F be the L × 2nL matrix consisting of 2n L × L identity matrices in a row. It is straightforward to see that P and Q are shuffle pairs if and only if F · A(P, Q) = 0. Let the co-kernel of a matrix X be the vector space comprising the vectors v for which vX = 0. We have the following definition. 3 Figure 1: A(P, Q) for L = 2, n = 4. When P and Q are shuffle pairs, each column has two copies of the same L-dimensional vector (up to negation). M is well-distributed if there are no non-trivial vectors v for which v · A(P, Q) = 0. Definition 3 (Well-distributed). The set of matrices M is well-distributed if the co-kernel of A(P, Q) has rank L. Equivalently, M is well-distributed if the co-kernel of A(P, Q) is spanned by the rows of F. Section 4 shows how to uniquely recover a mixture from the 3-trail probabilities Oj when M is well-distributed and S has only non-zero entries. Section 6 shows that nearly all M are well-distributed, or more formally, that the set of non well-distributed M has (Lebesgue) measure 0. 4 Reconstruction algorithm We present an algorithm to recover a mixture from its induced distribution on 3-trails. We assume for the rest of the section that M is well-distributed (see Definition 3) and S has only non-zero entries, which also means Pj, Qj, and Oj have rank L for each j. At a high level, the algorithm begins by performing an SVD of each Oj, thus recovering both Pj and Qj, as in (2), up to unknown rotation and scaling. The key to undoing the rotation will be the fact that the sets of matrices P and Q are shuffle pairs, and hence have algebraic dependencies. More specifically, our algorithm consists of four high-level steps. We first list the steps and provide an informal overview; later we will describe each step in full detail. (i) Matrix decomposition: Using SVD, we compute a decomposition Oj = UjΣjVj and let P ′ j = Uj and Q′ j = ΣjVj. These are the initial guesses at (Pj, Qj). We prove in Lemma 4 that there exist L × L matrices Yj and Zj so that Pj = YjP ′ j and Qj = ZjQ′ j for each j ∈[n]. (ii) Co-kernel: Let P′ = {P ′ 1, . . . , P ′ n}, and Q′ = {Q′ 1, . . . , Q′ n}. We compute the co-kernel of matrix A(P′, Q′) as defined in Section 3, to obtain matrices Y ′ j and Z′ j. We prove that there is a single matrix R for which Yj = RY ′ j and Zj = RZ′ j for all j. (iii) Diagonalization: Let R′ be the matrix of eigenvectors of (Z′ 1Y ′ 1)−1(Z′ 2Y ′ 2). We prove that there is a permutation matrix Π and a diagonal matrix D such that R = DΠR′. (iv) Two-trail matching: Given Oj it is easy to compute the probability distribution of the mixture over 2-trails. We use these to solve for D, and using D, compute R, Yj, Pj, and Sj for each j. 4.1 Matrix decomposition From the definition, both P ′ j and Q′ j are L × n matrices of full rank. The following lemma states that the SVD of the product of two matrices A and B returns the original matrices up to a change of basis. 4 Lemma 4. Let A, B, C, D be L × n matrices of full rank, such that AB = CD. Then there is an L × L matrix X of full rank such that C = X−1A and D = XB. Proof. Note that A = ABB−1 = CDB−1 = CW for W = DB−1. Since A has full rank, W must as well. We then get CD = AB = CWB, and since C has full column rank, D = WB. Setting X = W completes the proof. Since Oj = Pj(S−1 j Qj) and Oj = P ′ jQ′ j, Lemma 4 implies that there exists an L × L matrix Xj of full rank such that Pj = X−1 j P ′ j and Qj = SjXjQ′ j. Let Yj = X−1 j , and let Zj = SjXj. Note that both Yj and Zj have full rank, for each j. Once we have Yj and Zj, we can easily compute both Pj and Sj, so we have reduced our problem to finding Yj and Zj. 4.2 Co-kernel Since (P, Q) is a shuffle pair, ((YjP ′ j)j∈[n], (ZjQ′ j)j∈[n]) is also a shuffle pair. We can write the latter fact as B(Y, Z) A(P ′, Q′) = 0, where B(Y, Z) is the L × 2nL matrix comprising 2n matrices concatenated together; first Yj for each j, and then Zj for each j. We know A(P ′, Q′) from the matrix decomposition step, and we are trying to find B(Y, Z). By well-distributedness, the co-kernel of A(P, Q) has rank L. Let D be the 2nL × 2nL block diagonal matrix with the diagonal entries (Y −1 1 , Y −1 2 , . . . , Y −1 n , Z−1 1 , Z−1 2 , . . . , Z−1 n ). Then A(P ′, Q′) = D A(P, Q). Since D has full rank, the co-kernel of A(P ′, Q′) has rank L as well. We compute an arbitrary basis of the co-kernel of A(P ′, Q′)),2 and write it as an L × 2nL matrix as an initial guess B(Y ′, Z′) for B(Y, Z). Since B(Y, Z) lies in the co-kernel of A(P ′, Q′), and has exactly L rows, there exists an L × L matrix R such that B(Y, Z) = R B(Y ′, Z′), or equivalently, such that Yj = RY ′ j and Zj = RZ′ j for every j. Since Yj and Zj have full rank, so does R. Now our problem is reduced to computing R. 4.3 Diagonalization Recall from the matrix decomposition step that there exist matrices Xj such that Yj = X−1 j and Zj = SjXj. Hence Z′ jY ′ j = (R−1Zj)(Yj R−1) = R−1SjR−1. It seems difficult to compute R directly from equations of the form R−1SjR−1, but we can multiply any two of them together to get, e.g., (Z′ 1Y ′ 1)−1(Z′ 2Y ′ 2) = RS−1 1 S2R−1. Since S−1 1 S2 is a diagonal matrix, we can diagonalize RS−1 1 S2R−1 as a step towards computing R. Let R′ be the matrix of eigenvectors of RS−1 1 S2R−1. Now, R is determined up to a scaling and ordering of the eigenvectors. In other words, there is a permutation matrix Π and diagonal matrix D such that R = DΠR′. 4.4 Two-trail matching First, Oj1n = PjS−1 j Qj1n = Pj1L for each j, since each row of S−1 j Qj is simply the set of transition probabilities out of a particular Markov chain and state. Another way to see it is that both Oj1n and Pj1L are vectors whose ith coordinate is the probability of the trail i →j. From the first three steps of the algorithm, we also have Pj = YjP ′ j = RY ′ j P ′ j = DΠR′Y ′ j P ′ j. Hence 1LDΠ = 1LP1(R′Y ′ 1P ′ 1)−1 = O11n(R′Y ′ 1P ′ 1)−1, where the inverse is a pseudoinverse. We arbitrarily fix Π, from which we can compute D, R, Yj, and finally Pj for each j. From the diagonalization step (Section 4.3), we can also compute Sj = R(Z′ jY ′ j )R for each j. Note that the algorithm implicitly includes a proof of uniqueness, up to a setting of Π. Different orderings of Π correspond to different orderings of M ℓin M. 2For instance, by taking the SVD of A(P ′, Q′), and looking at the singular vectors. 5 5 Experiments We have presented an algorithm for reconstructing a mixture of Markov chains from the observations, assuming the observation matrices are known exactly. In this section we demonstrate that the algorithm is efficient, and performs well even when we use empirical observations. In addition, we also compare its performance against the most natural EM algorithm for the reconstruction problem. Synthetic data. We begin by generating well distributed instances M and S. Let Dn be the uniform distribution over the n-dimensional unit simplex, namely, the uniform distribution over vectors in Rn whose coordinates are non-negative and sum to 1. For a specific n and L, we generate an instance (M, S) as follows. For each state i and Markov chain M ℓ, the set of transition probabilities leaving i is distributed as Dn. We draw each sℓfrom Dn as well, and then divide by L, so that the sum over all sℓ(i) is 1. In other words, each trail is equally likely to come from any of the L Markov chains. This restriction has little effect on our algorithm, but is needed to make EM tractable. For each instance, we generate T samples of 3-trails. The results that we report are the medians of 100 different runs. Metric for synthetic data. Our goal is exact recovery of the underlying instance M. Given two n × n matrices A and B, the error is the average total variation distance between the transition probabilities: error(A, B) = 1/(2n) · P i,j |A(i, j) −B(i, j)|. Given a pair of instances M = {M 1, . . . , M L} and N = {N 1, . . . , N L} on the same state space [n], the recovery error is the minimum average error over all matchings of chains in N to M. Let σ be a permutation on [L], then: recovery error(M, N) = min σ 1 L X ℓ error(M ℓ, N σ(ℓ)). Given all the pairwise errors error(M ℓ, N p), this minimum can be computed in time O(L3) by the Hungarian algorithm. Note that the recovery error ranges from 0 to 1. Real data. We use the last.fm 1K dataset3, which contains the list of songs listened by heavy users of Last.Fm. We use the top 25 artist genres4 as the states of the Markov chain. We consider the ten heaviest users in the data set, and for each user, consider the first 3001 state transitions that change their state. We break each sequence into 3000 3-trails. Each user naturally defines a Markov chain on the genres, and the goal is to recover these individual chains from the observed mixture of 3-trails. Metric for real data. Given a 3-trail from one of the users, our goal is to predict which user the 3-trail came from. Specifically, given a 3-trail t and a mixture of Markov chains (M, S), we assign t to the Markov chain most likely to have generated it. A recovered mixture (M, S) thereby partitions the observed 3-trails into L groups. The prediction error is the minimum over all matchings between groups and users of the fraction of trails that are matched to the wrong user. The prediction error ranges from 0 to 1 −1/L. Handling approximations. Because the algorithm operates on real data, rather than perfect observation matrices, we make two minor modifications to make it more robust. First, in the diagonalization step (Section 4.3), we sum (Z′ iYi)−1(Z′ i+1Yi+1)−1 over all i before diagonalizing to estimate R′, instead of just using i = 1. Second, due to noise, the matrices M that we recover at the end need not be stochastic. Following the work of [7] we normalize the values by first taking absolute values of all entries, and then normalizing so that each of the columns sums to 1. Baseline. We turn to EM as a practical baseline for this reconstruction problem. In our implementation, we continue running EM until the log likelihood changes by less than 10−7 in each iteration; this corresponds to roughly 200-1000 iterations. Although EM continues to improve its solution past this point, even at the 10−7 cutoff, it is already 10-50x slower than the algorithm we propose. 5.1 Recovery and prediction error 3http://mtg.upf.edu/static/datasets/last.fm/lastfm-dataset-1K.tar.gz 4http://static.echonest.com/Lastfm-ArtistTags2007.tar.gz 6 0.0 0.2 0.4 0.6 0.8 1.0 Number of Samples 1e9 0.00 0.01 0.02 0.03 0.04 0.05 0.06 0.07 Median Recovery Error Alg EM 4 5 6 7 8 9 10 L 0.00 0.05 0.10 0.15 0.20 0.25 Median Recovery Error Alg EM 100 EM 1000 4 5 6 7 8 9 10 L 0.0 0.2 0.4 0.6 0.8 1.0 Median Prediction Error Alg EM 1000 (a) (b) (c) Figure 3: (a) Performance of EM and our algorithm vs number of samples (b) Performance of EM and our algorithm vs L (synthetic data) (c) Performance of EM and our algorithm (real data) 5 10 15 20 25 30 n 0.00 0.05 0.10 0.15 0.20 Median Recovery Error l=3 l=5 l=7 l=9 Figure 2: Performance of the algorithm as a function of n and L for a fixed number of samples. For the synthetic data, we fix n = 6 and L = 3, and for each of the 100 instances generate a progressively larger set of samples. Recall that the number of unknown parameters grows as Θ(n2L), so even this relatively simple setting corresponds to over 100 unknown parameters. Figure 3(a) shows the median recovery error of both approaches. It is clear that the proposed method significantly outperforms the EM approach, routinely achieving errors of 10-90% lower. Furthermore, while we did not make significant attempts to speed up EM, it is already over 10x slower than our algorithm at n = 6 and L = 3, and becomes even slower as n and L grow. In Figure 3(b) we study the error as a function of L. Our approach is significantly faster, and easily outperforms EM at 100 iterations. Running EM for 1000 iterations results with prediction error on par with our algorithm, but takes orders of magnitude more time to complete. For the real data, there are n = 25 states, and we tried L = 4, . . . , 10 for the number of users. We run EM for 500 iterations and show the results in Figure 3(c). While our algorithm slightly underperforms EM, it is significantly faster in practice. 5.2 Dependence on n and L To investigate the dependence of our approach on the size of the input, namely n and L, we fix the number of samples to 108 but vary both the number of states from 6 to 30, as well as the number of chains from 3 to 9. Recall that the number of parameters grows as n2L, therefore, the largest examples have almost 1000 parameters that we are trying to fit. We plot the results in Figure 2. As expected, the error grows linearly with the number of chains. This is expected — since we are keeping the number of samples fixed, the relative error (from the true observations) grows as well. It is therefore remarkable that the error grows only linearly with L. We see more interesting behavior with respect to n. Recall that the proofs required n ≥2L. Empirically we see that at n = 2L the approach is relatively brittle, and errors are relatively high. However, as n increases past that, we see the recovery error stabilizes. Explaining this behavior formally is an interesting open question. 6 Analysis We now show that nearly all M are well-distributed (see Definition 3), or more formally, that the set of non well-distributed M has (Lebesgue) measure 0 for every L > 1 and n ≥2L. We first introduce some notation. All arrays and indices are 1-indexed. In previous sections, we have interpreted i, j, k, and ℓas states or as indices of a mixture; in this section we drop these interpretations and just use them as generic indices. 7 For vectors v1, . . . , vn ∈RL, let v[n] denote (v1, . . . , vn), and let ∗(v1, . . . , vn) denote the vi’s concatenated together to form a vector in RnL. Let vi[j] denote the jth coordinate of vector vi. We first show that there exists at least one well-distributed P for each n and L. Lemma 5 (Existence of a well-distributed P). For every n and L with n ≥2L, there exists a P for which the co-kernel of A(P, Q) has rank L. Proof. It is sufficient to show it for n = 2L, since for larger n we can pad with zeros. Also, recall that F · A(P, Q) = 0 for any P, where F is the L × 2nL matrix consisting of 2n identity matrices concatenated together. So the co-kernel of any A(P, Q) has rank at least L, and we just need to show that there exists a P where the co-kernel of A(P, Q) has rank at most L. Now, let eℓbe the ℓth basis vector in RL. Let P∗= (P ∗ 1 , . . . , P ∗ n), and let p∗ ij denote the jth column of P ∗ i . We set p∗ ij to the (i, j)th entry of              e1 e2 · · · eL e1 e2 · · · eL eL e1 · · · eL−1 eL e1 · · · eL−1 ... ... ... ... e2 e3 · · · e1 e2 e3 · · · e1 e1 e2 · · · eL eL e1 · · · eL−1 eL e1 · · · eL−1 eL−1 eL · · · eL−2 ... ... ... ... e2 e3 · · · e1 e1 e2 · · · eL              . Formally, p∗ ij = ej−i+1 if i ≤L or j ≤L ej−i, if i, j > L , where subscripts are taken mod L. Note that we can split the above matrix into four L × L blocks  E E E E′  where E′ is a horizontal “rotation” of E. Now, let a[n], b[n] be any vectors in RL such that v = ∗(a1, . . . , an, b1, . . . , bn) ∈R2nL is in the co-kernel of A(P∗, Q∗). Recall this means v · A(P∗, Q∗) = 0. Writing out the matrix A, it is not too hard to see that this holds if and only if ⟨ai, p∗ ij⟩= ⟨bj, p∗ ij⟩for each i and j. Consider the i and j where p∗ ij = e1. For each k ∈[L], we have ak[1] = bk[1] from the upper left quadrant, ak[1] = bL+k[1] from the upper right quadrant, aL+k[1] = bk[1] from the lower left quadrant, and aL+k[1] = bL+(k+1 (mod L))[1] from the lower right quadrant. It is easy to see that these combine to imply that ai[1] = bj[1] for all i, j ∈[n]. A similar argument for each l ∈[L] shows that ai[l] = bj[l] for all i, j and l. Equivalently, ai = bj for each i and j, which means that v lives in a subspace of dimension L, as desired. We now bootstrap from our one example to show that almost all P are well-distributed. Theorem 6 (Almost all P are well-distributed). The set of non-well-distributed P has Lebesgue measure 0 for every n and L with n ≥2L. Proof. Let A′(P, Q) be all but the last L rows of A(P, Q). For any P, let h(P) = det |A′(P, Q) A′(P, Q)|. Note that h(P) is non-zero if and only if P is well-distributed. Let P∗be the P∗from Lemma 5. Since A′(P∗, Q∗) has full row rank, h(P∗) ̸= 0. Since h is a polynomial function of the entries of P, and h is non-zero somewhere, h is non-zero almost everywhere [4]. 7 Conclusions In this paper we considered the problem of reconstructing Markov chain mixtures from given observation trails. We showed that unique reconstruction is algorithmically possible under a mild technical condition on the “well-separatedness” of the chains. While our condition is sufficient, we conjecture it is also necessary; proving this is an interesting research direction. Extending our analysis to work for the noisy case is also a plausible research direction, though we believe the corresponding analysis could be quite challenging. 8 References [1] E. S. Allman, C. Matias, and J. A. Rhodes. Identifiability of parameters in latent structure models with many observed variables. The Annals of Statistics, pages 3099–3132, 2009. [2] A. Anandkumar, R. Ge, D. Hsu, S. M. Kakade, and M. Telgarsky. Tensor decompositions for learning latent variable models. JMLR, 15(1):2773–2832, 2014. [3] A. Anandkumar, D. Hsu, and S. M. Kakade. A method of moments for mixture models and hidden Markov models. In COLT, pages 33.1–33.34, 2012. [4] R. Caron and T. Traynor. The zero set of a polynomial. WSMR Report, pages 05–02, 2005. [5] K. Chaudhuri and S. Rao. Learning mixtures of product distributions using correlations and independence. In COLT, pages 9–20, 2008. [6] F. Chierichetti, R. Kumar, P. Raghavan, and T. Sarlos. Are web users really Markovian? In WWW, pages 609–618, 2012. [7] S. B. Cohen, K. Stratos, M. Collins, D. P. Foster, and L. Ungar. Experiments with spectral learning of latent-variable PCFGs. In NAACL, pages 148–157, 2013. [8] S. Dasgupta. Learning mixtures of Gaussians. In FOCS, pages 634–644, 1999. [9] A. P. Dempster, N. M. Laird, and D. B. Rubin. Maximum likelihood from incomplete data via the EM algorithm. Journal of the Royal Statistical Society, Series B, 39(1):1–38, 1977. [10] D. Hsu, S. M. Kakade, and T. Zhang. A spectral algorithm for learning hidden Markov models. JCSS, 78(5):1460–1480, 2012. [11] A. Moitra and G. Valiant. Settling the polynomial learnability of mixtures of Gaussians. In FOCS, pages 93–102, 2010. [12] R. A. Redner and H. F. Walker. Mixture densities, maximum likelihood, and the EM algorithm. SIAM Review, 26:195–239, 1984. [13] C. Subakan, J. Traa, and P. Smaragdis. Spectral learning of mixture of hidden Markov models. In NIPS, pages 2249–2257, 2014. [14] Y. C. Sübakan. Probabilistic time series classification. Master’s thesis, Bo˘gaziçi University, 2011. [15] S. Vempala and G. Wang. A spectral algorithm for learning mixture models. JCSS, 68(4):841– 860, 2004. 9
2016
320
6,240
Near-Optimal Smoothing of Structured Conditional Probability Matrices Moein Falahatgar University of California, San Diego San Diego, CA, USA moein@ucsd.edu Mesrob I. Ohannessian Toyota Technological Institute at Chicago Chicago, IL, USA mesrob@ttic.edu Alon Orlitsky University of California, San Diego San Diego, CA, USA alon@ucsd.edu Abstract Utilizing the structure of a probabilistic model can significantly increase its learning speed. Motivated by several recent applications, in particular bigram models in language processing, we consider learning low-rank conditional probability matrices under expected KL-risk. This choice makes smoothing, that is the careful handling of low-probability elements, paramount. We derive an iterative algorithm that extends classical non-negative matrix factorization to naturally incorporate additive smoothing and prove that it converges to the stationary points of a penalized empirical risk. We then derive sample-complexity bounds for the global minimzer of the penalized risk and show that it is within a small factor of the optimal sample complexity. This framework generalizes to more sophisticated smoothing techniques, including absolute-discounting. 1 Introduction One of the fundamental tasks in statistical learning is probability estimation. When the possible outcomes can be divided into k discrete categories, e.g. types of words or bacterial species, the task of interest is to use data to estimate the probability masses p1, · · · , pk, where pj is the probability of observing category j. More often than not, it is not a single distribution that is to be estimated, but multiple related distributions, e.g. frequencies of words within various contexts or species in different samples. We can group these into a conditional probability (row-stochastic) matrix Pi,1, · · · , Pi,k as i varies over c contexts, and Pij represents the probability of observing category j in context i. Learning these distributions individually would cause the data to be unnecessarily diluted. Instead, the structure of the relationship between the contexts should be harnessed. A number of models have been proposed to address this structured learning task. One of the wildly successful approaches consists of positing that P, despite being a c×k matrix, is in fact of much lower rank m. Effectively, this means that there exists a latent context space of size m ≪c, k into which the original context maps probabilistically via a c × m stochastic matrix A, then this latent context in turn determines the outcome via an m × k stochastic matrix B. Since this structural model means that P factorizes as P = AB, this problem falls within the framework of low-rank (non-negative) matrix factorization. Many topic models, such as the original work on probabilistic latent semantic analysis PLSA, also map to this framework. We narrow our attention here to such low-rank models, but note that more generally these efforts fall under the areas of structured and transfer learning. Other examples include: manifold learning, multi-task learning, and hierarchical models. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. In natural language modeling, low-rank models are motivated by the inherent semantics of language: context first maps into meaning which then maps to a new word prediction. An alternative form of such latent structure, word embeddings derived from recurrent neural networks (or LSTMs) are the state-of-the-art of current language models, [20, 25, 28]. A first chief motivation for the present work is to establish a theoretical underpinning of the success of such representations. We restrict the exposition to bigram models. The traditional definition of the bigram is that language is modeled as a sequence of words generated by a first order Markov-chain. Therefore the ‘context’ of a new word is simply its preceding word, and we have c = k. Since the focus here is not the dependencies induced by such memory, but rather the ramifications of the structural assumptions on P, we take bigrams to model word-pairs independently sampled by first choosing the contextual word with probability π and then choosing the second word according to the conditional probability P, thus resulting in a joint distribution over word-pairs (πiPij). What is the natural measure of performance for a probability matrix estimator? Since ultimately such estimators are used to accurately characterize the likelihood of test data, the measure of choice used in empirical studies is the perplexity, or alternatively its logarithm, the cross entropy. For data consisting of n word-pairs, if Cij is the number of times pair (i, j) appears, then the cross entropy of an estimator Q is 1 n P ij Cij log 1 Qij . The population quantity that corresponds to this empirical performance measure is the (row-by-row weighted) KL-divergence D(P∥Q) = P ij πiPij log Pij Qij . Note that this is indeed the expectation of the cross entropy modulo the true entropy, an additive term that does not depend on Q. This is the natural notion of risk for the learning task, since we wish to infer the likelihood of future data, and our goal can now be more concretely stated as using the data to produce an estimator Qn with a ‘small’ value of D(P∥Qn). The choice of KL-divergence introduces a peculiar but important problem: the necessity to handle small frequencies appropriately. In particular, using the empirical conditional probability is not viable, since a zero in Q implies infinite risk. This is the problem of smoothing, which has received a great amount of attention by the NLP community. Our second salient motivation for the present work is to propose principled methods of integrating well-established smoothing techniques, such as add- 1 2 and absolute discounting, into the framework of structured probability matrix estimation. Our contributions are as follows, we provide: • A general framework for integrating smoothing and structured probability matrix estimation, as an alternating-minimization that converges to a stationary point of a penalized empirical risk. • A sample complexity upper bound of O(km log2(2n + k)/n) for the expected KL-risk, for the global minimizer of this penalized empirical risk. • A lower bound that matches this upper bound up to the logarithmic term, showing near-optimality. The paper is organized as follows. Section 2 reviews related work. Section 3 states the problem and Section 4 highlights our main results. Section 5 proposes our central algorithm and Section 6 analyzes its idealized variant. Section 7 provides some experiments and Section 8 concludes. 2 Related Work Latent variable models, and in particular non-negative matrix factorization and topic models, have been such an active area of research in the past two decades that the space here cannot possibly do justice to the many remarkable contributions. We list here some of the most relevant to place our work in context. We start by mentioning the seminal papers [12, 18] which proposed the alternating minimization algorithm that forms the basis of the current work. This has appeared in many forms in the literature, including the multiplicative updates [29]. Some of the earliest work is reviewed in [23]. These may be generally interpreted as discrete analogs to PCA (and even ICA) [10]. An influential Bayesian generative topic model, the Latent Dirichlet Allocation, [7] is very closely related to what we propose. In fact, add-half smoothing effectively corresponds to a Dirichlet(1/2) (Jeffreys) prior. Our exposition differs primarily in adopting a minimax sample complexity perspective which is often not found in the otherwise elegant Bayesian framework. Furthermore, exact Bayesian inference remains a challenge and a lot of effort has been expended lately toward simple iterative algorithms with provable guarantees, e.g. [3, 4]. Besides, a rich array of efficient smoothing techniques exists for probability vector estimation [2, 16, 22, 26], of which one could directly avail in the methodology that is presented here. 2 A direction that is very related to ours was recently proposed in [13]. There, the primary goal is to recover the rows of A and B in ℓ1-risk. This is done at the expense of additional separation conditions on these rows. This makes the performance measure not easily comparable to our context, though with the proper weighted combination it is easy to see that the implied ℓ1-risk result on P is subsumed by our KL-risk result (via Pinsker’s inequality), up to logarithmic factors, while the reverse isn’t true. Furthermore, the framework of [13] is restricted to symmetric joint probability matrices, and uses an SVD-based algorithm that is difficult to scale beyond very small latent ranks m. Apart from this recent paper for the ℓ1-risk, sample complexity bounds for related (not fully latent) models have been proposed for the KL-risk, e.g. [1]. But these remain partial, and far from optimal. It is also worth noting that information geometry gives conditions under which KL-risk behaves close to ℓ2-risk [8], thus leading to a Frobenius-type risk in the matrix case. Although the core optimization problem itself is not our focus, we note that despite being a nonconvex problem, many instances of matrix factorization admit efficient solutions. Our own heuristic initialization method is evidence of this. Recent work, in the ℓ2 context, shows that even simple gradient descent, appropriately initialized, could often provably converge to the global optimum [6]. Concerning whether such low-rank models are appropriate for language modeling, there has been evidence that some of the abovementioned word embeddings [20] can be interpreted as implicit matrix factorization [19]. Some of the traditional bigram smoothing techniques, such as the Kneser-Ney algorithm [17, 11], are also reminiscent of rank reduction [14, 24, 15]. 3 Problem Statement Data Dn consists of n pairs (Xs, Ys), s = 1, · · · , n, where Xs is a context and Ys is the corresponding outcome. In the spirit of a bigram language model, we assume that the context and outcome spaces have the same cardinality, namely k. Thus (Xs, Ys) takes values in [k]2. We denote the count of pairs (i, j) by Cij. As a shortcut, we also write the row-sums as Ci = P j Cij. We assume the underlying generative model of the data to be i.i.d., where each pair is drawn by first sampling the context Xs according to a probability distribution π = (πi) over [k] and then sampling Ys conditionally on Xs according to a k × k conditional probability (stochastic) matrix P = (Pij), a non-negative matrix where each row sums to 1. We also assume that P has non-negative rank m. We denote the set of all such matrices by Pm. They can all be factorized (non-uniquely) as P = AB, where both A and B are stochastic matrices in turn, of size k × m and m × k respectively. A conditional probability matrix estimator is an algorithm that maps the data into a stochastic matrix Qn(X1, · · · , Xn) that well-approximates P, in the absence of any knowledge about the underlying model. We generally drop the explicit notation showing dependence on the data, and use instead the implicit n-subscript notation. The performance, or how well any given stochastic matrix Q approximates P, is measured according to the KL-risk: R(Q) = X ij πiPij log Pij Qij (1) Note that this corresponds to an expected loss, with the log-loss L(Q, i, j) = log Pij/Qij. Although we do seek out PAC-style (in-probability) bounds for R(Qn), in order to give a concise definition of optimality, we consider the average-case performance E[R(Qn)]. The expectation here is with respect to the data. Since the underlying model is completely unknown, we would like to do well against adversarial choices of π and P, and thus we are interested in a uniform upper bound of the form: r(Qn) = max π,P ∈Pm E[R(Qn)]. The optimal estimator, in the minimax sense, and the minimax risk of the class Pm are thus given by: Q⋆ n = arg min Qn r(Qn) = arg min Qn max π,P ∈Pm E[R(Qn)] r⋆(Pm) = min Qn max π,P ∈Pm E[R(Qn)]. Explicitly obtaining minimax optimal estimators is a daunting task, and instead we would like to exhibit estimators that compare well. 3 Definition 1 (Optimality). If an estimator satisfies E[R(Qn)] ≤ϕ·E[R(Q⋆ n)], ∀π, (called an oracle inequality), then if ϕ is a constant (of n, k, and m), we say that the estimator is (order) optimal. If ϕ is not constant, but its growth is negligible with respect to the decay of r⋆(Pm) with n or the growth of r⋆(Pm) with k or m, then we can call the estimator near-optimal. In particular, we reserve this terminology for a logarithmic gap in growth, that is an estimator is near-optimal if log ϕ/ log r⋆(Pm) →0 asymptotically in any of n, k, or m. Finally, if ϕ does not depend on P we have strong optimality, and r(Qn) ≤ϕ · r⋆(Pm). If ϕ does depend on P, we have weak optimality. As a proxy to the true risk (1), we define the empirical risk: Rn(Q) = 1 n X ij Cij log Pij Qij (2) The conditional probability matrix that minimizes this empirical risk is the empirical conditional probability ˆPn,ij = Cij/Ci. Not only is ˆPn,ij not optimal, but since there always is a positive (even if slim) probability that some Cij = 0 even if Pij ̸= 0, it follows that E[Rn( ˆPn)] = ∞. This shows the importance of smoothing. The simplest benchmark smoothing that we consider is add- 1 2 smoothing ˆP Add- 1 2 ij = (Cij + 1/2) / (Ci + k/2) , where we give an additional “phantom” half-sample to each word-pair, to avoid zeros. This simple method has optimal minimax performance when estimating probability vectors. However, in the present matrix case it is possible to show that this can be a factor of k/m away from optimal, which is significant (cf. Figure 1(a) in Section 7). Of course, since we have not used the low-rank structure of P, we may be tempted to “smooth by factoring”, by performing a low-rank approximation of ˆPn. However, this will not eliminate the zero problem, since a whole column may be zero. These facts highlight the importance of principled smoothing. The problem is therefore to construct (possibly weakly) optimal or near-optimal smoothed estimators. 4 Main Results In Section 5 we introduce the ADD- 1 2-SMOOTHED LOW-RANK algorithm, which essentially consists of EM-style alternating minimizations, with the addition of smoothing at each stage. Here we state the main results. The first is a characterization of the implicit risk function that the algorithm targets. Theorem 2 (Algorithm). QAdd- 1 2 -LR converges to a stationary point of the penalized empirical risk Rn,penalized(W, H) = Rn(Q) + 1 2n X i,ℓ log 1 Wiℓ + 1 2n X ℓ,j log 1 Hℓj , where Q = WH. (3) Conversely, any stationary point of (3) is a stable point of ADD- 1 2-SMOOTHED LOW-RANK. The proof of Theorem 2 follows closely that of [18]. We now consider the global minimum of this implicit risk, and give a sample complexity bound. By doing so, we intentionally decouple the algorithmic and statistical aspects of the problem and focus on the latter. Theorem 3 (Sample Complexity). Let Qn ∈Pm achieve the global minimum of Equation 3. Then for all P ∈Pm such that Pij > km n log(2n + k) ∀i, j and n > 3, E[R(Qn)] ≤ckm n log2(2n + k), with c = 3100. We outline the proof in Section 6. The basic ingredients are: showing the problem is near-realizable, a quantization argument to describe the complexity of Pm, and a PAC-style [27] relative uniform convergence which uses a sub-Poisson concentration for the sums of log likelihood ratios and uniform variance and scale bounds. Finer analysis based on VC theory may be possible, but it would need to handle the challenge of the log-loss being possibly unbounded and negative. The following result shows that Theorem 3 gives weak near-optimality for n large, as it is tight up to the logarithmic factor. Theorem 4 (Lower Bound). For n > k, the minimax rate of Pm satisfies: r⋆(Pm) ≥ckm n , with c = 0.06. This is based on the vector case lower bound and providing the oracle with additional information: instead of only (Xs, Ys) it observes (Xs, Zs, Ys), where Zs is sampled from Xs using A and Ys is sampled from Zs using B. This effectively allows the oracle to estimate A and B directly. 4 5 Algorithm Our main algorithm is a direct modification of the classical alternating minimization algorithm for non-negative matrix factorization [12, 18]. This classical algorithm (with a slight variation) can be shown to essentially solve the following mathematical program: QNNMF(Φ) = arg min Q=W H X i X j Φij log 1 Qij . The analysis is a simple extension of the original analysis of [12, 18]. By “essentially solves”, we mean that each of the update steps can be identified as a coordinate descent, reducing the cost function and ultimately converging as T →∞to a stationary (zero gradient) point of this function. Conversely, all stationary points of the function are stable points of the algorithm. In particular, since the problem is convex in W and H individually, but not jointly in both, the algorithm can be thought of as taking exact steps toward minimizing over W (as H is held fixed) and then minimizing over H (as W is held fixed), whence the alternating-minimization name. Before we incorporate smoothing, note that there are two ingredients missing from this algorithm. First, the cost function is the sum of row-by-row KL-divergences, but each row is not weighted, as compared to Equation (1). If we think of Φij as ˆPij = Cij/Ci, then the natural weight of row i is πi or its proxy Ci/n. For this, the algorithm can easily be patched. Similarly to the analysis of the original algorithm, one finds that this change essentially minimizes the weighted KL-risks of the empirical conditional probability matrix, or equivalently the empirical risk as defined in Equation (2): QLR(C) = arg min Q=W H Rn(Q) = arg min Q=W H X i Ci n X j Cij Ci log 1 Qij . Of course, this is nothing but the maximum likelihood estimator of P under the low-rank constraint. Just like the empirical conditional probability matrix, it suffers from lack of smoothing. For instance, if a whole column of C is zero, then so will be the corresponding column of QERM(C). The first naive attempt at smoothing would be to add- 1 2 to C and then apply the algorithm: QNaive Add- 1 2 -LR(C) = QLR(C + 1 2) However, this would result in excessive smoothing, especially when m is small. The intuitive reason is this: in the extreme case of m = 1 all rows need to be combined, and thus instead of adding 1 2 to each category, QNaiveadd−1 2 LR would add k/2, leading to the the uniform distribution overwhelming the original distribution. We may be tempted to mitigate this by adding instead 1/2k, but this doesn’t generalize well to other smoothing methods. A more principled approach should perform smoothing directly inside the factorization, and this is exactly what we propose here. Our main algorithm is: Algorithm: ADD- 1 2-SMOOTHED LOW-RANK • Input: k × k matrix (Cij); Initial W 0 and H0; Number of iterations T • Iterations: Start at t = 0, increment and repeat while t < T – For all i ∈[k], ℓ∈[m], update W t iℓ←W t−1 iℓ P j Cij (W H)t−1 ij Ht−1 ℓj – For all ℓ∈[m], j ∈[k], update Ht ℓj ←Ht−1 ℓj P i Cij (W H)t−1 ij W t−1 iℓ – Add-1/2 to each element of W t and Ht, then normalize each row. • Output: QAdd- 1 2 -LR(C) = W T HT The intuition here is that, prior to normalization, the updated W and H can be interpreted as soft counts. One way to see this is to sum each row i of (pre-normalized) W, which would give Ci. As for H, the sums of its (pre-normalized) columns reproduce the sums of the columns of C. Next, we are naturally led to ask: is QAdd- 1 2 LR(C) implicitly minimizing a risk, just as QLR(C) minimizes Rn(Q)? Theorem 2 shows that indeed QAdd- 1 2 LR(C) essentially minimizes a penalized empirical risk. More interestingly, ADD- 1 2-SMOOTHED LOW-RANK lends itself to a host of generalizations. In particular, an important smoothing technique, absolute discounting, is very well suited for heavytailed data such as natural language [11, 21, 5]. We can generalize it to fractional counts as follows. Let Ci indicate counts in traditional (vector) probability estimation, and let D be the total number of 5 distinct observed categories, i.e. D = P i I{Ci ≥1}. Let the number of fractional distinct categories d be defined as d = P i CiI{Ci < 1}. We have the following soft absolute discounting smoothing: ˆP Soft-AD i (C, α) = ( Ci−α P C if Ci ≥1, 1−α P C Ci + α(D+d) (k−D−d) P C (1 −Ci) if Ci < 1. This gives us the following patched algorithm, which we do not place under the lens of theory currently, but we strongly support it with our experimental results of Section 7. Algorithm: ABSOLUTE-DISCOUNTING-SMOOTHED LOW-RANK • Input: Specify α ∈(0, 1) • Iteration: – Add-1/2 to each element of W t, then normalize. – Apply soft absolute discounting to Ht ℓj ←ˆP Soft-AD j (Ht ℓ,·, α) • Output: QAD-LR(C, α) = W T HT 6 Analysis We now outline the proof of the sample complexity upper bound of Theorem 3. Thus for the remainder of this section we have: Qn(C) = arg min Q=W H Rn(Q) + 1 2n X i,ℓ log 1 Wiℓ + 1 2n X ℓ,j log 1 Hℓj , that is Qn ∈Pm achieves the global minimum of Equation 3. Since we have a penalized empirical risk minimization at hand, we can study it within the classical PAC-learning framework. However, rates of order 1 n are often associated withe the realizable case, where Rn(Qn) is exactly zero [27]. The following Lemma shows that we are near the realizable regime. Lemma 5 (Near-realizability). We have E[Rn(Qn)] ≤k n + km n log(2n + k). We characterize the complexity of the class Pm by quantizing probabilities, as follows. Given a positive integer L, define ∆L to be the subset of the appropriate simplex ∆consisting of L-empirical distributions (or “types” in information theory): ∆L consists exactly of those distributions p that can be written as pi = Li/L, where Li are non-negative integers that sum to L. Definition 6 (Quantization). Given a positive integer L, define the L-quantization operation as mapping a probability vector p to the closest (in ℓ1-distance) element of ∆L, ˜p = arg minq∈∆L ∥p − q∥1. For a matrix P ∈Pm, define an L-quantization for any given factorization choice P = AB as ˜P = ˜A ˜B, where each row of ˜A and ˜B is the L-quantization of the respective row of A and B. Lastly, define Pm,L to be the set of all quantized probability matrices derived from Pm. Via counting arguments, the cardinality of Pm,L is bounded by |Pm,L| ≤(L+1)2km. This quantized family gives us the following approximation ability. Lemma 7 (De-quantization). For a probability vector p, L-quantization satisfies |pi −˜pi| ≤1 L for all i, and ∥p −˜p∥1 ≤2 L. For a conditional probability matrix Q ∈Pm, any quantization ˜Q satisfies |Qij −˜Qij| ≤3 L for all i. Furthermore, if Q > ϵ per entry and L > 6 ϵ , then: |R(Q) −R( ˜Q)| ≤6 Lϵ and |Rn(Q) −Rn( ˜Q)| ≤6 Lϵ. We now give a PAC-style relative uniform convergence bound on the empirical risk [27]. Theorem 8 (Relative uniform convergence). Assume lower-bounded P > δ and choose any τ > 0. We then have the following uniform bound over all lower-bounded ˜Q > ϵ in Pm,L (Definition 6): Pr    sup ˜ Q∈Pm,L, ˜ Q>ϵ R( ˜Q) −Rn( ˜Q) q R( ˜Q) > τ   ≤e − nτ2 20 log 1 ϵ +2τ s 10 1 δ log 1 ϵ +2km log(L+1) . (4) 6 The proof of this Theorem consists, for fixed ˜Q, of showing a sub-Poisson concentration of the sum of the log likelihood ratios. This needs care, as a simple Bennett or Bernstein inequality is not enough, because we need to eventually self-normalize. A critical component is to relate the variance and scale of the concentration to the KL-risk and its square root, respectively. The theorem then follows from uniformly bounding the normalized variance and scale over Pm,L and a union bound. To put the pieces together, first note that thanks to the fact that the optimum is also a stable point of the ADD- 1 2-SMOOTHED LOW-RANK, the add- 1 2 nature of the updates implies that all of the elements of Qn are lower-bounded by 1 2n+k. By Lemma 7 and a proper choice of L of the order of (2n + k)2, the quantized version won’t be much smaller. We can thus choose ϵ = 1 2n+k in Theorem 8 and use our assumption of δ = km n log(2n + k). Using Lemmas 5 and 7 to bound the contribution of the empirical risk, we can then integrate the probability bound of (4) similarly to the realizable case. This gives a bound on the expected risk of the quantized version of Qn of order km n log 1 ϵ log L or effectively km n log2(2n + k). We then complete the proof by de-quantizing using Lemma 7. 7 Experiments Having expounded the theoretical merit of properly smoothing structered conditional probability matrices, we give a brief empirical study of its practical impact. We use both synthetic and real data. The various methods compared are as follows: • Add- 1 2, directly on the bigram counts: ˆP Add- 1 2 n,ij = (Cij + 1 2)/(Ci + 1 2) • Absolute-discounting, directly on the bigram counts: ˆP AD n (C, α) (see Section 5) • Naive Add- 1 2 Low-Rank, smoothing the counts then factorizing: QNaive Add- 1 2 -LR = QLR(C + 1 2) • Naive Absolute-Discounting Low-Rank: QNaive AD-LR = QLR(n ˆP AD n (C, α)) • Stupid backoff (SB) of Google, a very simple algorithm proposed in [9] • Kneser-Ney (KN), a widely successful algorithm proposed in [17] • Add- 1 2-Smoothed Low-Rank, our proposed algorithm with provable guarantees: QAdd- 1 2 -LR • Absolute-Discounting-Smoothed Low-Rank, heuristic generalization of our algorithm: QAD-LR The synthetic model is determined randomly. π is uniformly sampled from the k-simplex. The matrix P = AB is generated as follows. The rows of A are uniformly sampled from the k-simplex. The rows of B are generated in one of two ways: either sampled uniformly from the simplex or randomly permuted power law distributions, to imitate natural language. The discount parameter is then fixed to 0.75. Figure 1(a) uses uniformly sampled rows of B, and shows that, despite attempting to harness the low-rank structure of P, not only does Naive Add- 1 2 fall short, but it may even perform worse than Add- 1 2, which is oblivious to structure. Add- 1 2-Smoothed Low-Rank, on the other hand, reaps the benefits of both smoothing and structure. Figure 1(b) expands this setting to compare against other methods. Both of the proposed algorithms have an edge on all other methods. Note that Kneser-Ney is not expected to perform well in this regime (rows of B uniformly sampled), because uniformly sampled rows of B do not behave like natural language. On the other hand, for power law rows, even if k ≫n, Kneser-Ney does well, and it is only superseded by Absolute-Discounting-Smoothed Low-Rank. The consistent good performance of Absolute-Discounting-Smoothed Low-Rank may be explained by the fact that absolute-discounting seems to enjoy some of the competitive-optimality of Good-Turing estimation, as recently demonstrated by [22]. This is why we chose to illustrate the flexibility of our framework by heuristically using absolute-discounting as the smoothing component. Before moving on to experiments on real data, we give a short description of the data sets. All but the first one are readily available through the Python NLTK: • tartuffe, a French text, train and test size: 9.3k words, vocabulary size: 2.8k words. • genesis, English version, train and test size: 19k words, vocabulary size: 4.4k words • brown, shortened Brown corpus, train and test size: 20k words, vocabulary size: 10.5k words For natural language, using absolute-discounting is imperative, and we restrict ourselves to AbsoluteDiscounting-Smoothed Low-Rank. The results of the performance of various algorithms are listed in Table 1. For all these experiments, m = 50 and 200 iterations were performed. Note that the proposed method has less cross-entropy per word across the board. 7 Number of samples, n 0 500 1000 1500 2000 2500 3000 KL loss 0 0.2 0.4 0.6 0.8 1 1.2 1.4 Add-1/2 Naive Add-1/2 Low-Rank Add-1/2-Smoothed Low-Rank (a) k = 100, m = 5 Number of samples, n #104 0.5 1 1.5 2 2.5 KL loss 10-2 10-1 Add-1/2-Smoothed Low-Rank Absolute-discounting Naive Abs-Disc Low-Rank Abs-Disc-Smoothed Low-Rank Kneser-Ney (b) k = 50, m = 3 Number of samples, n 10 15 20 25 30 35 40 45 50 KL loss 1.5 2 2.5 3 3.5 4 Add-1/2-Smoothed Low-Rank Absolute-discounting Naive Abs-Disc Low-Rank Abs-Disc-Smoothed Low-Rank Kneser-Ney (c) k = 1000, m = 10 Figure 1: Performance of selected algorithms over synthetic data Training size (number of words) 0 5000 10000 15000 Diff in test cross-entropy from baseline (nats/word) -0.4 -0.35 -0.3 -0.25 -0.2 -0.15 -0.1 -0.05 0 Stupid Backoff (baseline) Smoothed Low Rank Kneser-Ney (a) Performance on tartuffe Training size (number of words) #104 0.5 1 1.5 2 Diff in test cross-entropy from baseline (nats/word) -0.3 -0.25 -0.2 -0.15 -0.1 -0.05 0 0.05 Stupid Backoff (baseline) Smoothed Low Rank Kneser-Ney (b) Performance on genesis m 0 20 40 60 80 100 120 Validation set cross-entropy (nats/word) 5.68 5.7 5.72 5.74 5.76 5.78 5.8 5.82 (c) rank selection for tartuffe Figure 2: Experiments on real data Dataset Add- 1 2 AD SB KN AD-LR tartuffe 7.1808 6.268 6.0426 5.7555 5.6923 genesis 7.3039 6.041 5.9058 5.7341 5.6673 brown 8.847 7.9819 7.973 7.7001 7.609 Table 1: Cross-entropy results for different methods on several small corpora We also illustrate the performance of different algorithms as the training size increases. Figure 2 shows the relative performance of selected algorithms with Stupid Backoff chosen as the baseline. As Figure 2(a) suggests, the amount of improvement in cross-entropy at n = 15k is around 0.1 nats/word. This improvement is comparable, even more significant, than that reported in the celebrated work of Chen and Goodman [11] for Kneser-Ney over the best algorithms at the time. Even though our algorithm is given the rank m as a parameter, the internal dimension is not revealed, if ever known. Therefore, we could choose the best m using model selection. Figure 2(c) shows one way of doing this, by using a simple cross-validation for the tartuffe data set. In particular, half of the data was held out as a validation set, and for a range of different choices for m, the model was trained and its cross-entropy on the validation set was calculated. The figure shows that there exists a good choice of m ≪k. A similar behavior is observed for all data sets. Most interestingly, the ratio of the best m to the vocabulary size corpus is reminiscent of the choice of internal dimension in [20]. 8 Conclusion Despite the theoretical impetus of the paper, the resulting algorithms considerably improve over several benchmarks. There is more work ahead, however. Many possible theoretical refinements are in order, such as eliminating the logarithmic term in the sample complexity and dependence on P (strong optimality). This framework naturally extends to tensors, such as for higher-order N-gram language models. It is also worth bringing back the Markov assumption and understanding how various mixing conditions influence the sample complexity. A more challenging extension, and one we suspect may be necessary to truly be competitive with RNNs/LSTMs, is to parallel this contribution in the context of generative models with long memory. The reason we hope to not only be competitive with, but in fact surpass, these models is that they do not use distributional properties of language, such as its quintessentially power-law nature. We expect smoothing methods such as absolute-discounting, which do account for this, to lead to considerable improvement. Acknowledgments We would like to thank Venkatadheeraj Pichapati and Ananda Theertha Suresh for many helpful discussions. This work was supported in part by NSF grants 1065622 and 1564355. 8 References [1] Abe, Warmuth, and Takeuchi. Polynomial learnability of probabilistic concepts with respect to the Kullback-Leibler divergence. In COLT, 1991. [2] Acharya, Jafarpour, Orlitsky, and Suresh. Optimal probability estimation with applications to prediction and classification. In COLT, 2013. [3] Agarwal, Anandkumar, Jain, and Netrapalli. Learning sparsely used overcomplete dictionaries via alternating minimization. arXiv preprint arXiv:1310.7991, 2013. [4] Arora, Ge, Ma, and Moitra. Simple, efficient, and neural algorithms for sparse coding. arXiv preprint arXiv:1503.00778, 2015. [5] Ben Hamou, Boucheron, and Ohannessian. Concentration Inequalities in the Infinite Urn Scheme for Occupancy Counts and the Missing Mass, with Applications. Bernoulli, 2017. [6] Bhojanapalli, Kyrillidis, and Sanghavi. Dropping convexity for faster semi-definite optimization. arXiv preprint arXiv:1509.03917, 2015. [7] Blei, Ng, and Jordan. Latent Dirichlet allocation. JMLR, 2003. [8] Borade and Zheng. Euclidean information theory. IEEE Int. Zurich Seminar on Comm., 2008. [9] Brants, Popat, Xu, Och, and Dean. Large language models in machine translation. In EMNLP, 2007. [10] Buntine and Jakulin. Applying discrete PCA in data analysis. In Proceedings of the 20th conference on Uncertainty in artificial intelligence, pages 59–66. AUAI Press, 2004. [11] Chen and Goodman. An empirical study of smoothing techniques for language modeling. Computer Speech & Language, 13(4):359–393, 1999. [12] Hofmann. Probabilistic latent semantic indexing. In ACM SIGIR, 1999. [13] Huang, Kakade, Kong, and Valiant. Recovering structured probability matrices. arXiv preprint arXiv:1602.06586, 2016. [14] Hutchinson, Ostendorf, and Fazel. Low rank language models for small training sets. IEEE SPL, 2011. [15] Hutchinson, Ostendorf, and Fazel. A Sparse Plus Low-Rank Exponential Language Model for Limited Resource Scenarios. IEEE Trans. on Audio, Speech, and Language Processing, 2015. [16] Kamath, Orlitsky, Pichapati, and Suresh. On learning distributions from their samples. In COLT, 2015. [17] Kneser and Ney. Improved backing-off for m-gram language modeling. In ICASSP, 1995. [18] Lee and Seung. Algorithms for non-negative matrix factorization. In NIPS, 2001. [19] Levy and Goldberg. Neural word embedding as implicit matrix factorization. In NIPS, 2014. [20] Mikolov, Kombrink, Burget, ˇCernock`y, and Khudanpur. Extensions of recurrent neural network language model. In ICASSP, 2011. [21] Ohannessian and Dahleh. Rare probability estimation under regularly varying heavy tails. In COLT, 2012. [22] Orlitsky and Suresh. Competitive distribution estimation: Why is Good-Turing good. In NIPS, 2015. [23] Papadimitriou, Tamaki, Raghavan, and Vempala. Latent semantic indexing: A probabilistic analysis. In ACM SIGACT-SIGMOD-SIGART, 1998. [24] Parikh, Saluja, Dyer, and Xing. Language Modeling with Power Low Rank Ensembles. arXiv preprint arXiv:1312.7077, 2013. [25] Shazeer, Pelemans, and Chelba. Skip-gram Language Modeling Using Sparse Non-negative Matrix Probability Estimation. arXiv preprint arXiv:1412.1454, 2014. [26] Valiant and Valiant. Instance optimal learning. arXiv preprint arXiv:1504.05321, 2015. [27] Vapnik. Statistical Learning Theory. Wiley-Interscience, 1998. [28] Williams, Prasad, Mrva, Ash, and Robinson. Scaling Recurrent Neural Network Language Models. arXiv preprint arXiv:1502.00512, 2015. [29] Zhu, Yang, and Oja. Multiplicative updates for learning with stochastic matrices. In Im. An. 2013. 9
2016
321
6,241
Dynamic Filter Networks Bert De Brabandere1∗ ESAT-PSI, KU Leuven, iMinds Xu Jia1∗ ESAT-PSI, KU Leuven, iMinds Tinne Tuytelaars1 ESAT-PSI, KU Leuven, iMinds Luc Van Gool1,2 ESAT-PSI, KU Leuven, iMinds D-ITET, ETH Zurich 1firstname.lastname@esat.kuleuven.be 2vangool@vision.ee.ethz.ch Abstract In a traditional convolutional layer, the learned filters stay fixed after training. In contrast, we introduce a new framework, the Dynamic Filter Network, where filters are generated dynamically conditioned on an input. We show that this architecture is a powerful one, with increased flexibility thanks to its adaptive nature, yet without an excessive increase in the number of model parameters. A wide variety of filtering operations can be learned this way, including local spatial transformations, but also others like selective (de)blurring or adaptive feature extraction. Moreover, multiple such layers can be combined, e.g. in a recurrent architecture. We demonstrate the effectiveness of the dynamic filter network on the tasks of video and stereo prediction, and reach state-of-the-art performance on the moving MNIST dataset with a much smaller model. By visualizing the learned filters, we illustrate that the network has picked up flow information by only looking at unlabelled training data. This suggests that the network can be used to pretrain networks for various supervised tasks in an unsupervised way, like optical flow and depth estimation. 1 Introduction Humans are good at predicting another view from related views. For example, humans can use their everyday experience to predict how the next frame in a video will differ; or after seeing a person’s profile face have an idea of her frontal view. This capability is extremely useful to get early warnings about impinging dangers, to be prepared for necessary actions, etc. The vision community has realized that endowing machines with similar capabilities would be rewarding. Several papers have already addressed the generation of an image conditioned on given image(s). Yim et al. [24] and Yang et al. [23] learn to rotate a given face to another pose. The authors of [16, 19, 18, 15, 12] train a deep neural network to predict subsequent video frames. Flynn et al. [3] use a deep network to interpolate between views separated by a wide baseline. Yet all these methods apply the exact same set of filtering operations on each and every input image. This seems suboptimal for the tasks at hand. For example, for video prediction, there are different motion patterns within different video clips. The main idea behind our work is to generate the future frames with parameters ∗X. Jia and B. De Brabandere contributed equally to this work and are listed in alphabetical order. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. adapted to the motion pattern within a particular video. Therefore, we propose a learnable parameter layer that provides custom parameters for different samples. Our dynamic filter module consists of two parts: a filter-generating network and a dynamic filtering layer (see Figure 1). The filter-generating network dynamically generates sample-specific filter parameters conditioned on the network’s input. Note that these are not fixed after training, like regular model parameters. The dynamic filtering layer then applies those sample-specific filters to the input. Both components of the dynamic filter module are differentiable with respect to the model parameters such that gradients can be backpropagated throughout the network. The filters can be convolutional, but other options are possible. In particular, we propose a special kind of dynamic filtering layer which we coin dynamic local filtering layer, which is not only sample-specific but also position-specific. The filters in that case vary from position to position and from sample to sample, allowing for more sophisticated operations on the input. Our framework can learn both spatial and photometric changes, as pixels are not simply displaced, but the filters possibly operate on entire neighbourhoods. We demonstrate the effectiveness of the proposed dynamic filter module on several tasks, including video prediction and stereo prediction. We also show that, because the computed dynamic filters are explicitly calculated - can be visualised as an image similar to an optical flow or stereo map. Moreover, they are learned in a totally unsupervised way, i.e. without groundtruth maps. The rest of paper is organised as follows. In section 2 we discuss related work. Section 3 describes the proposed method. We show the evaluation in section 4 and conclude the paper in section 5. 2 Related Work Deep learning architectures Several recent works explore the idea of introducing more flexibility into the network architecture. Jaderberg et al. [9] propose a module called Spatial Transformer, which allows the network to actively spatially transform feature maps conditioned on themselves without explicit supervision. They show this module is able to perform translation, scaling, rotation and other general warping transformations. They apply this module to a standard CNN network for classification, making it invariant to a set of spatial transformations. This seminal method only works with parametric transformations however, and applies a single transformation to the entire feature map(s). Patraucean et al. [15] extend the Spatial Transformer by modifying the grid generator such that it has one transformation for each position, instead of a single transformation for the entire image. They exploit this idea for the task of video frame prediction, applying the learned dense transformation map to the current frame to generate the next frame. Similarly, our method also applies a position specific transformation to the image or feature maps and takes video frame prediction as one testbed. In contrast to their work, our method generates the new image by applying dynamic local filters to the input image or feature maps instead of using a grid generator and sampler. Our method is not only able to learn how to displace a pixel, but how to construct it from an entire neighborhood, including its intensity (e.g. by learning a blur kernel). In the context of visual question answering, Noh et al. [13] introduce a dynamic parameter layer which output is used as parameters of a fully connected layer. In that work, the dynamic parameter layer takes the information from another domain, i.e. question representation, as input. They further apply hashing to address the issue of predicting the large amount of weights needed for a fully connected layer. Different from their work, we propose to apply the dynamically generated filters to perform a filtering operation on an image, hence we do not have the same problem of predicting large amounts of parameters. Our work also shares similar ideas with early work on fast-weight networks [4], that is, having a network learn to generate context dependent weights for another network. However, we instantiate this idea as a convolution/local filtering operation with spatial information under consideration while they use a fully connected layer, and use it as an alternative for RNN. Most similar to our work, a dynamic convolution layer is proposed by Klein et al. [10] in the context of short range weather prediction and by Riegler et al. [17] for single image non-blind single image super resolution. Our work differs from theirs in that it is more general: dynamic filter networks are not limited to translation-invariant convolutions, but also allow position-specific filtering using a dynamic locally connected layer. Lastly, Finn et al. [2] recently independently proposed a mechanism called (convolutional) dynamic neural advection that is very similar to ours. 2 New view synthesis Our work is also related to works on new view synthesis, that is, generating a new view conditioned on the given views of a scene. One popular task in this category is to predict future video frames. Ranzato et al. [16] use an encoder-decoder framework in a way similar to language modeling. Srivastava et al. [19] propose a multilayer LSTM based autoencoder for both past frames reconstruction and future frames prediction. This work has been extended by Shi et al. [18] who propose to use convolutional LSTM to replace the fully connected LSTM in the network. The use of convolutional LSTM reduces the amount of model parameters and also exploits the local correlation in the image. Oh et al. [14] address the problem of predicting future frames conditioned on both previous frames and actions. They propose the encoding-transformation-decoding framework with either feedforward encoding or recurrent encoding to address this task. Mathieu et al. [12] manage to generate reasonably sharp frames by means of a multi-scale architecture, an adversarial training method, and an image gradient difference loss function. In a similar vein, Flynn et al. [3] apply a deep network to produce unseen views given neighboring views of a scene. Their network comes with a selection tower and a color tower, and is trained in an end-to-end fashion. This idea is further refined by Xie et al. [22] for 2D-to-3D conversion. None of these works adapt the filter operations of the network to the specific input sample, as we do, with the exception of [3, 22]. We’ll discuss the relation between their selection tower and our dynamic filter layer in section 3.3. Shortcut connections Our work also shares some similarity, through the use of shortcut connections, with the highway network [20] and the residual network [7, 8]. For a module in the highway network, the transform gate and the carry gate are defined to control the information flow across layers. Similarly, He et al. [7, 8] propose to reformulate layers as learning residual functions instead of learning unreferenced functions. Compared to the highway network, residual networks remove the gates in the highway network module and the path for input is always open throughout the network. In our network architecture, we also learn a referenced function. Yet, instead of applying addition to the input, we apply filtering to the input - see section 3.3 for more details. 3 Dynamic Filter Networks Filter-generating network Input A Filters Output Input B Input Dynamic filtering layer Figure 1: The general architecture of a Dynamic Filter Network. In this section we describe our dynamic filter framework. A dynamic filter module consists of a filtergenerating network that produces filters conditioned on an input, and a dynamic filtering layer that applies the generated filters to another input. Both components of the dynamic filter module are differentiable. The two inputs of the module can be either identical or different, depending on the task. The general architecture of this module is shown schematically in Figure 1. We explicitly model the transformation: invariance to change should not imply one becomes totally blind to it. Moreover, such explicit modeling allows unsupervised learning of transformation fields like optical flow or depth. For clarity, we make a distinction between model parameters and dynamically generated parameters. Model parameters denote the layer parameters that are initialized in advance and only updated during training. They are the same for all samples. Dynamically generated parameters are sample-specific, and are produced on-the-fly without a need for initialization. The filter-generating network outputs dynamically generated parameters, while its own parameters are part of the model parameters. 3.1 Filter-Generating Network The filter-generating network takes an input IA ∈Rh×w×cA, where h, w and cA are height, width and number of channels of the input A respectively. It outputs filters Fθ parameterized by parameters θ ∈Rs×s×cB×n×d, where s is the filter size, cB the number of channels in input B and n the number of filters. d is equal to 1 for dynamic convolution and h × w for dynamic local filtering, which we discuss below. The filters are applied to input IB ∈Rh×w×cB to generate an output G = Fθ(IB), with G ∈Rh×w×n. The filter size s determines the receptive field and is chosen depending on the 3 application. The size of the receptive field can also be increased by stacking multiple dynamic filter modules. This is for example useful in applications that may involve large local displacements. The filter-generating network can be implemented with any differentiable architecture, such as a multilayer perceptron or a convolutional network. A convolutional network is particularly suitable when using images as input to the filter-generating network. 3.2 Dynamic Filtering Layer The dynamic filtering layer takes images or feature maps IB as input and outputs the filtered result G ∈Rh×w×n. For simplicity, in the experiments we only consider a single feature map (cB = 1) filtered with a single generated filter (n = 1), but this is not required in a general setting. The dynamic filtering layer can be instantiated as a dynamic convolutional layer or a dynamic local filtering layer. Dynamic convolutional layer. A dynamic convolutional layer is similar to a traditional convolutional layer in that the same filter is applied at every position of the input IB. But different from the traditional convolutional layer where filter weights are model parameters, in a dynamic convolutional layer the filter parameters θ are dynamically generated by a filter-generating network: G(i, j) = Fθ(IB(i, j)) (1) The filters are sample-specific and conditioned on the input of the filter-generating network. The dynamic convolutional layer is shown schematically in Figure 2(a). Given some prior knowledge about the application at hand, it is sometimes possible to facilitate training by constraining the generated convolutional filters in a certain way. For example, if the task is to produce a translated version of the input image IB where the translation is conditioned on another input IA, the generated filter can be sent through a softmax layer to encourage elements to only have a few high magnitude elements. We can also make the filter separable: instead of a single square filter, generate separate horizontal and vertical filters that are applied to the image consecutively similar to what is done in [10]. Dynamic local filtering layer. An extension of the dynamic convolution layer that proves interesting, as we show in the experiments, is the dynamic local filtering layer. In this layer the filtering operation is not translation invariant anymore. Instead, different filters are applied to different positions of the input IB similarly to the traditional locally connected layer: for each position (i, j) of the input IB, a specific local filter Fθ (i,j) is applied to the region centered around IB(i, j): G(i, j) = Fθ (i,j)(IB(i, j)) (2) The filters used in this layer are not only sample specific but also position specific. Note that dynamic convolution as discussed in the previous section is a special case of local dynamic filtering where the local filters are shared over the image’s spatial dimensions. The dynamic local filtering layer is shown schematically in Figure 2b. If the generated filters are again constrained with a softmax function so that each filter only contains one non-zero element, then the dynamic local filtering layer replaces each element of the input IB by an element selected from a local neighbourhood around it. This offers a natural way to model local spatial deformations conditioned on another input IA. The dynamic local filtering layer can perform not only a single transformation like the dynamic convolutional layer, but also position-specific transformations like local deformation. Before or after applying the dynamic local filtering operation we can add a dynamic pixel-wise bias to each element of the input IB to address situations like photometric changes. This dynamic bias can be produced by the same filter-generating network that generates the filters for the local filtering. When inputs IA and IB are both images, a natural way to implement the filter-generating network is with a convolutional network. This way, the generated position-specific filters are conditioned on the local image region around their corresponding position in IA. The receptive field of the convolutional network that generates the filters can be increased by using an encoder-decoder architecture. We can also apply a smoothness penalty to the output of the filter-generating network, so that neighboring filters are encouraged to apply the same transformation. Another advantage of the dynamic local filtering layer over the traditional locally connected layer is that we do not need so many model parameters. The learned model is smaller and this is desirable in embedded system applications. 4 Filter-generating network Input A Output Input B Input Filter-generating network Input A Output Input B Input (a) (b) Figure 2: Left: Dynamic convolution: the filter-generating network produces a single filter that is applied convolutionally on IB. Right: Dynamic local filtering: each location is filtered with a location-specific dynamically generated filter. 3.3 Relationship with other networks The generic formulation of our framework allows to draw parallels with other networks in the literature. Here we discuss the relation with the spatial transformer networks [9], the deep stereo network [3, 22], and the residual networks [7, 8]. Spatial Transformer Networks The proposed dynamic filter network shares the same philosophy as the spatial transformer network proposed by [9], in that it applies a transformation conditioned on an input to a feature map. The spatial transformer network includes a localization network which takes a feature map as input, and it outputs the parameters of the desired spatial transformation. A grid generator and sampler are needed to apply the desired transformation to the feature map. This idea is similar to our dynamic filter network, which uses a filter-generating network to compute the parameters of the desired filters. The filters are applied on the feature map with a simple filtering operation that only consists of multiplication and summation operations. A spatial transformer network is naturally suited for global transformations, even sophisticated ones such as a thin plate spline. The dynamic filter network is more suitable for local transformations, because of the limited receptive field of the generated filters, although this problem can be alleviated with larger filters, stacking multiple dynamic filter modules, and using multi-resolution extensions. A more fundamental difference is that the spatial transformer is only suited for spatial transformations, whereas the dynamic filter network can apply more general ones (e.g. photometric, filtering), as long as the transformation is implementable as a series of filtering operations. This is illustrated in the first experiment in the next section. Deep Stereo The deep stereo network of [3] can be seen as a specific instantiation of a dynamic filter network with a local filtering layer where inputs IA and IB denote the same image, only a horizontal filter is generated and softmax is applied to each dynamic filter. The effect of the selection tower used in their network is equivalent to the proposed dynamic local filtering layer. For the specific task of stereo prediction, they use a more complicated architecture for the filter-generating network. Dynamic filtering layer Input Output Parameter-generating network Parameters Figure 3: Relation with residual networks. Residual Networks The core idea of ResNets [7, 8] is to learn a residual function with respect to the identity mapping, which is implemented as an additive shortcut connection. In the dynamic filter network, we also have two branches where one branch acts as a shortcut connection. This becomes clear when we redraw the diagram (Figure 3). Instead of merging the branches with addition, we merge them with a dynamic filtering layer which is multiplicative in nature. Multiplicative interactions in neural networks have also been investigated by [21]. 5 Moving MNIST Model # params bce FC-LSTM [19] 142,667,776 341.2 Conv-LSTM [18] 7,585,296 367.1 Spatio-temporal [15] 1,035,067 179.8 Baseline (ours) 637,443 432.5 DFN (ours) 637,361 285.2 t t - 1 t - 2 SOFTMAX 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 t + 1 Table 1: Left: Quantitative results on Moving MNIST: number of model parameters and average binary cross-entropy (bce). Right: The dynamic filter network for video prediction. 4 Experiments Filter-generating network θ = 45° 0° 90° 139.2° 180° 242.9° Figure 4: The dynamic filter network for learning steerable filters and several examples of learned filters. The Dynamic Filter Network can be used in different ways in a wide variety of applications. In this section we show its application in learning steerable filters, video prediction and stereo prediction. All code to reproduce the experiments is available at https://github.com/ dbbert/dfn. 4.1 Learning steerable filters We first set up a simple experiment to illustrate the basics of the dynamic filter module with a dynamic convolution layer. The task is to filter an input image with a steerable filter of a given orientation θ. The network must learn this transformation from looking at input-output pairs, consisting of randomly chosen input images and angles together with their corresponding output. The task of the filter-generating network here is to transform an angle into a filter, which is then applied to the input image to generate the final output. We implement the filter-generating network as a few fully-connected layers with the last layer containing 81 neurons, corresponding to the elements of a 9x9 convolution filter. Figure 4 shows an example of the trained network. It has indeed learned the expected filters and applies the correct transformation to the image. 4.2 Video prediction In video prediction, the task is to predict the sequence of future frames that follows the given sequence of input frames. To address this task we use a convolutional encoder-decoder as the filter-generating network where the encoder consists of several strided convolutional layers and the decoder consists of several unpooling layers and convolutional layers. The convolutional encoder-decoder is able to exploit the spatial correlation within a frame and generates feature maps that are of the same size as the frame. To exploit the temporal correlation between frames we add a recurrent connection inside the filter-generating network: we pass the previous hidden state through two convolutional layers and sum it with the output of the encoder to produce the new hidden state. During prediction, we propagate the prediction from the previous time step. Table 1 (right) shows a diagram of our architecture. Note that we use a very simple recurrent architecture rather than the more advanced LSTM as in [19, 18]. A softmax layer is applied to each generated filter such that each filter is encouraged to only have a few high magnitude elements. This helps the dynamic filtering layer to generate sharper images because each pixel in the output image comes from only a few pixels in the previous frame. To produce the prediction of the next frame, the generated filters are applied on the previous frame to transform it with the dynamic local filtering mechanism explained in Section 3. Moving MNIST We first evaluate the method on the synthetic moving MNIST dataset [19]. Given a sequence of 10 frames with two moving digits as input, the goal is to predict the following 10 frames. We use the code provided by [19] to generate training samples on-the-fly, and use the provided test 6 Input Sequence Ground Truth and Prediction Figure 5: Qualitative results on moving MNIST. Note that the network has learned the bouncing dynamics and separation of overlapping digits. More examples and out-of-domain results are in the supplementary material. Input Sequence Ground Truth and Prediction Figure 6: Qualitative results of video prediction on the Highway Driving dataset. Note the good prediction of the lanes (red), bridge (green) and a car moving in the opposite direction (purple). set for comparison. Only simple pre-processing is done to convert pixel values into the range [0,1]. As the loss function we use average binary cross-entropy over the 10 frames. The size of the dynamic filters is set to 9x9. This allows the network to translate pixels over a distance of at most 4 pixels, which is sufficient for this dataset. Details on the hyper-parameter can be found in the available code. We also compare our results with a baseline consisting of only the filter-generating network, followed by a 1×1 convolution layer. This way, the baseline network has approximately the same structure and number of parameters as the proposed dynamic filter network. The quantitative results are shown in Table 1 (left). Our method outperforms the baseline and [19, 18] with a much smaller model. Figure 5 shows some qualitative results. Our method is able to correctly learn the individual motions of digits. We observe that the predictions deteriorate over time, i.e. the digits become blurry. This is partly because of the model error: our model is not able to perfectly separate digits after an overlap, and these errors accumulate over time. Another cause of blurring comes from an artifact of the dataset: because of imperfect cropping, it is uncertain when exactly the digit will bounce and change its direction. The behavior is not perfectly deterministic. This uncertainty combined with the pixel-wise loss function encourages the model to "hedge its bets" when a digit reaches the boundary, causing a blurry result. This issue could be alleviated with the methods proposed in [5, 6, 11]. Highway Driving We also evaluate our method on real-world data of a car driving on the highway. Compared to natural video like UCF101 used in [16, 12], the highway driving data is highly structured and much more predictable, making it a good testbed for video prediction. We add a small extension to the architecture: a dynamic per-pixel bias is added to the image before the filtering operation. This allows the network to handle illumination changes such as when the car drives through a tunnel. Because the Highway Driving sequence is less deterministic than moving MNIST, we only predict the next 3 frames given an input sequence of 3 frames. We split the approximately 20, 000 frames of the 30-minute video into a training set of 16, 000 frames and a test set of 4, 000 frames. We train with a Euclidean loss function and obtain a loss of 13.54 on the test set with a model consisting of 368, 122 parameters, beating the baseline which gets a loss of 15.97 with 368, 245 parameters. Figure 6 shows some qualitative results. Similar to the experiments on moving MNIST, the predictions get blurry over time. This can partly be attributed to the increasing uncertainty combined with an 7 input prediction ground truth filters Figure 7: Some samples for video (left) and stereo (right) prediction and visualization of the dynamically generated filters. More examples and a video can be found in the supplementary material. element-wise loss-function which encourages averaging out the possible predictions. Moreover, the errors accumulate over time and make the network operate in an out-of-domain regime. We can visualize the dynamically generated filters of the trained model in a flow-like manner. The result is shown in Figure 7 and the visualization process is explained in the supplementary material. Note that the network seems to generate "valid" flow only insofar that it helps with minimizing its video prediction objective. This is sometimes noticeable in uniform, textureless regions of the image, where a valid optical flow is no prerequisite for correctly predicting the next frame. Although the flow map is not perfectly smooth, it is learned in a self-supervised way by only training on unlabeled video data. This is different from supervised methods like [1]. 4.3 Stereo prediction We define stereo prediction as predicting the right view given the left view of a stereo camera. This task is a variant of video prediction, where the goal is to predict a new view in space rather than in time, and from a single image rather than multiple ones. Flynn et al. [3] developed a network for new view synthesis from multiple views in unconstrained settings like musea, parks and streets. We limit ourselves to the more structured Highway Driving dataset and a classical two-view stereo setup. We recycle the architecture from the previous section, and replace the square 9x9 filters with horizontal 13x1 filters. The network is trained and evaluated on the same train- and test split as in the previous section, with the left view as input and the right one as target. It reaches a loss of 0.52 on the test set with a model consisting of 464, 494 parameters. The baseline obtains a loss of 1.68 with 464, 509 parameters. The network has learned to shift objects to the left depending on their distance to the camera, as shown in Figure 7 (right). The results suggest that it is possible to use the proposed dynamic filter network architecture to pre-train networks for optical flow and disparity map estimation in a self-supervised manner using only unlabeled data. 5 Conclusion In this paper we introduced Dynamic Filter Networks, a class of networks that applies dynamically generated filters to an image in a sample-specific way. We discussed two versions: dynamic convolution and dynamic local filtering. We validated our framework in the context of steerable filters, video prediction and stereo prediction. As future work, we plan to explore the potential of dynamic filter networks on other tasks, such as finegrained image classification, where filters could learn to adapt to the object pose, or image deblurring, where filters can be tuned to adapt to the image structure. 6 Acknowledgements This work was supported by FWO through the project G.0696.12N “Representations and algorithms for captation, visualization and manipulation of moving 3D objects, subjects and scenes”, the EU FP7 project Europa2, the iMinds ICON project Footwork and bilateral Toyota project. 8 References [1] Alexey Dosovitskiy, Philipp Fischer, Eddy Ilg, Philip Häusser, Caner Hazirbas, Vladimir Golkov, Patrick van der Smagt, Daniel Cremers, and Thomas Brox. Flownet: Learning optical flow with convolutional networks. In ICCV, 2015. [2] Chelsea Finn, Ian Goodfellow, and Sergey Levine. Unsupervised learning for physical interaction through video prediction. In NIPS, 2016. [3] John Flynn, Ivan Neulander, James Philbin, and Noah Snavely. Deepstereo: Learning to predict new views from the world’s imagery. In CVPR, 2015. [4] Faustino J. Gomez and Jürgen Schmidhuber. Evolving modular fast-weight networks for control. In ICANN, 2005. [5] Ian J. Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron C. Courville, and Yoshua Bengio. Generative adversarial nets. In NIPS, 2014. [6] Ross Goroshin, Michaël Mathieu, and Yann LeCun. Learning to linearize under uncertainty. In NIPS, 2015. [7] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. CoRR, abs/1512.03385, 2015. [8] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Identity mappings in deep residual networks. CoRR, abs/1603.05027, 2016. [9] Max Jaderberg, Karen Simonyan, Andrew Zisserman, and Koray Kavukcuoglu. Spatial transformer networks. In NIPS, 2015. [10] Benjamin Klein, Lior Wolf, and Yehuda Afek. A dynamic convolutional layer for short range weather prediction. In CVPR, 2015. [11] Anders B. L. Larsen, Søren Kaae Sønderby, Hugo Larochelle, and Ole Winther. Autoencoding beyond pixels using a learned similarity metric. In ICML, 2016. [12] Michaël Mathieu, Camille Couprie, and Yann LeCun. Deep multi-scale video prediction beyond mean square error. In ICLR, 2016. [13] Hyeonwoo Noh, Paul Hongsuck Seo, and Bohyung Han. Image question answering using convolutional neural network with dynamic parameter prediction. In CVPR, 2016. [14] Junhyuk Oh, Xiaoxiao Guo, Honglak Lee, Richard L Lewis, and Satinder Singh. Action-conditional video prediction using deep networks in atari games. In NIPS, 2015. [15] Viorica Patraucean, Ankur Handa, and Roberto Cipolla. Spatio-temporal video autoencoder with differentiable memory. CoRR, abs/1511.06309, 2015. [16] Marc’Aurelio Ranzato, Arthur Szlam, Joan Bruna, Michaël Mathieu, R. Collobert, Video (language) modeling: a baseline for generative models of natural videos. CoRR, abs/1412.6604, 2014. [17] Gernot Riegler, Samuel Schulter, Matthias Rüther, and Horst Bischof. Conditioned regression models for non-blind single image super-resolution. In ICCV, 2015. [18] Xingjian Shi, Zhourong Chen, Hao Wang, Dit-Yan Yeung, Wai-Kin Wong, and Wang-chun Woo. Convolutional LSTM network: A machine learning approach for precipitation nowcasting. In NIPS, 2015. [19] Nitish Srivastava, Elman Mansimov, and Ruslan Salakhutdinov. Unsupervised learning of video representations using LSTMs. In ICML, 2015. [20] Rupesh Kumar Srivastava, Klaus Greff, and Jürgen Schmidhuber. Training very deep networks. In NIPS, 2015. [21] G. Taylor and G. Hinton. Factored conditional restricted boltzmann machines for modeling motion style. In ICML, 2009. [22] Junyuan Xie, Ross Girshick, and Ali Farhadi. Deep3d: Fully automatic 2D-to-3D video conversion with deep convolutional neural networks. In ECCV, 2016. [23] Jimei Yang, Scott Reed, Ming-Hsuan Yang, and Honglak Lee. Weakly-supervised disentangling with recurrent transformations for 3d view synthesis. In NIPS, 2015. [24] Junho Yim, Heechul Jung, ByungIn Yoo, Changkyu Choi, Du-Sik Park, and Junmo Kim. Rotating your face using multi-task deep neural network. In CVPR, 2015. 9
2016
322
6,242
Estimating the Size of a Large Network and its Communities from a Random Sample Lin Chen1,2, Amin Karbasi1,2, Forrest W. Crawford2,3 1Department of Electrical Engineering, 2Yale Institute for Network Science, 3Department of Biostatistics, Yale University {lin.chen, amin.karbasi, forrest.crawford}@yale.edu Abstract Most real-world networks are too large to be measured or studied directly and there is substantial interest in estimating global network properties from smaller sub-samples. One of the most important global properties is the number of vertices/nodes in the network. Estimating the number of vertices in a large network is a major challenge in computer science, epidemiology, demography, and intelligence analysis. In this paper we consider a population random graph G = (V, E) from the stochastic block model (SBM) with K communities/blocks. A sample is obtained by randomly choosing a subset W ⊆V and letting G(W) be the induced subgraph in G of the vertices in W. In addition to G(W), we observe the total degree of each sampled vertex and its block membership. Given this partial information, we propose an efficient PopULation Size Estimation algorithm, called PULSE, that accurately estimates the size of the whole population as well as the size of each community. To support our theoretical analysis, we perform an exhaustive set of experiments to study the effects of sample size, K, and SBM model parameters on the accuracy of the estimates. The experimental results also demonstrate that PULSE significantly outperforms a widely-used method called the network scale-up estimator in a wide variety of scenarios. 1 Introduction Many real-world networks cannot be studied directly because they are obscured in some way, are too large, or are too difficult to measure. There is therefore a great deal of interest in estimating properties of large networks via sub-samples [15, 5]. One of the most important properties of a large network is the number of vertices it contains. Unfortunately census-like enumeration of all the vertices in a network is often impossible, so researchers must try to learn about the size of real-world networks by sampling smaller components. In addition to the size of the total network, there is great interest in estimating the size of different communities or sub-groups from a sample of a network. Many real-world networks exhibit community structure, where nodes in the same community have denser connections than those in different communities [10, 18]. In the following examples, we describe network size estimation problems in which only a small subgraph of a larger network is observed. Social networks. The social and economic value of an online social network (e.g. Facebook, Instagram, Twitter) is closely related to the number of users the service has. When a social networking service does not reveal the true number of users, economists, marketers, shareholders, or other groups may wish to estimate the number of people who use the service based on a sub-sample [4]. World Wide Web. Pages on the World-Wide Web can be classified into several categories (e.g. academic, commercial, media, government, etc.). Pages in the same category tend to have more connections. Computer scientists have developed crawling methods for obtaining a sub-network of web pages, along with their hyperlinks to other unknown pages. Using the crawled sub-network and hyperlinks, they can estimate the number of pages of a certain category [17, 16, 21, 13, 19]. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. G(W) G True G(W) Observed Figure 1: Illustration of the vertex set size estimation problem with N = 13 and K = 2. White vertices are type-1 and gray are type-2. Size of the Internet. The number of computers on the Internet (the size of the Internet) is of great interest to computer scientists. However, it is impractical to access and enumerate all computers on the Internet and only a small sample of computers and the connection situation among them are accessible [24]. Counting terrorists. Intelligence agencies often target a small number of suspicious or radicalized individuals to learn about their communication network. But agencies typically do not know the number of people in the network. The number of elements in such a covert network might indicate the size of a terrorist force, and would be of great interest [7]. Epidemiology. Many of the groups at greatest risk for HIV infection (e.g. sex workers, injection drug users, men who have sex with men) are also difficult to survey using conventional methods. Since members of these groups cannot be enumerated directly, researchers often trace social links to reveal a network among known subjects. Public health and epidemiological interventions to mitigate the spread of HIV rely on knowledge of the number of HIV-positive people in the population [12, 11, 22, 23, 8]. Counting disaster victims. After a disaster, it can be challenging to estimate the number of people affected. When logistical challenges prevent all victims from being enumerated, a random sample of individuals may be possible to obtain [2, 3]. In this paper, we propose a novel method called PULSE for estimating the number of vertices and the size of individual communities from a random sub-sample of the network. We model the network as an undirected simple graph G = (V, E), and we treat G as a realization from the stochastic blockmodel (SBM), a widely-studied extension of the Erd˝os-Rényi random graph model [20] that accommodates community structures in the network by mapping each vertex into one of K ≥1 disjoint types or communities. We construct a sample of the network by choosing a sub-sample of vertices W ⊆V uniformly at random without replacement, and forming the induced subgraph G(W) of W in G. We assume that the block membership and total degree d(v) of each vertex v ∈W are observed. We propose a Bayesian estimation algorithm PULSE for N = |V |, the number of vertices in the network, along with the number of vertices Ni in each block. We first prove important regularity results for the posterior distribution of N. Then we describe the conditions under which relevant moments of the posterior distribution exist. We evaluate the performance of PULSE in comparison with the popular “network scale-up” method (NSUM) [12, 11, 22, 23, 8, 14, 9]. We show that while NSUM is asymptotically unbiased, it suffers from serious finite-sample bias and large variance. We show that PULSE has superior performance – in terms of relative error and variance – over NSUM in a wide variety of model and observation scenarios. All proofs are given in the extended version [6]. 2 Problem Formulation The stochastic blockmodel (SBM) is a random graph model that generalizes the Erd˝os-Rényi random graph [20]. Let G = (V, E) ∼G(N, K, p, t) be a realization from an SBM, where N = |V | is the total number of vertices, the vertices are divided into K types indexed 1, . . . , K, specified by the map t : V →{1, . . . , K}, and a type-i vertex and a type-j vertex are connected independently with probability pij ∈[0, 1]. Let Ni be the number of type-i vertices in G, with N = PK i=1 Ni. The degree of a vertex v is d(v). An edge is said to be of type-(i, j) if it connects a type-i vertex and a type-j vertex. A random induced subgraph is obtained by sampling a subset W ⊆V with |W| = n uniformly at random without replacement, and forming the induced subgraph, denoted by G(W). Let Vi be the number of type-i vertices in the sample and Eij be the number of type-(i, j) edges in the sample. 2 For a vertex v in the sample, a pendant edge connects vertex v to a vertex outside the sample. Let ˜d(v) = d(v)−P w∈W 1{{w, v} ∈E} be the number of pendant edges incident to v. Let yi(v) be the number of type-(t(v), i) pendant edges of vertex v; i.e., yi(v) = P w∈V \W 1{t(w) = i, {w, v} ∈E}. We have PK i=1 yi(v) = ˜d(v). Let ˜Ni = Ni−Vi be the number of type-i nodes outside the sample. We define ˜N = ( ˜Ni : 1 ≤i ≤K), p = (pij : 1 ≤i < j ≤K), and y = (yi(v) : v ∈W, 1 ≤i ≤K). We observe only G(W) and the total degree d(v) of each vertex v in the sample. Assume that we know the type of each vertex in the sample. The observed data D consists of G(W), (d(v) : v ∈W) and (t(v) : v ∈W); i.e., D = (G(W), (d(v) : v ∈W), (t(v) : v ∈W)). Problem 1. Given the observed data D, estimate the size N of the vertex set N = |V | and the size of each community Ni. Fig. 1 illustrates the vertex set size estimation problem. White nodes are of type-1 and gray nodes are of type-2. All nodes outside G(W) are unobserved. We observe the types and the total degree of each vertex in the sample. Thus we know the number of pendant edges that connect each vertex in the sample to other, unsampled vertices. However, the destinations of these pendant edges are unknown to us. 3 Network Scale-Up Estimator We briefly outline a simple and intuitive estimator for N = |V | that will serve as a comparison to PULSE. The network scale-up method (NSUM) is a simple estimator for the vertex set size of Erd˝os-Rényi random graphs. It has been used in real-world applications to estimate the size of hidden or hard-to-reach populations such as drug users [12], HIV-infected individuals [11, 22, 23], men who have sex with men (MSM) [8], and homeless people [14]. Consider a random graph that follows the Erd˝os-Rényi distribution. The expected sum of total degrees in a random sample W of vertices is E P v∈W d(v)  = n(N −1)p. The expected number of edges in the sample is E [ES] = n 2  p, where ES is the number of edges within the sample. A simple estimator of the connection probability p is ˆp = ES/ n 2  . Plugging ˆp into into the moment equation and solving for N yields ˆN = 1 + (n −1) P v∈W d(v)/2ES, often simplified to ˆNNS = n P v∈W d(v)/2ES [12, 11, 22, 23, 8, 14, 9]. Theorem 1. (Proof in [6]) Suppose G follows a stochastic blockmodel with edge probability pij > 0 for 1 ≤i, j ≤K. For any sufficiently large sample size, the NSUM is positively biased and E[ ˆNNS|ES > 0] −N has an asymptotic lower bound E[ ˆNNS|ES > 0] −N ≳N/n −1, as n becomes large, where for two sequences {an} and {bn}, an ≳bn means that there exists a sequence cn such that an ≥cn ∼bn; i.e., an ≥cn for all n and limn→∞cn/bn = 1. However, as sample size goes to infinity, the NSUM becomes asymptotically unbiased. 4 Main Results NSUM uses only aggregate information about the sum of the total degrees of vertices in the sample and the number of edges in the sample. We propose a novel algorithm, PULSE, that uses individual degree, vertex type, and the network structure information. Experiments (Section 5) show that it outperforms NSUM in terms of both bias and variance. Given p = (pij : 1 ≤i < j ≤K), the conditional likelihood of the edges in the sample is given by LW (D; p) =   Y 1≤i<j≤K pEij ij (1 −pij)ViVj−Eij  × K Y i=1 pEii ii (1 −pii)( Vi 2 )−Eii ! , and the conditional likelihood of the pendant edges is given by L¬W (D; p) = Y v∈W X y(v) K Y i=1  ˜Ni yi(v)  pyi(v) i,t(v)(1 −pi,t(v)) ˜ Ni−yi(v), where the sum is taken over all yi(v)’s (i = 1, 2, 3, . . . , K) such that yi(v) ≥0, ∀1 ≤i ≤K and PK i=1 yi(v) = ˜d(v). Thus the total conditional likelihood is L(D; p) = LW (D; p)L¬W (D; p). 3 If we condition on p and y, the likelihood of the edges within the sample is the same as LW (D; p) since it does not rely on y, while the likelihood of the pendant edges given p and y is L¬W (D; p, y) = Y v∈W K Y i=1  ˜Ni yi(v)  pyi(v) i,t(v)(1 −pi,t(v)) ˜ Ni−yi(v). Therefore the total likelihood conditioned on p and y is given by L(D; p, y) = LW (D; p)L¬W (D; p, y). The conditional likelihood L(D; p) is indeed a function of ˜N. We may view this as the likelihood of ˜N given the data D and the probabilities p; i.e., L( ˜N; D, p) ≜L(D; p). Similarly, the likelihood L(D; p, y) conditioned on p and y is a function of ˜N and y. It can be viewed as the joint likelihood of ˜N and y given the data D and the probabilities p; i.e., L( ˜N, y; D, p) ≜L(D; p, y), and P y L( ˜N, y; D, p) = L( ˜N; D, p), where the sum is taken over all yi(v)’s, v ∈W and 1 ≤i ≤K, such that yi(v) ≥0 and PK i=1 yi(v) = ˜d(v), ∀v ∈W, ∀1 ≤i ≤K. To have a full Bayesian approach, we assume that the joint prior distribution for ˜N and p is π( ˜N, p). Hence, the population size estimation problem is equivalent to the following optimization problem for ˜N: ˆ˜N = arg max ˆ L( ˜N; D, p)π( ˜N, p)dp. (1) Then we estimate the total population size as ˆN = PK i=1 ˆ˜Ni + |W|. We briefly study the regularity of the posterior distribution of N. In order to learn about ˜N, we must observe enough vertices from each block type, and enough edges connecting members of each block, so that the first and second moments of the posterior distribution exist. Intuitively, in order for the first two moments to exist, either we must observe many edges connecting vertices of each block type, or we must have sufficiently strong prior beliefs about pij. Theorem 2. (Proof in [6]) Assume that π( ˜N, p) = φ( ˜N)ψ(p) and pij follows the Beta distribution B(αij, βij) independently for 1 ≤i < j ≤K. Let λ = min1≤i≤K PK j=1(Eij + αij)  . If φ( ˜N) is bounded and λ > n + 1, then the n-th moment of N exists. In particular, if λ > 3, the variance of N exists. Theorem 2 gives the minimum possible number of edges in the sample to make the posterior sampling meaningful. If the prior distribution of pij is Uniform[0, 1], then we need at least three edges incident on type-i edges for all types i = 1, 2, 3, . . . , K to guarantee the existence of the posterior variance. 4.1 Erd˝os-Rényi Model In order to better understand how PULSE estimates the size of a general stochastic blockmodel we study the Erd˝os-Rényi case where K = 1, and all vertices are connected independently with probability p. Let N denote the total population size, W be the sample with size |W| = V1 and ˜N = N −|W|. For each vertex v ∈W in the sample, let ˜d(v) = y(v) denote the number of pendant edges of vertex v, and E = E11 is the number of edges within the sample. Then LW (D; p) = pE(1 −p)( |W | 2 )−E, L¬W (D; p) = Y v∈W  ˜N ˜d(v)  p ˜d(v)(1 −p) ˜ N−˜d(v). In the Erd˝os-Rényi case, y(v) = ˜d(v) and thus L¬W (D; p) = L¬W (D; p, y). Therefore, the total likelihood of ˜N conditioned on p is given by L( ˜ N; D, p) = LW (D; p)L¬W (D; p) = pE(1 −p)(|W | 2 )−E Y v∈W ˜ N ˜d(v) ! p ˜ d(v)(1 −p) ˜ N−˜ d(v). We assume that p has a beta prior B(α, β) and that ˜N has a prior φ( ˜N). Let L( ˜N; D) = Y v∈W  ˜N ˜d(v)  B(E + u + α, |W| 2  −E + |W| ˜N −u + β), where u = P v∈W ˜d(v). The posterior probability Pr[ ˜N|D] is proportional to Λ( ˜N; D) ≜ φ( ˜N)L( ˜N; D). The algorithm is presented in Algorithm 1. 4 Algorithm 1 Population size estimation algorithm PULSE (Erd˝os-Rényi case) Input: Data D; initial guess for ˆ N, denoted by N(0); parameters of the beta prior, α and β Output: Estimate for the population size ˆ N 1: ˜ N(0) ←N(0) −|W| 2: τ ←1 3: repeat 4: Propose ˜ N ′(τ) according to a proposal distribution g( ˜ N(τ −1) →˜ N ′(τ)) 5: q ←min{1, Λ( ˜ N′(τ);D)g( ˜ N′(τ)→˜ N(τ−1)) Λ( ˜ N(τ−1);D)g( ˜ N(τ−1)→˜ N′(τ))} 6: ˜ N(τ) ←˜ N ′(τ) with probability q; otherwise ˜ N(τ) ←˜ N(τ −1) 7: τ ←τ + 1 8: until some termination condition is satisfied 9: Look at { ˜ N(τ) : τ > τ0} and view it as the sampled posterior distribution for ˜ N 10: Let ˆ˜ N be the posterior mean with respect to the sampled posterior distribution. Algorithm 2 Population size estimation algorithm PULSE (general stochastic blockmodel case) Input: Data D; initial guess for ˜ N, denoted by ˜ N (0); initial guess for y, denoted by y(0); parameters of the beta prior, αij and βij, 1 ≤i ≤j ≤K. Output: Estimate for the population size ˆ N 1: τ ←1 2: repeat 3: Randomly decide whether to update ˜ N or y 4: if update ˜ N then 5: Randomly selects i ∈[1, K] ∩N. 6: ˜ N ∗←˜ N (τ−1) 7: Propose ˜ N ∗ i according to the proposal distribution gi( ˜ N (τ−1) i →˜ N ∗ i ) 8: q ←min{1, Λ( ˜ N∗,y;D)gi( ˜ N∗ i →˜ N(τ−1) i ) Λ( ˜ N(τ−1),y;D)gi( ˜ N(τ−1) i →˜ N∗ i )} 9: ˜ N (τ) ←˜ N ∗with probability q; otherwise ˜ N (τ) ←˜ N (τ−1). 10: y(τ) ←y(τ−1) 11: else 12: Randomly selects v ∈W. 13: y∗←y(τ−1) 14: Propose y(v)∗according to the proposal distribution hv(y(v)(τ−1) →y(v)∗) 15: q ←min{1, L( ˜ N,y∗;D)hv(y(v)∗→y(v)(τ−1)) L( ˜ N,y;D)hv(y(v)(τ−1)→y(v)∗) } 16: y(τ) ←y∗with probability q; otherwise y(τ) ←y(τ−1). 17: ˜ N (τ) ←˜ N (τ−1) 18: end if 19: τ ←τ + 1 20: until some termination condition is satisfied 21: Look at { ˜ N(τ) : τ > τ0} and view it as the sampled posterior distribution for ˜ N 22: Let ˆ N be the posterior mean of PK i=1 ˜ Ni + |W| with respect to the sampled posterior distribution. 4.2 General Stochastic Blockmodel In the Erd˝os-Rényi case, y(v) = ˜d(v). However, in the general stochastic blockmodel case, in addition to the unknown variables ˜N1, ˜N2, . . . , ˜NK to be estimated, we do not know yi(v) (v ∈W, i = 1, 2, 3, . . . , K) either. The expression L¬W (D; p) involves costly summation over all possibilities of integer composition of ˜d(v) (v ∈W). However, the joint posterior distribution for ˜N and y, which is proportional to ´ L( ˜N, y; D, p)φ( ˜N)ψ(p)dp, does not involve summing over integer partitions; thus we may sample from the joint posterior distribution for ˜N and y, and obtain the marginal distribution for ˜N. Our proposed algorithm PULSE realizes this idea. Let L( ˜N, y; D) = ´ L( ˜N, y; D, p)ψ(p)dp. We know that the joint posterior distribution for ˜N and y, denoted by Pr[ ˜N, y|D], is proportional to Λ( ˜N, y; D) ≜L( ˜N, y; D)ψ( ˜N). In addition, the conditional distributions Pr[ ˜Ni| ˜N¬i, y] and Pr[y(v)| ˜N, y(¬v)] are also proportional to L( ˜N, y; D)ψ( ˜N), where ˜N¬i = ( ˜Nj : 1 ≤j ≤K, j ̸= i), y(v) = (yi(v) : 1 ≤i ≤K) and y(¬v) = (y(w) : w ∈W, w ̸= v). The proposed algorithm PULSE is a Gibbs sampling process that samples from the joint posterior distribution (i.e., Pr[ ˜N, y|D]), which is specified in Algorithm 2. For every v ∈W and i = 1, 2, 3, . . . , K, 0 ≤yi(v) ≤˜Ni because the number of type-(i, t(v)) pendant edges of vertex v must not exceed the total number of type-i vertices outside the sample. Therefore, we have ˜Ni ≥maxv∈W yi(v) must hold for every i = 1, 2, 3, . . . , K. These observations put constraints on the choice of proposal distributions gi and hv, i = 1, 2, 3, . . . , K and v ∈W; i.e., the support of gi must be contained in [maxv∈W yi(v), ∞) ∩N and the support of hv must be contained in {y(v) : ∀1 ≤i ≤K, 0 ≤yi(v) ≤˜Ni, PK j=1 yi(v) = ˜d(v)}. 5 Let ωi be the window size for ˜Ni, taking values in N. Let l = max{maxv∈W yi(v), ˜N (τ−1) i −ωi}. Let the proposal distribution gi be defined as below: gi( ˜N (τ−1) i →˜N ∗ i ) = ( 1 2ωi+1 if l ≤˜N ∗ i ≤l + 2ωi 0 otherwise. The proposed value ˜N ∗ i is always greater than or equal to maxv∈W yi(v). This proposal distribution uniform within the window [l, l + 2ωi], and thus the proposal ratio is gi( ˜N ∗ i → ˜N (τ−1) i )/gi( ˜N (τ−1) i →˜N ∗ i ) = 1. The proposal for y(v) is detailed in the extended version [6]. 5 Experiment 5.1 Erd˝os-Rényi Effect of Parameter p. We first evaluate the performance of PULSE in the Erd˝os-Rényi case. We fix the size of the network at N = 1000 and the sample size |W| = 280 and vary the parameter p. For each p ∈[0.1, 0.9], we sample 100 graphs from G(N, p). For each selected graph, we compute NSUM and run PULSE 50 times (as it is a randomized algorithm) to compute its performance. We record the relative errors by the Tukey boxplots shown in Fig. 2a. The posterior mean proposed by PULSE is an accurate estimate of the size. For the parameter p varying from 0.1 to 0.9, most of the relative errors are bounded between −1% and 1%. We also observe that the NSUM tends to overestimate the size as it shows a positive bias. This confirms experimentally the result of Theorem 1. For both methods, the interquartile ranges (IQRs, hereinafter) correlate negatively with p. This shows that the variance of both estimators shrinks when the graph becomes denser. The relative errors of PULSE tend to concentrate around 0 with larger p which means that the performance of PULSE improves with larger p. In contrast, a larger p does not improve the bias of the NSUM. Effect of Network Size N. We fix the parameter p = 0.3 and the sample size |W| = 280 and vary the network size N from 400 to 1000. For each N ∈[400, 1000], we randomly pick 100 graphs from G(N, p). For each selected graph, we compute NSUM and run PULSE 50 times. We illustrate the results via Tukey boxplots in Fig. 2b. Again, the estimates given by PULSE are very accurate. Most of the relative errors reside in [−0.5%, 0.5%] and almost all reside in [−1%, 1%]. We also observe that smaller network sizes can be estimated more accurately as PULSE will have a smaller variance. For example, when the network size is N = 400, almost all of the relative errors are bounded in the range [−0.7%, 0.7%] while for N = 1000, the relative errors are in [−1.5%, 1.5%]. This agrees with our intuition that the performance of estimation improves with a larger sampling fraction. In contrast, NSUM heavily overestimates the network size as the size increases. In addition, its variance also correlates positively with network size. Effect of Sample Size |W|. We study the effect of the sample size |W| on the estimation error. Thus, we fix the size N = 1000 and the parameter p = 0.3, and we vary the sample size |W| from 100 to 500. For each |W| ∈[100, 500], we randomly select 100 graphs from G(N, p). For every selected graph, we compute the NSUM estimate, run PULSE 50 times, and record the relative errors. The results are presented in Fig. 2c. We observe that for both methods that the IQR shrinks as the sample size increases; thus a larger sample size reduces the variance of both estimators. PULSE does not exhibit appreciable bias when the sample size varies from 100 to 500. Again, NSUM overestimates the size; however, its bias reduces when the sample size becomes large. This reconfirms Theorem 1. 5.2 General Stochastic Blockmodel Effect of Sample Size and Type Partition. Here, we study the effect of the sample size and the type partition. We set the network size N to 200 and we assume that there are two types of vertices in this network: type 1 and type 2 with N1 and N2 nodes, respectively. The ratio N1/N quantifies the type partition. We vary N1/N from 0.2 to 0.8 and the sample size |W| from 40 to 160. For each combination of N1/N and the sample size |W|, we generate 50 graphs with p11, p22 ∼Uniform[0.5, 1] and p12 = p21 ∼Uniform[0, min{p11, p22}]. For each graph, we compute the NSUM and obtain the average relative error. Similarly, for each graph, we run PULSE 10 times in order to compute the average relative error for the 50 graphs and 10 estimates for each graph. The results are shown as heat maps in Fig. 2d. Note that the color bar on the right side of Fig. 6 −2.5 0.0 2.5 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 Parameter p Relative error (%) NSUM PULSE (a) −2 −1 0 1 2 400 500 600 700 800 900 1000 True network size Relative error (%) NSUM PULSE (b) −5 0 5 100 200 300 400 500 Sample size Relative error (%) NSUM PULSE (c) (d) −5 0 5 −0.3 −0.2 −0.1 0 0.1 0.2 0.3 Deviation from Erdos−Renyi Relative error (%) NSUM PULSE (e) −40 0 40 −0.3 −0.2 −0.1 0 0.1 0.2 0.3 Deviation from Erdos−Renyi Relative error (%) N1 (PULSE) N2 (PULSE) (f) −10 −5 0 5 10 1 2 3 4 5 6 Number of types (K) Relative error (%) NS 33% NS 50% NS 66% PU 33% PU 50% PU 66% (g) Figure 2: Fig. 2a, 2b and 2c are the results of the Erd˝os-Rényi case: (a) Effect of parameter p on the estimation error. (b) Effect of the network size on the estimation error. (c) Effect of the sample size on the estimation error. Fig. 2d, 2e, 2f and 2g are the results of the general SBM case: (d) Effect of sample size and type partition on the relative error. Note that the color bar on the right is on logarithmic scale. (e) Effect of deviation from the Erd˝os-Rényi model (controlled by ϵ) on the relative error of NSUM and PULSE in the SBM with K = 2. (f) Effect of deviation from the Erd˝os-Rényi model (controlled by ϵ) on the relative error of PULSE in estimating the number of type-1 and type-2 nodes in the SBM with K = 2. (g) Effect of the number of types K and the sample size on the population estimation. The percentages are the sampling fractions n/N. The horizontal axis represents the number of types K that varies from 1 to 6. The vertical axis is the relative error in percentage. 2d is on logarithmic scale. In general, the estimates given by PULSE are very accurate and exhibit significant superiority over the NSUM estimates. The largest relative errors of PULSE in absolute value, which are approximately 1%, appear in the upper-left and lower-left corner on the heat map. The performance of the NSUM (see the right subfigure in Fig. 2d) is robust to the type partition and equivalently the ratio N1/N. As we enlarge the sample size, its relative error decreases. The left subfigure in Fig. 2d shows the performance of PULSE. When the sample size is small, the relative error decreases as N1/N increases from 0.2 to 0.5; when N1/N rises from 0.5 to 0.8, the relative error becomes large. Given the fixed ratio N1/N, as expected, the relative error declines when we have a larger sample. This agrees with our observation in the Erd˝os-Rényi case. However, when the sample size is large, PULSE exhibits better performance when the type partition is more homogeneous. There is a local minimum relative error in absolute value shown at the center of the subfigure. PULSE performs best when there is a balance between the number of edges in the sampled 7 induced subgraph and the number of pendant edges emanating outward. Larger sampled subgraphs allow more precision in knowledge about pij, but more pendant edges allow for better estimation of y, and hence each Ni. Thus when the sample is about half of the network size, the balanced combination of the number of edges within the sample and those emanating outward leads to better performance. Effect of Intra- and Inter-Community Edge Probability. Suppose that there are two types of nodes in the network. The mean degree is given by dmean = 2 N hN1 2  p11 + N1 2  p22 + N1N2p12 i . We want to keep the mean degree constant and vary the random graph gradually so that we observe 3 phases: high intra-community and low inter-community edge probability (more cohesive), Erd˝os-Rényi , and low intra-community and high inter-community edge probability (more incohesive). We introduce a cohesion parameter ϵ. In the two-block model, we have p11 = p22 = p01 = ˜p, where ˜p is a constant. Let’s call ϵ the deviation from this situation and let p11 = ˜p + N1N2ϵ 2( N1 2 ) , p22 = ˜p + N1N2ϵ 2( N2 2 ) , p12 = ˜p −ϵ. The mean degree stays constant for different ϵ. In addition, p11, p12 and p22 must reside in [0, 1]. This requirement can be met if we set the absolute value of ϵ small enough. By changing ϵ from positive to negative we go from cohesive behavior to incohesive behavior. Clearly, for ϵ = 0, the graph becomes an Erd˝os-Rényi graph with p11 = p22 = p01 = ˜p. We set the network size N to 850, N1 to 350, and N2 to 500. We fix ˜p = 0.5 and let ϵ vary from −0.3 to 0.3. When ϵ = 0.3, the intra-community edge probabilities are p11 = 0.9298 and p22 = 0.7104 and the inter-community edge probability is p12 = 0.2. When ϵ = −0.3, the intra-community edge probabilities are p11 = 0.0702 and p22 = 0.2896 and the inter-community edge probability is p12 = 0.8. For each ϵ, we generate 500 graphs and for each graph, we run PULSE 50 times. Given each value of ϵ, relative errors are shown in box plots. We present the results in Fig. 2e as we vary ϵ. From Fig. 2e, we observe that despite deviation from the Erd˝os-Rényi graph, both methods are robust. However, the figure indicates that PULSE is unbiased (as median is around zero) while NSUM overestimates the size on average. This again confirms Theorem 1. An important feature of PULSE is that it can also estimate the number of nodes of each type while NSUM cannot. The results for type-1 and type-2 with different ϵ are shown in Fig. 2f. We observe that the median of all boxes agree with the 0% line; thus the separate estimates for N1 or N2 are unbiased. Note that when the edge probabilities are more homogeneous (i.e., when the graph becomes more similar to the Erd˝os-Rényi model) the IQRs, as well as the interval between the two ends of the whiskers, become larger. This shows that when we try to fit an Erd˝os-Rényi model (a single-type stochastic blockmodel) into a two-type model, the variance becomes larger. Effect of Number of Types and Sample Size. Finally, we study the impact of the number of types K and the sample size |W| = n on the relative error. To generate graphs with different number of types, we use a Chinese restaurant process (CRP) [1]. We set the total number of vertices to 200, first pick 100 vertices and use the Chinese restaurant process to assign them to different types. Suppose that CRP gives K types; We then distribute the remaining 100 vertices evenly among the K types. The edge probability pii (1 ≤i ≤K) is sampled from Uniform[0.7, 1] and pij (1 ≤i < j ≤K) is sampled from Uniform[0, min{pii, pjj}], all independently. We set the sampling fraction n/N to 33%, 50% and 66%, and use NSUM and PULSE to estimate the network size. Relative estimation errors are illustrated in Fig. 2g. We observe that with the same sampling fraction n/N and same the number of types K, PULSE has a smaller relative error than that of the NSUM. Similarly, the interquartile range of PULSE is also smaller than that of the NSUM. Hence, PULSE provides a higher accuracy with a smaller variance. For both methods the relative error decreases (in absolute value) as the sampling fraction increases. Accordingly, the IQRs also shrink for larger sampling fraction. With the sampling fraction fixed, the IQRs become larger when we increase the number of types in the graph. The variance of both methods increases for increasing values of K. The median of NSUM is always above 0 on average which indicates that it overestimates the network size. Acknowledgements This research was supported by Google Faculty Research Award, DARPA Young Faculty Award (D16AP00046), NIH grants from NICHD DP2HD091799, NCATS KL2 TR000140, and NIMH P30 MH062294, the Yale Center for Clinical Investigation, and the Yale Center for Interdisciplinary Research on AIDS. LC thanks Zheng Wei for his consistent support. 8 References [1] D. J. Aldous. Exchangeability and related topics. Springer, 1985. [2] H. Bernard, E. Johnsen, P. Killworth, and S. Robinson. How many people died in the mexico city earthquake. Estimating the Number of People in an Average Network and in an Unknown Event Population. The Small World, ed. M. Kochen (forthcoming). Newark, 1988. [3] H. R. Bernard, P. D. Killworth, E. C. Johnsen, G. A. Shelley, and C. McCarty. Estimating the ripple effect of a disaster. Connections, 24(2):18–22, 2001. [4] M. S. Bernstein, E. Bakshy, M. Burke, and B. Karrer. Quantifying the invisible audience in social networks. In Proc. SIGCHI, pages 21–30. ACM, 2013. [5] L. Chen, F. W. Crawford, and A. Karbasi. Seeing the unseen network: Inferring hidden social ties from respondent-driven sampling. In AAAI, pages 1174–1180, 2016. [6] L. Chen, A. Karbasi, and F. W. Crawford. Estimating the size of a large network and its communities from a random sample. arXiv preprint arXiv:1610.08473, 2016. https://arxiv.org/abs/1610.08473. [7] F. W. Crawford. The graphical structure of respondent-driven sampling. Sociological Methodology, 46(1):187–211, 2016. [8] S. Ezoe, T. Morooka, T. Noda, M. L. Sabin, and S. Koike. Population size estimation of men who have sex with men through the network scale-up method in Japan. PLoS One, 7(1):e31184, 2012. [9] D. M. Feehan and M. J. Salganik. Generalizing the network scale-up method: a new estimator for the size of hidden populations. Sociological Methodology, 46(1):153–186, 2016. [10] M. Girvan and M. E. Newman. Community structure in social and biological networks. PNAS, 99(12):7821– 7826, 2002. [11] W. Guo, S. Bao, W. Lin, G. Wu, W. Zhang, W. Hladik, A. Abdul-Quader, M. Bulterys, S. Fuller, and L. Wang. Estimating the size of HIV key affected populations in Chongqing, China, using the network scale-up method. PLoS One, 8(8):e71796, 2013. [12] C. Kadushin, P. D. Killworth, H. R. Bernard, and A. A. Beveridge. Scale-up methods as applied to estimates of heroin use. Journal of Drug Issues, 2006. [13] L. Katzir, E. Liberty, and O. Somekh. Estimating sizes of social networks via biased sampling. In WWW, pages 597–606. ACM, 2011. [14] P. D. Killworth, C. McCarty, H. R. Bernard, G. A. Shelley, and E. C. Johnsen. Estimation of seroprevalence, rape, and homelessness in the United States using a social network approach. Eval. Rev., 22(2):289–308, 1998. [15] A. S. Maiya and T. Y. Berger-Wolf. Benefits of bias: Towards better characterization of network sampling. In Proc. SIGKDD, pages 105–113. ACM, 2011. [16] L. Massoulié, E. Le Merrer, A.-M. Kermarrec, and A. Ganesh. Peer counting and sampling in overlay networks: random walk methods. In Proc. PODC, pages 123–132. ACM, 2006. [17] B. H. Murray and A. Moore. Sizing the internet. White paper, Cyveillance, page 3, 2000. [18] M. E. Newman. Modularity and community structure in networks. PNAS, 103(23):8577–8582, 2006. [19] M. Papagelis, G. Das, and N. Koudas. Sampling online social networks. TKDE, 25(3):662–676, 2013. [20] A. Rényi and P. Erd˝os. On random graphs. Publicationes Mathematicae, 6:290–297, 1959. [21] B. Ribeiro and D. Towsley. Estimating and sampling graphs with multidimensional random walks. In Proc. IMC, pages 390–403. ACM, 2010. [22] M. J. Salganik, D. Fazito, N. Bertoni, A. H. Abdo, M. B. Mello, and F. I. Bastos. Assessing network scale-up estimates for groups most at risk of HIV/AIDS: evidence from a multiple-method study of heavy drug users in Curitiba, Brazil. American Journal of Epidemiology, 174(10):1190–1196, 2011. [23] M. Shokoohi, M. R. Baneshi, and A.-a. Haghdoost. Size estimation of groups at high risk of HIV/AIDS using network scale up in Kerman, Iran. Int’l J. Prev. Medi., 3(7):471, 2012. [24] S. Xing and B.-P. Paris. Measuring the size of the internet via importance sampling. J. Sel. Areas Commun, 21(6):922–933, 2003. 9
2016
323
6,243
Generalization of ERM in Stochastic Convex Optimization: The Dimension Strikes Back∗ Vitaly Feldman IBM Research – Almaden Abstract In stochastic convex optimization the goal is to minimize a convex function F(x) .= Ef∼D[f(x)] over a convex set K ⊂Rd where D is some unknown distribution and each f(·) in the support of D is convex over K. The optimization is commonly based on i.i.d. samples f 1, f 2, . . . , f n from D. A standard approach to such problems is empirical risk minimization (ERM) that optimizes FS(x) .= 1 n P i≤n f i(x). Here we consider the question of how many samples are necessary for ERM to succeed and the closely related question of uniform convergence of FS to F over K. We demonstrate that in the standard ℓp/ℓq setting of Lipschitz-bounded functions over a K of bounded radius, ERM requires sample size that scales linearly with the dimension d. This nearly matches standard upper bounds and improves on Ω(log d) dependence proved for ℓ2/ℓ2 setting in [18]. In stark contrast, these problems can be solved using dimension-independent number of samples for ℓ2/ℓ2 setting and log d dependence for ℓ1/ℓ∞setting using other approaches. We further show that our lower bound applies even if the functions in the support of D are smooth and efficiently computable and even if an ℓ1 regularization term is added. Finally, we demonstrate that for a more general class of bounded-range (but not Lipschitz-bounded) stochastic convex programs an infinite gap appears already in dimension 2. 1 Introduction Numerous central problems in machine learning, statistics and operations research are special cases of stochastic optimization from i.i.d. data samples. In this problem the goal is to optimize the value of the expected objective function F(x) .= Ef∼D[f(x)] over some set K given i.i.d. samples f 1, f 2, . . . , f n of f. For example, in supervised learning the set K consists of hypothesis functions from Z to Y and each sample is an example described by a pair (z, y) ∈(Z, Y ). For some fixed loss function L : Y × Y →R, an example (z, y) defines a function from K to R given by f(z,y)(h) = L(h(z), y). The goal is to find a hypothesis h that (approximately) minimizes the expected loss relative to some distribution P over examples: E(z,y)∼P [L(h(z), y)] = E(z,y)∼P [f(z,y)(h)]. Here we are interested in stochastic convex optimization (SCO) problems in which K is some convex subset of Rd and each function in the support of D is convex over K. The importance of this setting stems from the fact that such problems can be solved efficiently via a large variety of known techniques. Therefore in many applications even if the original optimization problem is not convex, it is replaced by a convex relaxation. A classic and widely-used approach to solving stochastic optimization problems is empirical risk minimization (ERM) also referred to as stochastic average approximation (SAA) in the optimization ∗See [9] for the full version of this work. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. literature. In this approach, given a set of samples S = (f 1, f 2, . . . , f n) the empirical objective function: FS(x) .= 1 n P i≤n f i(x) is optimized (sometimes with an additional regularization term such as λ∥x∥2 for some λ > 0). The question we address here is the number of samples required for this approach to work distribution-independently. More specifically, for some fixed convex body K and fixed set of convex functions F over K, what is the smallest number of samples n such that for every probability distribution D supported on F, any algorithm that minimizes FS given n i.i.d. samples from D will produce an ϵ-optimal solution ˆx to the problem (namely, F(ˆx) ≤minx∈K F(x)+ϵ) with probability at least 1−δ? We will refer to this number as the sample complexity of ERM for ϵ-optimizing F over K (we will fix δ = 1/2 for now). The sample complexity of ERM for ϵ-optimizing F over K is lower bounded by the sample complexity of ϵ-optimizing F over K, that is the number of samples that is necessary to find an ϵ-optimal solution for any algorithm. On the other hand, it is upper bounded by the number of samples that ensures uniform convergence of FS to F. Namely, if with probability ≥1 −δ, for all x ∈K, |FS(x) −F(x)| ≤ϵ/2 then, clearly, any algorithm based on ERM will succeed. As a result, ERM and uniform convergence are the primary tool for analysis of the sample complexity of learning problems and are the key subject of study in statistical learning theory. Fundamental results in VC theory imply that in some settings, such as binary classification and least-squares regression, uniform convergence is also a necessary condition for learnability (e.g. [23, 17]) and therefore the three measures of sample complexity mentioned above nearly coincide. In the context of stochastic convex optimization the study of sample complexity of ERM and uniform convergence was initiated in a groundbreaking work of Shalev-Shwartz, Shamir, Srebro and Sridharan [18]. They demonstrated that the relationships between these notions of sample complexity are substantially more delicate even in the most well-studied settings of SCO. Specifically, let K be a unit ℓ2 ball and F be the set of all convex sub-differentiable functions with Lipschitz constant relative to ℓ2 bounded by 1 or, equivalently, ∥∇f(x)∥2 ≤1 for all x ∈K. Then, known algorithm for SCO imply that sample complexity of this problem is O(1/ϵ2) and often expressed as 1/√n rate of convergence (e.g. [14, 17]). On the other hand, Shalev-Shwartz et al.[18] show2 that the sample complexity of ERM for solving this problem with ϵ = 1/2 is Ω(log d). The only known upper bound for sample complexity of ERM is ˜O(d/ϵ2) and relies only on the uniform convergence of Lipschitz-bounded functions [21, 18]. As can seen from this discussion, the work of Shalev-Shwartz et al.[18] still leaves a major gap between known bounds on sample complexity of ERM (and also uniform convergence) for this basic Lipschitz-bounded ℓ2/ℓ2 setup. Another natural question is whether the gap is present in the popular ℓ1/ℓ∞setup. In this setup K is a unit ℓ1 ball (or in some cases a simplex) and ∥∇f(x)∥∞≤1 for all x ∈K. The sample complexity of SCO in this setup is θ(log d/ϵ2) (e.g. [14, 17]) and therefore, even an appropriately modified lower bound in [18], does not imply any gap. More generally, the choice of norm can have a major impact on the relationship between these sample complexities and hence needs to be treated carefully. For example, for (the reversed) ℓ∞/ℓ1 setting the sample complexity of the problem is θ(d/ϵ2) (e.g. [10]) and nearly coincides with the number of samples sufficient for uniform convergence. 1.1 Overview of Results In this work we substantially strengthen the lower bound in [18] proving that a linear dependence on the dimension d is necessary for ERM (and, consequently, uniform convergence). We then extend the lower bound to all ℓp/ℓq setups and examine several related questions. Finally, we examine a more general setting of bounded-range SCO (that is |f(x)| ≤1 for all x ∈K). While the sample complexity of this setting is still low (for example ˜O(1/ϵ2) when K is an ℓ2 ball) and efficient algorithms are known, we show that ERM might require an infinite number of samples already for d = 2. Our work implies that in SCO, even optimization algorithms that exactly minimize the empirical objective function can produce solutions with generalization error that is much larger than the generalization error of solutions obtained via some standard approaches. Another, somewhat counterintuitive, conclusion from our lower bounds is that, from the point of view of generalization of ERM and uniform convergence, convexity does not reduce the sample complexity in the worst case. 2The dependence on d is not stated explicitly but follows immediately from their analysis. 2 Basic construction: Our basic construction is fairly simple and its analysis is inspired by the technique in [18]. It is based on functions of the form max{1/2, maxv∈V ⟨v, x⟩}. Note that the maximum operator preserves both convexity and Lipschitz bound (relative to any norm). See Figure 1 for an illustration of such function for d = 2. Figure 1: Basic construction for d = 2. The distribution over the sets V that define such functions is uniform over all subsets of some set of vectors W of size 2d/6 such that for any two district u, v ∈W, ⟨u, v⟩≤1/2. Equivalently, each element of W is included in V with probability 1/2 independently of other elements in W. This implies that if the number of samples is less than d/6 then, with probability > 1/2, at least one of the vectors in W (say w) will not be observed in any of the samples. This implies that FS can be minimized while maximizing ⟨w, x⟩(the maximum over the unit ℓ2 ball is w). Note that a function randomly chosen from our distribution includes the term ⟨w, x⟩in the maximum operator with probability 1/2. Therefore the value of the expected function F at w is 3/4 whereas the minimum of F is 1/2. In particular, there exists an ERM algorithm with generalization error of at least 1/4. The details of the construction appear in Sec. 3.1 and Thm. 3.3 gives the formal statement of the lower bound. We also show that, by scaling the construction appropriately, we can obtain the same lower bound for any ℓp/ℓq setup with 1/p + 1/q = 1 (see Thm. 3.4). Low complexity construction: The basic construction relies on functions that require 2d/6 bits to describe and exponential time to compute. Most application of SCO use efficiently computable functions and therefore it is natural to ask whether the lower bound still holds for such functions. To answer this question we describe a construction based on a set of functions where each function requires just log d bits to describe (there are at most d/2 functions in the support of the distribution) and each function can be computed in O(d) time. To achieve this we will use W that consists of (scaled) codewords of an asymptotically good and efficiently computable binary error-correcting code [12, 22]. The functions are defined in a similar way but the additional structure of the code allows to use at most d/2 subsets of W to define the functions. Further details of the construction appear in Section 4. Smoothness: The use of maximum operator results in functions that are highly non-smooth (that is, their gradient is not Lipschitz-bounded) whereas the construction in [18] uses smooth functions. Smoothness plays a crucial role in many algorithms for convex optimization (see [5] for examples). It reduces the sample complexity of SCO in ℓ2/ℓ2 setup to O(1/ϵ) when the smoothness parameter is a constant (e.g. [14, 17]). Therefore it is natural to ask whether our strong lower bound holds for smooth functions as well. We describe a modification of our construction that proves a similar lower bound in the smooth case (with generalization error of 1/128). The main idea is to replace each linear function ⟨v, x⟩with some smooth function ν(⟨v, x⟩) guaranteing that for different vectors v1, v2 ∈W and every x ∈K, only one of ν(⟨v1, x⟩) and ν(⟨v2, x⟩) can be non-zero. This allows to easily control the smoothness of maxv∈V ν(⟨v, x⟩). See Figure 2 for an illustration of a function on which the construction is based (for d = 2). The details of this construction appear in Sec. 3.2 and the formal statement in Thm. 3.6. 3 Figure 2: Construction using 1-smooth functions for d = 2. ℓ1-regularization: Another important contribution in [18] is the demonstration of the important role that strong convexity plays for generalization in SCO: Minimization of FS(x) + λR(x) ensures that ERM will have low generalization error whenever R(x) is strongly convex (for a sufficiently large λ). This result is based on the proof that ERM of a strongly convex Lipschitz function is uniform replace-one stable and the connection between such stability and generalization showed in [4] (see also [19] for a detailed treatment of the relationship between generalization and stability). It is natural to ask whether other approaches to regularization will ensure generalization. We demonstrate that for the commonly used ℓ1 regularization the answer is negative. We prove this using a simple modification of our lower bound construction: We shift the functions to the positive orthant where the regularization terms λ∥x∥1 is just a linear function. We then subtract this linear function from each function in our construction, thereby balancing the regularization (while maintaining convexity and Lipschitz-boundedness). The details of this construction appear in Sec. 3.3 (see Thm. 3.7). Dependence on accuracy: For simplicity and convenience we have ignored the dependence on the accuracy ϵ, Lipschitz bound L and radius R of K in our lower bounds. It is easy to see, that this more general setting can be reduced to the case we consider here (Lipschitz bound and radius are equal to 1) with accuracy parameter ϵ′ = ϵ/(LR). We generalize our lower bound to this setting and prove that Ω(d/ϵ′2) samples are necessary for uniform convergence and Ω(d/ϵ′) samples are necessary for generalization of ERM. Note that the upper bound on the sample complexity of these settings is ˜O(d/ϵ′2) and therefore the dependence on ϵ′ in our lower bound does not match the upper bound for ERM. Resolving this gap or even proving any ω(d/ϵ′ + 1/ϵ′2) lower bound is an interesting open problem. Additional details can be found in the full version. Bounded-range SCO: Finally, we consider a more general class of bounded-range convex functions Note that the Lipschitz bound of 1 and the bound of 1 on the radius of K imply a bound of 1 on the range (up to a constant shift which does not affect the optimization problem). While this setting is not as well-studied, efficient algorithms for it are known. For example, the online algorithm in a recent work of Rakhlin and Sridharan [16] together with standard online-to-batch conversion arguments [6], imply that the sample complexity of this problem is ˜O(1/ϵ2) for any K that is an ℓ2 ball (of any radius). For general convex bodies K, the problems can be solved via random walk-based approaches [3, 10] or an adaptation of the center-of-gravity method given in [10]. Here we show that for this setting ERM might completely fail already for K being the unit 2-dimensional ball. The construction is based on ideas similar to those we used in the smooth case and is formally described in in the full version. 2 Preliminaries For an integer n ≥1 let [n] .= {1, . . . , n}. Random variables are denoted by bold letters, e.g., f. Given p ∈[1, ∞] we denote the ball of radius R > 0 in ℓp norm by Bd p(R), and the unit ball by Bd p. For a convex body (i.e., compact convex set with nonempty interior) K ⊆Rd, we consider problems of the form min K (FD) .= min x∈K  FD(x) .= E f∼D[f(x)]  , 4 where f is a random variable defined over some set of convex, sub-differentiable functions F on K and distributed according to some unknown probability distribution D. We denote F ∗= minK(FD). For an approximation parameter ϵ > 0 the goal is to find x ∈K such that FD(x) ≤F ∗+ ϵ and we call any such x an ϵ-optimal solution. For an n-tuple of functions S = (f 1, . . . , f n) we denote by FS .= 1 n P i∈[n] f i. We say that a point ˆx is an empirical risk minimum for an n-tuple S of functions over K, if FS(ˆx) = minK(FS). In some cases there are many points that minimize FS and in this case we refer to a specific algorithm that selects one of the minimums of FS as an empirical risk minimizer. To make this explicit we refer to the output of such a minimizer by ˆx(S) . Given x ∈K, and a convex function f we denote by ∇f(x) ∈∂f(x) an arbitrary selection of a subgradient. Let us make a brief reminder of some important classes of convex functions. Let p ∈[1, ∞] and q = p∗.= 1/(1 −1/p). We say that a subdifferentiable convex function f : K →R is in the class • F(K, B) of B-bounded-range functions if for all x ∈K, |f(x)| ≤B. • F0 p(K, L) of L-Lipschitz continuous functions w.r.t. ℓp, if for all x, y ∈K, |f(x) −f(y)| ≤ L∥x −y∥p; • F1 p(K, σ) of functions with σ-Lipschitz continuous gradient w.r.t. ℓp, if for all x, y ∈K, ∥∇f(x) −∇f(y)∥q ≤σ∥x −y∥p. We will omit p from the notation when p = 2. Omitted proofs can be found in the full version [9]. 3 Lower Bounds for Lipschitz-Bounded SCO In this section we present our main lower bounds for SCO of Lipschitz-bounded convex functions. For comparison purposes we start by formally stating some known bounds on sample complexity of solving such problems. The following uniform convergence bounds can be easily derived from the standard covering number argument (e.g. [21, 18]) Theorem 3.1. For p ∈[1, ∞], let K ⊆Bd p(R) and let D be any distribution supported on functions L-Lipschitz on K relative to ℓp (not necessarily convex). Then, for every ϵ, δ > 0 and n ≥n1 = O  d·(LR)2·log(dLR/(ϵδ)) ϵ2  Pr S∼Dn [∃x ∈K, |FD(x) −FS(x)| ≥ϵ] ≤δ. The following upper bounds on sample complexity of Lipschitz-bounded SCO can be obtained from several known algorithms [14, 18] (see [17] for a textbook exposition for p = 2). Theorem 3.2. For p ∈[1, 2], let K ⊆Bd p(R). Then, there is an algorithm Ap that given ϵ, δ > 0 and n = np(d, R, L, ϵ, δ) i.i.d. samples from any distribution D supported on F0 p(K, L), outputs an ϵoptimal solution to FD over K with probability ≥1−δ. For p ∈(1, 2], np = O((LR/ϵ)2 ·log(1/δ)) and for p = 1, np = O((LR/ϵ)2 · log d · log(1/δ)). Stronger results are known under additional assumptions on smoothness and/or strong convexity (e.g. [14, 15, 20, 1]). 3.1 Non-smooth construction We will start with a simpler lower bound for non-smooth functions. For simplicity, we will also restrict R = L = 1. Lower bounds for the general setting can be easily obtained from this case by scaling the domain and desired accuracy. We will need a set of vectors W ⊆{−1, 1}d with the following property: for any distinct w1, w2 ∈ W, ⟨w1, w2⟩≤d/2. The Chernoff bound together with a standard packing argument imply that there exists a set W with this property of size ≥ed/8 ≥2d/6. For any subset V of W we define a function gV (x) .= max{1/2, max w∈V ⟨¯w, x⟩}, (1) 5 where ¯w .= w/∥w∥= w/ √ d. See Figure 1 for an illustration. We first observe that gV is convex and 1-Lipschitz (relative to ℓ2). This immediately follows from ⟨¯w, x⟩being convex and 1-Lipschitz for every w and gV being the maximum of convex and 1-Lipschitz functions. Theorem 3.3. Let K = Bd 2 and we define H2 .= {gV | V ⊆W} for gV defined in eq. (1). Let D be the uniform distribution over H2. Then for n ≤d/6 and every set of samples S there exists an ERM ˆx(S) such that Pr S∼Dn [FD(ˆx(S)) −F ∗≥1/4] > 1/2. Proof. We start by observing that the uniform distribution over H2 is equivalent to picking the function gV where V is obtained by including every element of W with probability 1/2 randomly and independently of all other elements. Further, by the properties of W, for every w ∈W, and V ⊆W, gV ( ¯w) = 1 if w ∈V and gV ( ¯w) = 1/2 otherwise. For gV chosen randomly with respect to D, we have that w ∈V with probability exactly 1/2. This implies that FD( ¯w) = 3/4. Let S = (gV1, . . . , gVn) be the random samples. Observe that minK(FS) = 1/2 and F ∗= minK(FD) = 1/2 (the minimum is achieved at the origin ¯0). Now, if S i∈[n] Vi ̸= W then let ˆx(S) .= ¯w for any w ∈W \ S i∈[n] Vi. Otherwise ˆx(S) is defined to be the origin ¯0. Then by the property of H2 mentioned above, we have that for all i, gVi(ˆx(S)) = 1/2 and hence FS(ˆx(S)) = 1/2. This means that ˆx(S) is a minimizer of FS. Combining these statements, we get that, if S i∈[n] Vi ̸= W then there exists an ERM ˆx(S) such that FS(ˆx(S)) = minK(FS) and FD(ˆx(S)) −F ∗= 1/4. Therefore to prove the claim it suffices to show that for n ≤d/6 we have that Pr S∼Dn  [ i∈[n] Vi ̸= W  > 1 2. This easily follows from observing that for the uniform distribution over subsets of W, for every w ∈W, Pr S∼Dn  w ∈ [ i∈[n] Vi  = 1 −2−n and this event is independent from the inclusion of other elements in S i∈[n] Vi. Therefore Pr S∼Dn  [ i∈[n] Vi = W  = 1 −2−n|W | ≤e−2−n·2d/6 ≤e−1 < 1 2. Other ℓp norms: We now observe that exactly the same approach can be used to extend this lower bound to ℓp/ℓq setting. Specifically, for p ∈[1, ∞] and q = p∗we define gp,V (x) .= max 1 2, max w∈V ⟨w, x⟩ d1/q  . It is easy to see that for every V ⊆W, gq,V ∈F0 p(Bd p, 1). We can now use the same argument as before with the appropriate normalization factor for points in Bd p. Namely, instead of ¯w for w ∈W we consider the values of the minimized functions at w/d1/p ∈Bd p. This gives the following generalization of Thm. 3.3. Theorem 3.4. For every p ∈[1, ∞] let K = Bd p and we define Hp .= {gp,V | V ⊆W} and let D be the uniform distribution over Hp. Then for n ≤d/6 and every set of samples S there exists an ERM ˆx(S) such that Pr S∼Dn [FD(ˆx(S)) −F ∗≥1/4] > 1/2. 6 3.2 Smoothness does not help We now extend the lower bound to smooth functions. We will for simplicity restrict our attention to ℓ2 but analogous modifications can be made for other ℓp norms. The functions gV that we used in the construction use two maximum operators each of which introduces non-smoothness. To deal with maximum with 1/2 we simply replace the function max{1/2, ⟨¯w, x⟩} with a quadratically smoothed version (in the same way as hinge loss is sometimes replaced with modified Huber loss). To deal with the maximum over all w ∈V , we show that it is possible to ensure that individual components do not “interact". That is, at every point x, the value, gradient and Hessian of at most one component function are non-zero (value, vector and matrix, respectively). This ensures that maximum becomes addition and Lipschitz/smoothness constants can be upper-bounded easily. Formally, we define ν(a) .=  0 if a ≤0 a2 otherwise. Now, for V ⊆W, we define hV (x) .= X w∈V ν(⟨¯w, x⟩−7/8). (2) See Figure 2 for an illustration. We first prove that hV is 1/4-Lipschitz and 1-smooth. Lemma 3.5. For every V ⊆W and hV defined in eq. (2) we have hV ∈F0 2(Bd 2, 1/4) ∩F1 2(Bd 2, 1). From here we can use the proof approach from Thm. 3.3 but with hV in place of gV . Theorem 3.6. Let K = Bd 2 and we define H .= {hV | V ⊆W} for hV defined in eq. (2). Let D be the uniform distribution over H. Then for n ≤d/6 and every set of samples S there exists an ERM ˆx(S) such that Pr S∼Dn [FD(ˆx(S)) −F ∗≥1/128] > 1/2. 3.3 ℓ1 Regularization does not help Next we show that the lower bound holds even with an additional ℓ1 regularization term λ∥x∥for positive λ ≤1/ √ d. (Note that if λ > 1/ √ d then the resulting program is no longer 1-Lipschitz relative to ℓ2. Any constant λ can be allowed for ℓ1/ℓ∞setup). To achieve this we shift the construction to the positive orthant (that is x such that xi ≥0 for all i ∈[d]). In this orthant the subgradient of the regularization term is simply λ¯1 where ¯1 is the all 1’s vector. We can add a linear term to each function in our distribution that balances this term thereby reducing the analysis to non-regularized case. More formally, we define the following family of functions. For V ⊆W, hλ V (x) .= hV (x −¯1/ √ d) −λ⟨¯1, x⟩. (3) Note that over Bd 2(2), hλ V (x) is L-Lipschitz for L ≤2(2 −7/8) + λ √ d ≤9/4. We now state and prove this formally. Theorem 3.7. Let K = Bd 2(2) and for a given λ ∈(0, 1/ √ d], we define Hλ .= {hλ V | V ⊆W} for hλ V defined in eq. (3). Let D be the uniform distribution over Hλ. Then for n ≤d/6 and every set of samples S there exists ˆx(S) such that • FS(ˆx(S)) = minx∈K(FS(x) + λ∥x∥1); • PrS∼Dn [FD(ˆx(S)) −F ∗≥1/128] > 1/2. 4 Lower Bound for Low-Complexity Functions We will now demonstrate that our lower bounds hold even if one restricts the attention to functions that can be computed efficiently (in time polynomial in d). For this purpose we will rely on known constructions of binary linear error-correcting codes. We describe the construction for non-smooth ℓ2/ℓ2 setting but analogous versions of other constructions can be obtained in the same way. 7 We start by briefly providing the necessary background about binary codes. For two vectors w1, w2 ∈ {±1}d let #̸=(w1, w2) denote the Hamming distance between the two vectors. We say that a mapping G : {±1}k →{±1}d is a [d, k, r, T] binary error-correcting code if G has distance at least 2r + 1, G can be computed in time T and there exists an algorithm that for every w ∈{±1}d such that for some z ∈{±1}k, #̸=(w, G(z)) ≤r finds such z in time T (note that such z is unique). Given [d, k, r, T] code G, for every j ∈[k], we define a function gj(x) .= max  1 −r 2d, max w∈Wj⟨¯w, x⟩  , (4) where Wj .= {G(z) | z ∈{±1}k, zj = 1}. As before, we note that gj is convex and 1-Lipschitz (relative to ℓ2). We can now use any existing constructions of efficient binary error-correcting codes to obtain a lower bound that uses only a small set of efficiently computable convex functions. Getting a lower bound that has asymptotically optimal dependence on d requires that k = Ω(d) and r = Ω(d) (referred to as being asymptotically good). The existence of efficiently computable and asymptotically good binary error-correcting codes was first shown by Justesen [12]. More recent work of Spielman [22] shows existence of asymptotically good codes that can be encoded and decoded in O(d) time. In particular, for some constant ρ > 0, there exists a [d, d/2, ρ · d, O(d)] binary error-correcting code. As a corollary we obtain the following lower bound. Corollary 4.1. Let G be an asymptotically-good [d, d/2, ρ · d, O(d)] error-correcting code for a constant ρ > 0. Let K = Bd 2 and we define HG .= {gj | j ∈[d/2]} for gj defined in eq. (4). Let D be the uniform distribution over HG. Then for every x ∈K, gj(x) can be computed in time O(d). Further, for n ≤d/4 and every set of samples S ∈Hn G there exists an ERM ˆx(S) such that FD(ˆx(S)) −F ∗≥ρ/4. 5 Discussion Our work points out to substantial limitations of the classic approach to understanding and analysis of generalization in the context of general SCO. Further, it implies that in order to understand how well solutions produced by an optimization algorithm generalize, it is necessary to examine the optimization algorithm itself. This is a challenging task that we still have relatively few tools to address. Yet such understanding is also crucial for developing theory to guide the design of optimization algorithms that are used in machine learning applications. One way to bypass our lower bounds is to use additional structural assumptions. For example, for generalized linear regression problems uniform convergence gives nearly optimal bounds on sample complexity [13]. One natural question is whether there exist more general classes of functions that capture most of the practically relevant SCO problems and enjoy dimension-independent (or, scaling as log d) uniform convergence bounds. An alternative approach is to bypass uniform convergence (and possibly also ERM) altogether. Among a large number of techniques that have been developed for ensuring generalization, the most general ones are based on notions of stability [4, 19]. However, known analyses based on stability often do not provide the strongest known generalization guarantees (e.g. high probability bounds require very strong assumptions). Another issue is that we lack general algorithmic tools for ensuring stability of the output. Therefore many open problems remain and significant progress is required to obtain a more comprehensive understanding of this approach. Some encouraging new developments in this area are the use of notions of stability derived from differential privacy [7, 8, 2] and the use of techniques for analysis of convergence of convex optimization algorithms for proving stability [11]. Acknowledgements I am grateful to Ken Clarkson, Sasha Rakhlin and Thomas Steinke for discussions and insightful comments related to this work. 8 References [1] F. R. Bach and E. Moulines. Non-strongly-convex smooth stochastic approximation with convergence rate o(1/n). In NIPS, pages 773–781, 2013. [2] R. Bassily, K. Nissim, A. D. Smith, T. Steinke, U. Stemmer, and J. Ullman. Algorithmic stability for adaptive data analysis. In STOC, pages 1046–1059, 2016. [3] A. Belloni, T. Liang, H. Narayanan, and A. Rakhlin. Escaping the local minima via simulated annealing: Optimization of approximately convex functions. In COLT, pages 240–265, 2015. [4] O. Bousquet and A. Elisseeff. Stability and generalization. JMLR, 2:499–526, 2002. [5] S. Bubeck. Convex optimization: Algorithms and complexity. Foundations and Trends in Machine Learning, 8(3-4):231–357, 2015. [6] N. Cesa-Bianchi, A. Conconi, and C. Gentile. On the generalization ability of on-line learning algorithms. IEEE Transactions on Information Theory, 50(9):2050–2057, 2004. [7] C. Dwork, V. Feldman, M. Hardt, T. Pitassi, O. Reingold, and A. Roth. Preserving statistical validity in adaptive data analysis. CoRR, abs/1411.2664, 2014. Extended abstract in STOC 2015. [8] C. Dwork, V. Feldman, M. Hardt, T. Pitassi, O. Reingold, and A. Roth. Generalization in adaptive data analysis and holdout reuse. CoRR, abs/1506, 2015. Extended abstract in NIPS 2015. [9] V. Feldman. Generalization of ERM in stochastic convex optimization: The dimension strikes back. CoRR, abs/1608.04414, 2016. Extended abstract in NIPS 2016. [10] V. Feldman, C. Guzman, and S. Vempala. Statistical query algorithms for mean vector estimation and stochastic convex optimization. CoRR, abs/1512.09170, 2015. Extended abstract in SODA 2017. [11] M. Hardt, B. Recht, and Y. Singer. Train faster, generalize better: Stability of stochastic gradient descent. In ICML, pages 1225–1234, 2016. [12] J. Justesen. Class of constructive asymptotically good algebraic codes. IEEE Trans. Inf. Theor., 18(5):652 – 656, 1972. [13] S. Kakade, K. Sridharan, and A. Tewari. On the complexity of linear prediction: Risk bounds, margin bounds, and regularization. In NIPS, pages 793–800, 2008. [14] A. Nemirovski, A. Juditsky, G. Lan, and A. Shapiro. Robust stochastic approximation approach to stochastic programming. SIAM J. Optim., 19(4):1574–1609, 2009. [15] A. Rakhlin, O. Shamir, and K. Sridharan. Making gradient descent optimal for strongly convex stochastic optimization. In ICML, 2012. [16] A. Rakhlin and K. Sridharan. Sequential probability assignment with binary alphabets and large classes of experts. CoRR, abs/1501.07340, 2015. [17] S. Shalev-Shwartz and S. Ben-David. Understanding Machine Learning: From Theory to Algorithms. Cambridge University Press, 2014. [18] S. Shalev-Shwartz, O. Shamir, N. Srebro, and K. Sridharan. Stochastic convex optimization. In COLT, 2009. [19] S. Shalev-Shwartz, O. Shamir, N. Srebro, and K. Sridharan. Learnability, stability and uniform convergence. The Journal of Machine Learning Research, 11:2635–2670, 2010. [20] O. Shamir and T. Zhang. Stochastic gradient descent for non-smooth optimization: Convergence results and optimal averaging schemes. In ICML, pages 71–79, 2013. [21] A. Shapiro and A. Nemirovski. On complexity of stochastic programming problems. In V. Jeyakumar and A. M. Rubinov, editors, Continuous Optimization: Current Trends and Applications 144. Springer, 2005. [22] D. Spielman. Linear-time encodable and decodable error-correcting codes. IEEE Transactions on Information Theory, 42(6):1723–1731, 1996. [23] V. Vapnik. Statistical Learning Theory. Wiley-Interscience, New York, 1998. 9
2016
324
6,244
Nested Mini-Batch K-Means James Newling Idiap Research Institue & EPFL james.newling@idiap.ch Franc¸ois Fleuret Idiap Research Institue & EPFL francois.fleuret@idiap.ch Abstract A new algorithm is proposed which accelerates the mini-batch k-means algorithm of Sculley (2010) by using the distance bounding approach of Elkan (2003). We argue that, when incorporating distance bounds into a mini-batch algorithm, already used data should preferentially be reused. To this end we propose using nested mini-batches, whereby data in a mini-batch at iteration t is automatically reused at iteration t + 1. Using nested mini-batches presents two difficulties. The first is that unbalanced use of data can bias estimates, which we resolve by ensuring that each data sample contributes exactly once to centroids. The second is in choosing mini-batch sizes, which we address by balancing premature fine-tuning of centroids with redundancy induced slow-down. Experiments show that the resulting nmbatch algorithm is very effective, often arriving within 1% of the empirical minimum 100× earlier than the standard mini-batch algorithm. 1 Introduction The k-means problem is to find k centroids to minimise the mean distance between samples and their nearest centroids. Specifically, given N training samples X = {x(1), . . . , x(N)} in vector space V, one must find C = {c(1), . . . , c(k)} in V to minimise energy E defined by, E(C) = 1 N N X i=1 ∥x(i) −c(a(i))∥2, (1) where a(i) = arg minj∈{1,...,k} ∥x(i) −c(j)∥. In general the k-means problem is NP-hard, and so a trade off must be made between low energy and low run time. The k-means problem arises in data compression, classification, density estimation, and many other areas. A popular algorithm for k-means is Lloyd’s algorithm, henceforth lloyd. It relies on a two-step iterative refinement technique. In the assignment step, each sample is assigned to the cluster whose centroid is nearest. In the update step, cluster centroids are updated in accordance with assigned samples. lloyd is also referred to as the exact algorithm, which can lead to confusion as it does not solve the k-means problem exactly. Similarly, approximate k-means algorithms often refer to algorithms which perform an approximation in either the assignment or the update step of lloyd. 1.1 Previous works on accelerating the exact algorithm Several approaches for accelerating lloyd have been proposed, where the required computation is reduced without changing the final clustering. Hamerly (2010) shows that approaches relying on triangle inequality based distance bounds (Phillips, 2002; Elkan, 2003; Hamerly, 2010) always provide greater speed-ups than those based on spatial data structures (Pelleg and Moore, 1999; Kanungo et al., 2002). Improving bounding based methods remains an active area of research (Drake, 2013; Ding et al., 2015). We discuss the bounding based approach in § 2.1. 1 1.2 Previous approximate k-means algorithms The assignment step of lloyd requires more computation than the update step. The majority of approximate algorithms thus focus on relaxing the assignment step, in one of two ways. The first is to assign all data approximately, so that centroids are updated using all data, but some samples may be incorrectly assigned. This is the approach used in Wang et al. (2012) with cluster closures. The second approach is to exactly assign a fraction of data at each iteration. This is the approach used in Agarwal et al. (2005), where a representative core-set is clustered, and in Bottou and Bengio (1995), and Sculley (2010), where random samples are drawn at each iteration. Using only a fraction of data is effective in reducing redundancy induced slow-downs. The mini-batch k-means algorithm of Sculley (2010), henceforth mbatch, proceeds as follows. Centroids are initialised as a random selection of k samples. Then at every iteration, b of N samples are selected uniformly at random and assigned to clusters. Cluster centroids are updated as the mean of all samples ever assigned to them, and are therefore running averages of assignments. Samples randomly selected more often have more influence on centroids as they reappear more frequently in running averages, although the law of large numbers smooths out any discrepancies in the long run. mbatch is presented in greater detail in § 2.2. 1.3 Our contribution The underlying goal of this work is to accelerate mbatch by using triangle inequality based distance bounds. In so doing, we hope to merge the complementary strengths of two powerful and widely used approaches for accelerating lloyd. The effective incorporation of bounds into mbatch requires a new sampling approach. To see this, first note that bounding can only accelerate the processing of samples which have already been visited, as the first visit is used to establish bounds. Next, note that the expected proportion of visits during the first epoch which are revisits is at most 1/e, as shown in SM-A. Thus the majority of visits are first time visits and hence cannot be accelerated by bounds. However, for highly redundant datasets, mbatch often obtains satisfactory clustering in a single epoch, and so bounds need to be effective during the first epoch if they are to contribute more than a minor speed-up. To better harness bounds, one must preferentially reuse already visited samples. To this end, we propose nested mini-batches. Specifically, letting Mt ⊆{1, . . . , N} be the mini-batch indices used at iteration t ≥1, we enforce that Mt ⊆Mt+1. One concern with nesting is that samples entering in early iterations have more influence than samples entering at late iterations, thereby introducing bias. To resolve this problem, we enforce that samples appear at most once in running averages. Specifically, when a sample is revisited, its old assignment is first removed before it is reassigned. The idea of nested mini-batches is discussed in § 3.1. The second challenge introduced by using nested mini-batches is determining the size of Mt. On the one hand, if Mt grows too slowly, then one may suffer from premature fine-tuning. Specifically, when updating centroids using Mt ⊂{1, . . . , N}, one is using energy estimated on samples indexed by Mt as a proxy for energy over all N training samples. If Mt is small and the energy estimate is poor, then minimising the energy estimate exactly is a waste of computation, as as soon as the mini-batch is augmented the proxy energy loss function will change. On the other hand, if Mt grows too rapidly, the problem of redundancy arises. Specifically, if centroid updates obtained with a small fraction of Mt are similar to the updates obtained with Mt, then it is waste of computation using Mt in its entirety. These ideas are pursued in § 3.2. 2 Related works 2.1 Exact acceleration using the triangle inequality The standard approach to perform the assignment step of lloyd requires k distance calculations. The idea introduced in Elkan (2003) is to eliminate certain of these k calculations by maintaining bounds on distances between samples and centroids. Several novel bounding based algorithms have since been proposed, the most recent being the yinyang algorithm of Ding et al. (2015). A thorough comparison of bounding based algorithms was presented in Drake (2013). We illustrate the basic 2 idea of Elkan (2003) in Alg. 1, where for every sample i, one maintains k lower bounds, l(i, j) for j ∈{1, . . . , k}, each bound satisfying l(i, j) ≤∥x(i) −c(j)∥. Before computing ∥x(i) −c(j)∥on line 4 of Alg. 1, one checks that l(i, j) < d(i), where d(i) is the distance from sample i to the nearest currently found centroid. If l(i, j) ≥d(i) then ∥x(i) −c(j)∥≥d(i), and thus j can automatically be eliminated as a nearest centroid candidate. Algorithm 1 assignment-with-bounds(i) 1: d(i) ←∥x(i) −c(a(i))∥ ▷where d(i) is distance to nearest centroid found so far 2: for all j ∈{1, . . . , k} \ {a(i)} do 3: if l(i, j) < d(i) then 4: l(i, j) ←∥x(i) −c(j)∥ ▷make lower bound on distance between x(i) and c(j) tight 5: if l(i, j) < d(i) then 6: a(i) = j 7: d(i) = l(i, j) 8: end if 9: end if 10: end for The fully-fledged algorithm of Elkan (2003) uses additional tests to the one shown in Alg. 1, and includes upper bounds and inter-centroid distances. The most recently published bounding based algorithm, yinyang of Ding et al. (2015), is like that of Elkan (2003) but does not maintain bounds on all k distances to centroids, rather it maintains lower bounds on groups of centroids simultaneously. To maintain the validity of bounds, after each centroid update one performs l(i, j) ←l(i, j) −p(j), where p(j) is the distance moved by centroid j during the centroid update, the validity of this correction follows from the triangle inequality. Lower bounds are initialised as exact distances in the first iteration, and only in subsequent iterations can bounds help in eliminating distance calculations. Therefore, the algorithm of Elkan (2003) and its derivatives are all at least as slow as lloyd during the first iteration. 2.2 Mini-batch k-means The work of Sculley (2010) introduces mbatch, presented in Alg. 4, as a scalable alternative to lloyd. Reusing notation, we let the mini-batch size be b, and the total number of assignments ever made to cluster j be v(j). Let S(j) be the cumulative sum of data samples assigned to cluster j. The centroid update, line 9 of Alg. 4, is then c(j) ←S(j)/v(j). Sculley (2010) present mbatch in the context sparse datasets, and at the end of each round an l1-sparsification operation is performed to encourage sparsity. In this paper we are interested in mbatch in a more general context and do not consider sparsification. Algorithm 2 initialise-c-S-v for j ∈{1, . . . , k} do c(j) ←x(i) for some i ∈{1, . . . , N} S(j) ←x(i) v(j) ←1 end for Algorithm 3 accumulate(i) S(a(i)) ←S(a(i)) + x(i) v(a(i)) ←v(a(i)) + 1 3 Nested mini-batch k-means : nmbatch The bottleneck of mbatch is the assignment step, on line 5 of Alg. 4, which requires k distance calculations per sample. The underlying motivation of this paper is to reduce the number of distance calculations at assignment by using distance bounds. However, as already discussed in § 1.3, simply wrapping line 5 in a bound test would not result in much gain, as only a minority of visited samples would benefit from bounds in the first epoch. For this reason, we will replace random mini-batches at line 3 of Alg. 4 by nested mini-batches. This modification motivates a change to the running average centroid updates, discussed in Section 3.1. It also introduces the need for a scheme to 3 Algorithm 4 mbatch 1: initialise-c-S-v() 2: while convergence criterion not satisfied do 3: M ←uniform random sample of size b from {1, . . . , N} 4: for all i ∈M do 5: a(i) ←arg minj∈{1,...,k} ∥x(i) −c(j)∥ 6: accumulate(i) 7: end for 8: for all j ∈{1, . . . , k} do 9: c(j) ←S(j)/v(j) 10: end for 11: end while choose mini-batch sizes, discussed in 3.2. The resulting algorithm, which we refer to as nmbatch, is presented in Alg. 5. There is no random sampling in nmbatch, although an initial random shuffling of samples can be performed to remove any ordering that may exist. Let bt be the size of the mini-batch at iteration t, that is bt = |Mt|. We simply take Mt to be the first bt indices, that is Mt = {1, . . . , bt}. Thus Mt ⊆Mt+1 corresponds to bt ≤bt+1. Let T be the number of iterations of nmbatch before terminating. We use as stopping criterion that no assignments change on the full training set, although this is not important and can be modified. 3.1 One sample, one vote : modifying cumulative sums to prevent duplicity In mbatch, a sample used n times makes n contributions to one or more centroids, through line 6 of Alg. 4. Due to the extreme and systematic difference in the number of times samples are used with nested mini-batches, it is necessary to curtail any potential bias that duplicitous contribution may incur. To this end, we only alow a sample’s most recent assignment to contribute to centroids. This is done by removing old assignments before samples are reused, shown on lines 15 and 16 of Alg. 5. 3.2 Finding the sweet spot : balancing premature fine-tuning with redundancy We now discuss how to sensibly select mini-batch size bt, where recall that the sample indices of the mini-batch at iteration t are Mt = {1, . . . , bt}. The only constraint imposed so far is that bt ≤bt+1 for t ∈{1, . . . , T −1}, that is that bt does not decrease. We consider two extreme schemes to illustrate the importance of finding a scheme where bt grows neither too rapidly nor too slowly. The first extreme scheme is bt = N for t ∈{1, . . . , T}. This is just a return to full batch k-means, and thus redundancy is a problem, particularly at early iterations. The second extreme scheme, where Mt grows very slowly, is the following: if any assignment changes at iteration t, then bt+1 = bt, otherwise bt+1 = bt + 1. The problem with this second scheme is that computation may be wasted in finding centroids which accurately minimise the energy estimated on unrepresentative subsets of the full training set. This is what we refer to as premature fine-tuning. To develop a scheme which balances redundancy and premature fine-tuning, we need to find sensible definitions for these terms. A first attempt might be to define them in terms of energy (1), as this is ultimately what we wish to minimise. Redundancy would correspond to a slow decrease in energy caused by long iteration times, and premature fine-tuning would correspond to approaching a local minimum of a poor proxy for (1). A difficulty with an energy based approach is that we do not want to compute (1) at each iteration and there is no clear way to quantify the underestimation of (1) using a mini-batch. We instead consider definitions based on centroid statistics. 3.2.1 Balancing intra-cluster standard deviation with centroid displacement Let ct(j) denote centroid j at iteration t, and let ct+1(j|b) be ct+1(j) when Mt+1 = {1, . . . , b}, so that ct+1(j|b) is the update to ct(j) using samples {x(1), . . . , x(b)}. Consider two options, 4 Algorithm 5 nmbatch 1: t = 1 ▷Iteration number 2: M0 ←{} 3: M1 ←{1, . . . , bs} ▷Indices of samples in current mini-batch 4: initialise-c-S-v() 5: for j ∈{1, . . . , k} do 6: sse(j) ←0 ▷Initialise sum of squares of samples in cluster j 7: end for 8: while stop condition is false do 9: for i ∈Mt−1 and j ∈{1, . . . , k} do 10: l(i, j) ←l(i, j) −p(j) ▷Update bounds of reused samples 11: end for 12: for i ∈Mt−1 do 13: aold(i) ←a(i) 14: sse(aold(i)) ←sse(aold(i)) −d(i)2 ▷Remove expired sse, S and v contributions 15: S(aold(i)) ←S(aold(i)) −x(i) 16: v(aold(i)) ←v(aold(i)) −1 17: assignment-with-bounds(i) ▷Reset assignment a(i) 18: accumulate(i) 19: sse(a(i)) ←sse(a(i)) + d(i)2 20: end for 21: for i ∈Mt \ Mt−1 and j ∈{1, . . . , k} do 22: l(i, j) ←∥x(i) −c(j)∥ ▷Tight initialisation for new samples 23: end for 24: for i ∈Mt \ Mt−1 do 25: a(i) ←arg minj∈{1,...,k} l(i, j) 26: d(i) ←l(i, a(i)) 27: accumulate(i) 28: sse(a(i)) ←sse(a(i)) + d(i)2 29: end for 30: for j ∈{1, . . . , k} do 31: ˆσC(j) ← p (sse(j))/ (v(j)(v(j) −1)) 32: cold(j) ←c(j) 33: c(j) ←S(j)/v(j) 34: p(j) ←∥c(j) −cold(j)∥ 35: end for 36: if minj∈{1,...,k} (ˆσc(j)/p(j)) > ρ then ▷Check doubling condition 37: Mt+1 ←{1, . . . , min (2|Mt|, N)} 38: else 39: Mt+1 ←Mt 40: end if 41: t ←t + 1 42: end while bt+1 = bt with resulting update ct+1(j|bt), and bt+1 = 2bt with update ct+1(j|2bt). If, ∥ct+1(j|2bt) −ct+1(j|bt)∥≪∥ct(j) −ct+1(j|bt)∥, (2) then it makes little difference if centroid j is updated with bt+1 = bt or bt+1 = 2bt, as illustrated in Figure 1, left. Using bt+1 = 2bt would therefore be redundant. If on the other hand, ∥ct+1(j|2bt) −ct+1(j|bt)∥≫∥ct(j) −ct+1(j|bt)∥, (3) this suggests premature fine-tuning, as illustrated in Figure 1, right. Balancing redundancy and premature fine-tuning thus equates to balancing the terms on the left and right hand sides of (2) and (3). Let us denote by Mt(j) the indices of samples in Mt assigned to cluster j. In SM-B we show that the term on the left hand side of (2) and (3) can be estimated by 1 2 ˆσC(j), where ˆσ2 C(j) = 1 |Mt(j)|2 X i∈Mt(j) ∥x(i) −ct(j)∥2. (4) 5 • • • • • • ct(j) ct+1(j|bt) ct+1(j|2bt) ct(j) ct+1(j|2bt) ct+1(j|bt) Figure 1: Centroid based definitions of redundancy and premature fine-tuning. Starting from centroid ct(j), the update can be performed with a mini-batch of size bt or 2bt. On the left, it makes little difference and so using all 2bt points would be redundant. On the right, using 2bt samples results in a much larger change to the centroid, suggesting that ct(j) is near to a local minimum of energy computed on bt points, corresponding to premature fine-tuning. ˆσC(j) may underestimate ∥ct+1(j|2bt) −ct+1(j|bt)∥as samples {x(bt+1), . . . , x(2bt)} have not been used by centroids at iteration t, however our goal here is to establish dimensional homogeneity. The right hand sides of (2) and (3) can be estimated by the distance moved by centroid j in the preceding iteration, which we denote by p(j). Balancing redundancy and premature fine-tuning thus equates to preventing ˆσC(j)/p(j) from getting too large or too small. It may be that ˆσC(j)/p(j) differs significantly between clusters j. It is not possible to independently control the number of samples per cluster, and so a joint decision needs to be made by clusters as to whether or not to increase bt. We choose to make the decision based on the minimum ratio, on line 37 of Alg. 5, as premature fine-tuning is less costly when performed on a small mini-batch, and so it makes sense to allow slowly converging centroids to catch-up with rapidly converging ones. The decision to use a double-or-nothing scheme for growing the mini-batch is motivated by the fact that ˆσC(j) drops by a constant factor when the mini-batch doubles in size. A linearly increasing mini-batch would be prone to premature fine-tuning as the mini-batch would not be able to grow rapidly enough. Starting with an initial mini-batch size b0, nmbatch iterates until minj ˆσC(j)/p(j) is above some threshold ρ, at which point mini-batch size increases as bt ←min(2bt, N), shown on line 37 of Alg. 5. The mini-batch size is guaranteed to eventually reach N, as p(j) eventually goes to zero. The doubling threshold ρ reflects the relative costs of premature fine-tuning and redundancy. 3.3 A note on parallelisation The parallelisation of nmbatch can be done in the same way as in mbatch, whereby a mini-batch is simply split into sub-mini-batches to be distributed. For mbatch, the only constraint on submini-batches is that they are of equal size to guarantee equal processing times. With nmbatch the constraint is slightly stricter, as the time required to process a sample depends on its time of entry into the mini-batch, due to bounds. Samples from all iterations should thus be balanced, the constraint becoming that each sub-mini-batch contains an equal number of samples from Mt \Mt−1 for all t. 4 Results We have performed experiments on 3 dense datasets and sparse dataset used in Sculley (2010). The INFMNIST dataset (Loosli et al., 2007) is an extension of MNIST, consisting of 28×28 hand-written digits (d = 784). We use 400,000 such digits for performing k-means and 40,000 for computing a validation energy EV . STL10P (Coates et al., 2011) consists of 6×6×3 image patches (d = 108), we train with 960,000 patches and use 40,000 for validation. KDDC98 contains 75,000 training samples and 20,000 validation samples, in 310 dimensions. Finally, the sparse RCV1 dataset of Lewis et al. (2004) consists of data in 47,237 dimensions, with two partitions containing 781,265 and 23,149 samples respectively. As done in Sculley (2010), we use the larger partition to learn clusters. The experimental setup used on each of the datasets is the following: for 20 random seeds, the training dataset is shuffled and the first k datapoints are taken as initialising centroids. Then, for each of the algorithms, k-means is run on the shuffled training set. At regular intervals, a validation energy EV is computed on the validation set. The time taken to compute EV is not included in run times. The batchsize for mbatch and initial batchsize for nmbatch are 5, 000, and k = 50 clusters. 6 10−1 100 101 102 103 104 0.00 0.02 0.04 0.06 0.08 0.10 (EV −E∗) /E∗ KDDC98 lloyd yinyang mbatch nmbatch 10−1 100 101 102 103 104 0.00 0.01 0.02 0.03 0.04 0.05 0.06 INFMNIST 10−1 100 101 102 103 104 time [s] 0.000 0.005 0.010 0.015 0.020 0.025 0.030 (EV −E∗) /E∗ RCV1 10−1 100 101 102 103 104 time [s] 0.00 0.02 0.04 0.06 0.08 0.10 0.12 STL10P Figure 2: The mean energy on validation data (EV ) relative to lowest energy (E∗) across 20 runs with standard deviations. Baselines are lloyd, yinyang, and mbatch, shown with the new algorithm nmbatch with ρ = 100. We see that nmbatch is consistently faster than all baselines, and obtains final minima very similar to those obtained by the exact algorithms. On the sparse dataset RCV1, the speed-up is noticeable within 0.5% of the empirical minimum E∗. On the three dense datasets, the speed-up over mbatch is between 10× and 100× at 2% of E∗, with even greater speed-ups below 2% where nmbatch converges very quickly to local minima. 10−1 100 101 102 103 ρ 0.00 0.01 0.02 0.03 0.04 0.05 (EV −E∗)/E∗ KDDC98 100 101 102 103 ρ INFMNIST 100 101 102 103 ρ STL10P 100 101 102 103 ρ RCV1 t = 2s (active) t = 10s (actve) t = 2s (deactive) t = 10s (deactive) Figure 3: Relative errors on validation data at t ∈{2, 10}, for nmbatch with and with bound tests, for ρ ∈{10−1, 100, 101, 102, 103}. In the standard case of active bound testing, large values of ρ work well, as premature fine-tuning is less of a concern. However with the bound test deactivated, premature fine-tuning becomes costly for large ρ, and an optimal ρ value is one which trades off redundancy (ρ too small) and premature fine-tuning (ρ too large). The mean and standard deviation of EV over the 20 runs are computed, and this is what is plotted in Figure 2, relative to the lowest obtained validation energy over all runs on a dataset, E∗. Before comparing algorithms, we note that our implementation of the baseline mbatch is competitive with existing implementations, as shown in Appendix A. 7 In Figure 2, we plot time-energy curves for nmbatch with three baselines. We use ρ = 100, as described in the following paragraph. On the 3 dense datasets, we see that nmbatch is much faster than mbatch, obtaining a solution within 2% of E∗between 10× and 100× earlier than mbatch. On the sparse dataset RCV1, the speed-up becomes noticeable within 0.5% of E∗. Note that in a single epoch nmbatch gets very near to E∗, whereas the full batch algorithms lloyd and yinyang only complete one iteration. The mean final energies of nmbatch and the exact algorithms are consistently within one initialisation standard deviation. This means that the random initialisation seed has a larger impact on final energy than the choose between nmbatch and an exact algorithm. We now discuss the choice of ρ. Recall that the mini-batch size doubles when minj ˆσC(j)/p(j) > ρ. Thus a large ρ means smaller p(j)s are needed to invoke a doubling, which means less robustness against premature fine-tuning. The relative costs of premature fine-tuning and redundancy are influenced by the use of bounds. Consider the case of premature fine-tuning with bounds. p(j) becomes small, and thus bound tests become more effective as they decrease more slowly (line 10 of Alg. 5). Thus, while premature fine-tuning does result in more samples being visited than necessary, each visit is processed rapidly and so is less costly. We have found that taking ρ to be large works well for nmbatch. Indeed, there is little difference in performance for ρ ∈{10, 100, 1000}. To test that our formulation is sensible, we performed tests with the bound test (line 3 of Alg. 1) deactivated. When deactivated, ρ = 10 is in general better than larger values of ρ, as seen in Figure 3. Full time-energy curves for different ρ values are provided in SM-C. 5 Conclusion and future work We have shown how triangle inequality based bounding can be used to accelerate mini-batch kmeans. The key is the use of nested batches, which enables rapid processing of already used samples. The idea of replacing uniformly sampled mini-batches with nested mini-batches is quite general, and applicable to other mini-batch algorithms. In particular, we believe that the sparse dictionary learning algorithm of Mairal et al. (2009) could benefit from nesting. One could also consider adapting nested mini-batches to stochastic gradient descent, although this is more speculative. Celebi et al. (2013) show that specialised initialisation schemes such as k-means++ can result in better clusterings. While this is not the case for the datasets we have used, it would be interesting to consider adapting such initialisation schemes to the mini-batch context. Our nested mini-batch algorithm nmbatch uses a very simple bounding scheme. We believe that further improvements could be obtained through more advanced bounding, and that the memory footprint of O(KN) could be reduced by using a scheme where, as the mini-batch grows, the number of bounds maintained decreases, so that bounds on groups of clusters merge. A Comparing Baseline Implementations We compare our implementation of mbatch with two publicly available implementations, that accompanying Sculley (2010) in C++, and that in scikit-learn Pedregosa et al. (2011), written in Cython. Comparisons are presented in Table 1, where our implementations are seen to be competitive. Experiments were all single threaded. Our C++ and Python code is available at https: //github.com/idiap/eakmeans. INFMNIST (dense) RCV1 (sparse) ours sklearn ours sklearn sofia 12.4 20.6 15.2 63.6 23.3 Table 1: Comparing implementations of mbatch on INFMNIST (left) and RCV1 (right). Time in seconds to process N datapoints, where N = 400, 000 for INFMNIST and N = 781, 265 for RCV1. Implementations are our own (ours), that in scikit-learn (sklearn), and that of Sculley (2010) (sofia). Acknowledgments James Newling was funded by the Hasler Foundation under the grant 13018 MASH2. 8 References Agarwal, P. K., Har-Peled, S., and Varadarajan, K. R. (2005). Geometric approximation via coresets. In COMBINATORIAL AND COMPUTATIONAL GEOMETRY, MSRI, pages 1–30. University Press. Bottou, L. and Bengio, Y. (1995). Convergence properties of the K-means algorithm. pages 585– 592. Celebi, M. E., Kingravi, H. A., and Vela, P. A. (2013). A comparative study of efficient initialization methods for the k-means clustering algorithm. Expert Syst. Appl., 40(1):200–210. Coates, A., Lee, H., and Ng, A. (2011). An analysis of single-layer networks in unsupervised feature learning. In Gordon, G., Dunson, D., and Dudk, M., editors, Proceedings of the Fourteenth International Conference on Artificial Intelligence and Statistics, volume 15 of JMLR Workshop and Conference Proceedings, pages 215–223. JMLR W&CP. Ding, Y., Zhao, Y., Shen, X., Musuvathi, M., and Mytkowicz, T. (2015). Yinyang k-means: A drop-in replacement of the classic k-means with consistent speedup. In Proceedings of the 32nd International Conference on Machine Learning, ICML 2015, Lille, France, 6-11 July 2015, pages 579–587. Drake, J. (2013). Faster k-means clustering. Accessed online 19 August 2015. Elkan, C. (2003). Using the triangle inequality to accelerate k-means. In Machine Learning, Proceedings of the Twentieth International Conference (ICML 2003), August 21-24, 2003, Washington, DC, USA, pages 147–153. Hamerly, G. (2010). Making k-means even faster. In SDM, pages 130–140. Kanungo, T., Mount, D., Netanyahu, N., Piatko, C., Silverman, R., and Wu, A. (2002). An efficient k-means clustering algorithm: analysis and implementation. Pattern Analysis and Machine Intelligence, IEEE Transactions on, 24(7):881–892. Lewis, D. D., Yang, Y., Rose, T. G., and Li, F. (2004). Rcv1: A new benchmark collection for text categorization research. JOURNAL OF MACHINE LEARNING RESEARCH, 5:361–397. Loosli, G., Canu, S., and Bottou, L. (2007). Training invariant support vector machines using selective sampling. In Bottou, L., Chapelle, O., DeCoste, D., and Weston, J., editors, Large Scale Kernel Machines, pages 301–320. MIT Press, Cambridge, MA. Mairal, J., Bach, F., Ponce, J., and Sapiro, G. (2009). Online dictionary learning for sparse coding. In Proceedings of the 26th Annual International Conference on Machine Learning, ICML ’09, pages 689–696, New York, NY, USA. ACM. Pedregosa, F., Varoquaux, G., Gramfort, A., Michel, V., Thirion, B., Grisel, O., Blondel, M., Prettenhofer, P., Weiss, R., Dubourg, V., Vanderplas, J., Passos, A., Cournapeau, D., Brucher, M., Perrot, M., and Duchesnay, E. (2011). Scikit-learn: Machine learning in Python. Journal of Machine Learning Research, 12:2825–2830. Pelleg, D. and Moore, A. (1999). Accelerating exact k-means algorithms with geometric reasoning. In Proceedings of the Fifth ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, KDD ’99, pages 277–281, New York, NY, USA. ACM. Phillips, S. (2002). Acceleration of k-means and related clustering algorithms. volume 2409 of Lecture Notes in Computer Science. Springer. Sculley, D. (2010). Web-scale k-means clustering. In Proceedings of the 19th International Conference on World Wide Web, WWW ’10, pages 1177–1178, New York, NY, USA. ACM. Wang, J., Wang, J., Ke, Q., Zeng, G., and Li, S. (2012). Fast approximate k-means via cluster closures. In CVPR, pages 3037–3044. IEEE Computer Society. 9
2016
325
6,245
Infinite Hidden Semi-Markov Modulated Interaction Point Process Peng Lin§†, Bang Zhang§, Ting Guo§, Yang Wang§, Fang Chen§ §Data61 CSIRO, Australian Technology Park, 13 Garden Street, Eveleigh NSW 2015, Australia †School of Computer Science and Engineering, The University of New South Wales, Australia {peng.lin, bang.zhang, ting.guo, yang.wang, fang.chen}@data61.csiro.au Abstract The correlation between events is ubiquitous and important for temporal events modelling. In many cases, the correlation exists between not only events’ emitted observations, but also their arrival times. State space models (e.g., hidden Markov model) and stochastic interaction point process models (e.g., Hawkes process) have been studied extensively yet separately for the two types of correlations in the past. In this paper, we propose a Bayesian nonparametric approach that considers both types of correlations via unifying and generalizing the hidden semiMarkov model and interaction point process model. The proposed approach can simultaneously model both the observations and arrival times of temporal events, and automatically determine the number of latent states from data. A Metropoliswithin-particle-Gibbs sampler with ancestor resampling is developed for efficient posterior inference. The approach is tested on both synthetic and real-world data with promising outcomes. 1 Introduction Temporal events modeling is a classic machine learning problem that has drawn enormous research attentions for decades. It has wide applications in many areas, such as financial modelling, social events analysis, seismological and epidemiological forecasting. An event is often associated with an arrival time and an observation, e.g., a scalar or vector. For example, a trading event in financial market has a trading time and a trading price. A message in social network has a posting time and a sequence of words. A main task of temporal events modelling is to capture the underlying events correlation and use it to make predictions for future events’ observations and/or arrival times. The correlation between events’ observations can be readily found in many real-world cases in which an event’s observation is influenced by its predecessors’ observations. For examples, the price of a trading event is impacted by former trading prices. The content of a new social message is affected by the contents of the previous messages. State space model (SSM), e.g., the hidden Markov model (HMM) [16], is one of the most prevalent frameworks that consider such correlation. It models the correlation via latent state dependency. Each event in the HMM is associated with a latent state that can emit an observation. A latent state is independent of all but the most recent state, i.e., Markovianity. Hence, a future event observation can be predicted based on the observed events and inferred mechanisms of emission and transition. Despite its popularity, the HMM lacks the flexibility to model event arrival time. It only allows fixed inter-arrival time. The duration of a type of state follows a geometric distribution with its self-transition probability as the parameter due to the strict Markovian constraint. The hidden semiMarkov model (HSMM) [14, 21] was developed to allow non-geometric state duration. It is an extension of the HMM by allowing the underlying state transition process to be a semi-Markov chain 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. with a variable duration time for each state. In addition to the HMM components, the HSMM models the duration of a state as a random variable and a state can emit a sequence of observations. The HSMM allows the flexibility of variable inter-arrival times, but it does not consider events’ correlation on arrival times. In many real-world applications, one event can trigger the occurrences of others in the near future. For instance, earthquakes and epidemics are diffusible events, i.e., one can cause the occurrences of others. Trading events in financial markets arrive in clusters. Information propagation in social network shows contagious and clustering characteristics. All these events exhibit interaction characteristics in terms of arrival times. The likelihood of an event’s arrival time is affected by the previous events’ arrival times. Stochastic interaction point process (IPP), e.g., Hawkes process [6], is a widely adopted framework for capturing such arrival time correlation. It models the correlation via a conditional intensity function that depicts the event intensity depending on all the previous events’ arrival times. However, unlike the SSMs, it lacks the capability of modelling events’ latent states and their interactions. It is clearly desirable in real-world applications to have both arrival time correlation and observation correlation considered in a unified manner so that we can estimate both when and how events will appear. Inspired by the merits of SSMs and IPPs, we propose a novel Bayesian nonparametric approach that unifies and generalizes SSMs and IPPs via a latent semi-Markov state chain with infinitely countable number of states. The latent states governs both the observation emission and new event triggering mechanism. An efficient sampling method is developed within the framework of particle Markov chain Monte Carlo (PMCMC) [1] for the posterior inference of the proposed model. We first review closely related techniques in Section 2, and give the description of the proposed model in Section 3. Then Section 4 presents the inference algorithm. In Section 5, we show the results of the empirical studies on both synthetic and real-word data. Conclusions are drawn in Section 6. 2 Preliminaries In this section, we review the techniques that are closely related to the proposed method, namely hidden (semi-)Markov model, its Bayesian nonparametric extension and Hawkes process. 2.1 Hidden (Semi-)Markov Model The HMM [16] is one of the most popular approaches for temporal event modelling. It utilizes a sequence of latent states with Markovian property to model the dynamics of temporal events. Each event in the HMM is associated with a latent state that determines the event’s observation via a emission probability distribution. The state of an event is independent of all but its most recent predecessor’s state (i.e., Markovianity) following a transition probability distribution. The HMM consists of 4 components: (1) an initial state probability distribution,(2) a finite latent state space, (3) a state transition matrix, and (4) an emission probability distribution. As a result, the inference for the HMM involves: inferring (1) the initial state probability distribution, (2) the sequence of the latent states, (3) the state transition matrix and (4) the emission probability distribution. The HMM has proven to be an excellent general framework modelling sequential data, but it has two significant drawbacks: (1) The durations of events (or the inter-arrival times between events) are fixed to a common value. The state duration distributions are restricted to a geometric form. Such setting lacks the flexibility for real-world applications. (2) The size of the latent state space in the HMM must be set a priori instead of learning from data. The hidden semi-Markov model (HSMM) [14, 21] is a popular extension to the HMM, which tries to mitigate the first drawback of the HMM. It allows latent states to have variable durations, thereby forming a semi-Markov chain. It reduces to the HMM when durations follow a geometric distribution. Additional to the 4 components of the HMM, HSMM has a state duration probability distribution. As a result, the inference procedure for the HSMM also involves the inference of the duration probability distribution. It is worth noting that the interaction between events in terms of event arrival time is neglected by both the HMM and the HSMM. 2 2.2 Hierarchical Dirichlet Process Prior for State Transition The recent development in Bayesian nonparametrics helps address the second drawback of the HMM. Here, we briefly review the Hierarchical Dirichlet Process HMM (HDP-HMM). Let (Θ, B) be a measurable space and G0 be a probability measure on it. A Dirichlet process (DP) G is a distribution of a random probability measure over the measurable space (Θ, B). For any finite measurable partition (A1, · · · , Ar) of Θ, the random vector (G(A1), · · · , G(Ar)) follows a finite Dirichlet distribution parameterized by (α0G0(A1), · · · , α0G0(Ar)), where α0 is a positive real number. HDP is defined based on DP for modelling grouped data. It is a distribution over a collection of random probability measures over the measurable space (Θ, B). Each one of these random probability measure Gk is associated with a group. A global random probability measure G0 distributed as a DP is used as a mean measure with concentration parameter γ and base probability measure H. Because the HMM can be treated as a set of mixture models in a dynamic manner, each of which corresponds to a value of the current state, the HDP becomes a natural choice as the prior over the state transitions [2, 18]. The generative HDP-HMM model can be summarized as: β | γ ∽GEM(γ), πk |α0, β ∽DP(α0, β), θk | λ, H ∽H(λ), sn |sn−1, (πk)∞ k=1 ∽πsn−1, yn | sn, (θk)∞ k=1 ∽F(θsn) . (1) GEM denotes stick-breaking process. The variable sequence πk indicates the latent state sequence. yn represents the observation. HDP acts the role of a prior over the infinite transition matrices. Each πk is a draw from a DP, it depicts the transition distribution from state k. The probability measures from which πk’s are drawn are parameterized by the same discrete base measure β. θ parameterizes the emission distribution F. Usually H is set to be conjugate of F simplifying inference. γ controls base measure β’s degree of concentration. α0 plays the role of governing the variability of the prior mean measure across the rows of the transition matrix. Because the HDP prior doesn’t distinguish self-transitions from transitions to other states, it is vulnerable to unnecessary frequent switching of states and more states. Thus, [5] proposed a sticky HDP-HMM to include a self-transition bias parameter into the state transition measure πk ∼DP(α0 + κ, (α0β + κδk)/(α0 + κ)), where κ controls the stickness of the transition matrix. 2.3 Hawkes Process Stochastic point process [3] is a rich family of models that are designed for tackling various of temporal event modeling problems. A stochastic point process can be defined via its conditional intensity function that provides an equivalent representation as a counting process for temporal events. Given N(t) denoting the number of events occurred in the time interval [0, t) and τt indicating the arrival times of the temporal events before t, the intensity for a time point t conditioned on the arrival times of all the previous events is defined as: λ(t|τt) = lim ∆t→0 E[N(t + ∆t) −N(t)|τt] ∆t . (2) It is worth noting that we do not consider edge effect in this paper, hence no events exist before time 0. A variety of point processes has been developed with distinct functional forms of intensity for various modeling purposes. Interaction point process (IPP) [4] considers point interactions with an intensity function dependent on historical events. Hawkes process [7, 6] is one of the most popular and flexible IPPs. Its conditional intensity has the following functional form: λ(t) = µ(t) + X tn<t ψn(t −tn). (3) We use λ(t) to represent intensity function conditioned on previous points τt with the consideration of notation simplicity. The function µ(t) is a non-negative background intensity function which is often set to a positive real number. The function ψn(△t) represents the triggering kernel of event tn. It is a decay function defined on [0, ∞) depicting the decayed influence of triggering new events. A typical decay function is in exponential form, i.e., λ(t) = µ + P tn<t α′ · exp(−β′(t −tn)). As discussed in [7, 10], because the superposition of several Poisson processes is also a Poisson process, Hawkes process can be considered as a conditional Poisson process that is a constituted by combining a background Poisson process µ(t) and a set of triggered Poisson processes with intensity ψn(t −tn). 3 Figure 1: (1) An intuitive illustration of the iHSMM-IPP model. Every event in the iHSMM-IPP model is associated with a latent state s, an arrival time t and an observable value y. The colours of points indicate latent states. Blue curve shows the event intensity. The top part of the figure illustrates the IPP component of the iHSMM-IPP model and the bottom part illustrates the HSMM component. The two components are integrated together via an infinite countable semi-Markov latent state chain. (2) Graphical model of the iHSMM-IPP model. The top part shows the HDP-HMM. 3 Infinite Hidden Semi-Markov Modulated Interaction Point Process (iHSMM-IPP) Inspired by the merits of SSMs and IPPs, we propose an infinite hidden semi-Markov modulated interaction point process model (iHSMM-IPP). It is a Bayesian nonparametric stochastic point process with a latent semi-Markov state chain determining both event emission probabilities and event triggering kernels. An intuitive illustration is given in Fig. 1 (1). Each temporal event in the iHSMM-IPP is represented by a stochastic point and each point is associated with a hidden discrete state {si} that plays the role of determining event emission and triggering mechanism. As in SSMs and IPPs, the event emission probabilities guide the generation of event observations {yi} and the event triggering kernels influence the occurrence times {ti} of events. The hidden state depends only on the most recent event’s state. The size of the latent state space is infinite countable with the HDP prior. The model can be formally defined as the following and its corresponding graphical model is given in Fig. 1 (2). β | γ ∽GEM(γ), πk | α0, β ∽DP(α0, β), θk | η, H ∽H(η), ρk | χ, H′ ∽H′(χ), sn | sn−1, (πk)∞ k=1 ∽πsn−1, tn | · ∽PP(µ + n−1 X i=1 ψρsi (t −ti)), yn | sn, (θk)∞ k=1 ∽F(θsn). (4) We use ψρsi (·) to denote the triggering kernel parameterized by ρsi which is indexed by latent state si. We use ψsi(·) instead of ψρsi (·) for the remaining of the paper for the sake of notation simplicity. The iHSMM-IPP is a generative model that can be used for generating a series of events with arrival times and emitted observations. The arrival time tn is drawn from a Poisson process. We do not consider edge effect in this work. Therefore, the first event’s arrival time, t1, is drawn from a homogeneous Poisson process parameterized by a hyper-parameter µ. For n > 1, tn is drawn from an inhomogeneous Poisson process whose conditional intensity function is defined as: µ + Pn−1 i=1 ψsi(t −ti). As defined before, ψsi(·) indicates the triggering kernel of a former point i whose latent state is si. The state of the point sn is drawn following the guidance of the HDP prior as in the HDP-HMM. The emitted observation yn is generation from the emission probability distribution F(·) parameterized by θsn which is determined by the state sn. 4 4 Posterior Inference for the iHSMM-IPP In this section, we describe the inference method for the proposed iHSMM-IPP model. Despite its flexibility, the proposed iHSMM-IPP model faces three challenges for efficient posterior inference: (1) strong correlation nature of its temporal dynamics (2) non-Markovianity introduced by the event triggering mechanism, and (3) infinite dimensional state transition. The traditional sampling methods for high dimensional probability distributions, e.g., MCMC, sequential Monte Carlo (SMC), are unreliable when highly correlated variables are updated independently, which can be the case for the iHSMM-IPP model. So we develop the inference algorithm within the framework of particle MCMC (PMCMC), a family of inferential methods recently developed in [1]. The key idea of PMCMC is to use SMC to construct a proposal kernel for an MCMC sampler. It not only improves over traditional MCMC methods but also makes Bayesian inference feasible for a large class of statistical models. For tackling the non-Markovianity, ancestor resampling scheme [13] is incorporated into our inference algorithm. As existing forward-backward sampling methods, ancestor resampling uses backward sampling to improve the mixing of PMCMC. However, it achieves the same effect in a single forward sweep instead of using separate forward and backward sweeps. More importantly, it provides an effective way of sampling for non-Markovian SSMs. Given a sequence of N events, {yn, tn}N n=1, the inference algorithm needs to sample the hidden state sequence, {sn}N n=1, emission distribution parameters θ1:K, background event intensity µ, triggering kernel parameters, ψ1:K (we omit ρ and use ψ1:K instead of ψρ1:K for notation simplicity as before), transition matrix, π1:K, and the HDP parameters (α0, γ, κ, β). We use K to represent the number of active states and Ωto indicate the set of variables excluding the latent state sequence, i.e., Ω= {α0, β, γ, κ, µ, θ1:K, ψ1:K, π1:K}. Only major variables are listed, and Ωmay also include other variables, such as the probability of initial latent state. At a high level, all the variables are updated iteratively using a particle Gibbs (PG) sampler. A conditional SMC is performed as a proposal kernel for updating latent state sequence in each PG iteration. An ancestor resampling scheme is adopted in the conditional SMC for handling the non-Markovianity caused by the triggering mechanism. Metropolis sampling is used in each PG iteration to update background event intensity µ and triggering kernel parameters ψ1:K. The remaining variables in Ωcan be sampled by following the scheme in [5, 18] readily. The proposal distribution qΩ(·) in the conditional SMC can be set by following [19]. The PG sampler is given in the following: Step 1: Initialization, i = 0, set Ω(0), s1:N(0), B1:N(0). Step 2: For iteration i ⩾1 (a) Sample Ω(i) ∼p{·|y1:N, t1:N, s1:N(i −1)}. (b) Run a conditional SMC algorithm targeting pΩ(i)(s1:N|y1:N, t1:N) conditional on s1:N(i −1) and B1:N(i −1). (c) Sample s1:N(i) ∼ˆpΩ(i)(·|y1:N, t1:N). We use B1:N to represent the ancestral lineage of the prespecified state path s1:N and ˆpΩ(i)(·|y1:N) to represent the particle approximation of pΩ(i)(·|y1:N). The details of the conditional SMC algorithm are given in the following. It is worth noting that the conditioned latent state path is only updated via the ancestor resampling. Step 1: Let s1:N = {sB1 1 , sB2 2 , · · · , sBN N } denote the path that is associated with the ancestral lineage B1:N Step 2: For n = 1, (a) For j ̸= B1, sample sj 1 ∼qΩ(·|y1), j ∈[1, · · · , J]. (J denotes the number of particles.) (b) Compute weights w1(sj 1) = p(sj 1)F(y1|sj 1)/qΩ(sj 1|y1) and normalize the weights W j 1 = w1(sj 1)/ PJ m=1 w1(sm 1 ). (We use p(sj 1) to represent the probability of the initial latent state and qΩ(sj 1|y1) to represent the proposal distribution conditional on the variable set Ω.) Step 3: For n = 2, · · · , N : (a) For j ̸= Bn, sample ancestor index of particle j: aj n−1 ∼Cat(·|W 1:J n−1). 5 (b) For j ̸= Bn, sample sj n ∼qΩ(·|yn, s aj n−1 n−1 ). If sj n = K + 1 then create a new state using the stick-breaking construction for the HDP: (i) Sample a new transition probability πK+1 ∼Dir(α0β). (ii) Use stick-breaking construction to expand β ←[β, βK+1]: β′ K+1 ∼Beta(1, γ), βK+1 = β′ K+1 K Y l=1 (1 −β′ l). (iii) Expand transition probability vectors πk to include transitions to state K + 1 via the HDP stick-breaking construction: πk ←[πk,1, · · · , πk,K+1], ∀k ∈[1, K + 1], where π′ k,K+1 ∼Beta(α0βK+1, α0(1 − K+1 X l=1 βl)), πk,K+1 = π′ k,K+1 K Y l=1 (1 −π′ k,l). (iv) Sample parameters for a new emission probability and triggering kernel θK+1 ∼ H and ψ1:K ∼H′. (d) Perform ancestor resampling for the conditioned state path. Compute the ancestor weights ˜wp,j n−1|N via Eq. 7 and Eq. 8 and resample aBn n as p(aBn n = j) ∝˜wp,j n−1|N. (e) Compute and normalize particle weights: wn(sj n) = π(sj n|s aj n−1 n−1 )F(yn|sj n)/qΩ(sj n|s aj n−1 n−1 , yn), Wn(sj n) = wn(sj n)/( J X j=1 wn(sj n)). 4.1 Metropolis Sampling for Background Intensity and Triggering Kernel For the inference of the background intensity µ and the parameters of triggering kernels ψk in the step 2 (a) of the PG sampler, Metropolis sampling is used. As described in [3], the conditional likelihood of the occurrences of a sequence of events in IPP can be expressed as: L ≜p(t1:N|µ, ψ1:K) = N Y n=1 λ(tn) ! exp  − Z T 0 λ(t)dt  . (5) We describe the Metropolis update for ψk, and similar update can be derived for µ. The normal distribution with the current value of ψk as mean is used as the proposal distribution. The proposed candidate ψ∗ k will be accepted with the probability: A(ψ∗ k, ψk) = min  1, ˆp(ψ∗ k) ˆp(ψk)  . The ratio can be computed as: ˆp(ψ∗ k) ˆp(ψk) = p(ψ∗ k) p(ψk) · p(t1:N|ψ∗ k, rest) p(t1:N|ψk, rest) = p(ψ∗ k) p(ψk) · N Y n=1 µ(tn) + P u<n ψ∗ su(tn −tu) µ(tn) + P u<n ψsu(tn −tu) ! · exp  X u∈[1,N] (Ψsu(T −tu) −Ψ∗ su(T −tu))  . (6) We use Ψ(·) to represent the cumulative distribution function of the kernel function ψ(·). We use ψ∗ su(·) to represent the u-th event’s triggering kernel candidate if su = k. It remains the current triggering kernel otherwise. [0, T] indicates the time period of the N events. 4.2 Truncated Ancestor Resampling for Non-Markovianity Truncated ancestor resampling [13] is used for tackling the non-Markovianity caused by the triggering mechanism of the proposed model. The ancestor weight can be computed as: ˜wp,j n|N = wj n γn+p({sj 1:n, s′ n+1:n+p}) γn(sj 1:n) (7) γn+p({sj 1:n, s′ n+1:n+p}) γt(sj 1:n) = p(s1:p, y1:p, t1:p) p(s1:n, y1:n, t1:n) = L(t1:p) L(t1:n) · p Y j=n+1 F(yj|sj)π(sj|sj−1) (8) For notation simplicity, we use wj n to represent wn(sj n). In general, n + p needs to reach the last event in the sequence. However, due the computational cost and the influence decay of the past events in the proposed iHSMM-IPP, it is practical and feasible to use only a small number of events as an approximation instead of using all the remaining events in Eq. 8. 6 Figure 2: (1) Normalized Hamming distance errors for synthetic data. (2) Cleaned energy consumption readings of the REDD data set. (3) Estimated states by the proposed iHSMM-IPP model. 5 Empirical Study In the following experiments, we demonstrate the performance of the proposed inference algorithm and show the applications of the proposed iHSMM-IPP model in real-world settings. 5.1 Synthetic Data As in [20, 5, 19], we generate the synthetic data of 1000 events via a 4-state Gaussian emission HMM with self-transition probability of 0.75 and the remaining probability mass uniformly distributed over the other 3 states. The means of emission are set to −2.0 −0.5 1.0 4.0 with the deviation of 0.5. The occurrence times of events are generated via the Hawkes process with 4 different triggering kernels, each of which corresponds to a HMM state. The background intensity is set to 0.6 and the triggering kernels take the exponential form: λ(t) = 0.6 + P tn<t α′ · exp(−β′(t −tn)) with {0.1, 0.9}, {0.5, 0.9}, {0.1, 0.6}, {0.5, 0.6} as the {α′, β′} parameter pairs of the kernels. A thinning process [15] (a point process variant of rejection sampling) is used to generate event times of Hawkes process. We compared 4 related methods to demonstrate the performance of the proposed iHSMM-IPP model and inference algorithm: particle Gibbs sampler for sticky HDP-HMM [19], weak-limit sampler for HDP-HSMM [8], Metropolis-within-Gibbs sampler for marked Hawkes process [17] and variational inference for marked Hawkes process [11]. The normalized Hamming distance error is used to measure the performance of the estimated state sequences. The Diff distance used in [22] (i.e., R ( ˜ ψ(t)−ψ(t))2dt R (ψ(t))2dt , ψ(t) and ˜ψ(t) represent the true and estimated kernels respectively) is adopted for measuring the performance of the estimated triggering kernels. The estimated ones are greedily matched to minimize their distances from the ground truth. The average results of the normalized Hamming distance errors are shown in Fig. 2 (1) and the Diff distance errors are shown in the second column of Table 1. The results show that the proposed inference method can not only quickly converge to an accurate estimation of the latent state sequence but also well recover the underlying triggering kernels. Its clear advantage over the compared SSMs and marked Hawkes processes is due to its considerations of both occurrence times and emitted observations for the inference. 5.2 Understanding Energy Consumption Behaviours of Households In this section, we use energy consumption data from the Reference Energy Disaggregation Dataset (REDD ) [9] to demonstrate the application of the proposed model. The data set was collected via smart meters recording detailed appliance-level electricity consumption information for individual house. The data sets were collected with the intension to understand household energy usage patterns and make recommendations for efficient consumption. The 1 Hz low frequency REDD data is used and down sampled to 1 reading per minute covering 1 day energy consumption. Very low and high consumption readings are removed from the reading sequence. Fig. 2 (2) shows the cleaned reading sequence. Colours indicate appliance types and readings are in Watts. The appliance types are modelled as latent states in the proposed iHSMM-IPP model. The readings are the emitted observations of states governed by Gaussian distributions. The relationship between the usages of different appliances is modelled via the state transition matrix. The triggering kernels 7 Synthetic REDD Pipe Method Diff Hamming LogLik Hamming LogLik MSE Failures MSE Hours iHSMM-IPP 0.36 0.30 −120.11 0.39 −677 82.8 28.6 M-MHawkes 0.55 0.63 −173.36 0.64 −1035 142.2 80.2 VI-MHawkes 0.62 0.76 −193.62 0.78 −1200 166.7 93.7 HDP-HSMM 0.42 −147.52 0.52 −850 103.8 42.3 S-HDP-HMM 0.55 −163.28 0.59 −993 128.5 55.9 Table 1: Results on Synthetic, REDD and Pipe data sets. of states in the model depict the influences of appliances on triggering the following energy consumptions, e.g., the usage of washing machine triggers the following energy usage of dryer. As in the first experiment, exponential form of trigger is adopted and independent exponential priors with hyper-parameter 0.01 are used for kernel parameters (α′, β′). The 4 methods used in the first experiment are compared with the proposed model. The average results of the normalized Hamming distance errors and the log likelihoods are shown in the third and fourth columns of Table 1. The proposed model outperforms the other methods due to the fact that it has the flexibility to capture the interaction between the usages of different appliances. Other models mainly rely on the emitted observations, i.e., readings for inferring the types of appliances. 5.3 Understanding Infrastructure Failure Behaviours and Impacts Drinking water pipe networks are valuable infrastructure assets. Their failures (e.g., pipe bursts and leaks) can cause tremendous social and economic costs. Hence, it is of significant importance to understand the behaviours of pipe failures (i.e., occurrence time, failure type, labour hours for repair). In particular, the relationship between the types of two consecutive failures, the triggering effect of a failure on the intensity of future failures and the labour hours taken for a certain type of failure can help provide not only insights but also guidance to make informed maintenance strategies. In this experiment, a sequence of 1600 failures occurred in the same zone within 15 years with 10 different failure types [12] are used for testing the performance of the proposed iHSMM-IPP model. Failure types are modelled as latent states. Labour hours for repair are emissions of states, which are modelled by Gaussian distributions. It is well observed in industry that pipe failures occur in clusters, i.e., certain types of failures can cause high failure risk in near future. Such behaviours are modelled via the triggering kernels of states. As in the first experiment, we compare the proposed iHSMM-IPP model with 4 related methods. The sequence is divided into two parts 90% and 10%. The first part of the sequence is used for training models. The normalized Hamming distance errors and log likelihoods are used for measuring the performances on the first part. Then the models are used for predicting the remaining 10% of the sequence. The predicted total number of failures and total labour hours for each failure type are compared with ground truth by using mean square error. The results are shown in the last four columns of Table 1. It can be seen that the proposed iHSMM-IPP achieves the best performance for both the estimation on the first part of the sequence and the prediction on the second part of the sequence. Its superiority comes from the fact that it well utilizes both the observed labour hours and occurrence times while others only consider part of the observed information or have limitations on model flexibility. 6 Conclusion In this work, we proposed a new Bayesian nonparametric stochastic point process model, namely the infinite hidden semi-Markov modulated interaction point process model. It captures both emitted observations and arrival times of temporal events for capturing the underlying event correlation. A Metropolis-within-particle-Gibbs sampler with truncated ancestor resampling is developed for the posterior inference of the proposed model. The effectiveness of the sampler is shown on a synthetic data set with the comparison of 4 related state-of-the-art methods. The superiority of the proposed model over the compared methods is also demonstrated in two real-world applications, i.e., household energy consumption modelling and infrastructure failure modelling. 8 References [1] C. Andrieu, A. Doucet, and R. Holenstein. Particle markov chain monte carlo methods. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 72(3):269–342, 2010. [2] M. J. Beal, Z. Ghahramani, and C. E. Rasmussen. The infinite hidden markov model. In NIPS, pages 577–584, 2001. [3] D. J. Daley and D. Vere-Jones. An introduction to the theory of point processes: volume II: general theory and structure. Springer Science & Business Media, 2007. [4] P. J. Diggle, T. Fiksel, P. Grabarnik, Y. Ogata, D. Stoyan, and M. Tanemura. On parameter estimation for pairwise interaction point processes. International Statistical Review, pages 99–117, 1994. [5] E. B. Fox, E. B. Sudderth, M. I. Jordan, and A. S. Willsky. An hdp-hmm for systems with state persistence. In Proceedings of the 25th international conference on Machine learning, pages 312–319. ACM, 2008. [6] A. G. Hawkes. Spectra of some self-exciting and mutually exciting point processes. Biometrika, 58(1):83– 90, 1971. [7] A. G. Hawkes and D. Oakes. A cluster process representation of a self-exciting process. Journal of Applied Probability, pages 493–503, 1974. [8] M. J. Johnson and A. Willsky. The hierarchical dirichlet process hidden semi-markov model. arXiv preprint arXiv:1203.3485, 2012. [9] K. J.Z. and J. M.J. Redd: A public data set for energy disaggregation research. In Proceedings of the SustKDD Workshop on Data Mining Appliations in Sustainbility, 2011. [10] J. Kingman. On doubly stochastic poisson processes. In Mathematical Proceedings of the Cambridge Philosophical Society, volume 60, pages 923–930. Cambridge Univ Press, 1964. [11] L. Li and H. Zha. Energy usage behavior modeling in energy disaggregation via marked hawkes process. In Proceedings of the Twenty-Ninth AAAI Conference on Artificial Intelligence, January 25-30, 2015, Austin, Texas, USA., pages 672–678, 2015. [12] P. Lin, B. Zhang, T. Guo, Y. Wang, and F. Chen. Interaction point processes via infinite branching model. The Thirtieth AAAI Conference on Artificial Intelligence (AAAI), 2016. [13] F. Lindsten, M. I. Jordan, and T. B. Schön. Particle gibbs with ancestor sampling. The Journal of Machine Learning Research, 15(1):2145–2184, 2014. [14] K. P. Murphy. Hidden semi-markov models (hsmms). unpublished notes, 2, 2002. [15] Y. Ogata. On lewis’ simulation method for point processes. Information Theory, IEEE Transactions on, 27(1):23–31, 1981. [16] L. R. Rabiner. A tutorial on hidden markov models and selected applications in speech recognition. Proceedings of the IEEE, 77(2):257–286, 1989. [17] J. G. Rasmussen. Bayesian inference for hawkes processes. Methodology and Computing in Applied Probability, 15(3):623–642, 2013. [18] Y. W. Teh, M. I. Jordan, M. J. Beal, and D. M. Blei. Hierarchical dirichlet processes. Journal of the american statistical association, 101(476), 2006. [19] N. Tripuraneni, S. Gu, H. Ge, and Z. Ghahramani. Particle gibbs for infinite hidden markov models. In Advances in Neural Information Processing Systems, pages 2386–2394, 2015. [20] J. Van Gael, Y. Saatci, Y. W. Teh, and Z. Ghahramani. Beam sampling for the infinite hidden markov model. In Proceedings of the 25th international conference on Machine learning, pages 1088–1095. ACM, 2008. [21] S.-Z. Yu. Hidden semi-markov models. Artificial Intelligence, 174(2):215–243, 2010. [22] K. Zhou, H. Zha, and L. Song. Learning triggering kernels for multi-dimensional hawkes processes. In ICML, pages 1301–1309, 2013. 9
2016
326
6,246
A Credit Assignment Compiler for Joint Prediction Kai-Wei Chang University of Virginia kw@kwchang.net He He University of Maryland hhe@cs.umd.edu Hal Daumé III University of Maryland me@hal3.name John Langford Microsoft Research jcl@microsoft.com Stephane Ross Google stephaneross@google.com Abstract Many machine learning applications involve jointly predicting multiple mutually dependent output variables. Learning to search is a family of methods where the complex decision problem is cast into a sequence of decisions via a search space. Although these methods have shown promise both in theory and in practice, implementing them has been burdensomely awkward. In this paper, we show the search space can be defined by an arbitrary imperative program, turning learning to search into a credit assignment compiler. Altogether with the algorithmic improvements for the compiler, we radically reduce the complexity of programming and the running time. We demonstrate the feasibility of our approach on multiple joint prediction tasks. In all cases, we obtain accuracies as high as alternative approaches, at drastically reduced execution and programming time. 1 Introduction Many applications require a predictor to make coherent decisions. As an example, consider recognizing a handwritten word where each character might be recognized in turn to understand the word. Here, it is commonly observed that exposing information from related predictions (i.e. adjacent letters) aids individual predictions. Furthermore, optimizing a joint loss function can improve the gracefulness of error recovery. Despite these advantages, it is empirically common to build independent predictors, in settings where joint prediction naturally applies, because they are simpler to implement and faster to run. Can we make joint prediction algorithms as easy and fast to program and compute while maintaining their theoretical benefits? Methods making a sequence of sub-decisions have been proposed for handling complex joint predictions in a variety of applications, including sequence tagging [30], dependency parsing (known as transition-based method) [35], machine translation [18], and co-reference resolution [44]. Recently, general search-based joint prediction approaches (e.g., [10, 12, 14, 22, 41]) have been investigated. The key issue of these search-based approaches is credit assignment: when something goes wrong do you blame the first, second, or third prediction? Existing methods often take two strategies: • The system ignores the possibility that a previous prediction may have been wrong, different costs have different errors, or the difference between train-time and test-time prediction. • The system uses handcrafted credit assignment heuristics to cope with errors that the underlying algorithm makes and the long-term outcomes of decisions. Both approaches may lead to statistical inconsistency: when features are not rich enough for perfect prediction, the machine learning may converge sub-optimally. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. Algorithm 1 MYRUN(X) % for sequence tagging, X: input sequence, Y: output A sample user-defined function, where PREDICT and LOSS are library functions (see text). The credit assignment compiler translates the code and data into model updates. More examples are in appendices. 1: Y ←[] 2: for t = 1 to LEN(X) do 3: ref ←X[t].true_label 4: Y[t] ←PREDICT(x=examples[t], y=ref, tag=t, condition=[1:t-1]) 5: LOSS(number of Y[t] ̸= X[t].true_label) 6: return Y In contrast, learning to search approaches [5, 11, 40] automatically handle the credit assignment problem by decomposing the production of the joint output in terms of an explicit search space (states, actions, etc.); and learning a control policy that takes actions in this search space. These have formal correctness guarantees which differ qualitatively from models such as Conditional Random Fields [28] and structured SVMs [46, 47]. Despite the good properties, none of these methods have been widely adopted because the specification of a search space as a finite state machine is awkward and naive implementations do not fully demonstrate the ability of these methods. In this paper, we cast learning to search into a credit assignment compiler with a new programming abstraction for representing a search space. Together with several algorithmic improvements, this radically reduces both the complexity of programming1 and the running time. The programming interface has the following advantages: • The same decoding function (see Alg. 1 for example) is used for training and prediction so a developer need only code desired test time behavior and gets training “for free”. This simple implementation prevents common train/test asynchrony bugs. • The compiler automatically ensures the model learns to avoid compounding errors and makes a sequence of coherent decisions. • The library functions are in a reduction stack so as base classifiers and learning to search approaches improve, so does joint prediction performance. We implement the credit assignment compiler in Vowpal-Wabbit (http://hunch.net/~vw/), a fast online learning library, and show that the credit assignment compiler achieves outstanding empirical performance both in accuracy and in speed for several application tasks. This provides strong simple baselines for future research and demonstrates the compiler approach to solving complex prediction problems may be of broad interest. Details experimental settings are in appendices. 2 Programmable Learning to Search We first describe the proposed programmable joint prediction paradigm. Algorithm 1 shows sample code for a part of speech tagger (or generic sequence labeler) under Hamming loss. The algorithm takes as input a sequence of examples (e.g., words), and predicts the meaning of each element in turn. The ith prediction depends on previous predictions.2 It uses two underlying library functions, PREDICT(...) and LOSS(...). The function PREDICT(...) returns individual predictions based on x while LOSS(...) allows the declaration of an arbitrary loss for the point set of predictions. The LOSS(...) function and the reference y inputted to PREDICT(...) are only used in the training phase and it has no effect in the test phase. Surprisingly, this single library interface is sufficient for both testing and training, when augmented to include label “advice” from a training set as a reference decision (by the parameter y). This means that a developer only has to specify the desired test time behavior and gets training with minor additional decoration. The underlying system works as a credit assignment compiler to translate the user-specified decoding function and labeled data into updates of the learning model. How can you learn a good PREDICT function given just an imperative program like Algorithm 1? In the following, we show that it is essential to run the MYRUN(...) function (e.g., Algorithm 1) many times, “trying out” different versions of PREDICT(...) to learn one that yields low LOSS(...). We begin with formal definitions of joint prediction and a search space. 1With library supports, developing a new task often requires only a few lines of code. 2In this example, we use the library’s support for generating implicit features based on previous predictions. 2 S R E E E rollin rollout one-step deviations loss=.2 loss=0 loss=.8 The system begins at the start state S and chooses the middle action twice according to the rollin policy. At state R it considers both the chosen action (middle) and one-step deviations from that action (top and bottom). Each of these deviations is completed using the rollout policy until reaching an end state, at which point the loss is collected. Here, we learn that deviating to the top action (instead of middle) at state R decreases the loss by 0.2. Figure 1: A search space implicitly defined by an imperative program. The definition of a TDOLR program: • Always terminate. • Takes as input any relevant feature information X. • Make zero or more calls to an oracle O : X′ →Y which provides a discrete outcome. • Report a loss L on termination. Algorithm 2 TDOLR(X) 1: s ←a 2: while s ̸∈E do 3: Compute xs from X and s 4: s ←O(xs) 5: return LOSS(s) Figure 2: Left: the definition; right: A TDOLR program simulates the search space. Joint Prediction. Joint prediction aims to induce a function f such that for any X ∈X (the input space), f produces an output f(X) = Y ∈Y(X) in a (possibly input-dependent) space Y(X). The output Y often can be decomposed into smaller pieces (e.g., y1, y2, . . .), which are tied together by features, by a loss function and/or by statistical dependence. There is a task-specific loss function ℓ: Y × Y →R≥0, where ℓ(Y ∗, ˆY ) tells us how bad it is to predict ˆY when the true is Y ∗. Search Space. In our framework, the joint variable ˆY is produced incrementally by traversing a search space, which is defined by states s ∈S and a mapping A : S →2S defining the set of valid next states.3 One of the states is a unique start state S while some of the others are end states e ∈E. Each end state corresponds to some output variable Ye. The goal of learning is finding a function f : Xs →S that uses the features of an input state (xs) to choose the next state so as to minimize the loss ℓ(Y ∗, Ye) on a holdout test set.4 Follow reinforcement learning terminology, we call the function a policy and call the learned function f a learned policy πf. Turning Search Space into an Imperative Program Surprisingly, search space can be represented by a class of imperative program, called Terminal Discrete Oracle Loss Reporting (TDOLR) programs. The formal definition of TDOLR is listed in Figure 2. Without loss of generality, we assume the number of choices is fixed in a search space, and the following theorem holds: Theorem 1. For every TDOLR program, there exist an equivalent search space and for every search space, there exists an equivalent TDOLR program. Proof. A search space is defined by (A, E, S, l). We show there is a TDOLR program which can simulate the search space in algorithm 2. This algorithm does a straightforward execution of the search space, followed by reporting of the loss on termination. This completes the second claim. For the first claim, we need to define, (A, E, S, l) given a TDOLR program such that the search space can simulate the TDOLR program. At any point in the execution of TDOLR, we define an equivalent state s = (O(X1), ..., O(Xn)) where n is the number of calls to the oracle. We define a as the sequence of zero length, and we define E as the set of states after which TDOLR terminates. 3Comprehensive strategies for defining search space have been discussed [14]. The theoretical properties do not depend on which search space definition is used. 4Note that we use X and Y to represent joint input and output and use x and y to represent input and output to function f and PREDICT. 3 Algorithm 3 LEARN(X, F) 1: T, ex, cache ←0, [], [] 2: define PREDICT(x, y) := { T++ ; ex[T-1] ←x; cache[T-1] ←F(x, y, rollin) ; return cache[T-1] } 3: define LOSS(l) := no-op 4: MYRUN(X) % MYRUN(X) is a user-defined TDOLR program (e.g., Algorithm 1). 5: for t0 = 1 to T do 6: losses, t ←⟨0, 0, ..., 0⟩, 0 7: for a0 = 1 to A(ex[t0]) do 8: Define PREDICT(x, y) := { t++ ; return    cache[t-1] if t < t0 a0 if t = t0 F(x,y,rollout) if t > t0 } 9: Define LOSS(val) := { losses[a0] += val } 10: MYRUN(X) 11: Online update with cost-sensitive example (ex[t0], losses) For each s ∈E we define l(s) as the loss reported on termination. This search space manifestly outputs the same loss as the TDOLR program. The practical implication of this theorem is that instead of specifying search spaces, we can specify a TDOLR program (e.g., Algorithm 1), reducing the programming complexity of joint prediction. 3 Credit Assignment Compiler for Training Joint Predictor Now, we show how a credit assignment compiler turns a TDOLR program and training data into model updates. In the training phase, the supervised signals are used in two places: 1) to define the loss function, and 2) to construct a reference policy π∗. The reference policy returns at any prediction point a “suggestion” as to a good next state.5 The general strategy is, for some number of epochs, and for each example (X, Y ) in the training data, to do the following: 1. Execute MYRUN(...) on X with a rollin policy to obtain a trajectory of actions ⃗a and loss ℓ0 2. Many times: (a) For some (or for all) time step t ≤|⃗a| (b) For some (or for all) alternative action a′ t ̸= at (at is the action taken by ⃗a in time step t) (c) Execute MYRUN(...) on X, with PREDICT returning a1:t−1 initially, then a′ t, then acting according to a rollout policy to obtain a new loss ℓt,a′ t (d) Compare the overall losses ℓt,at and ℓt,a′ t to construct a classification/regression example that demonstrates how much better or worse a′ t is than at in this context. 3. Update the learned policy The rollin and rollout policies can be the reference π∗, the current classifier πf or a mixture between them. By varying them and the manner in which classification/regression examples are created, this general framework can mimic algorithms like SEARN [11], DAGGER [41], AGGREVATE [40], and LOLS [5].6 The full learning algorithm (for a single joint input X) is depicted in Algorithm 3.7 In lines 1–4, a rollin pass of MYRUN is executed. MYRUN can generally be any TDOLR program as discussed (e.g., Alg. 1). In this pass, predictions are made according to the current policy, F, flagged as rollin (this is to enable support of arbitrary rollin and rollout policies). Furthermore, the examples (feature vectors) encountered during prediction are stored in ex, indexed by their position in the sequence (T), and the rollin predictions are cached in the variable cache (see Sec. 4). The algorithm then initiates one-step deviations from this rollin trajectory. For every time step, (line 5), we generate a single cost-sensitive classification example; its features are ex[t0], and there 5Some papers assume the reference policy is optimal. An optimal policy always chooses the best next state assuming it gets to make all future decisions as well. 6E.g., rollin in LOLS is πf and rollout is a stochastic interpolation of πf and oracle π∗constructed by y. 7This algorithm is awkward because standard computational systems have a single stack. We have elected to give MYRUN control of the stack to ease the implementation of joint prediction tasks. Consequently, the learning algorithm does not have access to the machine stack and must be implemented as a state machine. 4 are A(ex[t0]) possible labels (=actions). For each action (line 7), we compute the cost of that action by executing MYRUN again (line 10) with a “tweaked” PREDICT which returns the cached predictions at steps before t0, returns the perturbed action a0 at t0, and at future timesteps calls F for rollouts. The LOSS function accumulates the loss for the query action. Finally, a cost-sensitive classification example is generated (line 11) and fed into an online learning algorithm. 4 Optimizing the Credit Assignment Compiler We present two algorithmic improvements which make training orders of magnitude faster. Optimization 1: Memoization The primary computational cost of Alg. 3 is making predictions: namely, calling the underlying classifier in Step 10. In order to avoid redundant predictions, we cache previous predictions. The challenge is understanding how to know when two predictions are going to be identical, faster than actually computing the prediction. To accomplish this, the user may decorate calls to the PREDICT function with tags. For a graphical model, a tag is effectively the “name” of a particular variable in the graphical model. For a sequence labeling problem, the tag for a given position might just be its index. When calling PREDICT, the user specifies both the tag of the current prediction and the tag of all previous predictions on which the current prediction depends. The user is guaranteeing that if the predictions for all the tags in the dependent variables are the same, then the prediction for the current example are the same. Under this assumption, we store a cache that maps triples of ⟨tag, condition tags, condition predictions⟩to ⟨current prediction⟩. The added overhead of maintaining this data structure is tiny in comparison to making repeated predictions on the same features. In line 11 the learned policy changes making correctness subtle. For data mixing algorithms (like DAgger), this potentially changes Fi implying the memoized predictions may no longer be up-to-date. Thus this optimization is okay if the policy does not change much. We evaluate this empirically in Section 5.3. Optimization 2: Forced Path Collapse The second optimization we can use is a heuristic that only makes rollout predictions for a constant number of steps (e.g., 2 or 4). The intuition is that optimizing against a truly long term reward may be impossible if features are not available at the current time t0 which enable the underlying learner to distinguish between the outcome of decisions far in the future. The optimization stops rollouts after some fixed number of rollout steps. This intuitive reasoning is correct, except for accumulating LOSS(...). If LOSS(...) is only declared at the end of MYRUN, then we must execute T−t0 time steps making (possibly memoized) predictions. However, for many problems, it is possible to declare loss early as with Hamming loss (= number of incorrect predictions). There is no need to wait until the end of the sequence to declare a persequence loss: one can declare it after every prediction, and have the total loss accumulate (hence the “+=” on line 9). We generalize this notion slightly to that of a history-independent loss: Definition 1 (History-independent loss). A loss function is history-independent at state s0 if, for any final state e reachable from s0, and for any sequence s0s1s2 . . . si = e: it holds that LOSS(e) = A(s0) + B(s1s2 . . . si), where B does not depend on any state before s1. For example, Hamming loss is history-independent: A(s0) corresponds to loss through s0 and B(s1 . . . si) is the loss after s0.8 When the loss function being optimized is history-independent, we allow LOSS(...) to be declared early for this optimization. In addition, for tasks like transition-base dependency parsing, although LOSS(...) is not decomposable over actions, expected cost per action can be directly computed based on gold labels [19] so the array losses can be directly specified. Speed Up We analyze the time complexity of the sequence tagging task. Suppose that the cost of calling the policy is d and each state has k actions.9 Without any speed enhancements, each execution of MYRUN takes O(T) time, and we execute it Tk + 1 times, yielding an overall complexity of O(kT 2d) per joint example. For comparison, structured SVMs or CRFs with first order Markov 8Any loss function that decomposes over the structure, as required by structured SVMs, is guaranteed to also be history-independent; the reverse is not true. Furthermore, when structured SVMs are run with a nondecomposable loss function, their runtime becomes exponential in t. When our approach is used with a loss function that’s not history-independent, our runtime increases by a factor of t. 9Because the policy is a multiclass classifier, d might hide a factor of k or log k. 5 Figure 3: Training time (minutes) versus test accuracy for POS and NER. Different points correspond to different termination criteria for training. The rightmost figure use default hyperparameters and the two left figures use hyperparameters that were tuned (for accuracy) on the holdout data. Results of NER with default parameters are in the appendix. X-axis is in log scale. dependencies run in O(k2T) time. When both memoization and forced path collapse are in effect, the complexity of training drops to O(Tkd), similar to independent prediction. In particular, if the ith prediction only depends on the i−1th prediction, then at most Tk unique predictions are made.10 5 System Performance We present two sets of experiments. In the first set, we compare the credit assignment compiler with existing libraries on two sequence tagging problems: Part of Speech tagging (POS) on the Wall Street Journal portion of the Penn Treebank; and sequence chunking problem: named entity recognition (NER) based on standard Begin-In-Out encoding on the CoNLL 2003 dataset. In the second set of experiments, we demonstrate a simple dependency parser built by our approach achieves strong results when comparing with systems with similar complexity. The parser is evaluated on the standard WSJ (English, Stanford-style labels), CTB (Chinese) datasets and the CoNLL-X datasets for 10 other languages.11 Our approach is implemented using the Vowpal Wabbit [29] toolkit on top of a cost-sensitive classifier [3] trained with online updates [15, 24, 42]. Details of dataset statistics, experimental settings, additional results on other applications, and pseudocode are in the appendix. 5.1 Sequence Tagging Tasks We compare our system with freely available systems, including CRF++ [27], CRF SGD [4], Structured Perceptron [9], Structured SVM [23], Structured SVM (DEMI-DCD) [6], and an unstructured baseline (OAA) predicting each label independently, using one-against-all classification [3]12. For each system, we consider two situations, either the default hyperparameters or the tuned hyperparameters that achieved the best performance on holdout data. We report both conditions to give a sense of how sensitive each approach is to the setting of hyperparameters (the amount of hyperparameter tuning directly affects effective training time). We use the built-in feature template of CRF++ to generate features and use them for other systems. The templates included neighboring words and, in the case of NER, neighboring POS tags. The CRF++ templates generate 630k unique features for the training data. However, because L2S is also able to generate features from its own templates, we also provide results for L2S (ft) in which it uses its own feature template generation. Training time. In Figure 3, we show trade-offs between training time (x-axis, log scaled) and prediction accuracy (y-axis) for the aforementioned six systems. For POS tagging, the independent classifier is the fastest (trains in less than one minute) but its performance peaks at 95% accuracy. Three other approaches are in roughly the same time/accuracy trade-off: L2s, L2S (ft) and Structured Perceptron. CRF SGD takes about twice as long. DEMI-DCD (taking a half hour) and CRF++ (taking 10We use tied randomness [34] to ensure that for any time step, the same policy is called. 11PTB and CTB are prepared by following [8], and CoNLL-X is from the CoNLL shared task 06. 12 Structured Perceptron and Structured SVM (DEMI-DCD) are implemented in Illioins-SL[7]. DEMIDCD is a multi-core dual approach, while Structured SVM uses cutting-planes. 6 Parser AR BU CH CZ+ DA DU+ JA+ PO+ SL+ SW PTB CTB DYNA 75.3 89.8 88.7 81.5 87.9 74.2 92.1 88.9 78.5 88.9 90.3 80.0 SNN 67.4∗88.1 87.3 78.2 83.0 75.3 89.5 83.2∗63.6∗85.7 91.8# 83.9# L2S 78.2 92.0 89.8 84.8 89.8 79.2 91.8 90.6 82.2 89.7 91.9 85.1 BEST 79.3 92.0 93.2 87.30 90.6 83.6 93.2 91.4 83.2 89.5 94.4# 87.2# Table 1: UAS on PTB, CTB and CoNLL-X. Best: the best known result in CoNLL-X or the best published results (CTB, PTB) using arbitrary features and resources. See details and additional results in text and in the appendix.15 over five hours) are not competitive. Structured SVM runs out of memory before achieving competitive performance (likely due to too many constraints). For NER the story is a bit different. The independent classifiers are not competitive. Here, the two variants of L2S totally dominate. In this case, Structured Perceptron is no longer competitive and is essentially dominated by CRF SGD. The only system coming close to L2S’s performance is DEMI-DCD, although it’s performance flattens out after a few minutes.13 The trends in the runs with default hyperparameters show similar behavior to those with tuned, though some of the competing approaches suffer significantly in prediction performance. Structured Perceptron has no hyperparameters. Test Time. In addition to training time, one might care about test time behavior. On NER, prediction times where 5.3k tokens/second (DEMI-DCD and Structured Perceptron, 20k (CRF SGD and Structured SVM), 100k (CRF++), 220k (L2S (ft)), and 285k (L2S). Although CRF SGD and Structured Perceptron fared well in terms of training time, their test-time behavior is suboptimal. When the number of labels increases from 9 (NER) to 45 (POS) the relative advantage of L2S increases further. The speed of L2S is about halved while for others, it is cut down by as much as a factor of 8 due to the O(k) vs O(k2) dependence on the label set size. 5.2 Dependency Parsing To demonstrate how the credit assignment compiler handles predictions with complex dependencies, we implement an arc-eager transition-based dependency parser [35]. At each state, it takes one of the four actions {Shift, Reduce, Left, Right} based on a simple neural network with one hidden layer of size 5 and generates a dependency parse to a sentence in the end. The rollin policy is the current (learned) policy. The probability of executing the reference policy (dynamic oracle) [19] for rollout decreases over each round. We compare our model with two recent greedy transitionbased parsers implemented by the original authors, the dynamic oracle parser (DYNA) [19] and the Stanford neural network parser (SNN) [8]. We also present the best results in CoNLL-X and the best-published results for CTB and PTB. The performances are evaluated by unlabeled attachment scores (UAS). Punctuation is excluded. Table 1 shows the results. Our implementation with only ˜300 lines of C++ code is competitive with DYNA and SNN, which are specifically designed for parsing. Remarkably, our system achieves strong performance on CoNLL-X without tuning any hyper-parameters, even beating heavily tuned systems participating in the challenge on one dataset. The best system to date on PTB [2] uses a global normalization, more complex neural network layers and k-best POS tags. Similarly, the best system for CTB [16] uses stack LSTM architectures tailored for dependency parsing. 5.3 Empirical evaluation of optimizations In Section 3, we discussed two approaches for computational improvements. Memoization avoids re-predicting on the same input multiple times while path collapse stops rollouts at a particular 13We also tried giving CRF SGD the features computed by L2S (ft) on both POS and NER. On POS, its accuracy improved to 96.5 with essentially the same speed. On NER it’s performance decreased. 15(∗) SNN makes assumptions about the structure of languages and hence obtains substantially worse performance on languages with multi-root trees. (+) Languages contains more than 1% non-projective arcs, where a transition-based parser (e.g. L2S) likely underperforms graph-based parser (Best) due to the model assumptions. (#) Numbers reported in the published papers [8, 16, 2]. 7 NER POS LOLS Searn LOLS Searn No Opts 96s 123s 3739s 4255s Mem. 75s 85s 1142s 1215s Col.@4+Mem. 71s 75s 1059s 1104s Col.@2+Mem. 69s 71s 1038s 1074s -7.5 -6.5 -5.5 -4.5 -3.5 0 1 2 3 4 5 6 7 8 9 10 Effect of Caching on Training Efficiency history=1 history=2 history=3 history=4 Alpha (log10), controls mixing rate Speedup factor for training Figure 4: The table on the left shows the effect of Collapse (Col) and Memorization (Mem.). The figure on the right shows the speed-up obtained for different historical lengths and mixing rate of rollout policy. Large α corresponds to more prediction required when training the model. point in time. The effect of the different optimizations depends greatly on the underlying learning algorithm. For example, DAgger does not do rollouts at all, so no efficiency is gained by either optimization.16 The affected algorithms are LOLS (with mixed rollouts) and Searn. Figure 4 shows the effect of these optimizations on the best NER and POS systems we trained without using external resources. In the left table, we can see that memoization alone reduces overall training runtime by about 25% on NER and about 70% on POS, essentially because the overhead for the classifier on POS tagging is so much higher (45 labels versus 9). When rollouts are terminated early, the speed increases are much more modest, essentially because memoization is already accounting for much of these gains. In all cases, the final performance of the predictors is within statistical significance of each other (p-value of 0.95, paired sign test), except for Collapse@2+Memoization on NER, where the performance decrease is only insignificant at the 0.90 level. The right figure demonstrates that when α increases, more prediction is required during the training time, and the speedup increases from a factor of 1 (no change) to a factor of as much as 9. However, as the history length increases, the speedup is more modest due to low cache hits. 6 Related Work Several algorithms are similar to learning to search approaches, including the incremental structured perceptron [10, 22], HC-Search [13, 14], and others [12, 38, 45, 48, 49]. Some fit this framework. Probabilistic programming [21] has been an active area of research. These approaches have a different goal: Providing a flexible framework for specifying graphical models and performing inference in those models. The credit assignment compiler instead allows a developer to learn to make coherent decisions for joint prediction (“learning to search”). We also differ by not designing a new programming language. Instead, we have a two-function library which makes adoption and integration into existing code bases much easier. The closest work to ours is Factorie [31]. Factorie is essentially an embedded language for writing factor graphs compiled into Scala to run efficiently.17 Similarly, Infer.NET [33], Markov Logic Networks (MNLs) [39], and Probabilistic Soft Logic (PSL) [25] concisely construct and use probabilistic graphical models. BLOG [32] falls in the same category, though with a very different focus. Similarly, Dyna [17] is a related declarative language for specifying probabilistic dynamic programs, and Saul [26] is a declarative language embedded in Scala that deals with joint prediction via integer linear programming. All of these examples have picked particular aspects of the probabilistic modeling framework to focus on. Beyond these examples, there are several approaches that essentially “reinvent” an existing programming language to support probabilistic reasoning at the first order level. IBAL [36] derives from O’Caml; Church [20] derives from LISP. IBAL uses a (highly optimized) form of variable elimination for inference that takes strong advantage of the structure of the program; Church uses MCMC techniques, coupled with a different type of structural reasoning to improve efficiency. Acknowledgements Part of this work was carried out while Kai-Wei, Hal and Stephane were visiting Microsoft Research. Hal and He are also supported by NSF grant IIS-1320538. Any opinions, findings, conclusions, or recommendations expressed here are those of the authors and do not necessarily reflect the view of the sponsor. The authors thank anonymous reviewers for their comments. 16Training speed is only degraded by about 0.5% with optimizations on, demonstrating negligible overhead. 17Factorie-based implementations of simple tasks are still less efficient than systems like CRF SGD. 8 References [1] A. Agarwal, O. Chapelle, M. Dudík, and J. Langford. A reliable effective terascale linear learning system. arXiv preprint arXiv:1110.4198, 2011. [2] D. Andor, C. Alberti, D. Weiss, A. Severyn, A. Presta, K. Ganchev, S. Petrov, and M. Collins. Globally normalized transition-based neural networks. Arxiv, 2016. [3] A. Beygelzimer, V. Dani, T. Hayes, J. Langford, and B. Zadrozny. Error limiting reductions between classification tasks. In ICML, pages 49–56, 2005. [4] L. Bottou. crfsgd project, 2011. http://leon.bottou.org/projects/sgd. [5] K.-W. Chang, A. Krishnamurthy, A. Agarwal, H. Daumé III, and J. Langford. Learning to search better than your teacher. In ICML, 2015. [6] K.-W. Chang, V. Srikumar, and D. Roth. Multi-core structural SVM training. In ECML, 2013. [7] K.-W. Chang, S. Upadhyay, M.-W. Chang, V. Srikumar, and D. Roth. Illinoissl: A JAVA library for structured prediction. Arxiv, 2015. [8] D. Chen and C. Manning. A fast and accurate dependency parser using neural networks. In EMNLP, pages 740–750, 2014. [9] M. Collins. Discriminative training methods for hidden Markov models: Theory and experiments with perceptron algorithms. In EMNLP, 2002. [10] M. Collins and B. Roark. Incremental parsing with the perceptron algorithm. In ACL, 2004. [11] H. Daumé III, J. Langford, and D. Marcu. Search-based structured prediction. Machine Learning Journal, 2009. [12] H. Daumé III and D. Marcu. Learning as search optimization: Approximate large margin methods for structured prediction. In ICML, 2005. [13] J. R. Doppa, A. Fern, and P. Tadepalli. Output space search for structured prediction. In ICML, 2012. [14] J. R. Doppa, A. Fern, and P. Tadepalli. HC-Search: A learning framework for search-based structured prediction. JAIR, 50, 2014. [15] J. Duchi, E. Hazan, and Y. Singer. Adaptive subgradient methods for online learning and stochastic optimization. JMLR, 12:2121–2159, 2011. [16] C. Dyer, M. Ballesteros, W. Ling, A. Matthews, and N. A. Smith. Transition-based dependency parsing with stack long short-term memory. In ACL, 2015. [17] J. Eisner, E. Goldlust, and N. A. Smith. Compiling comp ling: Practical weighted dynamic programming and the dyna language. In EMNLP, 2005. [18] U. Germann, M. Jahr, K. Knight, D. Marcu, and K. Yamada. Fast decoding and optimal decoding for machine translation. Artificial Intelligence, 154(1-2):127–143, 2003. [19] Y. Goldberg and J. Nivre. Training deterministic parsers with non-deterministic oracles. Transactions of the ACL, 1, 2013. [20] N. Goodman, V. Mansinghka, D. Roy, K. Bonawitz, and J. Tenenbaum. Church: a language for generative models. In UAI, 2008. [21] A. D. Gordon, T. A. Henzinger, A. V. Nori, and S. K. Rajamani. Probabilistic programming. In International Conference on Software Engineering (ICSE, FOSE track), 2014. [22] L. Huang, S. Fayong, and Y. Guo. Structured perceptron with inexact search. In NAACL, 2012. [23] T. Joachims, T. Finley, and C.-N. Yu. Cutting-plane training of structural SVMs. Machine Learning Journal, 2009. [24] N. Karampatziakis and J. Langford. Online importance weight aware updates. In UAI, 2011. [25] A. Kimmig, S. Bach, M. Broecheler, B. Huang, and L. Getoor. A short introduction to probabilistic soft logic. In NIPS Workshop on Probabilistic Programming, 2012. [26] P. Kordjamshidi, D. Roth, and H. Wu. Saul: Towards declarative learning based programming. In IJCAI, 2015. [27] T. Kudo. CRF++ project, 2005. http://crfpp.googlecode.com. [28] J. Lafferty, A. McCallum, and F. Pereira. Conditional random fields: Probabilistic models for segmenting and labeling sequence data. In ICML, pages 282–289, 2001. [29] J. Langford, A. Strehl, and L. Li. Vowpal wabbit, 2007. http://hunch.net/~vw. [30] A. McCallum, D. Freitag, and F. Pereira. Maximum entropy Markov models for information extraction and segmentation. In ICML, 2000. [31] A. McCallum, K. Schultz, and S. Singh. FACTORIE: probabilistic programming via imperatively defined factor graphs. In NIPS, 2009. [32] B. Milch, B. Marthi, S. Russell, D. Sontag, D. L. Ong, and A. Kolobov. BLOG: probabilistic models with unknown objects. Statistical relational learning, 2007. [33] T. Minka, J. Winn, J. Guiver, and D. Knowles. Infer .net 2.4, 2010. microsoft research cambridge, 2010. [34] A. Ng and M. Jordan. PEGASUS: A policy search method for large MDPs and POMDPs. In UAI, pages 406–415, 2000. [35] J. Nivre. An efficient algorithm for projective dependency parsing. In IWPT, pages 149–160, 2003. [36] A. Pfeffer. Ibal: A probabilistic rational programming language. In IJCAI, 2001. [37] L. Ratinov and D. Roth. Design challenges and misconceptions in named entity recognition. In CoNLL, 2009. [38] N. Ratliff, D. Bradley, J. A. Bagnell, and J. Chestnutt. Boosting structured prediction for imitation learning. In NIPS, 2007. [39] M. Richardson and P. Domingos. Markov logic networks. Machine learning, 62(1-2), 2006. [40] S. Ross and J. A. Bagnell. Reinforcement and imitation learning via interactive no-regret learning. arXiv:1406.5979, 2014. [41] S. Ross, G. J. Gordon, and J. A. Bagnell. A reduction of imitation learning and structured prediction to no-regret online learning. In AI-Stats, 2011. [42] S. Ross, P. Mineiro, and J. Langford. Normalized online learning. In UAI, 2013. [43] D. Roth and S. W. Yih. Global inference for entity and relation identification via a linear programming formulation. In Introduction to Statistical Relational Learning. MIT Press, 2007. [44] W. M. Soon, H. T. Ng, and D. C. Y. Lim. A machine learning approach to coreference resolution of noun phrases. Computational Linguistics, 27(4):521 – 544, 2001. [45] U. Syed and R. E. Schapire. A reduction from apprenticeship learning to classification. In NIPS, 2011. [46] B. Taskar, C. Guestrin, and D. Koller. Max-margin Markov networks. In NIPS, 2003. [47] I. Tsochantaridis, T. Hofmann, T. Joachims, and Y. Altun. Support vector machine learning for interdependent and structured output spaces. In ICML, 2004. [48] Y. Xu and A. Fern. On learning linear ranking functions for beam search. In ICML, pages 1047–1054, 2007. [49] Y. Xu, A. Fern, and S. W. Yoon. Discriminative learning of beam-search heuristics for planning. In IJCAI, pages 2041–2046, 2007. 9
2016
327
6,247
Deep Exploration via Bootstrapped DQN Ian Osband1,2, Charles Blundell2, Alexander Pritzel2, Benjamin Van Roy1 1Stanford University, 2Google DeepMind {iosband, cblundell, apritzel}@google.com, bvr@stanford.edu Abstract Efficient exploration remains a major challenge for reinforcement learning (RL). Common dithering strategies for exploration, such as ‘-greedy, do not carry out temporally-extended (or deep) exploration; this can lead to exponentially larger data requirements. However, most algorithms for statistically efficient RL are not computationally tractable in complex environments. Randomized value functions offer a promising approach to efficient exploration with generalization, but existing algorithms are not compatible with nonlinearly parameterized value functions. As a first step towards addressing such contexts we develop bootstrapped DQN. We demonstrate that bootstrapped DQN can combine deep exploration with deep neural networks for exponentially faster learning than any dithering strategy. In the Arcade Learning Environment bootstrapped DQN substantially improves learning speed and cumulative performance across most games. 1 Introduction We study the reinforcement learning (RL) problem where an agent interacts with an unknown environment. The agent takes a sequence of actions in order to maximize cumulative rewards. Unlike standard planning problems, an RL agent does not begin with perfect knowledge of the environment, but learns through experience. This leads to a fundamental trade-off of exploration versus exploitation; the agent may improve its future rewards by exploring poorly understood states and actions, but this may require sacrificing immediate rewards. To learn efficiently an agent should explore only when there are valuable learning opportunities. Further, since any action may have long term consequences, the agent should reason about the informational value of possible observation sequences. Without this sort of temporally extended (deep) exploration, learning times can worsen by an exponential factor. The theoretical RL literature offers a variety of provably-efficient approaches to deep exploration [9]. However, most of these are designed for Markov decision processes (MDPs) with small finite state spaces, while others require solving computationally intractable planning tasks [8]. These algorithms are not practical in complex environments where an agent must generalize to operate effectively. For this reason, large-scale applications of RL have relied upon statistically inefficient strategies for exploration [12] or even no exploration at all [23]. We review related literature in more detail in Section 4. Common dithering strategies, such as ‘-greedy, approximate the value of an action by a single number. Most of the time they pick the action with the highest estimate, but sometimes they choose another action at random. In this paper, we consider an alternative approach to efficient exploration inspired by Thompson sampling. These algorithms have some notion of uncertainty and instead maintain a distribution over possible values. They explore by randomly select a policy according to the probability it is the optimal policy. Recent work has shown that randomized value functions can implement something similar to Thompson sampling without the need for an intractable exact posterior update. However, this work is restricted to linearly-parameterized value functions [16]. We present a natural 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. extension of this approach that enables use of complex non-linear generalization methods such as deep neural networks. We show that the bootstrap with random initialization can produce reasonable uncertainty estimates for neural networks at low computational cost. Bootstrapped DQN leverages these uncertainty estimates for efficient (and deep) exploration. We demonstrate that these benefits can extend to large scale problems that are not designed to highlight deep exploration. Bootstrapped DQN substantially reduces learning times and improves performance across most games. This algorithm is computationally efficient and parallelizable; on a single machine our implementation runs roughly 20% slower than DQN. 2 Uncertainty for neural networks Deep neural networks (DNN) represent the state of the art in many supervised and reinforcement learning domains [12]. We want an exploration strategy that is statistically computationally efficient together with a DNN representation of the value function. To explore efficiently, the first step to quantify uncertainty in value estimates so that the agent can judge potential benefits of exploratory actions. The neural network literature presents a sizable body of work on uncertainty quantification founded on parametric Bayesian inference [3, 7]. We actually found the simple non-parametric bootstrap with random initialization [5] more effective in our experiments, but the main ideas of this paper would apply with any other approach to uncertainty in DNNs. The bootstrap principle is to approximate a population distribution by a sample distribution [6]. In its most common form, the bootstrap takes as input a data set D and an estimator Â. To generate a sample from the bootstrapped distribution, a data set ˜D of cardinality equal to that of D is sampled uniformly with replacement from D. The bootstrap sample estimate is then taken to be Â( ˜D). The bootstrap is widely hailed as a great advance of 20th century applied statistics and even comes with theoretical guarantees [2]. In Figure 1a we present an efficient and scalable method for generating bootstrap samples from a large and deep neural network. The network consists of a shared architecture with K bootstrapped “heads” branching offindependently. Each head is trained only on its bootstrapped sub-sample of the data and represents a single bootstrap sample Â( ˜D). The shared network learns a joint feature representation across all the data, which can provide significant computational advantages at the cost of lower diversity between heads. This type of bootstrap can be trained efficiently in a single forward/backward pass; it can be thought of as a data-dependent dropout, where the dropout mask for each head is fixed for each data point [19]. (a) Shared network architecture (b) Gaussian process posterior (c) Bootstrapped neural nets Figure 1: Bootstrapped neural nets can produce reasonable posterior estimates for regression. Figure 1 presents an example of uncertainty estimates from bootstrapped neural networks on a regression task with noisy data. We trained a fully-connected 2-layer neural networks with 50 rectified linear units (ReLU) in each layer on 50 bootstrapped samples from the data. As is standard, we initialize these networks with random parameter values, this induces an important initial diversity in the models. We were unable to generate effective uncertainty estimates for this problem using the dropout approach in prior literature [7]. Further details are provided in Appendix A. 3 Bootstrapped DQN For a policy fiwe define the value of an action a in state s Qfi(s, a) := Es,a,fi[qŒ t=1 “trt], where “ œ (0, 1) is a discount factor that balances immediate versus future rewards rt. This expectation indicates that the initial state is s, the initial action is a, and thereafter actions 2 are selected by the policy fi. The optimal value is Qú(s, a) := maxfiQfi(s, a). To scale to large problems, we learn a parameterized estimate of the Q-value function Q(s, a; ◊) rather than a tabular encoding. We use a neural network to estimate this value. The Q-learning update from state st, action at, reward rt and new state st+1 is given by ◊t+1 Ω ◊t + –(yQ t ≠Q(st, at; ◊t))Ò◊Q(st, at; ◊t) (1) where – is the scalar learning rate and yQ t is the target value rt + “ maxa Q(st+1, a; ◊≠). ◊≠ are target network parameters fixed ◊≠= ◊t. Several important modifications to the Q-learning update improve stability for DQN [12]. First the algorithm learns from sampled transitions from an experience buffer, rather than learning fully online. Second the algorithm uses a target network with parameters ◊≠that are copied from the learning network ◊≠Ω ◊t only every · time steps and then kept fixed in between updates. Double DQN [25] modifies the target yQ t and helps further1: yQ t Ω rt + “ max a Q ! st+1, arg max a Q(st+1, a; ◊t); ◊≠" . (2) Bootstrapped DQN modifies DQN to approximate a distribution over Q-values via the bootstrap. At the start of each episode, bootstrapped DQN samples a single Q-value function from its approximate posterior. The agent then follows the policy which is optimal for that sample for the duration of the episode. This is a natural adaptation of the Thompson sampling heuristic to RL that allows for temporally extended (or deep) exploration [21, 13]. We implement this algorithm efficiently by building up K œ N bootstrapped estimates of the Q-value function in parallel as in Figure 1a. Importantly, each one of these value function function heads Qk(s, a; ◊) is trained against its own target network Qk(s, a; ◊≠). This means that each Q1, .., QK provide a temporally extended (and consistent) estimate of the value uncertainty via TD estimates. In order to keep track of which data belongs to which bootstrap head we store flags w1, .., wK œ {0, 1} indicating which heads are privy to which data. We approximate a bootstrap sample by selecting k œ {1, .., K} uniformly at random and following Qk for the duration of that episode. We present a detailed algorithm for our implementation of bootstrapped DQN in Appendix B. 4 Related work The observation that temporally extended exploration is necessary for efficient reinforcement learning is not new. For any prior distribution over MDPs, the optimal exploration strategy is available through dynamic programming in the Bayesian belief state space. However, the exact solution is intractable even for very simple systems[8]. Many successful RL applications focus on generalization and planning but address exploration only via inefficient exploration [12] or even none at all [23]. However, such exploration strategies can be highly inefficient. Many exploration strategies are guided by the principle of “optimism in the face of uncertainty” (OFU). These algorithms add an exploration bonus to values of state-action pairs that may lead to useful learning and select actions to maximize these adjusted values. This approach was first proposed for finite-armed bandits [11], but the principle has been extended successfully across bandits with generalization and tabular RL [9]. Except for particular deterministic contexts [27], OFU methods that lead to efficient RL in complex domains have been computationally intractable. The work of [20] aims to add an effective bonus through a variation of DQN. The resulting algorithm relies on a large number of hand-tuned parameters and is only suitable for application to deterministic problems. We compare our results on Atari to theirs in Appendix D and find that bootstrapped DQN offers a significant improvement over previous methods. Perhaps the oldest heuristic for balancing exploration with exploitation is given by Thompson sampling [24]. This bandit algorithm takes a single sample from the posterior at every time step and chooses the action which is optimal for that time step. To apply the Thompson sampling principle to RL, an agent should sample a value function from its posterior. Naive applications of Thompson sampling to RL which resample every timestep can be extremely 1In this paper we use the DDQN update for all DQN variants unless explicitly stated. 3 inefficient. The agent must also commit to this sample for several time steps in order to achieve deep exploration [21, 8]. The algorithm PSRL does exactly this, with state of the art guarantees [13, 14]. However, this algorithm still requires solving a single known MDP, which will usually be intractable for large systems. Our new algorithm, bootstrapped DQN, approximates this approach to exploration via randomized value functions sampled from an approximate posterior. Recently, authors have proposed the RLSVI algorithm which accomplishes this for linearly parameterized value functions. Surprisingly, RLSVI recovers state of the art guarantees in the setting with tabular basis functions, but its performance is crucially dependent upon a suitable linear representation of the value function [16]. We extend these ideas to produce an algorithm that can simultaneously perform generalization and exploration with a flexible nonlinear value function representation. Our method is simple, general and compatible with almost all advances in deep RL at low computational cost and with few tuning parameters. 5 Deep Exploration Uncertainty estimates allow an agent to direct its exploration at potentially informative states and actions. In bandits, this choice of directed exploration rather than dithering generally categorizes efficient algorithms. The story in RL is not as simple, directed exploration is not enough to guarantee efficiency; the exploration must also be deep. Deep exploration means exploration which is directed over multiple time steps; it can also be called “planning to learn” or “far-sighted” exploration. Unlike bandit problems, which balance actions which are immediately rewarding or immediately informative, RL settings require planning over several time steps [10]. For exploitation, this means that an efficient agent must consider the future rewards over several time steps and not simply the myopic rewards. In exactly the same way, efficient exploration may require taking actions which are neither immediately rewarding, nor immediately informative. To illustrate this distinction, consider a simple deterministic chain {s≠3, .., s+3} with three step horizon starting from state s0. This MDP is known to the agent a priori, with deterministic actions “left” and “right”. All states have zero reward, except for the leftmost state s≠3 which has known reward ‘ > 0 and the rightmost state s3 which is unknown. In order to reach either a rewarding state or an informative state within three steps from s0 the agent must plan a consistent strategy over several time steps. Figure 2 depicts the planning and look ahead trees for several algorithmic approaches in this example MDP. The action “left” is gray, the action “right” is black. Rewarding states are depicted as red, informative states as blue. Dashed lines indicate that the agent can plan ahead for either rewards or information. Unlike bandit algorithms, an RL agent can plan to exploit future rewards. Only an RL agent with deep exploration can plan to learn. (a) Bandit algorithm (b) RL+dithering (c) RL+shallow explore (d) RL+deep explore Figure 2: Planning, learning and exploration in RL. 4 5.1 Testing for deep exploration We now present a series of didactic computational experiments designed to highlight the need for deep exploration. These environments can be described by chains of length N > 3 in Figure 3. Each episode of interaction lasts N + 9 steps after which point the agent resets to the initial state s2. These are toy problems intended to be expository rather than entirely realistic. Balancing a well known and mildly successful strategy versus an unknown, but potentially more rewarding, approach can emerge in many practical applications. Figure 3: Scalable environments that requires deep exploration. These environments may be described by a finite tabular MDP. However, we consider algorithms which interact with the MDP only through raw pixel features. We consider two feature mappings „1hot(st) := (1{x = st}) and „therm(st) := (1{x Æ st}) in {0, 1}N. We present results for „therm, which worked better for all DQN variants due to better generalization, but the difference was relatively small - see Appendix C. Thompson DQN is the same as bootstrapped DQN, but resamples every timestep. Ensemble DQN uses the same architecture as bootstrapped DQN, but with an ensemble policy. We say that the algorithm has successfully learned the optimal policy when it has successfully completed one hundred episodes with optimal reward of 10. For each chain length, we ran each learning algorithm for 2000 episodes across three seeds. We plot the median time to learn in Figure 4, together with a conservative lower bound of 99 + 2N≠11 on the expected time to learn for any shallow exploration strategy [16]. Only bootstrapped DQN demonstrates a graceful scaling to long chains which require deep exploration. Figure 4: Only Bootstrapped DQN demonstrates deep exploration. 5.2 How does bootstrapped DQN drive deep exploration? Bootstrapped DQN explores in a manner similar to the provably-efficient algorithm PSRL [13] but it uses a bootstrapped neural network to approximate a posterior sample for the value. Unlike PSRL, bootstrapped DQN directly samples a value function and so does not require further planning steps. This algorithm is similar to RLSVI, which is also provably-efficient [16], but with a neural network instead of linear value function and bootstrap instead of Gaussian sampling. The analysis for the linear setting suggests that this nonlinear approach will work well so long as the distribution {Q1, .., QK} remains stochastically optimistic [16], or at least as spread out as the “correct” posterior. Bootstrapped DQN relies upon random initialization of the network weights as a prior to induce diversity. Surprisingly, we found this initial diversity was enough to maintain diverse generalization to new and unseen states for large and deep neural networks. This is effective for our experimental setting, but will not work in all situations. In general it may be necessary to maintain some more rigorous notion of “prior”, potentially through the use of artificial prior data to maintain diversity [15]. One potential explanation for the efficacy of simple random initialization is that unlike supervised learning or bandits, where all networks fit the same data, each of our Qk heads has a unique target network. This, together with stochastic minibatch and flexible nonlinear representations, means that even small differences at initialization may become bigger as they refit to unique TD errors. 5 Bootstrapped DQN does not require that any single network Qk is initialized to the correct policy of “right” at every step, which would be exponentially unlikely for large chains N. For the algorithm to be successful in this example we only require that the networks generalize in a diverse way to the actions they have never chosen in the states they have not visited very often. Imagine that, in the example above, the network has made it as far as state ˜N < N, but never observed the action right a = 2. As long as one head k imagines Q( ˜N, 2) > Q( ˜N, 2) then TD bootstrapping can propagate this signal back to s = 1 through the target network to drive deep exploration. The expected time for these estimates at n to propagate to at least one head grows gracefully in n, even for relatively small K, as our experiments show. We expand upon this intuition with a video designed to highlight how bootstrapped DQN demonstrates deep exploration https://youtu.be/e3KuV_d0EMk. We present further evaluation on a difficult stochastic MDP in Appendix C. 6 Arcade Learning Environment We now evaluate our algorithm across 49 Atari games on the Arcade Learning Environment [1]. Importantly, and unlike the experiments in Section 5, these domains are not specifically designed to showcase our algorithm. In fact, many Atari games are structured so that small rewards always indicate part of an optimal policy. This may be crucial for the strong performance observed by dithering strategies2. We find that exploration via bootstrapped DQN produces significant gains versus ‘-greedy in this setting. Bootstrapped DQN reaches peak performance roughly similar to DQN. However, our improved exploration mean we reach human performance on average 30% faster across all games. This translates to significantly improved cumulative rewards through learning. We follow the setup of [25] for our network architecture and benchmark our performance against their algorithm. Our network structure is identical to the convolutional structure of DQN [12] except we split 10 separate bootstrap heads after the convolutional layer as per Figure 1a. Recently, several authors have provided architectural and algorithmic improvements to DDQN [26, 18]. We do not compare our results to these since their advances are orthogonal to our concern and could easily be incorporated to our bootstrapped DQN design. Full details of our experimental set up are available in Appendix D. 6.1 Implementing bootstrapped DQN at scale We now examine how to generate online bootstrap samples for DQN in a computationally efficient manner. We focus on three key questions: how many heads do we need, how should we pass gradients to the shared network and how should we bootstrap data online? We make significant compromises in order to maintain computational cost comparable to DQN. Figure 5a presents the cumulative reward of bootstrapped DQN on the game Breakout, for different number of heads K. More heads leads to faster learning, but even a small number of heads captures most of the benefits of bootstrapped DQN. We choose K = 10. (a) Number of bootstrap heads K. (b) Probability of data sharing p. Figure 5: Examining the sensitivities of bootstrapped DQN. The shared network architecture allows us to train this combined network via backpropagation. Feeding K network heads to the shared convolutional network effectively increases the learning rate for this portion of the network. In some games, this leads to premature and sub-optimal convergence. We found the best final scores by normalizing the gradients by 1/K, but this also leads to slower early learning. See Appendix D for more details. 2By contrast, imagine that the agent received a small immediate reward for dying; dithering strategies would be hopeless at solving this problem, just like Section 5. 6 To implement an online bootstrap we use an independent Bernoulli mask w1,..,wK≥Ber(p) for each head in each episode3. These flags are stored in the memory replay buffer and identify which heads are trained on which data. However, when trained using a shared minibatch the algorithm will also require an effective 1/p more iterations; this is undesirable computationally. Surprisingly, we found the algorithm performed similarly irrespective of p and all outperformed DQN, as shown in Figure 5b. This is strange and we discuss this phenomenon in Appendix D. However, in light of this empirical observation for Atari, we chose p=1 to save on minibatch passes. As a result bootstrapped DQN runs at similar computational speed to vanilla DQN on identical hardware4. 6.2 Efficient exploration in Atari We find that Bootstrapped DQN drives efficient exploration in several Atari games. For the same amount of game experience, bootstrapped DQN generally outperforms DQN with ‘-greedy exploration. Figure 6 demonstrates this effect for a diverse selection of games. Figure 6: Bootstrapped DQN drives more efficient exploration. On games where DQN performs well, bootstrapped DQN typically performs better. Bootstrapped DQN does not reach human performance on Amidar (DQN does) but does on Beam Rider and Battle Zone (DQN does not). To summarize this improvement in learning time we consider the number of frames required to reach human performance. If bootstrapped DQN reaches human performance in 1/x frames of DQN we say it has improved by x. Figure 7 shows that Bootstrapped DQN typically reaches human performance significantly faster. Figure 7: Bootstrapped DQN reaches human performance faster than DQN. On most games where DQN does not reach human performance, bootstrapped DQN does not solve the problem by itself. On some challenging Atari games where deep exploration is conjectured to be important [25] our results are not entirely successful, but still promising. In Frostbite, bootstrapped DQN reaches the second level much faster than DQN but network instabilities cause the performance to crash. In Montezuma’s Revenge, bootstrapped DQN reaches the first key after 20m frames (DQN never observes a reward even after 200m frames) but does not properly learn from this experience5. Our results suggest that improved exploration may help to solve these remaining games, but also highlight the importance of other problems like network instability, reward clipping and temporally extended rewards. 3p=0.5 is double-or-nothing bootstrap [17], p=1 is ensemble with no bootstrapping at all. 4Our implementation K=10, p=1 ran with less than a 20% increase on wall-time versus DQN. 5An improved training method, such as prioritized replay [18] may help solve this problem. 7 6.3 Overall performance Bootstrapped DQN is able to learn much faster than DQN. Figure 8 shows that bootstrapped DQN also improves upon the final score across most games. However, the real benefits to efficient exploration mean that bootstrapped DQN outperforms DQN by orders of magnitude in terms of the cumulative rewards through learning (Figure 9. In both figures we normalize performance relative to a fully random policy. The most similar work to ours presents several other approaches to improved exploration in Atari [20] they optimize for AUC-20, a normalized version of the cumulative returns after 20m frames. According to their metric, averaged across the 14 games they consider, we improve upon both base DQN (0.29) and their best method (0.37) to obtain 0.62 via bootstrapped DQN. We present these results together with results tables across all 49 games in Appendix D.4. Figure 8: Bootstrapped DQN typically improves upon the best policy. Figure 9: Bootstrapped DQN improves cumulative rewards by orders of magnitude. 6.4 Visualizing bootstrapped DQN We now present some more insight to how bootstrapped DQN drives deep exploration in Atari. In each game, although each head Q1, .., Q10 learns a high scoring policy, the policies they find are quite distinct. In the video https://youtu.be/Zm2KoT82O_M we show the evolution of these policies simultaneously for several games. Although each head performs well, they each follow a unique policy. By contrast, ‘-greedy strategies are almost indistinguishable for small values of ‘ and totally ineffectual for larger values. We believe that this deep exploration is key to improved learning, since diverse experiences allow for better generalization. Disregarding exploration, bootstrapped DQN may be beneficial as a purely exploitative policy. We can combine all the heads into a single ensemble policy, for example by choosing the action with the most votes across heads. This approach might have several benefits. First, we find that the ensemble policy can often outperform any individual policy. Second, the distribution of votes across heads to give a measure of the uncertainty in the optimal policy. Unlike vanilla DQN, bootstrapped DQN can know what it doesn’t know. In an application where executing a poorly-understood action is dangerous this could be crucial. In the video https://youtu.be/0jvEcC5JvGY we visualize this ensemble policy across several games. We find that the uncertainty in this policy is surprisingly interpretable: all heads agree at clearly crucial decision points, but remain diverse at other less important steps. 7 Closing remarks In this paper we present bootstrapped DQN as an algorithm for efficient reinforcement learning in complex environments. We demonstrate that the bootstrap can produce useful uncertainty estimates for deep neural networks. Bootstrapped DQN is computationally tractable and also naturally scalable to massive parallel systems. We believe that, beyond our specific implementation, randomized value functions represent a promising alternative to dithering for exploration. Bootstrapped DQN practically combines efficient generalization with exploration for complex nonlinear value functions. 8 References [1] Marc G Bellemare, Yavar Naddaf, Joel Veness, and Michael Bowling. The arcade learning environment: An evaluation platform for general agents. arXiv preprint arXiv:1207.4708, 2012. [2] Peter J Bickel and David A Freedman. Some asymptotic theory for the bootstrap. The Annals of Statistics, pages 1196–1217, 1981. [3] Charles Blundell, Julien Cornebise, Koray Kavukcuoglu, and Daan Wierstra. Weight uncertainty in neural networks. ICML, 2015. [4] Christoph Dann and Emma Brunskill. Sample complexity of episodic fixed-horizon reinforcement learning. In Advances in Neural Information Processing Systems, pages 2800–2808, 2015. [5] Bradley Efron. The jackknife, the bootstrap and other resampling plans, volume 38. SIAM, 1982. [6] Bradley Efron and Robert J Tibshirani. An introduction to the bootstrap. CRC press, 1994. [7] Yarin Gal and Zoubin Ghahramani. Dropout as a bayesian approximation: Representing model uncertainty in deep learning. arXiv preprint arXiv:1506.02142, 2015. [8] Arthur Guez, David Silver, and Peter Dayan. Efficient bayes-adaptive reinforcement learning using sample-based search. In Advances in Neural Information Processing Systems, pages 1025–1033, 2012. [9] Thomas Jaksch, Ronald Ortner, and Peter Auer. Near-optimal regret bounds for reinforcement learning. Journal of Machine Learning Research, 11:1563–1600, 2010. [10] Sham Kakade. On the Sample Complexity of Reinforcement Learning. PhD thesis, University College London, 2003. [11] Tze Leung Lai and Herbert Robbins. Asymptotically efficient adaptive allocation rules. Advances in applied mathematics, 6(1):4–22, 1985. [12] Volodymyr et al. Mnih. Human-level control through deep reinforcement learning. Nature, 518(7540):529–533, 2015. [13] Ian Osband, Daniel Russo, and Benjamin Van Roy. (More) efficient reinforcement learning via posterior sampling. In NIPS, pages 3003–3011. Curran Associates, Inc., 2013. [14] Ian Osband and Benjamin Van Roy. Model-based reinforcement learning and the eluder dimension. In Advances in Neural Information Processing Systems, pages 1466–1474, 2014. [15] Ian Osband and Benjamin Van Roy. Bootstrapped thompson sampling and deep exploration. arXiv preprint arXiv:1507.00300, 2015. [16] Ian Osband, Benjamin Van Roy, and Zheng Wen. Generalization and exploration via randomized value functions. arXiv preprint arXiv:1402.0635, 2014. [17] Art B Owen, Dean Eckles, et al. Bootstrapping data arrays of arbitrary order. The Annals of Applied Statistics, 6(3):895–927, 2012. [18] Tom Schaul, John Quan, Ioannis Antonoglou, and David Silver. Prioritized experience replay. arXiv preprint arXiv:1511.05952, 2015. [19] Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: A simple way to prevent neural networks from overfitting. The Journal of Machine Learning Research, 15(1):1929–1958, 2014. [20] Bradly C Stadie, Sergey Levine, and Pieter Abbeel. Incentivizing exploration in reinforcement learning with deep predictive models. arXiv preprint arXiv:1507.00814, 2015. [21] Malcolm J. A. Strens. A bayesian framework for reinforcement learning. In ICML, pages 943–950, 2000. [22] Richard Sutton and Andrew Barto. Reinforcement Learning: An Introduction. MIT Press, March 1998. [23] Gerald Tesauro. Temporal difference learning and td-gammon. Communications of the ACM, 38(3):58–68, 1995. [24] W.R. Thompson. On the likelihood that one unknown probability exceeds another in view of the evidence of two samples. Biometrika, 25(3/4):285–294, 1933. [25] Hado Van Hasselt, Arthur Guez, and David Silver. Deep reinforcement learning with double q-learning. arXiv preprint arXiv:1509.06461, 2015. [26] Ziyu Wang, Nando de Freitas, and Marc Lanctot. Dueling network architectures for deep reinforcement learning. arXiv preprint arXiv:1511.06581, 2015. [27] Zheng Wen and Benjamin Van Roy. Efficient exploration and value function generalization in deterministic systems. In NIPS, pages 3021–3029, 2013. 9
2016
328
6,248
Estimating Nonlinear Neural Response Functions using GP Priors and Kronecker Methods Cristina Savin IST Austria Klosterneuburg, AT 3400 csavin@ist.ac.at Gasper Tkaˇcik IST Austria Klosterneuburg, AT 3400 tkacik@ist.ac.at Abstract Jointly characterizing neural responses in terms of several external variables promises novel insights into circuit function, but remains computationally prohibitive in practice. Here we use gaussian process (GP) priors and exploit recent advances in fast GP inference and learning based on Kronecker methods, to efficiently estimate multidimensional nonlinear tuning functions. Our estimator requires considerably less data than traditional methods and further provides principled uncertainty estimates. We apply these tools to hippocampal recordings during open field exploration and use them to characterize the joint dependence of CA1 responses on the position of the animal and several other variables, including the animal’s speed, direction of motion, and network oscillations. Our results provide an unprecedentedly detailed quantification of the tuning of hippocampal neurons. The model’s generality suggests that our approach can be used to estimate neural response properties in other brain regions. 1 Introduction An important facet of neural data analysis concerns characterizing the tuning properties of neurons, defined as the average firing rate of a cell conditioned on the value of some external variables, for instance the orientation of an image patch in a V1 cell, or the position of the animal within an environment for hippocampal cells. As experiments become more complex and more naturalistic, the number of variables that modulate neural responses increases. These include not only experimentally targeted inputs but also variables that are no longer under the experimenter’s control but which can be (to a certain extent) measured, either external (the behavior of the animal) or internal (attentional level, network oscillations, etc). Characterizing these complex dependencies is very difficult, yet it could provide important insights into neural circuits computation and function. Traditional estimates of a cell’s tuning properties often manipulate one variable at the time or consider simple dependencies between inputs and the neural responses e.g. Generalized Linear Models, GLM [1, 2]). There is comparatively little work that allows for complex input-output functional relationships on multidimensional input spaces [3–5]. The reasons for this are twofold. On one hand, dealing with complex nonlinearities is computationally challenging, on the other hand, constraints on experimental duration lead to a potentially very sparse sampling of the stimulus space, requiring additional assumptions for a sensible interpolation. This problem is further exacerbated in experiments in awake animals where the sampling of the stimulus space is driven by the animal behavior. The few solutions for nonlinear tuning properties rely on spline-based approximation of one-dimensional functions (for position on a linear track) [6] or assume a log-Gaussian Cox process generative model as a way to enforce smoothness of 2D functional maps [3–5]. These methods are usually restricted to at most two input dimensions (but see [4]). 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. Here we take advantage of recent advances in scaling GP inference and learning using Kronecker methods [7] to extend the approach in [3] to the multidimensional setting, while keeping the computational and memory requirements almost linear in dataset size N, O  dN d+1 d  and O  dN 2 d  , respectively (for d dimensions) [8]. Our formulation requires a discretization of the input space,1 but allows for a flexible selection of the kernels specifying different assumptions about the nature of the functional dependencies we are looking for in the data, with hyperparameters inferred by maximizing marginal likelihood. We deal with the non-gaussian likelihood in the traditional way by using a Laplace approximation of the posterior [8]. The critical ingredient for our approach is the particular form of the covariance matrix that decomposes into a Kronecker product over covariances corresponding to individual input dimensions, dramatically simplifying computations. The focus here is not on the methods per se but rather on their previously unacknowledged utility for estimating multidimensional nonlinear tuning functions. The inferred tuning functions are probabilistic. The estimator is adaptive, in the sense that it relies strongly on the prior in regions of the input space where data is scarce, but can flexibly capture complex input-output relations where enough data is available. It naturally comes equipped with error bars which can be used for instance for detecting shifts in receptive field properties due to learning. Using artificial data we show that inference and learning in our model can robustly recover the underlying structure of neural responses even in the experimentally realistic setting where the sampling of the input space is sparse and strongly non-uniform (due to stereotyped animal behavior). We further argue for the utility of spectral mixture kernels as a powerful tool for detecting complex functional relationships beyond simple smoothing/interpolation. We go beyond artificial data that follows the assumptions of the model exactly, and show robust estimation of tuning properties in several experimental recordings. For illustration purposes we focus here on data from the CA1 region of the hippocampus of rats, during an open field exploration task. We characterize several 3D tuning functions as a function of the animal’s position but also additional internal (the overall activity in the network at the time) or external variables (speed or direction of motion, time within experiment) and use these to derive new insights into the distribution of spatial and non-spatial information at the level of CA1 principal cell activity. 2 Methods Generative model Given data in the form of spike count – input pairs D = {y(i), x(i)}i=1:N, we model neural activity as an inhomogeneous Poisson process with input-dependent firing rate λ (as in [3], see. Fig. 1a): P(y|x) = Y i Poisson  y(i); λ(x)(i) , where Poisson (y; λ) = 1 y!λye−λ. (1) The inputs x are defined on a d-dimensional lattice and the spike counts are measured within a time window δt for which the input is roughly constant (25.6ms, given by the frequency of positional tracking).2 We formalize assumptions about neural tuning as a GP prior f ∼GP(µ, kβ), with f = log λ(x), with a constant mean µi = α (for the overall scale of neural responses) and a covariance function k(·, ·) with hyperparameters β. This covariance function defines our assumptions about what kind of functional dependencies are expected in the data (smoothness, periodicity, etc.). The exponential linking f to λ provides a mathematically convenient way to enforce positivity of the mean firing while keeping the posterior log-concave in f, justifiying the use of Laplace methods for approximating the posterior (see also [3]). For computational tractability we restrict our model to the class of product kernels k(x, x′) = Q d kd(xd, x′ d) for which the covariance matrix decomposes as a Kronecker product K = K1 ⊗ K2 ⊗. . . Kd, allowing for efficient computation of determinants, matrix multiplications and eigendecomposition in terms of the individual factors Ki (see Suppl.Info. and [7]). The individual kernels can be tailored to the specific application, allowing for a flexible characterization of individual input dimensions (inputs need not live in the same space, e.g. space-time, or can be 1In practice many input dimensions are discrete to begin with (e.g. measurements of an animal’s position), so this is a weak requirement. The coarseness of the discretization depends on the application. 2Input noise is ignored here, but could be explicitly incorporated in the generative model [9]. 2 Poisson D-dimensional input neural response true field trajectory estimate histogram estimate GP 0 10 ground truth estimate a b c rate (Hz) data subgroups, 6min each d x y f(x) ∼GP (µα(x), kβ(·, ·)) time Figure 1: Model overview and estimator validation. a) Generative model: spike counts arise as Poisson draws with an input dependent mean, f(x) with an exponential linkage function. b) A GP prior specifies the assumptions concerning the properties of this function (smoothness, periodicity, etc). c) Place field estimates from artificial data; left to right: the position of the animal modelled as a bounded random walk, ground-truth, traditional estimate (without smoothing), posterior mean of the inferred functional. d) Vertical slice through the posterior with shaded area showing the 2 · sd confidence region. d) Estimates of place field selectivity in an example CA1 recording during open field exploration in a cross-shaped box; separate estimates for 6min subsets. periodic, e.g. the phase of theta oscillations). Here we use a classic squared-exponential (SE kernel for simple interpolation/smoothing tasks, kd(x, x′) = ρ2 d exp (x−x′) 2 2σ2 d , with parameters β = {ρ, σ} specifying the output variance and lengthscale [9]. For tasks involving extrapolation or discovering complex patterns we use spectral mixture (SM) kernels, as a powerful and mathematically tractable route towards automated kernel design [10]. SMs are stationary kernels defined as a linear mixture of basis functions in the spectral domain: kd(x, x′) = Q X q=1 wq exp −2π2(x −x′)2vq  cos(2π(x −x′)µq) (2) with parameters β = {w, µ, v} defining the weights, spectral means and variances for each of the mixture components. Assuming Q is large enough, such a spectral mixture can approximate any arbitrary kernel (the same way Gaussian mixtures can be used to approximate an arbitrary density). Moreover, many traditional kernels can be recovered as special cases; for instance the SE kernel corresponds to a single component spectral density with zero mean (see also [10]). Inference and learning We sketch the main steps of the derivation here and provide the details in the Suppl. Info. Our goal is to find the hyperparameters θ = {α, β} that maximize P (θ|y) ∝P (y|θ) · P(θ). We follow common practice in using a point estimate θ∗= argmaxθP (θ|y) for the hyperparameters, and leave a fully probabilistic treatment to future work (e.g. using [11]). We use θ∗to infer a predictive distribution P(f ∗|D, x∗, θ∗) for a set of test inputs x∗. Because of the Poisson observation noise these quantities do not have simple closed form solutions and some approximations are required. As it is customary [9], we use the Laplace method to approximate the log posterior log P(f|D) = log P(y|f) + log P(f) with its second-order Taylor expansion around the maximum ˆf. This results in a multivariate Gaussian approximate posterior, with mean ˆf and covariance H + K−1−1, where H = −∇∇log P(y|f) |ˆf is the Hessian of the log likelihood, and K is the covariance matrix. Substituting the approximate posterior, we obtain the Laplace approximate marginal likelihood of the form: log (y|θ) = log P(y|ˆf) −0.5z′K−1z −0.5 log |I + KH| (3) 3 with z = K−1(ˆf −µ). The approximate predictive distribution for θ∗is a multivariate Gaussian with mean k∗∇log P(y|ˆf) and covariance k∗∗−k′ ∗ H−1 + K −1 k∗, where k∗and k∗∗correspond to the test-data and test-test covariances, respectively [8]. Lastly the predicted tuning function for an individual test point λ∗) = exp(f ∗), is log-normal with closed-form expressions for mean and variance (see Suppl. Info.). Standard methods for implementing these computations using the Cholesky decomposition require O N 3 computations and O N 2 memory, restricting their use to a few hundred data points. The efficient implementation proposed here relies on the Kronecker structure of the covariance matrix (which makes eigenvalue decomposition and matrix vector products very fast, see Suppl.Info.), with linear conjugate gradients optimization and a lower bound on the marginal likelihood for hyperparameter learning. The predictive distribution can be efficiently evaluated in O  dN d+1 d  (with a hidden constant given by the number of Newton steps needed for convergence, cf. [8]) Our implementation is based on the gpml library [9] and the code is available online. A more detailed description of the algorithmic details is provided in the Suppl. Info. In practice, this means that it takes minutes on a laptop to estimate a 3D field for a 30min dataset (2-5min depending on the coarseness of the grid), with a traditional 2D field estimated in 20-30sec. 3 Results Estimator validation We first validated our implementation on artificial data with known statistics.3 We defined a circular arena with 1m diameter and simulated the animal’s behavior as a random walk with reflective bounds (Fig. 1 b, left panel). This random process would eventually uniformly cover the space, but for short sessions it yields occupancy maps similar to those seen in real data. We calibrated diffusion parameters to roughly match CA1 statistics (average speed 5cm/sec, peak firing 5-10Hz, 10-30min long sessions). Inferring the underlying place field was already robust with 10min sessions, with the posterior mean f ∗close to the ground truth (SE kernel, see Fig. 1 c). In comparison, the traditional histogram-based estimates is quite poor (Fig. 1 b, left panel), though it can potentially be improved by gaussian smoothing at the right spatial scale (although not without caveats, see Suppl. Info.). It is more difficult to quantify the effects of the various approximations on real data where the assumptions of the model are not matched exactly. Our approach was to check the robustness of the GP-based estimates on subsets of the data constructed by combining every 5th data point (see left panel in Fig. 1 d). This partitioning was designed to ensure that subsets are as statistically similar as possible, sharing slow fluctuations in responses (e.g. due to variations in attentional levels, or changes in behavior). An example cell’s response is shown in Fig. 1 d. Our analysis revealed robust field estimation in most cells, provided they were reasonably active during the session (with mean firing rates >0.1Hz; we discarded the non-responsive cells from subsequent analyses). true field trajectory estimate histogram estimate GP (kSM) estimate histogram estimate GP (kSM) extrapolation stereotyped behaviour Figure 2: Spectral mixture kernels for modelling complex structure. We use artificial data with hexagonal grid structure mimicking MEC responses. Extrapolation task: the animal’s position is restricted to the orange delimited region of the environment. Stereotyped behavior: the simulated animal performs a bounded random walk within an annulus . In both cases, we recover the full field, beyond these borders (GP estimate) using a spectral mixture kernel (kSM). 3Here we show a 2D example for simplicity; we obtained very similar results with 3D artificial inputs. 4 Spectral mixture kernels for complex functional dependencies Place field estimation is relatively easy in a traditional open field exploration session (30min). The main challenge is getting robust estimates on the time scale of a few minutes (e.g. in order to be able to detect changes due to learning), which we have seen a GP-based estimator can do well. A much more difficult problem is detecting tuning properties in a cheeseboard memory task [12]. What distinguishes this setup is that fact that the animal quickly discovers the location of the wells containing rewards, after which its running patterns become highly stereotypical, close to the shortest path that traverses the reward locations. While it is hard to figure out place field selectivity for locations that the animal never visits, GP-based estimators may have an advantage compared to traditional methods when functional dependencies are structured, as is the case for grid cells in the medial enthorinal cortex (MEC) [13, 14]. When tuning properties are complex and structured we can exploit the expressive power of spectral mixture kernels (SM) to make the most of very limited data. We simulated two versions of this scenario. First, we defined an extrapolation task in which the animal’s behaviour is restricted to a subregion of the environment (marked by orange lines in the 2nd panel of Fig. 2) but we want to infer the spatial selectivity outside these borders. The second scenario attempts to mimic the animal running patterns in a cheeseboard maze (after learning) by restricting the trajectory within a ring (random walk with reflective boundaries in both cases). Using a 5 component spectral mixture kernel we were able to fully reconstruct the hexagonal lattice structure of the true field despite the size of the observed region covering only about 2 times the length scale of the periodic pattern. In contrast, traditional methods (including GP-based inference with standard SE kernels) would fail completely at such extrapolation. While such complex patterns of spatial dependence are restricted to MEC (and the estimator is probably best suited for ventral MEC, where grids have a small length scale [15]) it is conceivable that such extrapolation may also be useful in the temporal domain, or more generally for cortical responses in neurons which have so far eluded a simple functional characterization. Spatial and non-spatial modulation of CA1 responses To explore the multidimensional characterization of principal cell responses in CA1 we constructed several 3D estimators where the input combines the position of the animal within a 2D environment with an additional non-spatial variable.4 The first non-spatial variable we considered is the network state, quantified as the population spike count, k = PNneurons i=1 yi (naturally a discrete variable between 0 and some kmax). This quantity provides a computationally convenient proxy for network oscillations and has been recently used in a series of studies on the statistics of population activity in the retina and cortex [16–19]. Second, we considered the animal’s speed and direction of motion (with a coarse discretization), motivated by past work on non-spatial modulation of place fields on linear tracks [20]. Third, we also considered input variable t measuring time within a session (SE kernel; 3-5 min windows), as a way to examine the stability of spatial tuning over time. For all analyses, positional information was discretized on a 32 × 32 grid, corresponding to a spacing of 2.5cm, comparable to the binning resolution used in traditional place field estimates. The animal speed (estimated from the positional information with 250ms temporal smoothing) varied between 0 and about 25cm/sec, with a very skewed distribution (not shown). Small to medium variations in the coarseness of the discretization did not qualitatively affect the results although the choice of prior becomes more important on the tail of the speed distribution, where data is scarce. The resulting 3D tuning functions are shown in Fig. 3 for a few example neurons. First, network state modulates the place field selectivity in most CA1 neurons in our recordings. The typical modulation pattern is a monotonic increase in firing with k (Fig. 3, a, top), although we also found k-dependent flickering in a minority of the cells (Fig. 3a, middle), and very rarely k invariance (Fig. 3a, bottom). Rate remapping is also the dominant pattern of speed-dependent modulation in our data set (Fig. 3b). In terms of place field stability over time, about half the cells were stable during a 30min session in a familiar environment, with occasionally higher firing rates at the very beginning of the trial (Fig. 3c, top), while the rest showed fluctuation in representations (Fig. 3c, bottom). Results shown for 5min windows, but results very similar for 3min. 4We chose to estimate multiple 3D fields rather than jointly conditioning on all variables mainly for simplicity; this strategy has the added bonus of providing sanity checks for the quality of the different estimates. 5 traditional place field 3D estimate GP k=0 k=26 network state 0cm/s >10cm/s speed a b c 5min time 30min 5min 30min d dimension cell1 cell2 cell3 cell4 cell5 k speed time 3rd spatial marginals familiar 0 10 novel 0 10 firing rate (Hz) familiar 0 1 2 3 0 1 2 3 spatial information MI(y,x) familiar 0 0.2 0.4 0.6 0 0.2 0.4 0.6 temporal instability, MI(y,t) f nonspatial modulation e >10cm/sec 6 0cm/sec speed 0 60 k=26 k=0 network state 0 5 30min 5min time Figure 3: Estimating 3D response dependences in CA1 cells. a) Conditional place fields when constraining the network state, defined by the average population activity k. c) Conditional place fields as a function of the time within a 30min session, used to assess the stability of the representation. In all cases, the rightmost field corresponds to the traditional place field ignoring the 3rd dimension. d) Sanity check: marginal statistics of the place field selectivity obtained independently from the 3D fields in 5 example cells. e) Population summary of the degree of modulation of spatial selectivity by non-spatial variables; see text for details. f) Within comparison of cell properties during the exploration of a familiar vs. a novel environment. As a sanity check of our 3D estimators’ quality, we independently computed the traditional place field by marginalizing out the 3rd dimension for each of our 3D estimates. We used the empirical distribution as a prior for the non-spatial dimensions, and an uniform prior for space. Reassuringly we find that the estimates computed after marginalization are very close to the simple 2D place field map in all but 2 cells, which we exclude from the next analysis (examples in Fig. 3d). This provides additional confidence in the robustness of the estimator in the multidimensional case. Since we have a closed form expression for the map between stimulus dimensions and neural responses, we can estimate the mutual information between neural activity and various input variables as a way to dissect their contribution to coding. First, we visualize the modulation of spatial selectivity by the non-spatial variable as the spatial information conditioned on the 3rd variable, normalized by the marginal spatial information, MI(x,y|z) MI(x,y) , with z generically denoting any of the non-spatial variables (approximate closed form expression given f and Poisson observation noise). We see monotonic increases in spatial information with k (Fig. 3e, top), and speed (Fig. 3e, top) at the level of the population, and a weak decrease in spatial information over time (possibly due to higher speeds at the beginning of the session, combined with heightened attention/motivation levels). In terms of the division of spatial vs. non-spatial information across cells, we found that space selective cells have weaker k-modulation (Spearman corr(MI(y, x), MI(y, k) = −0.17). This however does not exclude the possibility that theta-coupled cells have additional spatial information at the fine temporal scale. Additionally, there is little correlation between the coding of position and speed (corr(MI(y, x), MI(y, speed) = −0.03), suggesting that the encoding of the two is relatively orthogonal at the level of the population. Somewhat unexpectedly, we found a cell’s temporal stability to be largely independent of its spatial selectivity corr(MI(y, x), MI(y, t) = −0.04). 6 Motivated by recent observations that the overall excitability of cells may be predictive of both their spatial selectivity and of the rigidity of their representation [21], we compared the overall firing rate of the cells with their spatial and non-spatial selectivity. We found relatively strong dependencies, with positive correlations between firing rate and spatial information (cc = 0.21), network influence (cc = 0.43) and the cell’s stability (cc = 0.38). When comparing these quantities in the same cells as the animal visits a familiar or a novel environment (93 cells, 20min in each environment) we found additional nontrivial dependences between spatial and non-spatial tuning. Although the overall firing rates of the cells are remarkably preserved across conditions (reflecting general cell excitability, cc = 0.66), the subpopulation of cells with strong spatial selectivity is largely non-overlapping across environments (corr(MIfam(y, x), MInov(y, x) = 0.07). Moreover, the temporal stability of the representation is also environment specific (corr(MIfam(y, t), MInov(y, t) = −0.04). Overall, these results paint a complex picture of hippocampal coding, the implications of which need further empirical and theoretical investigation. Lastly, we studied the dependence of CA1 responses on the animal’s direction of motion. Although directional selectivity is well documented on a linear track [20] it remains unclear if a similar behavior occurs in a 2D environment. The main challenge comes from the poor sampling of the position×direction-of-motion input space, something which our methods can handle readily. To construct directionally selective place field estimates in 2D we took inspiration from recent analyses of 2D phase procession [22] conditioning the responses on the main direction of motion within the place field. Specifically, we used our estimation of a traditional 2D place field to define a region of interest (ROI) that covers 90% of the field for each cell (Fig. 4. We isolated all trajectory segments that traverse this ROI and classified them based on the primary direction of motion along the cardinal orientations. We then computed place field estimates for each direction, with data outside the ROI shared across conditions. To avoid artefacts due to the stereotypical pattern of running along the box borders, we restricted this analysis to cells with fields in the central part of the environment (10 cells). A set of representative examples for the resulting directional fields are shown in Fig. 4d. We found the fields to be largely invariant to direction of motion in our setup, with small displacements in peak firing possibly due to differences between the perceived vs. the camera-based measurements of position (see also [22]). Overall, these results suggest that, in contrast to linear track behavior, CA1 responses are largely invariant to the direction of motion in an open field exploration task. directional fields (GP) traditional field GP histogram a b c d cell1 cell6 Figure 4: Directional selectivity in CA1 cells. a) Cell specific ROI that covers the classic place field (example corresponding to cell 6). b) Classification of the traversals of the region of interest as a function of the primary direction of motion along the cardinal directions. Out of ROI data shared across conditions. c) Traditional place field estimates for example CA1 cells and d) their corresponding direction-specific tuning. 7 4 Discussion Strong constraints on experiment duration, poor sampling of the stimulus space and additional sources of variability that are not under direct experimental control make the estimation of tuning properties during awake behavior particularly challenging. Here we have shown that recent advances on fast GP inference based on Kronecker methods allow for a robust characterization of multidimensional nonlinear tuning functions, which was inaccessible to traditional methods. Furthermore, our estimators inherit all the advantages of a probabilistic approach, including a principled way of dealing with the non-uniform sampling of the input space and natural uncertainty estimates. Our methods can robustly estimate place fields with one order of magnitude fewer data points. Furthermore, they allow for more than two-dimensional inputs. While one could imagine it would suffice to estimate separate place fields conditioned on each value of the non-spatial dimension, z, the joint estimator has the advantage that it allows for smoothing across z values, borrowing strength from well-sampled regions of the z space to make better estimates for poorly sampled z values. Several related algorithms have been proposed in the literature [3–5], which vary primarily in how they handle the tradeoff between kernel flexibility and the computational time required for inference and learning (see Table 1). At one extreme, [3] strongly restricts the nature of the covariance matrix to nearest-neighbour interactions on a 2D grid (resulting in a band-diagonal inverse covariance matrix) which allows them to exploit sparse matrix techniques to estimate the posterior mean in linear time. At the other extreme, [4, 5] allow for an arbitrary covariance structure, but are computationally prohibitive, O N 3 . Our proposal sits between these extremes in that it achieves close-to-linear computational and memory costs without significantly restricting the flexibility of the covariance structure (for a better intuition of the effect of different covariances, see also Fig. S1). In particular, it can be combined with powerful spectral mixture kernels to extract complex functional dependencies that go beyond simple smoothing. This opens the door to a variety of previously inaccessible tasks such as extrapolation. Moreover, it allows for an agnostic exploration of the neural responses functional space, which could be used to discover novel tuning properties in cells for which coding is poorly understood. When applied to CA1 data, our multidimensional estimators revealed a complex picture of the modulation of neural responses by spatial and non-spatial inputs in the hippocampus. First we confirmed linear track results concerning the speed and oscillatory modulation of spatial tuning. Furthermore, we revealed additional insights into the interaction between the representation of space and these non-spatial dimensions, which go beyond the capabilities of traditional methods. Most notably we found 1) a mostly orthogonal representation of speed and position, that 2) place field stability cannot be easily explained in terms of cell excitability or spatial selectivity, although 3) it is environment specific. Lastly, while we showed 2D place field maps to be direction-invariant in an open field exploration task, more interesting directional dependencies may be revealed in other 2D tasks, where the direction of motion is behavioraly more relevant (e.g. cheeseboard). Importantly, there is nothing hippocampus-specific in the methodology. Hence fast GP inference using Kronecker methods, combined with expressive kernels, may provide a general-purpose tool for characterizing neural responses across brain regions. Table 1: Summary comparison of different estimators. Algorithm Kernel function Computing cost Memory cost Data size Rad et al. 2010 [3] sparse banded inverse covariance O (N) O (N) 105 Park et al. 2014 [4] SE, any in principle O N 3 O N 2 < 103 Savin & Tkacik SE and SM, works for any tensor-product O  dN d+1 d  O  dN 2 d  105 Acknowledgments We thank Jozsef Csicsvari for kindly sharing the CA1 data. This work was supported by the People Programme (Marie Curie Actions) of the European Union’s Seventh Framework Programme (FP7/2007-2013) under REA grant agreement no. 291734. 8 References [1] Pillow, J.W. Likelihood-based approaches to modeling the neural code. in Bayesian brain: probabilistic approaches to neural coding 1–21 (2006). [2] Pillow, J.W. et al. Spatio-temporal correlations and visual signalling in a complete neuronal population. Nature 454, 995–999 (2008). [3] Rad, K.R. & Paninski, L. Efficient, adaptive estimation of two-dimensional firing rate surfaces via Gaussian process methods. Network 21, 142–168 (2010). [4] Park, M., Weller, J.P., Horwitz, G.D. & Pillow, J.W. Bayesian active learning of neural firing rate maps with transformed gaussian process priors. Neural computation 26, 1519–1541 (2014). [5] Macke, J.H., Gerwinn, S., White, L.E., Kaschube, M. & Bethge, M. Gaussian process methods for estimating cortical maps. neuroimage 56, 570–581 (2011). [6] Frank, L.M., Eden, U.T., Solo, V., Wilson, M.A. & Brown, E.N. Contrasting patterns of receptive field plasticity in the hippocampus and the entorhinal cortex: an adaptive filtering approach. Journal of Neuroscience 22, 3817–3830 (2002). [7] Saatçi, Y. Scalable inference for structured Gaussian process models. PhD thesis, Cambridge University, UK, (2012). [8] Flaxman, A., Wilson, A., Neill, D., Nickisch, H. & Smola, A. Fast Kronecker inference in Gaussian Processes with non-Gaussian likelihoods. in Proceedings of the 32nd International Conference on Machine Learning (ICML-15) , 607–616, (2015). [9] Rasmussen, C.E. & Williams, C.K.I. Gaussian Processes for Machine Learning (Adaptive Computation and Machine Learning) (The MIT Press, 2005). [10] Wilson, A., & Adams, R. Gaussian Process kernels for pattern discovery and extrapolation. arXiv.org (2013). [11] Hensman, J., Matthews, A.G. & Filippone, M. MCMC for Variationally Sparse Gaussian Processes. in Advances in Neural Information Processing Systems . MIT Press, (2015). [12] Dupret, D., O’Neill, J., Pleydell-Bouverie, B. & Csicsvari, J. The reorganization and reactivation of hippocampal maps predict spatial memory performance. Nature Publishing Group 13, 995– 1002 (2010). [13] Moser, E.I., Kropff, E. & Moser, M.B. Place Cells, Grid Cells, and the Brain’s Spatial Representation System. Annual Review of Neuroscience 31, 69–89 (2008). [14] Moser, E.I. et al. Grid cells and cortical representation. Nature Publishing Group 15, 466–481 (2014). [15] Brun, V.H. et al. Progressive increase in grid scale from dorsal to ventral medial entorhinal cortex. Hippocampus 18, 1200–1212 (2008). [16] Tkaˇcik, G. et al. The simplest maximum entropy model for collective behavior in a neural network. Journal of Statistical Mechanics: Theory and Experiment 2013, P03011 (2013). [17] Tkaˇcik, G. et al. Searching for collective behavior in a large network of sensory neurons. PLoS Computational Biology 10, e1003408 (2014). [18] Fiser, J., Lengyel, M., Savin, C., Orban, G. & Berkes, P. How (not) to assess the importance of correlations for the matching of spontaneous and evoked activity. arXiv (2013). [19] Okun, M. et al. Diverse coupling of neurons to populations in sensory cortex. Nature (2015). [20] McNaughton, B.L., Barnes, C.A. & O’Keefe, J. The contributions of position, direction, and velocity to single unit activity in the hippocampus of freely-moving rats. Experimental Brain Research 52, 41–49 (1983). [21] Grosmark, A.D. & Buzsáki, G. Diversity in neural firing dynamics supports both rigid and learned hippocampal sequences. Science, 1–5 (2016). [22] Huxter, J.R., Senior, T.J., Allen, K. & Csicsvari, J. Theta phase–specific codes for twodimensional position, trajectory and heading in the hippocampus. Nature Neuroscience 11, 587–594 (2008). 9
2016
329
6,249
Maximal Sparsity with Deep Networks? Bo Xin1,2 Yizhou Wang1 Wen Gao1 Baoyuan Wang3 David Wipf2 1Peking University 2Microsoft Research, Beijing 3Microsoft Research, Redmond {boxin, baoyuanw, davidwip}@microsoft.com {yizhou.wang, wgao}@pku.edu.cn Abstract The iterations of many sparse estimation algorithms are comprised of a fixed linear filter cascaded with a thresholding nonlinearity, which collectively resemble a typical neural network layer. Consequently, a lengthy sequence of algorithm iterations can be viewed as a deep network with shared, hand-crafted layer weights. It is therefore quite natural to examine the degree to which a learned network model might act as a viable surrogate for traditional sparse estimation in domains where ample training data is available. While the possibility of a reduced computational budget is readily apparent when a ceiling is imposed on the number of layers, our work primarily focuses on estimation accuracy. In particular, it is well-known that when a signal dictionary has coherent columns, as quantified by a large RIP constant, then most tractable iterative algorithms are unable to find maximally sparse representations. In contrast, we demonstrate both theoretically and empirically the potential for a trained deep network to recover minimal ℓ0-norm representations in regimes where existing methods fail. The resulting system, which can effectively learn novel iterative sparse estimation algorithms, is deployed on a practical photometric stereo estimation problem, where the goal is to remove sparse outliers that can disrupt the estimation of surface normals from a 3D scene. 1 Introduction Our launching point is the optimization problem min x ∥x∥0 s.t. y = Φx, (1) where y ∈Rn is an observed vector, Φ ∈Rn×m is some known, overcomplete dictionary of feature/basis vectors with m > n, and ∥·∥0 denotes the ℓ0 norm of a vector, or a count of the number of nonzero elements. Consequently, (1) can be viewed as the search for a maximally sparse feasible vector x∗(or approximately feasible if the constraint is relaxed). Unfortunately however, direct assault on (1) involves an intractable, combinatorial optimization process, and therefore efficient alternatives that return a maximally sparse x∗with high probability in restricted regimes are sought. Popular examples with varying degrees of computational overhead include convex relaxations such as ℓ1-norm minimization [2, 5, 21], greedy approaches like orthogonal matching pursuit (OMP) [18, 22], and many flavors of iterative hard-thresholding (IHT) [3, 4]. Variants of these algorithms find practical relevance in numerous disparate domains, including feature selection [7, 8], outlier removal [6, 13], compressive sensing [5], and source localization [1, 16]. However, a fundamental weakness underlies them all: If the Gram matrix Φ⊤Φ has significant offdiagonal energy, indicative of strong coherence between columns of Φ, then estimation of x∗may be extremely poor. Loosely speaking this occurs because, as higher correlation levels are present, the null-space of Φ is more likely to include large numbers of approximately sparse vectors that tend to distract existing algorithms in the feasible region, an unavoidable nuisance in many practical applications. In this paper we consider recent developments in the field of deep learning as an entry point for improving the performance of sparse recovery algorithms. Although seemingly unrelated at first 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. glance, the layers of a deep neural network (DNN) can be viewed as iterations of some algorithm that have been unfolded into a network structure [9, 11]. In particular, iterative thresholding approaches such as IHT mentioned above typically involve an update rule comprised of a fixed, linear filter followed by a non-linear activation function that promotes sparsity. Consequently, algorithm execution can be interpreted as passing an input through an extremely deep network with constant weights (dependent on Φ) at every layer. This ‘unfolding’ viewpoint immediately suggests that we consider substituting discriminatively learned weights in place of those inspired by the original sparse recovery algorithm. For example, it has been argued that, given access to a sufficient number of {x∗, y} pairs, a trained network may be capable of producing quality sparse estimates with a few number of layers. This in turn can lead to a dramatically reduced computational burden relative to purely optimization-based approaches [9, 19, 23] or to enhanced non-linearities for use with traditional iterative algorithms [15]. While existing empirical results are promising, especially in terms of the reduction in computational footprint, there is as of yet no empirical demonstration of a learned deep network that can unequivocally recover maximally sparse vectors x∗with greater accuracy than conventional, state-of-the-art optimization-based algorithms, especially with a highly coherent Φ. Nor is there supporting theoretical evidence elucidating the exact mechanism whereby learning may be expected to improve the estimation accuracy, especially in the presence of coherent dictionaries. This paper attempts to fill in some of these gaps, and our contributions can be distilled to the following points: Quantifiable Benefits of Unfolding: We rigorously dissect the benefits of unfolding conventional sparse estimation algorithms to produce trainable deep networks. This includes a precise characterization of exactly how different architecture choices can affect the ability to improve so-called restrictive isometry property (RIP) constants, which measure the degree of disruptive correlation in Φ. This helps to quantify the limits of shared layer weights, which are the standard template of existing methods [9, 19, 23], and motivates more flexible network constructions reminiscent of LSTM cells [12] that account for multi-resolution structure in Φ in a previously unexplored fashion. Note that we defer all proofs, as well as many additional analyses and problem details, to a longer companion paper [26]. Isolation of Important Factors: Based on these theoretical insights, and a better understanding of the essential factors governing performance, we establish the degree to which it is favorable to diverge from strict conformity to any particular unfolded algorithmic script. In particular, we argue that layer-wise independent weights and/or activations are essential, while retainment of original thresholding non-linearities and squared-error loss implicit to many sparse algorithms is not. We also recast the the core problem as deep multi-label classification given that optimal support pattern recovery is the primary concern. This allows us to adopt a novel training paradigm that is less sensitive to the specific distribution encountered during testing. Ultimately, we development the first, ultra-fast sparse estimation algorithm (or more precisely a learning procedure that produces such an algorithm) that can effectively deal with coherent dictionaries and adversarial RIP constants. State-of-the-Art Empirical Performance: We apply the proposed system to a practical photometric stereo computer vision problem, where the goal is to estimate the 3D geometry of an object using only 2D photos taken from a single camera under different lighting conditions. In this context, shadows and specularities represent sparse outliers that must be simultaneously removed from ∼104 −106 surface points. We achieve state-of-the-art performance using only weak supervision despite a minuscule computational budget appropriate for real-time mobile environments. 2 From Iterative Hard Thesholding (IHT) to Deep Neural Networks Although any number of iterative algorithms could be adopted as our starting point, here we examine IHT because it is representative of many other sparse estimation paradigms and is amenable to theoretical analysis. With knowledge of an upper bound on the true cardinality, solving (1) can be replaced by the equivalent problem min x 1 2∥y −Φx∥2 2 s.t. ∥x∥0 ≤k. (2) IHT attempts to minimize (2) using what can be viewed as computationally-efficient projected gradient iterations [3]. Let x(t) denote the estimate of some maximally sparse x∗after t iterations. The aggregate IHT update computes x(t+1) = Hk h x(t) −µΦ⊤ Φx(t) −y i , (3) 2 where µ is a step-size parameter and Hk[·] is a hard-thresholding operator that sets all but the k largest values (in magnitude) of a vector to zero. For the vanilla version of IHT, the step-size µ = 1 leads to a number of recovery guarantees whereby iterating (3), starting from x(0) = 0 is guaranteed to reduce (2) at each step before eventually converging to the globally optimal solution. These results hinge on properties of Φ which relate to the coherence structure of dictionary columns as encapsulated by the following definition. Definition 1 (Restricted Isometry Property) A dictionary Φ satisfies the Restricted Isometry Property (RIP) with constant δk[Φ] < 1 if (1 −δk[Φ])∥x∥2 2 ≤∥Φx∥2 2 ≤(1 + δk[Φ])∥x∥2 2 (4) holds for all {x : ∥x∥0 ≤k}. In brief, the smaller the value of the RIP constant δk[Φ], the closer any sub-matrix of Φ with k columns is to being orthogonal (i.e., it has less correlation structure). It is now well-established that dictionaries with smaller values of δk[Φ] lead to sparse recovery problems that are inherently easier to solve. For example, in the context of IHT, it has been shown [3] that if y = Φx∗, with ∥x∗∥0 ≤k and δ3k[Φ] < 1/ √ 32, then at iteration t of (3) we will have ∥x(t) −x∗∥2 ≤2−t∥x∗∥2. It follows that as t →∞, x(t) →x∗, meaning that we recover the true, generating x∗. Moreover, it can be shown that this x∗is also the unique, optimal solution to (1) [5]. The success of IHT in recovering maximally sparse solutions crucially depends on the RIP-based condition that δ3k[Φ] < 1/ √ 32, which heavily constrains the degree of correlation structure in Φ that can be tolerated. While dictionaries with columns drawn independently and uniformly from the surface of a unit hypersphere (or with elements drawn iid from N(0, 1/n) ) will satisfy this condition with high probability provided k is small enough [6], for many/most practical problems of interest we cannot rely on this type of IHT recovery guarantee. In fact, except for randomized dictionaries in high dimensions where tight bounds exist, we cannot even compute the value of δ3k[Φ], which requires calculating the spectral norm of m 3k  subsets of dictionary columns. There are many ways nature might structure a dictionary such that IHT (or most any other existing sparse estimation algorithm) will fail. Here we examine one of the most straightforward forms of dictionary coherence that can easily disrupt performance. Consider the situation where Φ =  ϵA + uv⊤ N, where columns of A ∈Rn×m and u ∈Rn are drawn iid from the surface of a unit hypersphere, while v ∈Rm is arbitrary. Additionally, ϵ > 0 is a scalar and N is a diagonal normalization matrix that scales each column of Φ to have unit ℓ2 norm. It then follows that if ϵ is sufficiently small, the rank-one component begins to dominate, and there is no value of 3k such that δ3k[Φ] < 1/ √ 32. In this type of problem we hypothesize that DNNs provide a potential avenue for improvement to the extent that they might be able to compensate for disruptive correlations in Φ. For example, at the most basic level we might consider general networks with the layer t defined by x(t+1) = f h Ψx(t) + Γy i , (5) where f : Rm →Rm is a non-linear activation function, and Ψ ∈Rm×m and Γ ∈Rm×n are arbitrary. Moreover, given access to training pairs {x∗, y}, where x∗is a sparse vector such that y = Φx∗, we can optimize Ψ and Γ using traditional stochastic gradient descent just like any other DNN structure. We will first precisely characterize the extent to which this adaptation affords any benefit over IHT where f(·) = Hk[·]. Later we will consider flexible, layer-specific non-linearities f (t) and parameters {Ψ(t), Γ(t)}. 3 Analysis of Adaptable Weights and Activations For simplicity in this section we restrict ourselves to the fixed hard-threshold operator Hk[·] across all layers; however, many of the conclusions borne out of our analysis nonetheless carry over to a much wider range of activation functions f. In general it is difficult to analyze how arbitrary Ψ and Γ may improve upon the fixed parameterization from (3) where Ψ = I −Φ⊤Φ and Γ = Φ⊤(assuming µ = 1). Fortunately though, we can significantly collapse the space of potential weight matrices by including the natural requirement that if x∗represents the true, maximally sparse solution, then it must be a fixed-point of (5). Indeed, without this stipulation the iterations could 3 diverge away from the globally optimal value of x, something IHT itself will never do. These considerations lead to the following: Proposition 1 Consider a generalized IHT-based network layer given by (5) with f(·) = Hk[·] and let x∗denote any unique, maximally sparse feasible solution to y = Φx with ∥x∥0 ≤k. Then to ensure that any such x∗is a fixed point it must be that Ψ = I −ΓΦ. Although Γ remains unconstrained, this result has restricted Ψ to be a rank-n factor, parameterized by Γ, subtracted from an identity matrix. Certainly this represents a significant contraction of the space of ‘reasonable’ parameterizations for a general IHT layer. In light of Proposition 1, we may then further consider whether the added generality of Γ (as opposed to the original fixed assignment Γ = Φ⊤) affords any further benefit to the revised IHT update x(t+1) = Hk h (I −ΓΦ) x(t) + Γy i . (6) For this purpose we note that (6) can be interpreted as a projected gradient descent step for solving min x 1 2x⊤ΓΦx −x⊤Γy s.t. ∥x∥0 ≤k. (7) However, if ΓΦ is not positive semi-definite, then this objective is no longer even convex, and combined with the non-convex constraint is likely to produce an even wider constellation of troublesome local minima with no clear affiliation with the global optimum of our original problem from (2). Consequently it does not immediately appear that Γ ̸= Φ⊤is likely to provide any tangible benefit. However, there do exist important exceptions. The first indication of how learning a general Γ might help comes from the following result: Proposition 2 Suppose that Γ = DΦ⊤W W ⊤, where W is an arbitrary matrix of appropriate dimension and D is a full-rank diagonal that jointly solve δ∗ 3k [Φ] ≜ inf W ,D δ3k [W ΦD] . (8) Moreover, assume that Φ is substituted with ΦD in (6), meaning we have simply replaced Φ with a new dictionary that has scaled columns. Given these qualifications, if y = Φx∗, with ∥x∗∥0 ≤k and δ∗ 3k [Φ] < 1/ √ 32, then at iteration t of (6) ∥D−1x(t) −D−1x∗∥2 ≤2−t∥D−1x∗∥2. (9) It follows that as t →∞, x(t) →x∗, meaning that we recover the true, generating x∗. Additionally, it can be guaranteed that after a finite number of iterations, the correct support pattern will be discovered. And it should be emphasized that rescaling Φ by some known diagonal D is a common prescription for sparse estimation (e.g., column normalization) that does not alter the optimal ℓ0-norm support pattern.1 But the real advantage over regular IHT comes from the fact that δ∗ 3k [Φ] ≤δk [Φ], and in many practical cases, δ∗ 3k [Φ] ≪δ3k [Φ], which implies success can be guaranteed across a much wider range of RIP conditions. For example, if we revisit the dictionary Φ =  ϵA + uv⊤ N, an immediate benefit can be observed. More concretely, for ϵ sufficiently small we argued that δ3k [Φ] > 1/ √ 32 for all k, and consequently convergence to the optimal solution may fail. In contrast, it can be shown that δ∗ 3k [Φ] will remain quite small, satisfying δ∗ 3k [Φ] ≈δ3k [A], implying that performance will nearly match that of an equivalent recovery problem using A (and as we discussed above, δ3k [A] is likely to be relatively small per its unique, randomized design). The following result generalizes a sufficient regime whereby this is possible: Corollary 1 Suppose Φ = [ϵA + ∆r] N, where elements of A are drawn iid from N(0, 1/n), ∆r is any arbitrary matrix with rank[∆r] = r < n, and N is a diagonal matrix (e.g, one that enforces unit ℓ2 column norms). Then E (δ∗ 3k [Φ]) ≤E  δ3k h eA i , (10) where eA denotes the matrix A with any r rows removed. 1Inclusion of this diagonal factor D can be equivalently viewed as relaxing Proposition 1 to hold under some fixed rescaling of Φ, i.e., an operation that preserves the optimal support pattern. 4 Additionally, as the size of Φ grows proportionally larger, it can be shown that with overwhelming probability δ∗ 3k [Φ] ≤δ3k h eA i . Overall, these results suggest that we can essentially annihilate any potentially disruptive rank-r component ∆r at the cost of implicitly losing r measurements (linearly independent rows of A, and implicitly the corresponding elements of y). Therefore, at least provided that r is sufficiently small such that δ3k h eA i ≈δ3k [A], we can indeed be confident that a modified form of IHT can perform much like a system with an ideal RIP constant. And of course in practice we may not know how Φ decomposes as some Φ ≈[ϵA + ∆r] N; however, to the extent that this approximation can possibly hold, the RIP constant can be improved nonetheless. It should be noted that globally solving (8) is non-differentiable and intractable, but this is the whole point of incorporating a DNN network to begin with. If we have access to a large number of training pairs {x∗, y} generated using the true Φ, then during the course of the learning process a useful W and D can be implicitly estimated such that a maximal number of sparse vectors can be successfully recovered. Of course we will experience diminishing marginal returns as more non-ideal components enter the picture. In fact, it is not difficult to describe a slightly more sophisticated scenario such that use of layer-wise constant weights and activations are no longer capable of lowering δ3k[Φ] significantly at all, portending failure when it comes to accurate sparse recovery. One such example is a clustered dictionary model (which we describe in detail in [26]), whereby columns of Φ are grouped into a number of tight clusters with minimal angular dispersion. While the clusters themselves may be well-separated, the correlation within clusters can be arbitrarily large. In some sense this model represents the simplest partitioning of dictionary column correlation structure into two scales: the inter- and intra-cluster structures. Assuming the number of such clusters is larger than n, then layer-wise constant weights and activations are unlikely to provide adequate relief, since the implicit ∆r factor described above will be full rank. Fortunately, simple adaptations of IHT, which are reflective of many generic DNN structures, can remedy the problem. The core principle is to design a network such that earlier layers/iterations are tasked with exposing the correct support at the cluster level, without concern for accuracy within each cluster. Once the correct cluster support has been obtained, later layers can then be charged with estimating the fine-grain details of within-cluster support. We believe this type of multi-resolution sparse estimation is essential when dealing with highly coherent dictionaries. This can be accomplished with the following adaptations to IHT: 1. The hard-thresholding operator is generalized to ‘remember’ previously learned clusterlevel sparsity patterns, in much the same way that LSTM gates allow long term dependencies to propagate [12] or highway networks [20] facilitate information flow unfettered to deeper layers. Practically speaking this adaptation can be computed by passing the prior layer’s activations x(t) through linear filters followed by indicator functions, again reminiscent of how DNN gating functions are typically implemented. 2. We allow the layer weights {Ψ(t), Γ(t)} to vary from iteration to iteration t sequencing through a fixed set akin to layers of a DNN. In [26] we show that hand-crafted versions of these changes allow IHT to provably recovery maximally sparse vectors x∗in situations where existing algorithms fail. 4 Discriminative Multi-Resolution Sparse Estimation As implied previously, guaranteed success for most existing sparse estimation strategies hinges on the dictionary Φ having columns drawn (approximately) from a uniform distribution on the surface of a unit hypersphere, or some similar condition to ensure that subsets of columns behave approximately like an orthogonal basis. Essentially this confines the structure of the dictionary to operate on a single universal scale. The clustered dictionary model described in the previous section considers a dictionary built on two different scales, with a cluster-level distribution (coarse) and tightly-packed within-cluster details (fine). But practical dictionaries may display structure operating across a variety of scales that interleave with one another, forming a continuum among multiple levels. When the scales are clearly demarcated, we have argued that it is possible to manually define a multi-resolution IHT-inspired algorithm that guarantees success in recovering the optimal support pattern; and indeed, IHT could be extended to handle a clustered dictionary model with nested 5 structures across more than two scales. However, without clearly partitioned scales it is much less obvious how one would devise an optimal IHT modification. It is in this context that learning flexible algorithm iterations is likely to be most advantageous. In fact, the situation is not at all unlike many computer vision scenarios whereby handcrafted features such as SIFT may work optimally in confined, idealized domains, while learned CNN-based features are often more effective otherwise. Given a sufficient corpus of {x∗, y} pairs linked via some fixed Φ, we can replace manual filter construction with a learning-based approach. On this point, although we view our results from Section 3 as a convincing proof of concept, it is unlikely that there is anything intrinsically special about the specific hard-threshold operator and layer-wise construction we employed per se, as long as we allow for deep, adaptable layers that can account for structure at multiple scales. For example, we expect that it is more important to establish a robust training pipeline that avoids stalling at the hand of vanishing gradients in a deep network, than to preserve the original IHT template analogous to existing learning-based methods. It is here that we propose several deviations: Multi-Label Classification Loss: We exploit the fact that in producing a maximally sparse vector x∗, the main challenge is estimating supp[x∗]. Once the support is obtained, computing the actual nonzero coefficients just boils down to solving a least squares problem. But any learning system will be unaware of this and could easily expend undue effort in attempting to match coefficient magnitudes at the expense of support recovery. Certainly the use of a data fit penalty of the form ∥y −Φx∥2 2, as is adopted by nearly all sparse recovery algorithms, will expose us to this issue. Therefore we instead formulate sparse recovery as a multi-label classification problem. More specifically, instead of directly estimating x∗, we attempt to learn s∗= [s∗ 1, . . . , s∗ m]⊤, where s∗ i equals the indicator function I[x∗ i ̸= 0]. For this purpose we may then incorporate a traditional multi-label classification loss function via a final softmax output layer, which forces the network to only concern itself with learning support patterns. This substitution is further justified by the fact that even with traditional IHT, the support pattern will be accurately recovered before the iterations converge exactly to x∗. Therefore we may expect that fewer layers (as well as training data) are required if all we seek is a support estimate, opening the door for weaker forms of supervision. Instruments for Avoiding Bad Local Solutions: Given that IHT can take many iterations to converge on challenging problems, we may expect that a relatively deep network structure will be needed to obtain exact support recovery. We must therefore take care to avoid premature convergence to local minima or areas with vanishing gradient by incorporating several recent countermeasures proposed in the DNN community. For example, the adaptive variant of IHT described previously is reminiscent of highway networks or LSTM cells, which have been proposed to allow longer range flow of gradient information to improve convergence through the use of gating functions. An even simpler version of this concept involves direct, un-gated connections that allow much deeper ‘residual’ networks to be trained [10] (which is even suggestive of the residual factor embedded in the original IHT iterations). We deploy this tool, along with batch-normalization [14] to aid convergence, for our basic feedforward pipeline, along with an alternative structure based on recurrent LSTM cells. Note that unfolded LSTM networks frequently receive a novel input for every time step, whereas here y is applied unaltered at every layer (more on this in [26]). We also replace the non-integrable hard-threshold operator with simple rectilinear (ReLu) units [17], which are functionally equivalent to one-sided soft-thresholding; this convex selection likely reduces the constellation of sub-optimal local minima during the training process. 5 Experiments and Applications Synthetic Tests with Correlated Dictionaries: We generate a dictionary matrix Φ ∈Rn×m using Φ = Pn i=1 1 i2 uiv⊤ i , where ui ∈Rn and vi ∈Rm have iid elements drawn from N(0, 1). We also rescale each column of Φ to have unit ℓ2 norm. Φ generated in this way has super-linear decaying singular values (indicating correlation between the columns) but is not constrained to any specific structure. Many dictionaries in real applications have such a property. As a basic experiment, we generate N = 700000 ground truth samples x∗∈Rm by randomly selecting d nonzero entries, with nonzero amplitudes drawn iid from the uniform distribution U[−0.5, 0.5], excluding the interval [−0.1, 0.1] to avoid small, relatively inconsequential contributions to the support pattern. We then create y ∈Rn via y = Φx∗. As d increases, the estimation problem becomes more difficult. In fact, to guarantee success with such correlated data (and high RIP constant) requires evaluating on the order of m n  linear systems of size n×n, which is infeasible even for small values, indicative of how challenging it can be to solve sparse inverse problems of any size. We set n=20 and m=100. 6 d 2 4 6 8 acc 0 0.5 1 ℓ1 IHT ISTA-Net IHT-Net Ours-Res Ours-LSTM d 2 4 6 8 acc 0 0.5 1 Res NoRes HardAct LSLoss d 2 4 6 8 acc 0 0.5 1 U2U-test U2U-train U2N-test U2N-train N2U-test N2U-train N2N-test N2N-train Figure 1: Average support recovery accuracy. Left: Uniformly distributed nonzero elements. Mid: Different network variants. Right: Different training and testing distr. (LSTM-Net results). We used N1 = 600000 samples for training and the remaining N2 = 100000 for testing. Echoing our arguments in Section 4, we explored both a feedforward network with residual connections [10] and a recurrent network with vanilla LSTM cells [12]. To evaluate the performance, we check whether the d ground truth nonzeros are aligned with the predicted top-d values produced by our network, a common all-or-nothing metric in the compressive sensing literature. Detailed network design, optimization setup, and alternative metrics can be found in [26]. Figure 1(left) shows comparisons against a battery of existing algorithms, both learning- and optimization-based. These include standard ℓ1 minimization via ISTA iterations [2], IHT [3] (supplied with the ground truth number of nonzeros), an ISTA-based network [9], and an IHT-inspired network [23]. For both the ISTA- and IHT-based networks, we used the exact same training data described above. Note that given the correlated Φ matrix, the recovery performance of IHT, and to a lesser degree ℓl minimization using ISTA, is rather modest as expected given that the associated RIP constant will be quite large by construction. In contrast our two methods achieve uniformly higher accuracy, including over other learning-based methods trained with the same data. This improvement is likely the result of three significant factors: (i) Existing learning methods initialize using weights derived from the original sparse estimation algorithms, but such an initialization will be associated with locally optimal solutions in most cases with correlated dictionaries. (ii) As described in Section 3, constant weights across layers have limited capacity to unravel multi-resolution dictionary structure, especially one that is not confined to only possess some low rank correlating component. (iii) The quadratic loss function used by existing methods does not adequately focus resources on the crux of the problem, which is accurate support recovery. In contrast we adopt an initialization motivated by DNN-based training considerations, unique layer weights to handle a multi-resolution dictionary, and a multi-label classification output layer to focus on support recovery. To further isolate essential factors affecting performance, we next consider the following changes: (1) We remove the residual connections from Res-Net. (2) We replace ReLU with hard-threshold activations. In particular, we utilize the so-called HELUσ function introduced in [23], which is a continuous and piecewise linear approximation of the scalar hard-threshold operator. (3) We use a quadratic penalty layer instead of a multi-label classification loss layer, i.e., the loss function is changed to PN1 i=1 ∥a(i) −y(i)∥2 2 (where a is the output of the last fully-connected layer) during training. Figure 1(middle) displays the associated recovery percentages, where we observe that in each case performance degrades. Without the residual design, and also with the inclusion of a rigid, non-convex hard-threshold operator, local minima during training appear to be a likely culprit, consistent with observations from [10]. Likewise, use of a least-squares loss function is likely to over-emphasize the estimation of coefficient amplitudes rather than focusing on support recovery. Finally, from a practical standpoint we may expect that the true amplitude distribution may deviate at times from the original training set. To explore robustness to such mismatch, as well as different amplitude distributions, we consider two sets of candidate data: the original data, and similarlygenerated data but with the uniform distribution of nonzero elements replaced with the Gaussians N(±0.3, 0.1), where the mean is selected with equal probability as either −0.3 or 0.3, thus avoiding tiny magnitudes with high probability. Figure 1(right) reports accuracies under different distributions for both training and testing, including mismatched cases. (The results are obtained using LSTM-Net, but the Res-net showed similar pattern.) The label ‘U2U’ refers to training and testing with the uniformly distributed amplitudes, while ‘U2N’ uses uniform training set and a Gaussian test set. Analogous definitions apply for ‘N2N’ and ‘N2U’. In all cases we note that the performance is 7 (a) GT 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 (b) LS (E=12.1 T=4.1) 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 (c) ℓ1 (E=7.1 T=33.7) 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 (d) Ours (E=1.5 T=1.2) Figure 2: Reconstruction error maps. Angular error in degrees (E) and runtime in sec. (T) are provided. quite stable across training and testing conditions. We would argue that our recasting of the problem as multi-label classification contributes, at least in part, to this robustness. The application example described next demonstrates further tolerance of training-testing set mismatches. Practical Application - Photometric Stereo: Suppose we have q observations of a given surface point from a Lambertian scene under different lighting directions. Then the resulting measurements from a standard calibrated photometric stereo design (linear camera response function, an orthographic camera projection, and known directional light sources), denoted o ∈Rq, can be expressed as o = ρLn, where n ∈R3 denotes the true 3D surface normal, each row of L ∈Rq×3 defines a lighting direction, and ρ is the diffuse albedo, acting here as a scalar multiplier [24]. If specular highlights, shadows, or other gross outliers are present, then the observations are more realistically modeled as o = ρLn + e, where e is an an unknown sparse vector [13, 25]. It is apparent that, since n is unconstrained, e need not compensate for any component of o in the range of L. Given that null[L⊤] is the orthogonal complement to range[L], we may consider the following problem min e ∥e∥0 s.t. Projnull[L⊤](o) = Projnull[L⊤](e) (11) which ultimately collapses to our canonical sparse estimation problem from (1), where lightinghardware-dependent correlations may be unavoidable in the implicit dictionary. Following [13], we use 32-bit HDR gray-scale images of the object Bunny (256×256) with foreground masks under different lighting conditions whose directions, or rows of L, are randomly selected from a hemisphere with the object placed at the center. To apply our method, we first compute Φ using the appropriate projection operator derived from the lighting matrix L. As real-world training data is expensive to acquire, we instead use weak supervision by synthetically generating a training set as follows. First, we draw a support pattern for e randomly with cardinality d sampled uniformly from the range [d1, d2]. The values of d1 and d2 can be tuned in practice. Nonzero values of e are assigned iid random values from a Gaussian distribution whose mean and variance are also tunable. Beyond this, no attempt was made to match the true outlier distributions encountered in applications of photometric stereo. Finally, for each e we can naturally compute observations via the linear constraint in (11), which serve as candidate network inputs. Given synthetic training data acquired in this way, we learn a network with the exact same structure and optimization parameters as in Section 5; no application-specific tuning was introduced. We then deploy the resulting network on the gray-scale Bunny images. For each surface point, we use our DNN model to approximately solve (11). Since the network output will be a probability map for the outlier support set instead of the actual values of e, we choose the 4 indices with the least probability as inliers and use them to compute n via least squares. We compare our method against the baseline least squares estimate from [24] and ℓ1 norm minimization. We defer more quantitative comparisons to [26]. In Figure 2, we illustrate the recovered surface normal error maps of the hardest case (fewest lighting directions). Here we observe that our DNN estimates lead to far fewer regions of significant error and the runtime is orders of magnitude faster. Overall though, this application example illustrates that weak supervision with mismatched synthetic training data can, at least for some problem domains, be sufficient to learn a quite useful sparse estimation DNN; here one that facilitates real-time 3D modeling in mobile environments. Discussion: In this paper we have shown that deep networks with hand-crafted, multi-resolution structure can provably solve certain specific classes of sparse recovery problems where existing algorithms fail. However, much like CNN-based features can often outperform SIFT on many computer vision tasks, we argue that a discriminative approach can outperform manual structuring of layers/iterations and compensate for dictionary coherence under more general conditions. 8 Acknowledgements: This work was done while the first author was an intern at Microsoft Research, Beijing. It is also funded by 973-2015CB351800, NSFC-61231010, NSFC-61527804, NSFC-61421062, NSFC-61210005 and MOEMicrosoft Key Laboratory, Peking University. References [1] S. Baillet, J.C. Mosher, and R.M. Leahy. Electromagnetic brain mapping. IEEE Signal Processing Magazine, pages 14–30, Nov. 2001. [2] A. Beck and M. Teboulle. A fast iterative shrinkage-thresholding algorithm for linear inverse problems. SIAM J. Imaging Sciences, 2(1), 2009. [3] T. Blumensath and M.E. Davies. Iterative hard thresholding for compressed sensing. Applied and Computational Harmonic Analysis, 27(3), 2009. [4] T. Blumensath and M.E. Davies. Normalized iterative hard thresholding: Guaranteed stability and performance. IEEE J. Selected Topics Signal Processing, 4(2), 2010. [5] E. Cand`es, J. Romberg, and T. Tao. Robust uncertainty principles: Exact signal reconstruction from highly incomplete frequency information. IEEE Trans. Information Theory, 52(2):489–509, 2006. [6] E. Cand`es and T. Tao. Decoding by linear programming. IEEE Trans. Information Theory, 51(12), 2005. [7] S.F. Cotter and B.D. Rao. Sparse channel estimation via matching pursuit with application to equalization. IEEE Trans. on Communications, 50(3), 2002. [8] M.A.T. Figueiredo. Adaptive sparseness using Jeffreys prior. NIPS, 2002. [9] K. Gregor and Y. LeCun. Learning fast approximations of sparse coding. In ICML, 2010. [10] K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. CVPR, 2016. [11] J.R. Hershey, J. Le Roux, and F. Weninger. Deep unfolding: Model-based inspiration of novel deep architectures. arXiv preprint arXiv:1409.2574v4, 2014. [12] S. Hochreiter and J. Schmidhuber. Long short-term memory. Neural computation, 9(8), 1997. [13] S. Ikehata, D.P. Wipf, Y. Matsushita, and K. Aizawa. Robust photometric stereo using sparse regression. In CVPR, 2012. [14] S. Ioffe and C. Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167, 2015. [15] U. Kamilov and H. Mansour. Learning optimal nonlinearities for iterative thresholding algorithms. arXiv preprint arXiv:1512.04754, 2015. [16] D.M. Malioutov, M. C¸ etin, and A.S. Willsky. Sparse signal reconstruction perspective for source localization with sensor arrays. IEEE Trans. Signal Processing, 53(8), 2005. [17] V. Nair and G. Hinton. Rectified linear units improve restricted boltzmann machines. ICML, 2010. [18] Y.C. Pati, R. Rezaiifar, and P.S. Krishnaprasad. Orthogonal matching pursuit: Recursive function approximation with applications to wavelet decomposition. In 27th Asilomar Conference on Signals, Systems and Computers, 1993. [19] P. Sprechmann, A.M. Bronstein, and G. Sapiro. Learning efficient sparse and low rank models. IEEE Trans. Pattern Analysis and Machine Intelligence, 37(9), 2015. [20] R.K. Srivastava, K. Greff, and J. Schmidhuber. Training very deep networks. NIPS, 2015. [21] R. Tibshirani. Regression shrinkage and selection via the lasso. J. of the Royal Statistical Society, 1996. [22] J.A. Tropp. Greed is good: Algorithmic results for sparse approximation. IEEE Transactions on Information Theory, 50(10):2231–2242, October 2004. [23] Z. Wang, Q. Ling, and T. Huang. Learning deep ℓ0 encoders. arXiv preprint arXiv:1509.00153v2, 2015. [24] R.J. Woodham. Photometric method for determining surface orientation from multiple images. Optical Engineering, 19(1), 1980. [25] L. Wu, A. Ganesh, B. Shi, Y. Matsushita, Y. Wang, and Y. Ma. Robust photometric stereo via low-rank matrix completion and recovery. Asian Conference on Computer Vision, 2010. [26] Bo Xin, Yizhou Wang, Wen Gao, and David Wipf. Maximal sparsity with deep networks? arXiv preprint arXiv:1605.01636, 2016. 9
2016
33
6,250
Structured Sparse Regression via Greedy Hard-thresholding Prateek Jain Microsoft Research India Nikhil Rao Technicolor Inderjit Dhillon UT Austin Abstract Several learning applications require solving high-dimensional regression problems where the relevant features belong to a small number of (overlapping) groups. For very large datasets and under standard sparsity constraints, hard thresholding methods have proven to be extremely efficient, but such methods require NP hard projections when dealing with overlapping groups. In this paper, we show that such NP-hard projections can not only be avoided by appealing to submodular optimization, but such methods come with strong theoretical guarantees even in the presence of poorly conditioned data (i.e. say when two features have correlation ≥0.99), which existing analyses cannot handle. These methods exhibit an interesting computation-accuracy trade-off and can be extended to significantly harder problems such as sparse overlapping groups. Experiments on both real and synthetic data validate our claims and demonstrate that the proposed methods are orders of magnitude faster than other greedy and convex relaxation techniques for learning with group-structured sparsity. 1 Introduction High dimensional problems where the regressor belongs to a small number of groups play a critical role in many machine learning and signal processing applications, such as computational biology and multitask learning. In most of these cases, the groups overlap, i.e., the same feature can belong to multiple groups. For example, gene pathways overlap in computational biology applications, and parent-child pairs of wavelet transform coefficients overlap in signal processing applications. The existing state-of-the-art methods for solving such group sparsity structured regression problems can be categorized into two broad classes: a) convex relaxation based methods , b) iterative hard thresholding (IHT) or greedy methods. In practice, IHT methods tend to be significantly more scalable than the (group-)lasso style methods that solve a convex program. But, these methods require a certain projection operator which in general is NP-hard to compute and often certain simple heuristics are used with relatively weak theoretical guarantees. Moreover, existing guarantees for both classes of methods require relatively restrictive assumptions on the data, like Restricted Isometry Property or variants thereof [2, 7, 16], that are unlikely to hold in most common applications. In fact, even under such settings, the group sparsity based convex programs offer at most polylogarithmic gains over standard sparsity based methods [16]. Concretely, let us consider the following linear model: y = Xw⇤+ β, (1) where β ⇠N(0, λ2I), X 2 Rn⇥p, each row of X is sampled i.i.d. s.t. xi ⇠N(0, ⌃), 1 i n, and w⇤is a k⇤-group sparse vector i.e. w⇤can be expressed in terms of only k⇤groups, Gj ✓[p]. The existing analyses for both convex as well as hard thresholding based methods require = σ1/σp c, where c is an absolute constant (like say 3) and σi is the i-th largest eigenvalue of ⌃. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. This is a significantly restrictive assumption as it requires all the features to be nearly independent of each other. For example, if features 1 and 2 have correlation more than say .99 then the restriction on required by the existing results do not hold. Moreover, in this setting (i.e., when = O(1)), the number of samples required to exactly recover w⇤(with λ = 0) is given by: n = ⌦(s + k⇤log M) [16], where s is the maximum support size of a union of k⇤groups and M is the number of groups. In contrast, if one were to directly use sparse regression techniques (by ignoring group sparsity altogether) then the number of samples is given by n = ⌦(s log p). Hence, even in the restricted setting of = O(1), group-sparse regression improves upon the standard sparse regression only by logarithmic factors. Greedy, Iterative Hard Thresholding (IHT) methods have been considered for group sparse regression problems, but they involve NP-hard projections onto the constraint set [3]. While this can be circumvented using approximate operations, the guarantees they provide are along the same lines as the ones that exist for convex methods. In this paper, we show that IHT schemes with approximate projections for the group sparsity problem yield much stronger guarantees. Specifically, our result holds for arbitrarily large , and arbitrary group structures. In particular, using IHT with greedy projections, we show that n = ⌦ ! (s log 1 ✏+ 2k⇤log M) log 1 ✏ " samples suffice to recover ✏-approximatation to w⇤when λ = 0. On the other hand, IHT for standard sparse regression [10] requires n = ⌦(2s log p). Moreover, for general noise variance λ2, our method recovers ˆw s.t. k ˆw −w⇤k 2✏+ λ ·  q s+2k⇤log M n . On the other hand, the existing state-of-the-art results for IHT for group sparsity [4] guarantees k ˆw −w⇤k λ · ps + k⇤log M for 3, i.e., ˆw is not a consistent estimator of w⇤even for small condition number . Our analysis is based on an extension of the sparse regression result by [10] that requires exact projections. However, a critical challenge in the case of overlapping groups is the projection onto the set of group-sparse vectors is NP-hard in general. To alleviate this issue, we use the connection between submodularity and overlapping group projections and a greedy selection based projection is at least good enough. The main contribution of this work is to carefully use the greedy projection based procedure along with hard thresholding iterates to guarantee the convergence to the global optima as long as enough i.i.d. data points are generated from model (1). Moreover, the simplicity of our hard thresholding operator allows us to easily extend it to more complicated sparsity structures. In particular, we show that the methods we propose can be generalized to the sparse overlapping group setting, and to hierarchies of (overlapping) groups. We also provide extensive experiments on both real and synthetic datasets that show that our methods are not only faster than several other approaches, but are also accurate despite performing approximate projections. Indeed, even for poorly-conditioned data, IHT methods are an order of magnitude faster than other greedy and convex methods. We also observe a similar phenomenon when dealing with sparse overlapping groups. 1.1 Related Work Several papers, notably [5] and references therein, have studied convergence properties of IHT methods for sparse signal recovery under standard RIP conditions. [10] generalized the method to settings where RIP does not hold, and also to the low rank matrix recovery setting. [21] used a similar analysis to obtain results for nonlinear models. However, these techniques apply only to cases where exact projections can be performed onto the constraint set. Forward greedy selection schemes for sparse [9] and group sparse [18] constrained programs have been considered previously, where a single group is added at each iteration. The authors in [2] propose a variant of CoSaMP to solve problems that are of interest to us, and again, these methods require exact projections. Several works have studied approximate projections in the context of IHT [17, 6, 12]. However, these results require that the data satisfies RIP-style conditions which typically do not hold in real-world regression problems. Moreover, these analyses do not guarantee a consistent estimate of the optimal regressor when the measurements have zero-mean random noise. In contrast, we provide results under a more general RSC/RSS condition, which is weaker [20], and provide crisp rates for the error bounds when the noise in measurements is random. 2 2 Group Iterative Hard Thresholding for Overlapping Groups In this section, we formally set up the group sparsity constrained optimization problem, and then briefly present the IHT algorithm for the same. Suppose we are given a set of M groups that can arbitrarily overlap G = {G1, . . . , GM}, where Gi ✓[p]. Also, let [M i=1Gi = {1, 2, . . . , p}. We let kwk denote the Euclidean norm of w, and supp(w) denotes the support of w. For any vector w 2 Rp, [8] defined the overlapping group norm as kwkG := inf M X i=1 kaGik s.t. M X i=1 aGi = w, supp(aGi) ✓Gi (2) We also introduce the notion of “group-support” of a vector and its group-`0 pseudo-norm: G-supp(w) := {i s.t. kaGik > 0}, kwkG 0 := inf M X i=1 1{kaGik > 0}, (3) where aGi satisfies the constraints of (2). 1{·} is the indicator function, taking the value 1 if the condition is satisfied, and 0 otherwise. For a set of groups G, supp(G) = {Gi, i 2 G}. Similarly, G-supp(S) = G-supp(wS). Suppose we are given a function f : Rp ! R and M groups G = {G1, . . . , GM}. The goal is to solve the following group sparsity structured problem (GS-Opt): GS-Opt: min w f(w) s.t. kwkG 0 k (4) f can be thought of as a loss function over the training data, for instance, logistic or least squares loss. In the high dimensional setting, problems of the form (4) are somewhat ill posed and are NP-hard in general. Hence, additional assumptions on the loss function (f) are warranted to guarantee a reasonable solution. Here, we focus on problems where f satisfies the restricted strong convexity and smoothness conditions: Definition 2.1 (RSC/RSS). The function f : Rp ! R satisfies the restricted strong convexity (RSC) and restricted strong smoothness (RSS) of order k, if the following holds: ↵kI ⪯H(w) ⪯LkI, where H(w) is the Hessian of f at any w 2 Rp s.t. kwkG 0 k. Note that the goal of our algorithms/analysis would be to solve the problem for arbitrary ↵k > 0 and Lk < 1. In contrast, adapting existing IHT results to this setting lead to results that allow Lk/↵kless than a constant (like say 3). We are especially interested in the linear model described in (1), and in recovering w? consistently (i.e. recover w? exactly as n ! 1). To this end, we look to solve the following (non convex) constrained least squares problem GS-LS: ˆw = arg min w f(w) := 1 2nky −Xwk2 s.t. kwkG 0 k (5) with k ≥k⇤being a positive, user defined integer 1. In this paper, we propose to solve (5) using an Iterative Hard Thresholding (IHT) scheme. IHT methods iteratively take a gradient descent step, and then project the resulting vector (g) on to the (non-convex) constraint set of group sparse vectos, i.e., w⇤= P G k (g) = arg min w kw −gk2 s.t kwkG 0 k (6) Computing the gradient is easy and hence the complexity of the overall algorithm heavily depends on the complexity of performing the aforementioned projection. Algorithm 1 details the IHT procedure for the group sparsity problem (4). Throughout the paper we consider the same high-level procedure, but consider different projection operators bP G k (g) for different settings of the problem. 1typically chosen via cross-validation 3 Algorithm 1 IHT for Group-sparsity 1: Input : data y, X, parameter k, iterations T, step size ⌘ 2: Initialize: t = 0, w0 2 Rp a k-group sparse vector 3: for t = 1, 2, ..., T do 4: gt = wt −⌘rf(wt) 5: wt = bP G k (gt) where bP G k (gt) performs (approximate) projections 6: end for 7: Output : wT Algorithm 2 Greedy Projection Require: g 2 Rp, parameter ˜k, groups G 1: ˆu = 0 , v = g, bG = {0} 2: for t = 1, 2, . . . ˜k do 3: Find G? = arg maxG2G\ b G kvGk 4: bG = bG S G? 5: v = v −vG? 6: u = u + vG? 7: end for 8: Output ˆu := bP G k (g), bG = supp(u) 2.1 Submodular Optimization for General G Suppose we are given a vector g 2 Rp, which needs to be projected onto the constraint set kukG 0 k (see (6)). Solving (6) is NP-hard when G contains arbitrary overlapping groups. To overcome this, P G k (·) can be replaced by an approximate operator bP G k (·) (step 5 of Algorithm 1). Indeed, the procedure for performing projections reduces to a submodular optimization problem [3], for which the standard greedy procedure can be used (Algorithm 2). For completeness, we detail this in Appendix A, where we also prove the following: Lemma 2.2. Given an arbitrary vector g 2 Rp, suppose we obtain ˆu, bG as the output of Algorithm 2 with input g and target group sparsity ˜k. Let u⇤= P G k (g) be as defined in (6). Then kˆu −gk2 e− ˜k k k(g)supp(u⇤)k2 + ku⇤−gk2 where e is the base of the natural logarithm. Note that the term with the exponent in Lemma 2.2 approaches 0 as ˜k increases. Increasing ˜k should imply more samples for recovery of w⇤. Hence, this lemma hints at the possibility of trading off sample complexity for better accuracy, despite the projections being approximate. See Section 3 for more details. Algorithm 2 can be applied to any G, and is extremely efficient. 2.2 Incorporating Full Corrections IHT methods can be improved by the incorporation of “corrections” after each projection step. This merely entails adding the following step in Algorithm 1 after step 5: wt = arg min ˜ w f( ˜w) s.t. supp( ˜w) = supp( bP G k (gt)) When f(·) is the least squares loss as we consider, this step can be solved efficiently using Cholesky decompositions via the backslash operator in MATLAB. We will refer to this procedure as IHTFC. Fully corrective methods in greedy algorithms typically yield significant improvements, both theoretically and in practice [10]. 3 Theoretical Performance Bounds We now provide theoretical guarantees for Algorithm 1 when applied to the overlapping group sparsity problem (4). We then specialize the results for the linear regression model (5). Theorem 3.1. Let w⇤= arg minw,kwGk0k⇤f(w) and let f satisfy RSC/RSS with constants ↵k0, Lk0, respectively (see Definition 2.1). Set k = 32 ⇣ Lk0 ↵k0 ⌘2 ·k⇤log ⇣ Lk0 ↵k0 · kw⇤k2 ✏ ⌘ and let k0 2k+k⇤. Suppose we run Algorithm 1, with ⌘= 1/Lk0 and projections computed according to Algorithm 2. Then, the following holds after t + 1 iterations: kwt+1 −w⇤k2  ✓ 1 − ↵k0 10 · Lk0 ◆ · kwt −w⇤k2 + γ + ↵k0 Lk0 ✏, 4 where γ = 2 Lk0 maxS, s.t., | G-supp(S)|k k(rf(w⇤))Sk2. Specifically, the output of the T = O ⇣ Lk0 ↵k0 · kw⇤k2 ✏ ⌘ -th iteration of Algorithm 1 satisfies: kwT −w⇤k2 2✏+ 10 · Lk0 ↵k0 · γ. The proof uses the fact that Algorithm 2 performs approximately good projections. The result follows from combining this with results from convex analysis (RSC/RSS) and a careful setting of parameters. We prove this result in Appendix B. Remarks Theorem 3.1 shows that Algorithm 1 recovers w⇤up to O ⇣ Lk0 ↵k0 · γ ⌘ error. If k arg minw f(w)kG 0 k, then, γ = 0. In general our result obtains an additive error which is weaker than what one can obtain for a convex optimization problem. However, for typical statistical problems, we show that γ is small and gives us nearly optimal statistical generalization error (for example, see Theorem 3.2). Theorem 3.1 displays an interesting interplay between the desired accuracy ✏, and the penalty we thus pay as a result of performing approximate projections γ. Specifically, as ✏is made small, k becomes large, and thus so does γ. Conversely, we can let ✏be large so that the projections are coarse, but incur a smaller penalty via the γ term. Also, since the projections are not too accurate in this case, we can get away with fewer iterations. Thus, there is a tradeoff between estimation error ✏and model selection error γ. Also, note that the inverse dependence of k on ✏is only logarithmic in nature. We stress that our results do not hold for arbitrary approximate projection operators. Our proof critically uses the greedy scheme (Algorithm 2), via Lemma 2.2. Also, as discussed in Section 4, the proof easily extends to other structured sparsity sets that allow such greedy selection steps. We obtain similar result as [10] for the standard sparsity case, i.e., when the groups are singletons. However, our proof is significantly simpler and allows for a significantly easier setting of ⌘. 3.1 Linear Regression Guarantees We next proceed to the standard linear regression model considered in (5). To the best of our knowledge, this is the first consistency result for overlapping group sparsity problems, especially when the data can be arbitrarily conditioned. Recall that σmax (σmin) are the maximum (minimum) singular value of ⌃, and := σmax/σmin is the condition number of ⌃. Theorem 3.2. Let the observations y follow the model in (1). Suppose w⇤is k⇤-group sparse and let f(w) := 1 2nkXw −yk2 2. Let the number of samples satisfy: n ≥⌦ ⇣ (s + 2 · k⇤· log M) · log ⇣ ✏ ⌘⌘ , where s = maxw,kwkG 0 k | supp(w)|. Then, applying Algorithm 1 with k = 82k⇤· log !  ✏ " , ⌘= 1/(4σmax), guarantees the following after T = ⌦ ⇣ log ·kw⇤k2 ✏ ⌘ iterations (w.p. ≥1−1/n8): kwT −w⇤k λ ·  r s + 2k⇤log M n + 2✏ Remarks Note that one can ignore the group sparsity constraint, and instead look to recover the (at most) ssparse vector w⇤using IHT methods for `0 optimization [10]. However, the corresponding sample complexity is n ≥2s log(p). Hence, for an ill conditioned ⌃, using group sparsity based methods provide a significantly stronger result, especially when the groups overlap significantly. Note that the number of samples required increases logarithmically with the accuracy ✏. Theorem 3.2 thus displays an interesting phenomenon: by obtaining more samples, one can provide a smaller recovery error while incurring a larger approximation error (since we choose more groups). Our proof critically requires that when restricted to group sparse vectors, the least squares objective function f(w) = 1 2nky −Xwk2 2 is strongly convex as well as strongly smooth: 5 Lemma 3.3. Let X 2 Rn⇥p be such that each xi ⇠N(0, ⌃). Let w 2 Rp be k-group sparse over groups G = {G1, . . . GM}, i.e., kwkG 0 k and s = maxw,kwkG 0 k | supp(w)|. Let the number of samples n ≥⌦(C (k log M + s)). Then, the following holds with probability ≥1 −1/n10: ✓ 1 − 4 p C ◆ σminkwk2 2 1 nkXwk2 2  ✓ 1 + 4 p C ◆ σmaxkwk2 2, We prove Lemma 3.3 in Appendix C. Theorem 3.2 then follows by combining Lemma 3.3 with Theorem 3.1. Note that in the least squares case, these are the Restricted Eigenvalue conditions on the matrix X, which as explained in [20] are much weaker than traditional RIP assumptions on the data. In particular, RIP requires almost 0 correlation between any two features, while our assumption allows for arbitrary high correlations albeit at the cost of a larger number of samples. 3.2 IHT with Exact Projections P G k (·) We now consider the setting where P G k (·) can be computed exactly and efficiently for any k. Examples include the dynamic programming based method by [3] for certain group structures, or Algorithm 2 when the groups do not overlap. Since the exact projection operator can be arbitrary, our proof of Theorem 3.1 does not apply directly in this case. However, we show that by exploiting the structure of hard thresholding, we can still obtain a similar result: Theorem 3.4. Let w⇤= arg minw,kwGk0k⇤f(w). Let f satisfy RSC/RSS with constants ↵2k+k⇤, L2k+k⇤, respectively (see Definition 2.1). Then, the following holds for the T = O ⇣ Lk0 ↵k0 · kw⇤k2 ✏ ⌘ -th iterate of Algorithm 1 (with ⌘= 1/L2k+k⇤) with bP G k (·) = P G k (·) being the exact projection: kwT −w⇤k2 ✏+ 10 · Lk0 ↵k0 · γ. where k0 = 2k + k⇤, k = O(( Lk0 ↵k0 )2 · k⇤), γ = 2 Lk0 maxS, s.t., | G-supp(S)|k k(rf(w⇤))Sk2. See Appendix D for a detailed proof. Note that unlike greedy projection method (see Theorem 3.1), k is independent of ✏. Also, in the linear model, the above result also leads to consistent estimate of w⇤. 4 Extension to Sparse Overlapping Groups (SoG) The SoG model generalizes the overlapping group sparse model, allowing the selected groups themselves to be sparse. Given positive integers k1, k2 and a set of groups G, IHT for SoG would perform projections onto the following set: Csog 0 := ( w = M X i=1 aGi : kwkG 0 k1, kaG1k0 k2 ) (7) As in the case of overlapping group lasso, projection onto (7) is NP-hard in general. Motivated by our greedy approach in Section 2, we propose a similar method for SoG (see Algorithm 3). The algorithm essentially greedily selects the groups that have large top-k2 elements by magnitude. Below, we show that the IHT (Algorithm 1) combined with the greedy projection (Algorithm 3) indeed converges to the optimal solution. Moreover, our experiments (Section 5) reveal that this method, when combined with full corrections, yields highly accurate results significantly faster than the state-of-the-art. We suppose that there exists a set of supports Sk⇤such that supp(w⇤) 2 Sk⇤. Then, we obtain the following result, proved in Appendix E: Theorem 4.1. Let w⇤= arg minw,supp(w)2Sk⇤f(w), where Sk⇤✓Sk ✓{0, 1}p is a fixed set parameterized by k⇤. Let f satisfy RSC/RSS with constants ↵k, Lk, respectively. Furthermore, assume that there exists an approximately good projection operator for the set defined in (7) (for example, Algorithm 3). Then, the following holds for the T = O ⇣ Lk0 ↵k0 · kw⇤k2 ✏ ⌘ -th iterate of Algorithm 1 : kwT −w⇤k2 2✏+ 10 · L2k+k⇤ ↵2k+k⇤ · γ, where k = O(( L2k+k⇤ ↵2k+k⇤)2 · k⇤· β ↵2k+k⇤ L2k+k⇤✏), γ = 2 L2k+k⇤maxS, S2Sk k(rf(w⇤))Sk2. 6 Algorithm 3 Greedy Projections for SoG Require: g 2 Rp, parameters k1, k2, groups G 1: ˆu = 0 , v = g, bG = {0}, ˆS = {0} 2: for t=1,2,... k1 do 3: Find G? = arg maxG2G\ b G kvGk 4: bG = bG S G? 5: Let S correspond to the indices of the top k2 entries of vG? by magnitude 6: Define ¯v 2 Rp, ¯vS = (vG?)S ¯vi = 0 i /2 S 7: ˆS = ˆS S S 8: v = v −¯v 9: u = u + ¯v 10: end for 11: Output ˆu, bG, ˆS Remarks Similar to Theorem 3.1, we see that there is a tradeoff between obtaining accurate projections ✏and model mismatch γ. Specifically in this case, one can obtain small ✏by increasing k1, k2 in Algorithm 3. However, this will mean we select large number of groups, and subsequently γ increases. A result similar to Theorem 3.2 can be obtained for the case when f is least squares loss function. Specifically, the sample complexity evaluates to n ≥2 ! k⇤ 1 log(M) + 2k⇤ 1k⇤ 2 log(maxi |Gi|) " . We obtain results for least squares in Appendix F. An interesting extension to the SoG case is that of a hierarchy of overlapping, sparsely activated groups. When the groups at each level do not overlap, this reduces to the case considered in [11]. However, our theory shows that when a corresponding approximate projection operator is defined for the hierarchical overlapping case (extending Algorithm 3), IHT methods can be used to obtain the solution in an efficient manner. 5 Experiments and Results Time (seconds) 0 50 100 150 200 250 300 log(objective) 3 3.5 4 4.5 5 5.5 6 IHT IHT+FC CoGEnT FW GOMP Time (seconds) 0 50 100 150 200 250 300 log(objective) 3 4 5 6 7 8 IHT IHT+FC CoGEnT FW GOMP condition number measurements 50 100 150 200 250 300 2000 1800 1600 1400 1200 condition number 50 100 150 200 250 300 measurements 2000 1800 1600 1200 1200 Figure 1: (From left to right) Objective value as a function of time for various methods, when data is well conditioned and poorly conditioned. The latter two figures show the phase transition plots for poorly conditioned data, for IHT and GOMP respectively. In this section, we empirically compare and contrast our proposed group IHT methods against the existing approaches to solve the overlapping group sparsity problem. At a high level, we observe that our proposed variants of IHT indeed outperforms the existing state-of-the-art methods for groupsparse regression in terms of time complexity. Encouragingly, IHT also performs competitively with the existing methods in terms of accuracy. In fact, our results on the breast cancer dataset shows a 10% relative improvement in accuracy over existing methods. Greedy methods for group sparsity have been shown to outperform proximal point schemes, and hence we restrict our comparison to greedy procedures. We compared four methods: our algorithm with (IHT-FC) and without (IHT) the fully corrective step, the Frank Wolfe (FW) method [19] , CoGEnT, [15] and the Group OMP (GOMP) [18]. All relevant hyper-parameters were chosen via a grid search, and experiments were run on a macbook laptop with a 2.5 GHz processor and 16gb memory. Additional experimental results are presented in Appendix G 7 0 5 10 15 20 −8 −7 −6 −5 −4 −3 −2 time (seconds) log(MSE) IHT IHT−FC COGEnT FW 500 1000 1500 2000 2500 3000 3500 −1 0 1 500 1000 1500 2000 2500 3000 3500 −1 0 1 500 1000 1500 2000 2500 3000 3500 −1 0 1 Method Error % time (sec) FW 29.41 6.4538 IHT 27.94 0.0400 GOMP 25.01 0.2891 CoGEnT 23.53 0.1414 IHT-FC 21.65 0.1601 Figure 2: (Left) SoG: error vs time comparison for various methods, (Center) SoG: reconstruction of the true signal (top) from IHT-FC (middle) and CoGEnT (bottom). (Right:) Tumor Classification: misclassification rate of various methods. Synthetic Data, well conditioned: We first compared various greedy schemes for solving the overlapping group sparsity problem on synthetic data. We generated M = 1000 groups of contiguous indices of size 25; the last 5 entries of one group overlap with the first 5 of the next. We randomly set 50 of these to be active, populated by uniform [−1, 1] entries. This yields w? 2 Rp, p ⇠22000. X 2 Rn⇥p where n = 5000 and Xij i.i.d ⇠N(0, 1). Each measurement is corrupted with Additive White Gaussian Noise (AWGN) with standard deviation λ = 0.1. IHT mehods achieve orders of magnitude speedup compared to the competing schemes, and achieve almost the same (final) objective function value despite approximate projections (Figure 1 (Left)). Synthetic Data, poorly conditioned: Next, we consider the exact same setup, but with each row of X given by: xi ⇠N(0, ⌃) where = σmax(⌃)/σmin(⌃) = 10. Figure 1 (Center-left) shows again the advantages of using IHT methods; IHT-FC is about 10 times faster than the next best CoGEnT. We next generate phase transition plots for recovery by our method (IHT) as well as the stateof-the-art GOMP method. We generate vectors in the same vein as the above experiment, with M = 500, B = 15, k = 25, p ⇠5000. We vary the the condition number of the data covariance (⌃) as well as the number of measurements (n). Figure 1 (Center-right and Right) shows the phase transition plot as the measurements and the condition number are varied for IHT, and GOMP respectively. The results are averaged over 10 independent runs. It can be seen that even for condition numbers as high as 200, n ⇠1500 measurements suffices for IHT to exactly recovery w⇤, whereas GOMP with the same setting is not able to recover w⇤even once. Tumor Classification, Breast Cancer Dataset We next compare the aforementioned methods on a gene selection problem for breast cancer tumor classification. We use the data used in [8] 2. We ran a 5-fold cross validation scheme to choose parameters, where we varied ⌘2 {2−5, 2−4, . . . , 23} k 2 {2, 5, 10, 15, 20, 50, 100} ⌧2 {23, 24, . . . , 213}. Figure 2 (Right) shows that the vanilla hard thresholding method is competitive despite performing approximate projections, and the method with full corrections obtains the best performance among the methods considered. We randomly chose 15% of the data to test on. Sparse Overlapping Group Lasso: Finally, we study the sparse overlapping group (SoG) problem that was introduced and analyzed in [14] (Figure 2). We perform projections as detailed in Algorithm 3. We generated synthetic vectors with 100 groups of size 50 and randomly selected 5 groups to be active, and among the active group only set 30 coefficients to be non zero. The groups themselves were overlapping, with the last 10 entries of one group shared with the first 10 of the next, yielding p ⇠4000. We chose the best parameters from a grid, and we set k = 2k⇤for the IHT methods. 6 Conclusions and Discussion We proposed a greedy-IHT method that can applied to regression problems over set of group sparse vectors. Our proposed solution is efficient, scalable, and provide fast convergence guarantees under general RSC/RSS style conditions, unlike existing methods. We extended our analysis to handle even more challenging structures like sparse overlapping groups. Our experiments show that IHT methods achieve fast, accurate results even with greedy and approximate projections. 2download at http : //cbio.ensmp.fr/ ljacob/ 8 References [1] Francis Bach. Convex analysis and optimization with submodular functions: A tutorial. arXiv preprint arXiv:1010.4207, 2010. [2] Richard G Baraniuk, Volkan Cevher, Marco F Duarte, and Chinmay Hegde. Model-based compressive sensing. Information Theory, IEEE Transactions on, 56(4):1982–2001, 2010. [3] Nirav Bhan, Luca Baldassarre, and Volkan Cevher. Tractability of interpretability via selection of groupsparse models. In Information Theory Proceedings (ISIT), 2013 IEEE International Symposium on, pages 1037–1041. IEEE, 2013. [4] Thomas Blumensath and Mike E Davies. Sampling theorems for signals from the union of finitedimensional linear subspaces. Information Theory, IEEE Transactions on, 55(4):1872–1882, 2009. [5] Thomas Blumensath and Mike E Davies. Normalized iterative hard thresholding: Guaranteed stability and performance. Selected Topics in Signal Processing, IEEE Journal of, 4(2):298–309, 2010. [6] Chinmay Hegde, Piotr Indyk, and Ludwig Schmidt. Approximation algorithms for model-based compressive sensing. Information Theory, IEEE Transactions on, 61(9):5129–5147, 2015. [7] Junzhou Huang, Tong Zhang, and Dimitris Metaxas. Learning with structured sparsity. The Journal of Machine Learning Research, 12:3371–3412, 2011. [8] Laurent Jacob, Guillaume Obozinski, and Jean-Philippe Vert. Group lasso with overlap and graph lasso. In Proceedings of the 26th annual International Conference on Machine Learning, pages 433–440. ACM, 2009. [9] Prateek Jain, Ambuj Tewari, and Inderjit S Dhillon. Orthogonal matching pursuit with replacement. In Advances in Neural Information Processing Systems, pages 1215–1223, 2011. [10] Prateek Jain, Ambuj Tewari, and Purushottam Kar. On iterative hard thresholding methods for highdimensional m-estimation. In Advances in Neural Information Processing Systems, pages 685–693, 2014. [11] Rodolphe Jenatton, Julien Mairal, Francis R Bach, and Guillaume R Obozinski. Proximal methods for sparse hierarchical dictionary learning. In Proceedings of the 27th International Conference on Machine Learning (ICML-10), pages 487–494, 2010. [12] Anastasios Kyrillidis and Volkan Cevher. Combinatorial selection and least absolute shrinkage via the clash algorithm. In Information Theory Proceedings (ISIT), 2012 IEEE International Symposium on, pages 2216–2220. IEEE, 2012. [13] George L Nemhauser, Laurence A Wolsey, and Marshall L Fisher. An analysis of approximations for maximizing submodular set functions. Mathematical Programming, 14(1):265–294, 1978. [14] Nikhil Rao, Christopher Cox, Rob Nowak, and Timothy T Rogers. Sparse overlapping sets lasso for multitask learning and its application to fmri analysis. In Advances in neural information processing systems, pages 2202–2210, 2013. [15] Nikhil Rao, Parikshit Shah, and Stephen Wright. Forward–backward greedy algorithms for atomic norm regularization. Signal Processing, IEEE Transactions on, 63(21):5798–5811, 2015. [16] Nikhil S Rao, Ben Recht, and Robert D Nowak. Universal measurement bounds for structured sparse signal recovery. In International Conference on Artificial Intelligence and Statistics, pages 942–950, 2012. [17] Parikshit Shah and Venkat Chandrasekaran. Iterative projections for signal identification on manifolds: Global recovery guarantees. In Communication, Control, and Computing (Allerton), 2011 49th Annual Allerton Conference on, pages 760–767. IEEE, 2011. [18] Grzegorz Swirszcz, Naoki Abe, and Aurelie C Lozano. Grouped orthogonal matching pursuit for variable selection and prediction. In Advances in Neural Information Processing Systems, pages 1150–1158, 2009. [19] Ambuj Tewari, Pradeep K Ravikumar, and Inderjit S Dhillon. Greedy algorithms for structurally constrained high dimensional problems. In Advances in Neural Information Processing Systems, pages 882–890, 2011. [20] Sara A Van De Geer, Peter B¨uhlmann, et al. On the conditions used to prove oracle results for the lasso. Electronic Journal of Statistics, 3:1360–1392, 2009. [21] Xiaotong Yuan, Ping Li, and Tong Zhang. Gradient hard thresholding pursuit for sparsity-constrained optimization. In Proceedings of the 31st International Conference on Machine Learning (ICML-14), pages 127–135, 2014. 9
2016
330
6,251
A Multi-Batch L-BFGS Method for Machine Learning Albert S. Berahas Northwestern University Evanston, IL albertberahas@u.northwestern.edu Jorge Nocedal Northwestern University Evanston, IL j-nocedal@northwestern.edu Martin Takáˇc Lehigh University Bethlehem, PA takac.mt@gmail.com Abstract The question of how to parallelize the stochastic gradient descent (SGD) method has received much attention in the literature. In this paper, we focus instead on batch methods that use a sizeable fraction of the training set at each iteration to facilitate parallelism, and that employ second-order information. In order to improve the learning process, we follow a multi-batch approach in which the batch changes at each iteration. This can cause difficulties because L-BFGS employs gradient differences to update the Hessian approximations, and when these gradients are computed using different data points the process can be unstable. This paper shows how to perform stable quasi-Newton updating in the multi-batch setting, illustrates the behavior of the algorithm in a distributed computing platform, and studies its convergence properties for both the convex and nonconvex cases. 1 Introduction It is common in machine learning to encounter optimization problems involving millions of parameters and very large datasets. To deal with the computational demands imposed by such applications, high performance implementations of stochastic gradient and batch quasi-Newton methods have been developed [1, 11, 9]. In this paper we study a batch approach based on the L-BFGS method [20] that strives to reach the right balance between efficient learning and productive parallelism. In supervised learning, one seeks to minimize empirical risk, F(w) := 1 n n X i=1 f(w; xi, yi) def = 1 n n X i=1 fi(w), where (xi, yi)n i=1 denote the training examples and f(·; x, y) : Rd →R is the composition of a prediction function (parametrized by w) and a loss function. The training problem consists of finding an optimal choice of the parameters w ∈Rd with respect to F, i.e., min w∈Rd F(w) = 1 n n X i=1 fi(w). (1.1) At present, the preferred optimization method is the stochastic gradient descent (SGD) method [23, 5], and its variants [14, 24, 12], which are implemented either in an asynchronous manner (e.g. when 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. using a parameter server in a distributed setting) or following a synchronous mini-batch approach that exploits parallelism in the gradient evaluation [2, 22, 13]. A drawback of the asynchronous approach is that it cannot use large batches, as this would cause updates to become too dense and compromise the stability and scalability of the method [16, 22]. As a result, the algorithm spends more time in communication as compared to computation. On the other hand, using a synchronous mini-batch approach one can achieve a near-linear decrease in the number of SGD iterations as the mini-batch size is increased, up to a certain point after which the increase in computation is not offset by the faster convergence [26]. An alternative to SGD is a batch method, such as L-BFGS, which is able to reach high training accuracy and allows one to perform more computation per node, so as to achieve a better balance with communication costs [27]. Batch methods are, however, not as efficient learning algorithms as SGD in a sequential setting [6]. To benefit from the strength of both methods some high performance systems employ SGD at the start and later switch to a batch method [1]. Multi-Batch Method. In this paper, we follow a different approach consisting of a single method that selects a sizeable subset (batch) of the training data to compute a step, and changes this batch at each iteration to improve the learning abilities of the method. We call this a multi-batch approach to differentiate it from the mini-batch approach used in conjunction with SGD, which employs a very small subset of the training data. When using large batches it is natural to employ a quasiNewton method, as incorporating second-order information imposes little computational overhead and improves the stability and speed of the method. We focus here on the L-BFGS method, which employs gradient information to update an estimate of the Hessian and computes a step in O(d) flops, where d is the number of variables. The multi-batch approach can, however, cause difficulties to L-BFGS because this method employs gradient differences to update Hessian approximations. When the gradients used in these differences are based on different data points, the updating procedure can be unstable. Similar difficulties arise in a parallel implementation of the standard L-BFGS method, if some of the computational nodes devoted to the evaluation of the function and gradient are unable to return results on time — as this again amounts to using different data points to evaluate the function and gradient at the beginning and the end of the iteration. The goal of this paper is to show that stable quasi-Newton updating can be achieved in both settings without incurring extra computational cost, or special synchronization. The key is to perform quasi-Newton updating based on the overlap between consecutive batches. The only restriction is that this overlap should not be too small, something that can be achieved in most situations. Contributions. We describe a novel implementation of the batch L-BFGS method that is robust in the absence of sample consistency; i.e., when different samples are used to evaluate the objective function and its gradient at consecutive iterations. The numerical experiments show that the method proposed in this paper — which we call the multi-batch L-BFGS method — achieves a good balance between computation and communication costs. We also analyze the convergence properties of the new method (using a fixed step length strategy) on both convex and nonconvex problems. 2 The Multi-Batch Quasi-Newton Method In a pure batch approach, one applies a gradient based method, such as L-BFGS [20], to the deterministic optimization problem (1.1). When the number n of training examples is large, it is natural to parallelize the evaluation of F and ∇F by assigning the computation of the component functions fi to different processors. If this is done on a distributed platform, it is possible for some of the computational nodes to be slower than the rest. In this case, the contribution of the slow (or unresponsive) computational nodes could be ignored given the stochastic nature of the objective function. This leads, however, to an inconsistency in the objective function and gradient at the beginning and at the end of the iteration, which can be detrimental to quasi-Newton methods. Thus, we seek to find a fault-tolerant variant of the batch L-BFGS method that is capable of dealing with slow or unresponsive computational nodes. A similar challenge arises in a multi-batch implementation of the L-BFGS method in which the entire training set T = {(xi, yi)n i=1} is not employed at every iteration, but rather, a subset of the data is used to compute the gradient. Specifically, we consider a method in which the dataset is randomly divided into a number of batches — say 10, 50, or 100 — and the minimization is performed with respect to a different batch at every iteration. At the k-th iteration, the algorithm chooses a batch 2 Sk ⊂{1, . . . , n}, computes F Sk(wk) = 1 |Sk| X i∈Sk fi (wk) , ∇F Sk(wk) = gSk k = 1 |Sk| X i∈Sk ∇fi (wk) , (2.2) and takes a step along the direction −HkgSk k , where Hk is an approximation to ∇2F(wk)−1. Allowing the sample Sk to change freely at every iteration gives this approach flexibility of implementation and is beneficial to the learning process, as we show in Section 4. (We refer to Sk as the sample of training points, even though Sk only indexes those points.) The case of unresponsive computational nodes and the multi-batch method are similar. The main difference is that node failures create unpredictable changes to the samples Sk, whereas a multi-batch method has control over sample generation. In either case, the algorithm employs a stochastic approximation to the gradient and can no longer be considered deterministic. We must, however, distinguish our setting from that of the classical SGD method, which employs small mini-batches and noisy gradient approximations. Our algorithm operates with much larger batches so that distributing the function evaluation is beneficial and the compute time of gSk k is not overwhelmed by communication costs. This gives rise to gradients with relatively small variance and justifies the use of a second-order method such as L-BFGS. Robust Quasi-Newton Updating. The difficulties created by the use of a different sample Sk at each iteration can be circumvented if consecutive samples Sk and Sk+1 overlap, so that Ok = Sk∩Sk+1 ̸= ∅. One can then perform stable quasi-Newton updating by computing gradient differences based on this overlap, i.e., by defining yk+1 = gOk k+1 −gOk k , sk+1 = wk+1 −wk, (2.3) in the notation given in (2.2). The correction pair (yk, sk) can then be used in the BFGS update. When the overlap set Ok is not too small, yk is a useful approximation of the curvature of the objective function F along the most recent displacement, and will lead to a productive quasi-Newton step. This observation is based on an important property of Newton-like methods, namely that there is much more freedom in choosing a Hessian approximation than in computing the gradient [7, 3]. Thus, a smaller sample Ok can be employed for updating the inverse Hessian approximation Hk than for computing the batch gradient gSk k in the search direction −HkgSk k . In summary, by ensuring that unresponsive nodes do not constitute the vast majority of all working nodes in a fault-tolerant parallel implementation, or by exerting a small degree of control over the creation of the samples Sk in the multi-batch method, one can design a robust method that naturally builds upon the fundamental properties of BFGS updating. We should mention in passing that a commonly used strategy for ensuring stability of quasi-Newton updating in machine learning is to enforce gradient consistency [25], i.e., to use the same sample Sk to compute gradient evaluations at the beginning and the end of the iteration. Another popular remedy is to use the same batch Sk for multiple iterations [19], alleviating the gradient inconsistency problem at the price of slower convergence. In this paper, we assume that achieving such sample consistency is not possible (in the fault-tolerant case) or desirable (in a multi-batch framework), and wish to design a new variant of L-BFGS that imposes minimal restrictions in the sample changes. 2.1 Specification of the Method At the k-th iteration, the multi-batch BFGS algorithm chooses a set Sk ⊂{1, . . . , n} and computes a new iterate wk+1 = wk −αkHkgSk k , (2.4) where αk is the step length, gSk k is the batch gradient (2.2) and Hk is the inverse BFGS Hessian matrix approximation that is updated at every iteration by means of the formula Hk+1 = V T k HkVk + ρksksT k , ρk = 1 yT k sk , Vk = I −ρkyksT k . To compute the correction vectors (sk, yk), we determine the overlap set Ok = Sk ∩Sk+1 consisting of the samples that are common at the k-th and k + 1-st iterations. We define F Ok(wk) = 1 |Ok| X i∈Ok fi (wk) , ∇F Ok(wk) = gOk k = 1 |Ok| X i∈Ok ∇fi (wk) , 3 and compute the correction vectors as in (2.3). In this paper we assume that αk is constant. In the limited memory version, the matrix Hk is defined at each iteration as the result of applying m BFGS updates to a multiple of the identity matrix, using a set of m correction pairs {si, yi} kept in storage. The memory parameter m is typically in the range 2 to 20. When computing the matrix-vector product in (2.4) it is not necessary to form that matrix Hk since one can obtain this product via the two-loop recursion [20], using the m most recent correction pairs {si, yi}. After the step has been computed, the oldest pair (sj, yj) is discarded and the new curvature pair is stored. A pseudo-code of the proposed method is given below, and depends on several parameters. The parameter r denotes the fraction of samples in the dataset used to define the gradient, i.e., r = |S| n . The parameter o denotes the length of overlap between consecutive samples, and is defined as a fraction of the number of samples in a given batch S, i.e., o = |O| |S| . Algorithm 1 Multi-Batch L-BFGS Input: w0 (initial iterate), T = {(xi, yi), for i = 1, . . . , n} (training set), m (memory parameter), r (batch, fraction of n), o (overlap, fraction of batch), k ←0 (iteration counter). 1: Create initial batch S0 ▷As shown in Firgure 1 2: for k = 0, 1, 2, ... do 3: Calculate the search direction pk = −HkgSk k ▷Using L-BFGS formula 4: Choose the step length αk > 0 5: Compute wk+1 = wk + αkpk 6: Create the next batch Sk+1 7: Compute the curvature pairs sk+1 = wk+1 −wk and yk+1 = gOk k+1 −gOk k 8: Replace the oldest pair (si, yi) by sk+1, yk+1 9: end for 2.2 Sample Generation We now discuss how the sample Sk+1 is created at each iteration (Line 8 in Algorithm 1). Distributed Computing with Faults. Consider a distributed implementation in which slave nodes read the current iterate wk from the master node, compute a local gradient on a subset of the dataset, and send it back to the master node for aggregation in the calculation (2.2). Given a time (computational) budget, it is possible for some nodes to fail to return a result. The schematic in Figure 1a illustrates the gradient calculation across two iterations, k and k+1, in the presence of faults. Here Bi, i = 1, ..., B denote the batches of data that each slave node i receives (where T = ∪iBi), and ˜∇f(w) is the gradient calculation using all nodes that responded within the preallocated time. MASTER NODE SLAVE NODES MASTER NODE (a) (b) wk wk wk wk B1 B1 B2 B2 B3 B3 BB BB · · · wk+1 wk+1 wk+1 wk+1 B1 B1 B2 B2 B3 B3 BB BB · · · ˜rf BB(wk) ˜rf BB(wk) ˜rf B3(wk) ˜rf B3(wk) ˜rf B1(wk) ˜rf B1(wk) ˜rf BB(wk+1) ˜rf BB(wk+1) ˜rf B1(wk+1) ˜rf B1(wk+1) ˜rf(wk) ˜rf(wk+1) SHUFFLED DATA n d SHUFFLED DATA O0 O0 O1 O1 O2 O2 O3 O3 O4 O4 O5 O5 O6 S0 S1 S2 S3 S4 S5 S6 Figure 1: Sample and Overlap formation. Let Jk ⊂{1, 2, ..., B} and Jk+1 ⊂{1, 2, ..., B} be the set of indices of all nodes that returned a gradient at the k-th and k + 1-st iterations, respectively. Using this notation Sk = ∪j∈JkBj and Sk+1 = ∪j∈Jk+1Bj, and we define Ok = ∪j∈Jk∩Jk+1Bj. The simplest implementation in this setting preallocates the data on each compute node, requiring minimal data communication, i.e., only 4 one data transfer. In this case the samples Sk will be independent if node failures occur randomly. On the other hand, if the same set of nodes fail, then sample creation will be biased, which is harmful both in theory and practice. One way to ensure independent sampling is to shuffle and redistribute the data to all nodes after a certain number of iterations. Multi-batch Sampling. We propose two strategies for the multi-batch setting. Figure 1b illustrates the sample creation process in the first strategy. The dataset is shuffled and batches are generated by collecting subsets of the training set, in order. Every set (except S0) is of the form Sk = {Ok−1, Nk, Ok}, where Ok−1 and Ok are the overlapping samples with batches Sk−1 and Sk+1 respectively, and Nk are the samples that are unique to batch Sk. After each pass through the dataset, the samples are reshuffled, and the procedure described above is repeated. In our implementation samples are drawn without replacement, guaranteeing that after every pass (epoch) all samples are used. This strategy has the advantage that it requires no extra computation in the evaluation of gOk k and gOk k+1, but the samples {Sk} are not independent. The second sampling strategy is simpler and requires less control. At every iteration k, a batch Sk is created by randomly selecting |Sk| elements from {1, . . . n}. The overlapping set Ok is then formed by randomly selecting |Ok| elements from Sk (subsampling). This strategy is slightly more expensive since gOk k+1 requires extra computation, but if the overlap is small this cost is not significant. 3 Convergence Analysis In this section, we analyze the convergence properties of the multi-batch L-BFGS method (Algorithm 1) when applied to the minimization of strongly convex and nonconvex objective functions, using a fixed step length strategy. We assume that the goal is to minimize the empirical risk F given in (1.1), but note that a similar analysis could be used to study the minimization of the expected risk. 3.1 Strongly Convex case Due to the stochastic nature of the multi-batch approach, every iteration of Algorithm 1 employs a gradient that contains errors that do not converge to zero. Therefore, by using a fixed step length strategy one cannot establish convergence to the optimal solution w⋆, but only convergence to a neighborhood of w⋆[18]. Nevertheless, this result is of interest as it reflects the common practice of using a fixed step length and decreasing it only if the desired testing error has not been achieved. It also illustrates the tradeoffs that arise between the size of the batch and the step length. In our analysis, we make the following assumptions about the objective function and the algorithm. Assumptions A. 1. F is twice continuously differentiable. 2. There exist positive constants ˆλ and ˆΛ such that ˆλI ⪯∇2F O(w) ⪯ˆΛI for all w ∈Rd and all sets O ⊂{1, 2, . . . , n}. 3. There is a constant γ such that ES  ∥∇F S(w)∥ 2 ≤γ2 for all w ∈Rd and all sets S ⊂ {1, 2, . . . , n}. 4. The samples S are drawn independently and ∇F S(w) is an unbiased estimator of the true gradient ∇F(w) for all w ∈Rd, i.e., ES[∇F S(w)] = ∇F(w). Note that Assumption A.2 implies that the entire Hessian ∇2F(w) also satisfies λI ⪯∇2F(w) ⪯ΛI, ∀w ∈Rd, for some constants λ, Λ > 0. Assuming that every sub-sampled function F O(w) is strongly convex is not unreasonable as a regularization term is commonly added in practice when that is not the case. We begin by showing that the inverse Hessian approximations Hk generated by the multi-batch L-BFGS method have eigenvalues that are uniformly bounded above and away from zero. The proof technique used is an adaptation of that in [8]. Lemma 3.1. If Assumptions A.1-A.2 above hold, there exist constants 0 < µ1 ≤µ2 such that the Hessian approximations {Hk} generated by Algorithm 1 satisfy µ1I ⪯Hk ⪯µ2I, for k = 0, 1, 2, . . . 5 Utilizing Lemma 3.1, we show that the multi-batch L-BFGS method with a constant step length converges to a neighborhood of the optimal solution. Theorem 3.2. Suppose that Assumptions A.1-A.4 hold and let F ⋆= F(w⋆), where w⋆is the minimizer of F. Let {wk} be the iterates generated by Algorithm 1 with αk = α ∈(0, 1 2µ1λ), starting from w0. Then for all k ≥0, E[F(wk) −F ⋆] ≤(1 −2αµ1λ)k[F(w0) −F ⋆] + [1 −(1 −αµ1λ)k]αµ2 2γ2Λ 4µ1λ k→∞ −−−−→αµ2 2γ2Λ 4µ1λ . The bound provided by this theorem has two components: (i) a term decaying linearly to zero, and (ii) a term identifying the neighborhood of convergence. Note that a larger step length yields a more favorable constant in the linearly decaying term, at the cost of an increase in the size of the neighborhood of convergence. We will consider again these tradeoffs in Section 4, where we also note that larger batches increase the opportunities for parallelism and improve the limiting accuracy in the solution, but slow down the learning abilities of the algorithm. One can establish convergence of the multi-batch L-BFGS method to the optimal solution w⋆by employing a sequence of step lengths {αk} that converge to zero according to the schedule proposed by Robbins and Monro [23]. However, that provides only a sublinear rate of convergence, which is of little interest in our context where large batches are employed and some type of linear convergence is expected. In this light, Theorem 3.2 is more relevant to practice. 3.2 Nonconvex case The BFGS method is known to fail on noconvex problems [17, 10]. Even for L-BFGS, which makes only a finite number of updates at each iteration, one cannot guarantee that the Hessian approximations have eigenvalues that are uniformly bounded above and away from zero. To establish convergence of the BFGS method in the nonconvex case cautious updating procedures have been proposed [15]. Here we employ a cautious strategy that is well suited to our particular algorithm; we skip the update, i.e., set Hk+1 = Hk, if the curvature condition yT k sk ≥ϵ∥sk∥2 (3.5) is not satisfied, where ϵ > 0 is a predetermined constant. Using said mechanism we show that the eigenvalues of the Hessian matrix approximations generated by the multi-batch L-BFGS method are bounded above and away from zero (Lemma 3.3). The analysis presented in this section is based on the following assumptions. Assumptions B. 1. F is twice continuously differentiable. 2. The gradients of F are Λ-Lipschitz continuous, and the gradients of F O are ΛO-Lipschitz continuous for all w ∈Rd and all sets O ⊂{1, 2, . . . , n}. 3. The function F(w) is bounded below by a scalar bF . 4. There exist constants γ ≥0 and η > 0 such that ES  ∥∇F S(w)∥ 2 ≤γ2 + η∥∇F(w)∥2 for all w ∈Rd and all sets S ⊂{1, 2, . . . , n}. 5. The samples S are drawn independently and ∇F S(w) is an unbiased estimator of the true gradient ∇F(w) for all w ∈Rd, i.e., E[∇F S(w)] = ∇F(w). Lemma 3.3. Suppose that Assumptions B.1-B.2 hold and let ϵ > 0 be given. Let {Hk} be the Hessian approximations generated by Algorithm 1, with the modification that Hk+1 = Hk whenever (3.5) is not satisfied. Then, there exist constants 0 < µ1 ≤µ2 such that µ1I ⪯Hk ⪯µ2I, for k = 0, 1, 2, . . . We can now follow the analysis in [4, Chapter 4] to establish the following result about the behavior of the gradient norm for the multi-batch L-BFGS method with a cautious update strategy. Theorem 3.4. Suppose that Assumptions B.1-B.5 above hold, and let ϵ > 0 be given. Let {wk} be the iterates generated by Algorithm 1, with αk = α ∈(0, µ1 µ2 2ηΛ), starting from w0, and with the 6 modification that Hk+1 = Hk whenever (3.5) is not satisfied. Then, E h 1 L L−1 X k=0 ∥∇F(wk)∥2i ≤αµ2 2γ2Λ µ1 + 2[F(w0) −bF] αµ1L L→∞ −−−−→αµ2 2γ2Λ µ1 . This result bounds the average norm of the gradient of F after the first L −1 iterations, and shows that the iterates spend increasingly more time in regions where the objective function has a small gradient. 4 Numerical Results In this Section, we present numerical results that evaluate the proposed robust multi-batch L-BFGS scheme (Algorithm 1) on logistic regression problems. Figure 2 shows the performance on the webspam dataset1, where we compare it against three methods: (i) multi-batch L-BFGS without enforcing sample consistency (L-BFGS), where gradient differences are computed using different samples, i.e., yk = gSk+1 k+1 −gSk k ; (ii) multi-batch gradient descent (Gradient Descent), which is obtained by setting Hk = I in Algorithm 1; and, (iii) serial SGD, where at every iteration one sample is used to compute the gradient. We run each method with 10 different random seeds, and, where applicable, report results for different batch (r) and overlap (o) sizes. The proposed method is more stable than the standard L-BFGS method; this is especially noticeable when r is small. On the other hand, serial SGD achieves similar accuracy as the robust L-BFGS method and at a similar rate (e.g., r = 1%), at the cost of n communications per epochs versus 1 r(1−o) communications per epoch. Figure 2 also indicates that the robust L-BFGS method is not too sensitive to the size of overlap. Similar behavior was observed on other datasets, in regimes where r · o was not too small. We mention in passing that the L-BFGS step was computed using the a vector-free implementation proposed in [9]. 0 0.5 1 1.5 2 2.5 3 10 −4 10 −2 10 0 10 2 10 4 Epochs ∥∇F(w)∥ webspam α = 1 r= 1% K = 16 o=20% Robust L−BFGS L−BFGS Gradient Descent SGD 0 0.5 1 1.5 2 2.5 3 10 −4 10 −3 10 −2 10 −1 10 0 Epochs ∥∇F(w)∥ webspam α = 1 r= 5% K = 16 o=20% Robust L−BFGS L−BFGS Gradient Descent SGD 0 0.5 1 1.5 2 2.5 3 10 −4 10 −3 10 −2 10 −1 10 0 Epochs ∥∇F(w)∥ webspam α = 1 r= 10% K = 16 o=20% Robust L−BFGS L−BFGS Gradient Descent SGD 0 0.5 1 1.5 2 2.5 3 10 −4 10 −3 10 −2 10 −1 10 0 10 1 Epochs ∥∇F(w)∥ webspam α = 1 r= 1% K = 16 o=5% Robust L−BFGS L−BFGS Gradient Descent SGD 0 0.5 1 1.5 2 2.5 3 10 −4 10 −2 10 0 10 2 Epochs ∥∇F(w)∥ webspam α = 1 r= 1% K = 16 o=10% Robust L−BFGS L−BFGS Gradient Descent SGD 0 0.5 1 1.5 2 2.5 3 10 −4 10 −3 10 −2 10 −1 10 0 Epochs ∥∇F(w)∥ webspam α = 1 r= 1% K = 16 o=30% Robust L−BFGS L−BFGS Gradient Descent SGD Figure 2: webspam dataset. Comparison of Robust L-BFGS, L-BFGS (multi-batch L-BFGS without enforcing sample consistency), Gradient Descent (multi-batch Gradient method) and SGD for various batch (r) and overlap (o) sizes. Solid lines show average performance, and dashed lines show worst and best performance, over 10 runs (per algorithm). K = 16 MPI processes. We also explore the performance of the robust multi-batch L-BFGS method in the presence of node failures (faults), and compare it to the multi-batch variant that does not enforce sample consistency (L-BFGS). Figure 3 illustrates the performance of the methods on the webspam dataset, for various 1LIBSVM: https://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/binary.html. 7 probabilities of node failures p ∈{0.1, 0.3, 0.5}, and suggests that the robust L-BFGS variant is more stable. 0 50 100 150 200 250 300 10 −6 10 −4 10 −2 10 0 Iterations/Epochs ∥∇F(w)∥ webspam α = 0.1 p= 0.1 K = 16 Robust L−BFGS L−BFGS 0 50 100 150 200 250 300 10 −5 10 −4 10 −3 10 −2 10 −1 10 0 Iterations/Epochs ∥∇F(w)∥ webspam α = 0.1 p= 0.3 K = 16 Robust L−BFGS L−BFGS 0 50 100 150 200 250 300 10 −5 10 −4 10 −3 10 −2 10 −1 10 0 Iterations/Epochs ∥∇F(w)∥ webspam α = 0.1 p= 0.5 K = 16 Robust L−BFGS L−BFGS Figure 3: webspam dataset. Comparison of Robust L-BFGS and L-BFGS (multi-batch L-BFGS without enforcing sample consistency), for various node failure probabilities p. Solid lines show average performance, and dashed lines show worst and best performance, over 10 runs (per algorithm). K = 16 MPI processes. Lastly, we study the strong and weak scaling properties of the robust L-BFGS method on artificial data (Figure 4). We measure the time needed to compute a gradient (Gradient) and the associated communication (Gradient+C), as well as, the time needed to compute the L-BFGS direction (LBFGS) and the associated communication (L-BFGS+C), for various batch sizes (r). The figure on the left shows strong scaling of multi-batch LBFGS on a d = 104 dimensional problem with n = 107 samples. The size of input data is 24GB, and we vary the number of MPI processes, K ∈{1, 2, . . . , 128}. The time it takes to compute the gradient decreases with K, however, for small values of r, the communication time exceeds the compute time. The figure on the right shows weak scaling on a problem of similar size, but with varying sparsity. Each sample has 10 · K non-zero elements, thus for any K the size of local problem is roughly 1.5GB (for K = 128 size of data 192GB). We observe almost constant time for the gradient computation while the cost of computing the L-BFGS direction decreases with K; however, if communication is considered, the overall time needed to compute the L-BFGS direction increases slightly. 10 1 10 2 10 −6 10 −4 10 −2 10 0 r = 0.04% Number of MPI processes − K Elapsed Time [s] Strong Scaling r = 0.08% r = 0.16% r = 0.32% r = 0.63% r = 1.25% r = 2.50% r = 5.00% r = 10.00% Gradient Gradient+C L−BFGS L−BFGS+C 10 1 10 2 10 −6 10 −5 10 −4 10 −3 10 −2 10 −1 r = 0.04% Number of MPI processes − K Elapsed Time [s] Weak Scaling − Fix problem dimensions r = 0.08% r = 0.16% r = 0.32% r = 0.63% r = 1.25% r = 2.50% r = 5.00% r = 10.00% Gradient Gradient+C L−BFGS L−BFGS+C Figure 4: Strong and weak scaling of multi-batch L-BFGS method. 5 Conclusion This paper describes a novel variant of the L-BFGS method that is robust and efficient in two settings. The first occurs in the presence of node failures in a distributed computing implementation; the second arises when one wishes to employ a different batch at each iteration in order to accelerate learning. The proposed method avoids the pitfalls of using inconsistent gradient differences by performing quasi-Newton updating based on the overlap between consecutive samples. Numerical results show that the method is efficient in practice, and a convergence analysis illustrates its theoretical properties. Acknowledgements The first two authors were supported by the Office of Naval Research award N000141410313, the Department of Energy grant DE-FG02-87ER25047 and the National Science Foundation grant DMS-1620022. Martin Takáˇc was supported by National Science Foundation grant CCF-1618717. 8 References [1] A. Agarwal, O. Chapelle, M. Dudík, and J. Langford. A reliable effective terascale linear learning system. The Journal of Machine Learning Research, 15(1):1111–1133, 2014. [2] D. P. Bertsekas and J. N. Tsitsiklis. Parallel and Distributed Computation: Numerical Methods, volume 23. Prentice hall Englewood Cliffs, NJ, 1989. [3] R. Bollapragada, R. Byrd, and J. Nocedal. Exact and inexact subsampled newton methods for optimization. arXiv preprint arXiv:1609.08502, 2016. [4] L. Bottou, F. E. Curtis, and J. Nocedal. Optimization methods for large-scale machine learning. arXiv preprint arXiv:1606.04838, 2016. [5] L. Bottou and Y. LeCun. Large scale online learning. In NIPS, pages 217–224, 2004. [6] O. Bousquet and L. Bottou. The tradeoffs of large scale learning. In NIPS, pages 161–168, 2008. [7] R. H. Byrd, G. M. Chin, W. Neveitt, and J. Nocedal. On the use of stochastic Hessian information in optimization methods for machine learning. SIAM Journal on Optimization, 21(3):977–995, 2011. [8] R. H. Byrd, S. L. Hansen, J. Nocedal, and Y. Singer. A stochastic quasi-newton method for large-scale optimization. SIAM Journal on Optimization, 26(2):1008–1031, 2016. [9] W. Chen, Z. Wang, and J. Zhou. Large-scale L-BFGS using MapReduce. In NIPS, pages 1332–1340, 2014. [10] Y.-H. Dai. Convergence properties of the BFGS algoritm. SIAM Journal on Optimization, 13(3):693–701, 2002. [11] J. Dean, G. Corrado, R. Monga, K. Chen, M. Devin, M. Mao, A. Senior, P. Tucker, K. Yang, Q. V. Le, et al. Large scale distributed deep networks. In NIPS, pages 1223–1231, 2012. [12] A. Defazio, F. Bach, and S. Lacoste-Julien. SAGA: A fast incremental gradient method with support for non-strongly convex composite objectives. In NIPS, pages 1646–1654, 2014. [13] I. Goodfellow, Y. Bengio, and A. Courville. Deep learning. Book in preparation for MIT Press, 2016. [14] R. Johnson and T. Zhang. Accelerating stochastic gradient descent using predictive variance reduction. In NIPS, pages 315–323, 2013. [15] D.-H. Li and M. Fukushima. On the global convergence of the BFGS method for nonconvex unconstrained optimization problems. SIAM Journal on Optimization, 11(4):1054–1064, 2001. [16] H. Mania, X. Pan, D. Papailiopoulos, B. Recht, K. Ramchandran, and M. I. Jordan. Perturbed iterate analysis for asynchronous stochastic optimization. arXiv preprint arXiv:1507.06970, 2015. [17] W. F. Mascarenhas. The BFGS method with exact line searches fails for non-convex objective functions. Mathematical Programming, 99(1):49–61, 2004. [18] A. Nedi´c and D. Bertsekas. Convergence rate of incremental subgradient algorithms. In Stochastic Optimization: Algorithms and Applications, pages 223–264. Springer, 2001. [19] J. Ngiam, A. Coates, A. Lahiri, B. Prochnow, Q. V. Le, and A. Y. Ng. On optimization methods for deep learning. In ICML, pages 265–272, 2011. [20] J. Nocedal and S. Wright. Numerical Optimization. Springer New York, 2 edition, 1999. [21] M. J. Powell. Some global convergence properties of a variable metric algorithm for minimization without exact line searches. Nonlinear programming, 9(1):53–72, 1976. [22] B. Recht, C. Re, S. Wright, and F. Niu. HOGWILD!: A lock-free approach to parallelizing stochastic gradient descent. In NIPS, pages 693–701, 2011. [23] H. Robbins and S. Monro. A stochastic approximation method. The Annals of Mathematical Statistics, pages 400–407, 1951. [24] M. Schmidt, N. Le Roux, and F. Bach. Minimizing finite sums with the stochastic average gradient. Mathematical Programming, page 1–30, 2016. [25] N. N. Schraudolph, J. Yu, and S. Günter. A stochastic quasi-Newton method for online convex optimization. In AISTATS, pages 436–443, 2007. [26] M. Takáˇc, A. Bijral, P. Richtárik, and N. Srebro. Mini-batch primal and dual methods for SVMs. In ICML, pages 1022–1030, 2013. [27] Y. Zhang and X. Lin. DiSCO: Distributed optimization for self-concordant empirical loss. In ICML, pages 362–370, 2015. 9
2016
331
6,252
Cooperative Graphical Models Josip Djolonga Dept. of Computer Science, ETH Z¨urich josipd@inf.ethz.ch Stefanie Jegelka CSAIL, MIT stefje@mit.edu Sebastian Tschiatschek Dept. of Computer Science, ETH Z¨urich stschia@inf.ethz.ch Andreas Krause Dept. of Computer Science, ETH Z¨urich krausea@inf.ethz.ch Abstract We study a rich family of distributions that capture variable interactions significantly more expressive than those representable with low-treewidth or pairwise graphical models, or log-supermodular models. We call these cooperative graphical models. Yet, this family retains structure, which we carefully exploit for efficient inference techniques. Our algorithms combine the polyhedral structure of submodular functions in new ways with variational inference methods to obtain both lower and upper bounds on the partition function. While our fully convex upper bound is minimized as an SDP or via tree-reweighted belief propagation, our lower bound is tightened via belief propagation or mean-field algorithms. The resulting algorithms are easy to implement and, as our experiments show, effectively obtain good bounds and marginals for synthetic and real-world examples. 1 Introduction X1,1 X1,2 X1,3 X1,4 X2,1 X2,2 X2,3 X2,4 X3,1 X3,2 X3,3 X3,4 Figure 1: Example cooperative model. Edge colors indicate the edge cluster. Dotted edges are cut under the current assignment. Probabilistic inference in high-order discrete graphical models has been an ongoing computational challenge, and all existing methods rely on exploiting specific structure: either low-treewidth or pairwise graphical models, or functional properties of the distribution such as log-submodularity. Here, we aim to compute approximate marginal probabilities in complex models with long-range variable interactions that do not possess any of these properties. Instead, we exploit a combination of structural and functional properties in new ways. The classical example of image segmentation may serve to motivate our family of models: we would like to estimate a posterior marginal distribution over k labels for each pixel in an image. A common approach uses Conditional Random Fields on a pixel neighborhood graph with pairwise potentials that encourage neighboring pixels to take on the same label. From the perspective of the graph, this model prefers configurations with few edges cut, where an edge is said to be cut if its endpoints have different labels. Such cut-based models, however, short-cut elongated structures (e.g. tree branches), a problem known as shrinking bias. Jegelka and Bilmes [1] hence replace the bias towards short cuts (boundaries) by a bias towards configurations with certain higher-order structure: the cut edges occur at similar-looking pixel pairs. They group the graph edges into clusters (based on, say, color gradients across the endpoints), observing that the true object boundary is captured by few of these clusters. To encourage cutting edges from few clusters, the cost of cutting an edge decreases as more edges in its cluster are cut. In short, the edges “cooperate”. In Figure 1, each pixel takes on one of two labels (colors), and cut 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. edges are indicated by dotted lines. The current configuration cuts three red edges and one blue edge, and has lower probability than the configuration that swaps X3,1 to gray, cutting only red edges. Such a model can be implemented by an energy (cost) h(#red edges cut) + h(#blue edges cut), where e.g. h(u) = √u. Similar cooperative models can express a preference for shapes [2]. While being expressive, such models are computationally very challenging: the nonlinear function on pairs of variables (edges) is equivalent to a graphical model of extremely high order (up to the number of variables). Previous work hence addressed only MAP inference [3, 4]; the computation of marginals and partition functions was left as an open problem. In this paper, we close this gap, even for a larger family of models. We address models, which we call cooperative graphical models, that are specified by an undirected graph G = (V, E): each node i ∈V is associated with a random variable Xi that takes values in X = {1, 2, . . . , k}. To each vertex i ∈V and edge {i, j}, we attach a potential function θi : X →R and θi,j : X 2 →R, respectively. Our distribution is then P(x) = 1 Z exp  −  X i∈V θi(xi) + X {i,j}∈E θi,j(xi, xj) + f(y(x))  ν(x), (1) where we call y: X n →{0, 1}E the disagreement variable1, defined as yi,j = Jxi ̸= xjK. The term ν : X n →R≥0 is the base-measure and allows to encode constraints, e.g., conditioning on some variables. With f ≡0 we obtain a Markov random field. Probabilistic inference in our model class (1) is very challenging, since we make no factorization assumption about f. One solution would be to encode P(x) as a log-linear model via a new variable z ∈{0, 1}E and constraints ν(x, z) = Jy(x) = zK, but this in general requires computing exponential-sized sufficient statistics from z. In contrast, we make one additional key assumption that will enable the development of efficiently computable variational lower and upper bounds: we henceforth assume that f : {0, 1}E →R is submodular, i.e., it satisfies f(min(y, y′)) + f(max(y, y′)) ≤f(y) + f(y′) for all y, y′ ∈{0, 1}E, where the min and max operations are taken element-wise. For example, the pairwise potentials θi,j are submodular if θi,j(0, 0) + θi,j(1, 1) ≤θi,j(0, 1) + θi,j(1, 0). In our introductory example, f is submodular if h is concave. As opposed to [3], we do not assume that f is monotone increasing. Importantly, even if f is submodular, P(x) neither has low treewdith, nor is its logarithm sub- or supermodular in x, properties that have commonly been exploited for inference. Contributions. We make the following contributions: (1) We introduce a new family of probabilistic models that can capture rich non-submodular interactions, while still admitting efficient inference. This family includes pairwise and certain higher-order graphical models, cooperative cuts [1], and other, new models. We develop new inference methods for these models; in particular, (2) upper bounds that are amenable to convex optimization, and (3) lower bounds that we optimize with traditional variational methods. Finally, we demonstrate the efficacy of our methods empirically. 1.1 Related work Maximum-a-posteriori (MAP). Computing the mode of (1) for binary models is also known as the cooperative cut problem, and has been analyzed for the case when both the pairwise interactions θi,j are submodular and f is monotone [1]. While the general problem is NP-hard, it can be solved if f is defined by a piecewise linear concave function [4]. Variational inference. Since computing marginal probabilities for (1) is #P-hard even for pairwise models (when f ≡0) [5, 6], we revert to approximate inference. Variational inference methods for discrete pairwise models have been studied extensively; a comprehensive overview may be found in [7]. We will build on a selection of techniques that we discuss in the next section. Most existing methods focus on pairwise models (f ≡0), and many scale exponentially with the size of the largest factor, which is infeasible for our cooperative models. Some specialized tractable inference methods exist for higher-order models [8, 9], but they do not apply to our family of models (1). 1The results presented in this paper can be easily extended to arbitrary binary-valued functions y(x). 2 Log-supermodular models. A related class of relatively tractable models are distributions P(x) = 1 Z exp(−g(x)) for some submodular function g; Djolonga and Krause [10] showed variational inference methods for those models. However, our models are not log-supermodular. While [10] also obtain upper and lower bounds, we need different optimization techniques, and also different polytopes. In fact, submodular and multi-class submodular [11] settings are a strict subset of ours: the function g(x) can be expressed via an auxiliary variable z ∈{0, 1} that is fixed to zero using ν(x, z) = Jz = 0K. We then set f(y(x, z)) = g(x1 ̸= z, x2 ̸= z, . . . , xn ̸= z). 2 Notation and Background Throughout this paper, we have n variables in a graph of m edges, and the potentials θi and θi,j are stored in a vector θ. The characteristic vector (or indicator vector) 1A of a set A is the binary vector which contains 1 in the positions corresponding to elements in A, and zeros elsewhere. Moreover, the vector of all ones is 1, and the neighbours of i ∈V are denoted by δ(i) ⊆V . Submodularity. We assume that f in Eqn. (1) is submodular. Occasionally (in Sec. 4 and 5, where stated), we assume that f is monotone: for any y and y′ in {0, 1}E such that y ≤y′ coordinate-wise, it holds that f(y) ≤f(y′). When defining the inference schemes, we make use of two polytopes associated with f. First, the base polytope of a submodular function f is B(f) = {g ∈Rm | ∀y ∈{0, 1}E : gT y ≤f(y)} ∩{g ∈Rm | gT 1 = f(1)}. Although B(f) is defined by exponentially many inequalities, an influential result [12] states that it is tractable: we can optimize linear functions over B(f) in time O(m log m + mF), where F is the time complexity of evaluating f. This algorithm is part of our scheme in Figure 2. Moreover, as a result of this (linear) tractability, it is possible to compute orthogonal projections onto B(f). Projection is equivalent to the minimum norm point problem [13]. While the general projection problem has a high degree polynomial time complexity, there are many very commonly used models that admit practically fast projections [14, 15, 16]. The second polytope is the upper submodular polyhedron of f [17], defined as U(f) = {(g, c) ∈Rm+1 | ∀y ∈{0, 1}E : gT y + c ≥f(y)}. Unfortunately, U(f) is not as tractable as B(f): even checking membership in U(f) is hard [17]. However, we can still succinctly describe specific elements of U(f). In §4, we show how to efficiently optimize over those elements. Variational inference. We briefly summarize key results for variational inference for pairwise models, following Wainwright and Jordan [7]. We write pairwise models as2 P(x) = exp  −  X i∈V θi(xi) + X {i,j}∈E (gi,jJxi ̸= xjK + θi,j(xi, xj)  −A(g)  ν(x), where g ∈RE is an arbitrary vector and A(g) is the log-partition function. For any choice of parameters (θ, g), there is a resulting vector of marginals µ ∈[0, 1]k|V |+k2|E|. Specifically, for every i ∈V , µ has k elements µi,xi = P(Xi = xi), one for each xi ∈X. Similarly, for each {i, j} ∈E, there are k2 elements µij,xixj so that µij,xixj = P(Xi = xi, Xj = xj). The marginal polytope M is now the set of all such vectors µ that are realizable under some distribution P(x), and the partition function can equally be expressed in terms of the marginals [7]: A(g) = sup µ∈M  − X i∈V,xi µi,xiθi(xi) − X {i,j}∈E X xi,xj µij,xixjθi,j(xi, xj) −∆(µ)T g   | {z } ⟨stack(θ,g),µ⟩ + H(µ), (2) where H(µ) is the entropy of the distribution, ∆(µ) is the vector of disagreement probabilities with entries ∆(µ)i,j = P xi̸=xj µij,xixj, and stack(θ, g) adds the elements of θ and g into a single 2This formulation is slightly nonstandard, but will be very useful for the subsequent discussion in §3. 3 vector so that the sum can be written as an inner product. Alas, neither M nor H(µ) have succinct descriptions and we will have to approximate them. Because the vectors in the approximation of M are in general not correct marginals, they are called pseudo-marginals and will be denoted by τ instead of µ. Different approximations of M and H yield various methods, e.g. mean-field [7], the semidefinite programming (SDP) relaxation of Wainwright and Jordan [18], tree-reweighted belief propagation (TRWBP) [19], or the family of weighted entropies [20, 21]. Due to the space constraints, we only discuss the latter. They approximate M with the local polytope L = {τ ≥0 | (∀i ∈V ) X xi τi,xi = 1 and (∀j ∈δ(i)) τi,xi = X xj τij,xixj}. The approximations H to the entropy H are parametrized by one weight ρi,j per edge and one ρi per vertex i, all collected in a vector ρ ∈R|V |+|E|. Then, they take the following form H(τ, ρ) = X i∈V ρiHi(τ i)+ X {i,j}∈E ρi,jHi,j(τ i,j), where Hi(τ i) = −P xi τi,xi log τi,xi, and Hi,j(τ i,j) = −P xi,xj τij,xijxj log τij,xixj. The most prominent example is traditional belief propagation, i.e., using the Bethe entropy, which sets ρe = 1 for all e ∈E, and assigns to each vertex i ∈V a weight of ρi = 1 −|δ(i)|. 3 Convex upper bounds The above variational methods do not directly generalize to our cooperative models: the vectors of marginals could be exponentially large. Hence, we derive a different approach that relies on the submodularity of f. Our first step is to approximate f(y(x)) by a linear lower bound, f(y(x)) ≈ gT y(x), so that the resulting (pairwise) linearized model will have a partition function upper bounding that of the original model. Ensuring that g indeed remains a lower bound means to satisfy an exponential number of constraints f(y(x)) ≥gT y(x), one for each x ∈{0, 1}n. While this is hard in general, the submodularity of f implies that these constraints are easily satisfied if g ∈B(f), a very tractable constraint. For g ∈B(f), we have log Z = log X x∈{0,1}V exp −( X i∈V X xi θi(xi) + X {i,j}∈E θi,j(xi, xj) + f(y(x)))  ≤log X x∈{0,1}V exp −( X i∈V X xi θi(xi) + X {i,j}∈E (θi,j(xi, xj) + gi,jJxi ̸= xjK))  ≡A(g). Unfortunately, A(g) is still very hard to compute and we need to approximate it. If we use an approximation A(g) that upper bounds A(g), then the above inequality will still hold when we replace A by A. Such approximations can be obtained by relaxing the marginal polytope M to an outer bound M ⊇M, and using a concave entropy surrogate H that upper bounds the true entropy H. TRWBP [19] or the SDP formulation [18] implement this approach. Our central optimization problem is now to find the tightest upper bound, an optimization problem3 in g: minimize g∈B(f) sup τ∈M ⟨stack(θ, g), τ⟩+ H(τ). (3) Because the inner problem is linear in g, this is a convex optimization problem over the base polytope. To obtain the gradient with respect to g (equal to the negative disagreement probabilities −∆(τ)), we have to solve the inner problem. This subproblem corresponds to performing variational inference in a pairwise model, e.g. via TRWBP or an SDP. The optimization properties of the problem (3) depend on its Lipschitz continuity of the gradients (smoothness). Informally, the inferred pseudomarginals should not drastically change if we perturb the linearization g. The formal condition is that there exists some σ > 0 so that ∥∆(τ) −∆(τ ′)∥≤σ∥τ −τ ′∥for all τ, τ ′ ∈M. We discuss below when this condition holds. Before that, we discuss two different algorithms for solving problem (3), and how their convergence depends on σ. 3If we compute the Fenchel dual, we obtain a special case of the problem considered in [22] with the Lov´asz extension acting as a non-smooth non-local energy function (in the terminology introduced therein). 4 Frank-Wolfe. Given that we can efficiently solve linear programs over B(f), the Frank-Wolfe [23] algorithm is a natural candidate for solving the problem. We present it in Figure 2. It iteratively moves towards the minimizer of a linearization of the objective around the current iterate. The method has a convergence rate of O(σ/t) [24], where σ is the assumed smoothness parameter. One can either use a fixed step size γ = 2/(t + 2), or determine it using line search. In each iteration, the algorithm calls the procedure LINEAR-ORACLE, which finds the vector s ∈B(f) that minimizes the linearization of the objective function in (3) over the base polytope B(f). The linearization is given by the (approximate) gradient ∆(τ), determined by the computed approximate marginals τ. When taking a step towards s, the weight of edge ei is changed by sei = f({e1, e2, . . . , ei}) − f({e1, e2, . . . , ei−1}). Due to the submodularity4 of f, an edge will obtain a higher weight if it appears earlier in the order determined by the disagreement probabilities ∆(τ). Hence, in every iteration, the algorithm will re-adjusts the pairwise potentials, by encouraging the variables to agree more as a function of their (approximate) disagreement probability. 1: procedure FW-INFERENCE(f, θ) 2: g ←LINEAR-ORACLE(f, 0) 3: for t = 0, 1, . . . , max steps do 4: τ ←VAR-INFERENCE(θ, g) 5: s ←LINEAR-ORACLE(f, τ) 6: γ ←COMPUTE-STEP-SIZE(g, s) 7: g ←(1 −γ)g + γs 8: return τ, ˆA 1: procedure LINEAR-ORACLE(f, τ) 2: Let e1, e2, . . . , e|E| be the edges E sorted so that ∆(τ)e1 ≥∆(τ)e2 ≥. . . ≥∆(τ)e|E| 3: for i = 0, 1, . . . , |E| do 4: f−i ←f({e1, e2, . . . , ei−1}) 5: f+i ←f({e1, e2, . . . , ei}) 6: sei ←f+i −f−i 7: return s Figure 2: Inference with Frank-Wolfe, assuming that VAR-INFERENCE guarantees an upper bound. Projected gradient descent (PGD). Since it is possible to compute projections onto B(f), and practically so for many submodular functions f, we can alternatively use projected gradient or subgradient descent (PGD). Without smoothness, PGD converges at a rate of O(1/ √ t). If the objective is smooth, we can use an accelerated methods like FISTA [25], which has both a much better O(σ/t2) rate and seems to converge faster than many Frank-Wolfe variants in our experiments. Smoothness and convergence. The final question that remains to be answered is under which conditions problem (3) is smooth (the proof can be found in the appendix). Theorem 1 Problem (3) is k2σ-smooth over B(f) if the entropy surrogate −H is 1 σ-strongly convex. This result follows from the duality between smoothness and strong convexity for convex conjugates, see e.g. [26]. It implies that the convergence rates of the proposed algorithms depend on the strong convexity of the entropy approximation −H. The benefits of strongly convex entropy approximations are known. For instance, the tree-reweighted entropy approximation is strongly convex with a modulus σ depending on the size of the graph; similarly, the SDP relaxation is strongly convex [27]. London et al. [28] provide an even sharper bound for the tree reweighted entropy, and show how one can strong-convexify any weighted entropy by solving a QP over the weights ρ. In practice, because the inner problem is typically solved using an iterative algorithm and because the problem is smooth, we obtain speedups by warm-starting the solver with the solution at the previous iterate. We can moreover easily obtain duality certificates using the results in [24]. Joint optimization. When using weighted entropy approximations, it makes sense to optimize over both the linearization g and the weights ρ jointly. Specifically, let T be some set of weights that yield an entropy approximation H that upper bounds H. Then, if we expand H in problem (3), we obtain minimize g∈B(f),ρ∈T sup τ∈L ⟨stack(θ, g), τ⟩+ X i∈V ρiHi(τ i) + X {i,j}∈E ρi,jHi,j(τ i,j). Note that inside the supremum, both g and ρ appear only linearly, and there is no summand that has terms from both of them. Thus, the problem is convex in (g, ρ), and we can optimize jointly over 4This is also known as the diminishing returns property. 5 both variables. As a final remark, if we already perform inference in a pairwise model and repeatedly tighten the approximation by optimizing over ρ via Frank-Wolfe (as suggested in [19]), then the complexity per iteration remains the same even if we use the higher-order term f. 4 Submodular lower bounds While we just derived variational upper bounds, we next develop lower bounds on the partition function. Specifically, analogously to the linearization for the upper bound, if we pick an element (g, c) of U(f), the partition function of the resulting pairwise approximation always lower bounds the partition function of (1). Formally, log Z ≥log X x∈{0,1}V exp −(aT x + X {i,j}∈E θij,xixj + X {i,j}∈E gi,jJxi ̸= xjK + c)  = A(g) −c. As before, after plugging in a lower bound estimate of A, we obtain a variational lower bound over the partition function, which takes the form log Z ≥ sup (g,c)∈U(f),τ∈M −c + ⟨stack(θ, g), τ⟩+ H(τ), (4) for any pair of approximations of M and H that guarantee a lower bound of the pairwise model. We propose to optimize this lower bound in a block-coordinate-wise manner: first with respect to the pseudo-marginals τ (which amounts to approximate inference in the linearized model), and then with respect to the supergradient (g, c) ∈U(f). As already noted, this step is in general intractable. However, it is well-known [29] that for any Y ⊆E we can construct a point (so called bar supergradient) in U(f) as follows. First, define the vectors ai,j = f(1{i,j}) and bi,j = f(1)−f(1−1{i,j}). Then, the vector (g, c) with g = b⊙1Y +(1−1Y )⊙a and c = f(Y )−bT 1Y belongs to U(f), where ⊙denotes element-wise multiplication. Theorem 2 Optimizing problem (4) for a fixed τ over all bar supergradients is equal to the following submodular minimization problem minY ⊆E f(Y ) + ∆(τ) ⊙(b −a) −b T 1Y . In contrast to computing the MAP, the above problem has no constraints and can be easily solved using existing algorithms. As the approximation algorithm for the linearized pairwise model, one can always use mean-field [7]. Moreover, if (i) the problem is binary with submodular pairwise potentials θi,j and (ii) f is monotone, we can also use belief propagation. This is an implication of the result of Ruozzi [30], who shows that traditional belief-propagation yields a lower bound on the partition function for binary pairwise log-supermodular models. It is easy to see that the above conditions are sufficient for the log-supermodularity of the linearized model, as g ≥0 when f is monotone (because both a and b have non-negative components). Moreover, in this setting both the mean-field and belief propagation objectives (i.e. computing τ) can be cast as an instance of continuous submodular minimization (see e.g. [31]), which means that they can be solved to arbitrary precision in polynomial time. Unfortunately, problem (4) will not be jointly submodular, so we still need to use the block-coordinate ascent method we have just outlined. 5 Approximate inference via MAP perturbations For binary models with submodular pairwise potentials and monotone f we can (approximately) solve the MAP problem using the techniques in [1, 4]. Hence, this opens as an alternative approach the perturb-and-MAP method of Papandreou and Yuille [32]. This method relies on a set of tractable first order perturbations: For any i ∈V define θ′ i(xi) = θi(xi) −ηi,xi, where η = (ηi,xi)i∈V,xi∈X are a set of independently drawn Gumbel random variables. The optimizer argminxGη(x) of the perturbed model energy Gη(x) = P i∈V θ′ i(xi) + P {i,j}∈E θi,j(xi, xj) + f(y(x)) is then a sample from (an approximation to) the true distribution. If this MAP problem can be solved exactly (which is not always the case here), then it is possible to obtain an upper bound on the partition function [33]. 6 Experiments Synthetic experiments. Our first set of experiments uses a complete graph on n variables. The unary potentials were sampled as θi(xi) ∼Uniform(−α, α). The edges E were randomly split 6 into five disjoint buckets E1, E2, . . . , E5, and we used f(y) = P5 j=1 hj(yEj), where yEi are the coordinates of y corresponding to that group, and the functions {hj} will be defined below. To perform inference in the linearized pairwise models, we used: trwbp, jtree+ (exact inference, upper bound), jtree- (same, lower bound), sdp (SDP), mf (mean-field), bp (belief propagation), pmap (perturb-and-MAP with approximate MAP) and epmap (perturb-and-MAP with exact MAP). We used libDAI [34] and implemented sdp using cvxpy [35] and SCS [36]. As a maxflow solver we used [37]. Errors bars denote three standard errors. Figure 3 shows the results for hi(yEi) = wi qP e∈Ei ye/ p |Ei|, with weights wi ∼Uniform(0, β). In panel (c) we use mixed (attractive and repulsive) pairwise potentials, chosen as θi,j(xi, xj) = wi,jJxi ̸= xjK, where wi,j ∼Uniform(−β, β). First, the results imply that the methods optimizing the fully convex upper bound yield very good marginal probabilities over a large set of parameter configurations. The estimate of the log-partition function from trwbp is also very good, while sdp is much worse, which we believe can be attributed to the very loose entropy bound used in the relaxation. The lower bounds (bp and mf) work well for settings when the pairwise strength β is small compared to the unary strength α. Otherwise, both the bound and the marginals become worse, while jtreestill performs very well. This could be explained by the hardness of the pairwise models obtained after linearizing f. Finally, pmap (when applicable) seems very promising for small β. To better understand the regimes when one should use trwbp or pmap, we compare their marginal errors in Figure 5. We see that for most parameter configurations, trwbp performs better, and significantly so when the edge interactions are strong. Finally, we evaluate the effects of the approximate MAP solver for pmap in Figure 4. To be able to solve the MAP problem exactly (see [4]), we used h(yEj) = max{P e∈Ej yeve, P e∈Ej ve/2}, where ve ∼Uniform(0, β). As evident from the figure, the gains from the exact solver seem minimal, and it seems that solving the MAP problem approximately does not strongly affect the results. An example from computer vision. To demonstrate the scalability of our method and obtain a better qualitative understanding of the resulting marginals, we ran trwbp and pmap on a real world image segmentation task. We use the same setting, data and models as [1], as implemented in the pycoop5 package. Because libDAI was too slow, we wrote our own TRWBP implementation. Figure 6 shows the results for two specific images (size 305 × 398 and 214 × 320). The example in the first row is particularly difficult for pairwise models, but the rich higher-order model has no problem capturing the details even in the challenging shaded regions of the image. The second row shows results for two different model parameters. The second model uses a function f that is closer to being linear, while the first one is more curved (see the appendix for details). We observe that trwbp requires lower temperature parameters (i.e. relatively larger functions θi, θi,j and f) than pmap, and that the bottleneck of the complete inference procedure is running the trwbp updates. In other words, the added complexity from our method is minimal and the runtime is dominated by the message passing updates of TRWBP. Hence, any algorithms that speed up TRWBP (e.g., by parallelization or better message scheduling) will result in a direct improvement on the proposed inference procedure. 7 Conclusion We developed new inference techniques for a new broad family of discrete probabilistic models by exploiting the (indirect) submodularity in the model, and carefully combining it with ideas from classical variational inference in graphical models. The result are inference schemes that optimize rigorous bounds on the partition function. For example, our upper bounds lead to convex variational inference problems. Our experiments indicate the scalability, efficacy and quality of these schemes. Acknowledgements. This research was supported in part by SNSF grant CRSII2 147633, ERC StG 307036, a Microsoft Research Faculty Fellowship, a Google European Doctoral Fellowship, and NSF CAREER 1553284. References [1] S. Jegelka and J. Bilmes. “Submodularity beyond submodular energies: coupling edges in graph cuts”. CVPR. 2011. 5https://github.com/shelhamer/coop-cut. 7 −0.1 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 Mean absolute error in marginals bp jtree+ jtreemf pmap sdp trwbp 10−1 100 101 102 Pairwise strength β −8 −6 −4 −2 0 2 4 6 Error in the estimate log ˆZ −log Z (a) α = 2, binary, K15 0.00 0.02 0.04 0.06 0.08 0.10 0.12 0.14 Mean absolute error in marginals bp jtree+ jtreemf pmap sdp trwbp 10−1 100 101 102 Pairwise strength β −6 −4 −2 0 2 4 6 Error in the estimate log ˆZ −log Z (b) α = 0.1, binary, K15 −0.1 0.0 0.1 0.2 0.3 0.4 0.5 Absolute mean error in marginals jtree+ jtreemf trwbp 10−1 100 101 102 Pairwise strength β −8 −6 −4 −2 0 2 4 Error in the estimate log ˆZ −log Z (c) α = 0.1, mixed, 4 labels, K10 Figure 3: Results on several synthetic models. The methods that optimize the convex upper bound (trwbp, sdp) obtain very good marginals for a large set of parameter settings. Those maximizing the lower bound (bp, mf) fail when there is strong coupling between the edges. In the strong coupling regime the results of pmap also deteriorate, but not as strongly. In (c) bp, pmap, sdp are not applicable. 10−1 100 101 102 0.0 0.2 0.4 0.6 0.8 Mean absolute error in marginals bp epmap jtree+ jtreemf pmap sdp trwbp 10−1 100 101 102 Pairwise strength β −6 −4 −2 0 2 4 6 8 Error in the estimate log ˆZ −log Z Figure 4: α = 2, K15, model where epmap is applicable. Solving the MAP problem exactly only marginally improves over pmap. The other observations are similar to those in Fig. 3b. 0.1 0.5 1.0 2.0 4.0 8.0 16.0 32.0 64.0 Pairwise strength β 16.0 8.0 4.0 2.0 1.0 0.5 0.1 Unary strength α 0.002 0.0021 0.0014 0.091 0.26 0.034 0.0036 0.0023 0.058 0.24 0.069 0.0056 0.0012 -0.0052 -0.013 0.16 0.12 0.1 0.073 0.0088 -0.0011 -0.015 -0.032 0.057 0.086 0.15 0.2 0.12 0.01 -0.0095-0.0095 0.097 0.2 0.2 0.068 0.0099 0.0072 0.0046 0.085 0.17 0.12 0.012 0.012 0.011 0.0087 0.019 0.037 -0.049 -0.23 Figure 5: errorpmap - errortrwbp on K15. Missing entries were not significant at the 0.05 level. (a) Original image (b) trwbp, pairwise (c) pmap, pairwise (d) trwbp, coop. (e) pmap, coop. (f) Original image (g) trwbp, model 1 (h) pmap, model 1 (i) trwbp, model 2 (j) pmap, model 2 Figure 6: Inferred marginals on an image segmentation task. The first row showcases an example that is particularly hard for pairwise models. In the second row we show the results for two different models (the cooperative function f is more curved for model 1). 8 [2] N. Silberman, L. Shapira, R. Gal, and P. Kohli. “A Contour Completion Model for Augmenting Surface Reconstructions”. ECCV. 2014. [3] S. Jegelka and J. Bilmes. “Approximation Bounds for Inference using Cooperative Cuts”. ICML. 2011. [4] P. Kohli, A. Osokin, and S. Jegelka. “A principled deep random field model for image segmentation”. CVPR. 2013. [5] M. Jerrum and A. Sinclair. “Polynomial-time approximation algorithms for the Ising model”. SIAM Journal on computing 22.5 (1993), pp. 1087–1116. [6] L. A. Goldberg and M. Jerrum. “The complexity of ferromagnetic Ising with local fields”. Combinatorics, Probability and Computing 16.01 (2007), pp. 43–61. [7] M. J. Wainwright and M. I. Jordan. “Graphical models, exponential families, and variational inference”. Foundations and Trends R⃝in Machine Learning 1.1-2 (2008). [8] D. Tarlow, K. Swersky, R. S. Zemel, R. P. Adams, and B. J. Frey. “Fast Exact Inference for Recursive Cardinality Models”. UAI. 2012. [9] V. Vineet, J. Warrell, and P. H. Torr. “Filter-based mean-field inference for random fields with higher-order terms and product label-spaces”. IJCV 110 (2014). [10] J. Djolonga and A. Krause. “From MAP to Marginals: Variational Inference in Bayesian Submodular Models”. NIPS. 2014. [11] J. Zhang, J. Djolonga, and A. Krause. “Higher-Order Inference for Multi-class Log-supermodular Models”. ICCV. 2015. [12] J. Edmonds. “Submodular functions, matroids, and certain polyhedra”. Combinatorial structures and their applications (1970), pp. 69–87. [13] S. Fujishige and S. Isotani. “A submodular function minimization algorithm based on the minimum-norm base”. Pacific Journal of Optimization 7.1 (2011), pp. 3–17. [14] P. Stobbe and A. Krause. “Efficient Minimization of Decomposable Submodular Functions”. NIPS. 2010. [15] S. Jegelka, F. Bach, and S. Sra. “Reflection methods for user-friendly submodular optimization”. NIPS. 2013. [16] F. Bach. “Learning with submodular functions: a convex optimization perspective”. Foundations and Trends R⃝in Machine Learning 6.2-3 (2013). [17] R. Iyer and J. Bilmes. “Polyhedral aspects of Submodularity, Convexity and Concavity”. arXiv:1506.07329 (2015). [18] M. J. Wainwright and M. I. Jordan. “Log-determinant relaxation for approximate inference in discrete Markov random fields”. Signal Processing, IEEE Trans. on 54.6 (2006). [19] M. J. Wainwright, T. S. Jaakkola, and A. S. Willsky. “A new class of upper bounds on the log partition function”. UAI. 2002. [20] T. Heskes. “Convexity Arguments for Efficient Minimization of the Bethe and Kikuchi Free Energies.” JAIR 26 (2006). [21] O. Meshi, A. Jaimovich, A. Globerson, and N. Friedman. “Convexifying the Bethe free energy”. UAI. 2009. [22] L. Vilnis, D. Belanger, D. Sheldon, and A. McCallum. “Bethe Projections for Non-Local Inference”. UAI. 2015. [23] M. Frank and P. Wolfe. “An algorithm for quadratic programming”. Naval Res. Logist. Quart. (1956). [24] M. Jaggi. “Revisiting Frank-Wolfe: Projection-free sparse convex optimization”. ICML. 2013. [25] A. Beck and M. Teboulle. “A fast iterative shrinkage-thresholding algorithm for linear inverse problems”. SIAM Journal on imaging sciences 2.1 (2009), pp. 183–202. [26] S. Kakade, S. Shalev-Shwartz, and A. Tewari. “On the duality of strong convexity and strong smoothness: Learning applications and matrix regularization”. Technical Report (2009). [27] M. J. Wainwright. “Estimating the wrong graphical model: Benefits in the computation-limited setting”. JMLR 7 (2006). [28] B. London, B. Huang, and L. Getoor. “The benefits of learning with strongly convex approximate inference”. ICML. 2015. [29] R. Iyer, S. Jegelka, and J. Bilmes. “Fast Semidifferential-based Submodular Function Optimization”. ICML. 2013. [30] N. Ruozzi. “The Bethe partition function of log-supermodular graphical models”. NIPS. 2012. [31] A. Weller and T. Jebara. “Approximating the Bethe Partition Function”. UAI. 2014. [32] G. Papandreou and A. L. Yuille. “Perturb-and-MAP random fields: Using discrete optimization to learn and sample from energy models”. ICCV. 2011. [33] T. Hazan and T. Jaakkola. “On the partition function and random maximum a-posteriori perturbations”. ICML (2012). [34] J. M. Mooij. “libDAI: A Free and Open Source C++ Library for Discrete Approximate Inference in Graphical Models”. Journal of Machine Learning Research (2010), pp. 2169–2173. [35] S. Diamond and S. Boyd. “CVXPY: A Python-Embedded Modeling Language for Convex Optimization”. JMLR (2016). To appear. [36] B. O’Donoghue, E. Chu, N. Parikh, and S. Boyd. “Conic Optimization via Operator Splitting and Homogeneous Self-Dual Embedding”. Journal of Optimization Theory and Applications (2016). [37] Y. Boykov and V. Kolmogorov. “An experimental comparison of min-cut/max-flow algorithms for energy minimization in vision”. Pattern Analysis and Machine Intelligence, IEEE Trans. on 26 (2004). 9
2016
332
6,253
What Makes Objects Similar: A Unified Multi-Metric Learning Approach Han-Jia Ye De-Chuan Zhan Xue-Min Si Yuan Jiang Zhi-Hua Zhou National Key Laboratory for Novel Software Technology, Nanjing University, Nanjing, 210023, China {yehj,zhandc,sixm,jiangy,zhouzh}@lamda.nju.edu.cn Abstract Linkages are essentially determined by similarity measures that may be derived from multiple perspectives. For example, spatial linkages are usually generated based on localities of heterogeneous data, whereas semantic linkages can come from various properties, such as different physical meanings behind social relations. Many existing metric learning models focus on spatial linkages, but leave the rich semantic factors unconsidered. Similarities based on these models are usually overdetermined on linkages. We propose a Unified Multi-Metric Learning (UM2L) framework to exploit multiple types of metrics. In UM2L, a type of combination operator is introduced for distance characterization from multiple perspectives, and thus can introduce flexibilities for representing and utilizing both spatial and semantic linkages. Besides, we propose a uniform solver for UM2L which is guaranteed to converge. Extensive experiments on diverse applications exhibit the superior classification performance and comprehensibility of UM2L. Visualization results also validate its ability on physical meanings discovery. 1 Introduction Similarities measure the closeness of connections between objects and usually are reflected by distances. Distance Metric Learning (DML) aims to learn appropriate metric that can figure out the underlying linkages or connections, thus can greatly improve the performance of similarity-based classifiers, such as kNN. Objects are linked with each other for different reasons. Global DML methods consider the deterministic single metric which measures similarities between all object pairs. Recently, investigations on local DML have considered locality specific approaches, and consequently multiple metrics are learned. These metrics are either in charge of different spatial areas [15, 20] or responsible for each specific instance [7, 22]. Both global and local DML methods emphasize the linkage constraints (including must-link and cannot-link) in localities with univocal semantic meaning, e.g., the side information of class. However, there can be many different reasons for two instances to be similar in real world applications [3, 9]. Linkages between objects can be with multiple latent semantics. For example, in a social network, friendship linkages may lie on different hobbies of users. Although a user has many friends, their common hobbies could be different and as a consequence, one can be friends with others for different reasons. Another concrete example is, for articles on “A. Feature Learning” which are closely related to both “B. Feature Selection” and “C. Subspace Models”, their connections are different in semantics. The linkage between A and B emphasizes “picking up some helpful features”, while the common semantic between A and C is about “extracting subspaces” or “ feature transformation”. These phenomena clearly indicate ambiguities rather than a single meaning in linkage generation. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. Hence, the distance/similarity measurements are overdetermined in these applications. As a consequence, a new type of multi-metric learner which can describe the ambiguous linkages is desired. In this paper, we propose a Unified Multi-Metric Learning (UM2L) approach which integrates the consideration of linking semantic ambiguities and localities in one framework. In the training process, more than one metric is learned to measure distances between instances and each of them reflects a type of inherent spatial or semantic properties of objects. During the test, UM2L can automatically pick up or integrate these measurements, since semantically/spatially similar data points have small distances and otherwise they are pulled away from each other; such a mechanism enables the adaptation to environment to some degree, which is important for the development of learnwares [25]. Furthermore, the proposed framework can be easily adapted to different types of ambiguous circumstances: by specifying the mechanism of metric integration, various types of linkages in applications can be considered; by incorporating sparse constraints, UM2L also turns out good visualization results reflecting physical meanings of latent linkages between objects; besides, by limiting the number of metrics or specifying the regularizer, the approach can be degenerated to some popular DML methods, such as MMLMNN [20]. Benefitting from alternative strategy and stochastic techniques, the general framework can be optimized steadily and efficiently. Our main contributions are: (I) A Unified Multi-Metric Learning framework considering both data localities and ambiguous semantics linkages. (II) A flexible framework adaptable for different tasks. (III) Unified and efficient optimization solutions, superior and interpretable results. The rest of this paper starts with some notations. Then the UM2L framework is presented in detail, which is followed by a review of related work. The last are experiments and conclusion. 2 The Unified Multi-Metric Framework Generally speaking, the supervision information for Distance Metric Learning (DML) is formed as pairwise constraints or triplet sets. We restrict our discussion on the latter one, T = {xt, yt, zt}T t=1, since it provides more local information. In each triplet, target instance yt is more similar to xt than imposter zt and {xt, yt, zt} ∈Rd. Sd and S+ d are the set of symmetric and positive semidefinite (PSD) matrix of size d × d, respectively. I is the identity matrix. Matrix Frobenius Norm ∥M∥F = √ Tr(M ⊤M). Let mi and mj denote the i-th row and j-th column of matrix M respectively, and ℓ2,1-norm ∥M∥2,1 = ∑d i ∥mi∥2. Operator [·]+ = max(·, 0) preserves the non-negative part of the input value. DML aims at learning a metric M ∈S+ d making similar instances have small distances to each other and dissimilar ones far apart. The (squared) Mahalanobis distance between pair (xt, yt) with metric M can be denoted as: Dis2 M(xt, yt) = (xt −yt)⊤M(xt −yt) = Tr(MAt xy). (1) At xy = (xt −yt)(xt −yt)⊤∈S+ d is the outer product of difference between instance xt and yt. The distance in Eq.1 assumes that there is a single type of relationship between object features, which uses univocal linkages between objects. Multi-metric learning takes data heterogeneities into consideration. However, both single metric learned by global DML and multiple metrics learned with local methods focus on exploiting locality information, i.e., constraints or metrics are closely related to the localities. In particular, local DML approaches mainly aim at learning a set of multiple metrics one for each local area. In this paper, a general multi-metric configuration is investigated to deal with linkage ambiguities from both semantic and locality perspectives. We denote the set of K multiple metrics to be learned as MK = {M1, M2, . . . , MK} and {Mk}K k=1 ∈S+ d . Similarity score between a pair of instances based on Mk, w.l.o.g., can be set as the negative distance, i.e., fMk(xt, yt) = −Dis2 Mk(xt, yt). In multi-metric scenario, consequently, there will be a set of multiple similarity scores fMK = {fMk}K k=1. Each metric/score in the set reflects a particular semantic or spatial view of data. The overall similarity score f v(xt, yt) = κv(fMK(xt, yt)), v = {1, 2} and κv(·) is a functional operator closely related to concrete applications, which maps the set of similarity scores w.r.t. all metrics to a single value. With these discussions, the Unified Multi-Metric Learning (UM2L) framework can be denoted as: min MK 1 T T ∑ t=1 ℓ ( f 1(xt, yt) −f 2(xt, zt) ) + λ K ∑ k=1 Ωk(Mk) . (2) 2 The overall inter-instance similarity f 1 and f 2 are based on operators κ1 and κ2 respectively. ℓ(·) is a convex loss function which encourages (xt, yt) to have larger overall similarity score than (xt, zt). Note that although inter-instance similarities are defined on different metrics in MK, the convex loss function ℓ(·) acts as a bridge and makes the similarities measured by different metrics comparable as in [20]. The fact that triplet restrictions being provided without specifying concrete measurements makes it reasonable to use flexible κs. For instance, in a social network, similar nodes only share some common interests (features) rather than consistently possessing all interests. Tendency on different types of hobbies can be reflected by various metrics. Therefore, the similarity scores may be calculated with different measurements and operator κv is used for taking charge of “selecting” or “integrating” the right base metric for measuring similarities. The choices of loss functions and κs are substantial issues in this framework and will be described later. Convex regularizer Ωk(Mk) can impose prior or structure information on base metric Mk. λ ≥0 is a balance parameter. 2.1 Choices for κ UM2L takes both spatial and ambiguous semantic linkages into account based on the configurations of κ, which integrates or selects base metrics. As an integrator, in applications where locality related multiple metrics are needed, κ can be an RBF like function which decreases as the distance is increasing. The locality determines the impact of each metric. When κ acts as a selector, UM2L should automatically assign triplets to one of the metrics which can explain instance similarity/dissimilarity best. Besides, from the aspect of loss function ℓ(·), the elected fs form a comparable set of similarity measurements [17, 20]. In this case, we may implement the operator κ by choosing the most remarkable base metric making the pair of instances xt and yt similar. Advantages of selection mechanism are two folds. First, it reduces the impact of initial triplets construction in localities [19]; second, it stresses the most evident semantic and reflects the consideration of ambiguous semantics in a linkage construction. Choices of κs heavily depend on concrete applications. It is actually a combiner and can get inspiration from ensemble methods [24]. Here, we mainly consider 4 different types of linkage based on various sets of κs as follows. Apical Dominance Similarity (ADS): which is named after the phenomenon in auxanology of plants, where the most important term dominates the evaluation. In this case, κ1 = κ2 = max(·), i.e., maximum similarity among all similarities calculated with MK on similar pair (xt, yt) should be larger than the maximum similarity of (xt, zt). This corresponds to similar pairs being close to each other under at least one measurement, meanwhile dissimilar pairs are disconnected by all different measurements. This type of linkage generation often occurs in social network applications, e.g., nodes are linked together for a portion of similar orientations while nodes are unlinked because there are no common interests. By explicitly modeling each node in a social network as an instance, each of the base metrics {Mk}K k=1 can represent parts of semantics in linkages. Then the dissimilar pair in a triplet, e.g., the non-friendship relationship, should be with small similarity scores over MK; while for the similar pair, there should be at least one base similarity score with high value, which reflects their common interests [3, 11]. One Vote Similarity (OVS): which indicates the existence of potential key metric in MK, i.e., either similar or dissimilar pair is judged by at least one key metric respectively, while remaining metrics with other semantic meanings are ignored. In this case, κ1 = max(·) and κ2 = min(·). This type of similarity should usually be applied as an “interpreter” in domains like image, video which are with complicated semantics. The learned metrics reveal different latent concepts in objects. Note that simply applying OVS in UM2L with impropriate regularizer Ωwill lead to a trivial solution, i.e., Mk = 0, which satisfies all similar pair restrictions yet has no generalization ability. Therefore, we need to set Ωk(Mk) = ∥Mk −I∥2 F or restrict the trace of Mk to equal to 1. Rank Grouping Similarity (RGS): which groups the pairs and makes the similar pairs with higher ranks than dissimilar ones. This is the most rigorous similarity and we also refer it as One-Vote Veto Similarity (OV2S). In this case, κ1 = min(·) while κ2 = max(·), which regards the pairs as dissimilar even when there is only one metric denying the linkage. This case is usually applied to applications where latent multiple views exist and different views are measured by different metrics in MK. In these applications, it is obviously required that all potential views obtain consistencies, and weak conflict detected by one metric should also be punished by RGS (OV2S) loss. Average Case Similarity (ACS): which treats all metrics in MK equally, i.e., κ1 = κ2 = ∑(·). This is the general case when there is no prior knowledge on applications. 3 There are many derivatives of similarity where κv is configured as min(·), max(·) and ∑(·). Furthermore, κv in fact can be with richer forms, and we will leave the discussions of choosing different κs later in section 3. Besides, in the framework, multiple choices of the regularizer Ωk(·) can be made. As most DML methods [14], Ωk(Mk) can be set as ∥Mk∥2 F . Yet it also can be incorporated with more structural information, e.g., we can configure Ω(Mk) = ∥Mk∥2,1, where the row/column sparsity filters influential features for composing linkages in a network; or Ωk(Mk) = Tr(Mk), which guarantees the low rank property for all metrics. Due to the high applicability of the proposed framework, we name it as UM2L (Unified Multi-Metric Learning). 2.2 General Solutions for UM2L UM2L can be solved alternatively between metrics MK and affiliation portion of each instance, when κ is a piecewise linear operator such as max(·) and min(·). For example, in the case of ADS, the metric used to measure the similarity of pair (xt, yt) is decided by: kt v,∗ = arg maxk fMk(xt, yt), which is the index of the metric Mk that has the largest similarity value over the pair. Once the dominating key metric of each instance is found, the whole optimization problem is convex w.r.t. each Mk, which can be easily optimized. On account of the convexity of each sub-problem in the alternating approach, the whole objective is ensured to decrease in iterations so as to converge eventually. It is notable that when dealing with a single triplet in a stochastic approach, the convergence can be guaranteed as well in Theorem 1, which will be introduced later. In batch case, for facilitating the discussion, we can implement ℓ(·) as the smooth hinge loss, i.e., ℓ(x) = [ 1 2 −x]+ if x ≥1 or x ≤0 and equals to 1 2(1 −x)2 otherwise. If trace norm Ωk(Mk) = Tr(Mk) is used, MK can be solved with accelerated projected gradient descent method. If the whole objective in Eq. 2 is denoted as LMK, the gradient w.r.t. one metric Mk can be computed as: ∂LMK ∂Mk = 1 T ∑ t∈ˆ Tk ∂ℓ(Tr(Mkt 2,∗At xz) −Tr(Mkt 1,∗At xy)) ∂Mk + λI = 1 T ∑ t∈ˆ Tk ∇t Mk(at) + λI , (3) where the first part is a sum of gradients over the triplets subset ˆTk whose membership indexes containing k, i.e., ˆTk = {t | k = kt 1,∗or k = kt 2,∗}. The separated gradient ∇t Mk(at), with at = Tr(Mkt 2,∗At xz) −Tr(Mkt 1,∗At xy), for triplet t ∈ˆTk is: ∇t Mk(at) = { 0 if at ≥1 δ(k = kt 1,∗)At xy −δ(k = kt 2,∗)At xz if at ≤0 δ(k = kt 1,∗)(1 −at)At xy −δ(k = kt 2,∗)(1 −at)At xz otherwise . δ(·) is the Kronecker delta function, which contributes to the computation of the gradient when κv is optimized by Mk. After accelerated gradient descent, a projection step is conducted to maintain the PSD property of each solution. If structured sparsity is stressed, ℓ2,1-norm is used as a regularizer, i.e., Ωk(Mk) = ∥Mk∥2,1. FISTA [2] can be used to optimize the non-smooth regularizer efficiently: after a gradient descent with step size γ on the smooth loss to get an intermediate solution Vk = Mk−γ 1 T ∑ t∈ˆTk ∇t Mk(at), the following proximal sub-problem is conducted to get a further update: M ′ k = arg min M∈Sd 1 2∥M −Vk∥2 F + λ∥M∥2,1 . (4) The PSD property of Mk can be ensured by a projection in each iteration, or can often be preserved by last step projection [14]. Hence, in Eq. 4, only symmetric constraint of Mk is imposed. Since ℓ2,1-norm considers only one-side (row-wise) property of a matrix, Lim et al. [12] uses iterative symmetric projection to get a solution, which has heavy computational cost in some cases. In a reweighted way, the proximal subproblem can be tackled by the following lemma efficiently. Lemma 1 The proximal problem in Eq. 4 can be solved by updating diagonal matrixes D1 and D2 and symmetric matrix M alternatively: {D1,ii = 1 2∥mi∥2 , D2,ii = 1 2∥mi∥2 }d i=1 ; vec(M) = (I ⊗(I + λ 2 D1) + (λ 2 D2 ⊗I))−1vec(Vk) , where vec(·) is the vector form of a matrix and ⊗means the Kronecker product. Due to the diagonal property of each term, the update of M can be further simplified.1 1Detailed derivation and efficiency comparison are in the supplementary material. 4 The update of M in Lemma 1 takes row-wise and column-wise ℓ2-norm into consideration simultaneously, and usually gets converged in about 5 ∼10 iterations. The batch solution for UM2L can benefit from the acceleration strategy [2]. The computational cost of a full gradient, however, sometimes becomes the dominant expense owing to the huge number of triplets. Inspired by [6], we propose a stochastic solution, which manipulates one triplet in each iteration. In the s-th iteration, we sample a triplet (xs, ys, zs) uniformly and update current solution set Ms K = {M s k}K k=1. The whole objective of s-th iteration with Ms K is: Ls Ms K = ℓ(f 1(xs, ys) −f 2(xs, zs)) + λ K ∑ k=1 Ωk(M s k). (5) Similar to proximal gradient solution, after doing (sub-) gradient descent on the loss function in Eq. 5, proximal operator can be utilized to update base metrics {M s k}K k=1. The stochastic strategy is guaranteed to converge theoretically. By denoting M∗ K = (M ∗ 1 , . . . , M ∗ K) ∈ arg min ∑S s=1 Ls(M s 1, . . . , M s K) as the optimal solution, given totally S iterations, we have: Theorem 1 Suppose in UM2L framework, the loss ℓ(·) is a convex one and selection operator κv is in piecewise linear form. If each training instance ∥x∥2 ≤1, the sub-gradient set of Ωk(·) is bounded by R, i.e., ∥∂Ωk(Mk)∥2 F ≤R2 and sub-gradient of loss ℓ(·) is bounded by C. When for each base metric2 ∥Mk −M ∗ k∥F ≤D, it holds that:3 S ∑ s=1 Ls Ms K −Ls M∗ K ≤2GD + B √ S with G2 = max(C2, R2) and B = ( D2 2 + 8G2). Given hinge loss, C2 = 16. 3 Related Work and Discussions Global DML approaches devote to finding a single metric for all instances [5, 20] while local DML approaches further take spatial data heterogeneities into consideration. Recently, different types of local metric approaches are proposed, either assigning cluster-specific metric to instance based on locality [20] or constructing local metrics generatively [13] or discriminatively [15, 18]. Furthermore, instance specific metric learning methods [7, 22] extend the locality properties of linkages to extreme and gain improved classification performance. However, these DML methods, either global or local, take univocal semantic from label, namely, the side information. Richness of semantics is noticed and exploited by machine learning researchers [3, 11]. In DML community, PSD [9] and SCA [4] are proposed. PSD works as collective classification which is less related to UM2L. SCA, a multi-metric learning method based on pairwise constraints, focuses on learning metrics under one specific type of ambiguities, i.e., linkages are with competitive semantic meanings. UM2L is a more general multi-metric learning framework which considers triplet constraints and various kinds of ambiguous linkages from both localities and semantic views. UM2L maintains good compatibilities and can degenerate to several state-of-the-art DML methods. For example, by considering univocal semantic (K = 1), we can get a global metric learning model used in [14]. If we further choose the hinge loss and set the regularizer Ω(M) = tr(MB) with B an intra-class similar pair covariance matrix, UM2L degrades to LMNN [20]. With trace norm on M, [10] is recovered. For multi-metric approaches, if we set κv as the indicator of classes for the second instance in a similar or dissimilar pair, UM2L can be transformed to MMLMNN [20]. 4 Experiments on Different Types of Applications Due to different choices of κs in UM2L, we test the framework in diverse real applications, namely social linkages/feature pattern discovering, classification, physical semantic meaning distinguishing and visualization on multi-view semantic detection. To simplify the discussion, we use alternative batch solver, smooth hinge loss and set regularizer Ωk(Mk) = ∥Mk∥2,1 if without further statement. Triplets are constructed with 3 targets and 10 impostors with Euclidean nearest neighbors. 2This condition generally holds according to the norm regularizer in the objective function. 3Detailed proof can be found in the supplementary material. 5 4.1 Comparisons on Social Linkage/Feature Pattern Discovering ADS configuration is designed for social linkage and pattern discovering. To validate the effectiveness of UM2LADS , we test it on social network data and synthetic data to show its grouping ability on linkages and features, respectively. Social linkages come from 6 real world Facebook network datasets from [11]. Given friendship circles of an ego user and users’ binary features, the goal of ego-user linkages discovering is to utilize the overall linkage and figure out how users are grouped. We form instances by taking absolute value of differences between features of ego and the others. After circles with < 5 nodes are removed, K is configured as the number of circles remained. Pairwise distance is computed by each metric in MK, and a threshold is tuned on the training set to filter out irrelevant users. Thus, users with different common hobbies are grouped together. MAC detects group assignments based on binary features [8]; SCA constructs user linkages in a probabilistic way, and EGO [11] can directly output user circles. KMeans (KM) and Spectral Clustering (SC) directly group users based on their features without using linkages. Performance is measured by Balanced Error Rate (BER) [11], the lower the better. Results are listed in Table 1, which shows UM2LADS performs the best on most datasets. Table 1: BER of the linkage discovering comparisons on Facebook datasets: UM2LADS vs. others BER↓ KM SP MAC SCA EGO UM2L Facebook_348 .669 .669 .730 .847 .426 .405 Facebook_414 .721 .721 .699 .870 .449 .420 Facebook_686 .637 .637 .681 .772 .446 .391 Facebook_698 .661 .661 .640 .729 .392 .420 Facebook_1684 .807 .807 .767 .844 .491 .465 Facebook_3980 .708 .708 .541 .667 .538 .402 Table 2: BER of feature pattern discovery comparisons on synthetic datasets: UM2LADS vs. others BER↓ KM SP SCA EGO UM2L syn1 .382 .382 .392 .467 .355 syn2 .564 .564 .399 .428 .323 ad .670 .670 .400 .583 .381 ccd .244 .244 .250 .225 .071 my_movie .370 .370 .249 .347 .155 reuters .704 .704 .400 .609 .398 Similarly, we test feature pattern discovering ability of UM2LADS on 4 transformed multi-view datasets. For each dataset, we first extract principal components of each view, and construct sublinkage candidates between instances with random thresholds on each single view. Thus, these candidates are various among different views. After that, the overall linkage is further generated from these candidates using “or” operation. With features on each view and the overall linkage, the goal of feature pattern discovering is to reveal responsible features for each sub-linkage. Zero-value rows/columns of learned metrics indicate irrelevant features in the corresponding group. Syn1 and syn2 are purely synthetic datasets with features sampled from Uniform, Beta, Binomial, Gamma and Normal distributions using different parameters. BER results are listed in Table 2 and UM2LADS achieves the best on all datasets. These assessments indicate UM2LADS can figure out reasonable linkages or patterns hidden behind observations, and even better than domain specific methods. 4.2 Comparisons on Classification Performance To test classification generalization performance, our framework is compared with 8 state-of-the-art metric learning methods on 10 benchmark datasets and 8 large scale datasets (results of 8 large scale data are in the supplementary material). In detail, global DML methods: ITML [5], LMNN [20] and EIG [21]; local and instance specific DML methods: PLML [18], SCML (local version) [15]; MMLMNN [20], ISD [22] and SCA [4]. In UM2L, distance values from different metrics are comparable. Therefore in the test phase, we first compute 3 nearest neighbors for testing instance ˜x using each base metric Mk. Then 3×K distance values are collected adaptively and the smallest 3 ones (3 instances with the highest similarity scores) form neighbor candidates. Majority voting over them is used for prediction. Evaluations on classification are repeated for 30 times. In each trial, 70% of instances are used for training, and the remaining part is for test. Cross-validation is employed for parameters tuning. Generalization errors (mean±std.) based on 3NN are listed in Table 3 where Euclidean distance results (EUCLID) are also listed as a baseline. Considering the abilities of multi-semantic description of ADS and the rigorous restrictions of RGS, UM2LADS/RGS are implemented in this comparison. Number of metrics K is configured as the number of classes. Table 3 clearly shows that UM2LADS/RGS perform well on most datasets. Especially, UM2LRGS achieves best on more datasets according to t-tests and this can be attributed to the rigorous restrictions of RGS. 6 Table 3: Comparisons of classification performance (test errors, mean ± std.) based on 3NN. UM2LADS and UM2LRGS are compared. The best performance on each dataset is in bold. Last two rows list the Win/Tie/Lose counts of UM2LADS/RGS against other methods on all datasets with t-test at significance level 95%. UM2LADS UM2LRGS PLML SCML MMLMNN ISD SCA ITML LMNN EIG EUCLID Autompg .201±.034 .225±.031 .265±.048 .253±.026 .256±.032 .288±.033 .286±.037 .292±.032 .259±.037 .266±.031 .260±.036 Clean1 .070±.018 .086±.020 .098±.027 .100±.027 .097±.022 .143±.023 .306±.072 .141±.024 .084±.021 .127±.021 .139±.023 German .281±.019 .284±.030 .280±.016 .302±.021 .289±.019 .297±.017 .292±.023 .288±.021 .292±.021 .284±.014 .296±.021 Glass .312±.043 .293±.047 .389±.050 .328±.054 .296±.047 .334±.050 .529±.053 .311±.038 .315±.049 .314±.050 .307±.042 Hayes-r .276±.044 .307±.068 .436±.201 .296±.053 .282±.062 .378±.093 .379±.068 .342±.080 .314±.072 .289±.067 .398±.046 Heart-s .190±.035 .194±.063 .365±.127 .205±.040 .191±.037 .192±.036 .203±.039 .186±.032 .200±.026 .189±.034 .190±.030 House-v .051±.015 .048±.013 .121±.240 .066±.019 .055±.017 .072±.024 .174±.075 .063±.023 .061±.017 .080±.024 .083±.025 Liver-d .363±.045 .342±.047 .361±.055 .371±.042 .372±.045 .364±.042 .408±.011 .377±.052 .373±.045 .380±.037 .384±.040 Segment .023±.038 .029±.034 .041±.031 .041±.008 .036±.006 .063±.009 .324±.043 .050±.012 .039±.006 .059±.016 .050±.007 Sonar .136±.032 .132±.036 .171±.048 .193±.045 .157±.038 .182±.038 .220±.040 .174±.039 .145±.032 .159±.042 .168±.036 W / T / L UM2LADS vs. others 6 / 4 / 0 7 / 3 / 0 4 / 6 / 0 7 / 3 / 0 8 / 2 / 0 6 / 4 / 0 5 / 5 / 0 6 / 4 / 0 8 / 2 / 0 W / T / L UM2LRGS vs. others 6 / 4 / 0 8 / 2 / 0 5 / 5 / 0 9 / 1 / 0 8 / 2 / 0 8 / 2 / 0 8 / 2 / 0 7 / 3 / 0 8 / 2 / 0 (a) LMNN (b) PLML 1 (c) PLML 2 (d) MMLMNN 1 (e) MMLMNN 2 (f) MMLMNN 3 (g) UM2L 1 (h) UM2L 2 (i) UM2L 3 (j) UM2L 4 (k) UM2L 5 (l) UM2L 6 Figure 1: Word clouds generated from the results of compared DML methods. The size of word depends on the importance weight of each word (feature). The weight is calculated by decomposing each metric Mk = LkL⊤ k , and calculate the ℓ2-norm of each row in Lk, where each row corresponds to a specific word. Each subplot gives a word cloud for a base metric learned from DML approaches. 4.3 Comparisons of Latent Semantic Discovering UM2L is proposed for DML with both localities and semantic linkages considered. Hence, to investigate the ability of latent semantics discovering, two assessments in real applications are performed, i.e., Academic Paper Linkages Explanation (APLE) and Image Weak Label Discovering (IWLD). In APLE, data are collected from 2012-2015 ICML papers, which can be connected with each other by more than one topic, yet only the session ID is captured to form explicit linkages. 3 main directions of sessions are picked up in this assessment, i.e., “feature learning”, “online learning” and “deep learning”. No sub-fields and additional labels/topics are provided. Simplest TF-IDF is used to extract features, which forms a corpus of 220 papers and 1622 words in total. Aiming at finding the hidden linkages together with their causes, both UM2LADS and UM2LOVS are invoked. To avoid trivial solutions, regularizer for each metric is configured as Ωk(Mk) = ∥Mk −I∥2 F for UM2LOVS. All feature (word) weights and correlations can be provided by learned metrics, i.e., with decomposition Mk = LkL⊤ k , the ℓ2-norm value of each row in Lk can be regarded as the weight for each feature (word). The importance of feature (word) weights is demonstrated in word clouds in Fig. 1, where the size of fonts reflects the weights of each word. Due to the page limits, supplementary materials represent full evaluations. Fig. 1 shows the results of LMNN [20] (a), PLML [18] (b, c), MMLMNN [20] (d, e, f) and UM2LOVS (g ∼l) with K = 6, respectively. Global method LMNN returns one subplot. The metric learned by LMNN perhaps has discriminative ability but the weights of words cannot distinguish subfields in 3 selective domains. For multi-metric learning approaches PLML and MMLMNN, though they can provide more than one base metric and consequently have multiple word clouds, the words presented in subplots are not with legible physical semantic meanings. Especially, PLML outputs multiple metrics which are similar to each other (tends to global learner’s behavior) and only focus on first part of the alphabet, while MMLMNN by default only learns multiple metrics with the number of base metrics equaling to the number of classes. However, results of UM2LOVS clearly demonstrate all 3 fields. On session “online learning”, it can discover different sub-fields such as “online convex opti7 (a) (sea, mountains) (b) (mountains, sea) (c) (sea, sunset) Figure 2: Results of visual semantic discovery on images. The first annotation in the bracket is the provided weak label. The second one is one of the latent semantic labels discovered by UM2L. (a) ADS subspace 1 (b) ADS subspace 2 (c) RGS subspace Figure 3: Subspaces discovered by UM2LADS (a,b) and UM2LRGS (c). Instances possess 2 semantic properties, i.e., color and shape. Blue dot-lines give the decision boundary. mization” (g and h), and “online (multi-) armed bandit problem” (j); for session “feature learning”, it has “feature score” (i) and “PCA projection” (l); and for “deep learning”, the word cloud returns popular words like “network layer”, “autoencoder” and “layer”(k). Besides APLE, the second application is about weak label discovering in images from [23], where the most obvious label for each image is used for triplets constraints generation. UM2LOVS can obtain multiple metrics, each of which is with a certain visual semantic. By computing similarities based on different metrics, latent semantics can be discovered, i.e., if we assume images connected with high similarities share the same label, missing labels can be completed as in Fig. 2. More weak label results can be found in the supplementary material. 4.4 Investigations of Latent Multi-View Detection Another direct application of UM2L is hidden multi-view detection, where data can be described by multiple views from different channels yet feature partitions are not clearly provided [16]. Data with multi-view goes consistent with the assumption of ADS or RGS configuration. ADS emphasizes the existence of relevant views and aims at decomposing helpful aspects or views; while RGS requires full accordance among views. Trace norm regularizes the approach in this part to get low dimensional projection. UM2L framework facilitates the understanding of data by decomposing each base metric to low dimensional subspace, i.e., for each base metric Mk, 2 eigen-vectors Lk ∈Rd×2 corresponding to the largest 2 eigen-values are picked as orthogonal bases. The hidden multi-view data [1] are composed of 200 instances and each instance has two hidden views, namely color and shape. We perform UM2LADS/RGS on this dataset with K = 2. Results of other methods such as SCA can be found in the supplementary material. Fig. 3 (a) (b) give the 2-D visualization results by plotting the projected instances in subspaces corresponding to metric M1 and M2 of UM2LADS. It clearly shows that M1 captures the semantic view of color, and M2 reflects the meaning of shape. While for UM2LRGS, the visualization result of one of the obtained metrics is showed in Fig. 3 (c). It can be clearly found that both UM2LADS and UM2LRGS can capture the two different semantic views hidden in data. Moreover, since UM2LRGS requires more accordance, it can capture these physical meanings with a single metric. 5 Conclusion In this paper, we propose the Unified Multi-Metric Learning (UM2L) framework which can exploit side information from multiple aspects such as locality and semantics linkage constraints. It is notable that both types of constraints can be absorbed in the multi-metric loss functions with a type of flexible function operator κ in UM2L. By implementing κ in different forms, UM2L can be used for local metric learning in classification, latent semantic linkage discovering, etc., or degrade to stateof-the-art DML approaches. The regularizer in UM2L is flexible for different purposes. UM2L can be solved by various optimization techniques such as proximal gradient and accelerated stochastic approaches, and theoretical guarantee on the convergence is proved. Experiments show the superiority of UM2L in classification performance and hidden semantics discovery. Automatic determination of the number of base metrics is an interesting future work. Acknowledgements This research was supported by NSFC (61273301, 61333014), Collaborative Innovation Center of Novel Software Technology and Industrialization, and Tencent Fund. 8 References [1] E. Amid and A. Ukkonen. Multiview triplet embedding: Learning attributes in multiple maps. In ICML, pages 1472–1480, Lille, France, 2015. [2] A. Beck and M. Teboulle. A fast iterative shrinkage-thresholding algorithm for linear inverse problems. SIIMS, 2(1):183–202, 2009. [3] D. Chakrabarti, S. Funiak, J. Chang, and S. Macskassy. Joint inference of multiple label types in large networks. In ICML, pages 874–882, Beijing, China, 2014. [4] S. Changpinyo, K. Liu, and F. Sha. Similarity component analysis. In NIPS, pages 1511–1519. MIT Press, Cambridge, MA., 2013. [5] J. V. Davis, B. Kulis, P. Jain, S. Sra, and I. S. Dhillon. Information-theoretic metric learning. In ICML, pages 209–216, Corvalis, OR., 2007. [6] J. C. Duchi and Y. Singer. Efficient online and batch learning using forward backward splitting. JMLR, 10:2899–2934, 2009. [7] E. Fetaya and S. Ullman. Learning local invariant mahalanobis distances. In ICML, pages 162–168, Pairs, France, 2015. [8] M. Frank, A. P. Streich, D. Basin, and J. M. Buhmann. Multi-assignment clustering for boolean data. JMLR, 13:459–489, 2012. [9] J.-H. Hu, D.-C. Zhan, X. Wu, Y. Jiang, and Z.-H. Zhou. Pairwised specific distance learning from physical linkages. TKDD, 9(3):Article 20, 2015. [10] K. Huang, Y. Ying, and C. Campbell. GSML: A unified framework for sparse metric learning. In ICDM, pages 189–198, Miami, FL., 2009. [11] J. Leskovec and J. Mcauley. Learning to discover social circles in ego networks. In NIPS, pages 539–547. MIT Press, Cambridge, MA., 2012. [12] D. Lim, G. Lanckriet, and B. McFee. Robust structural metric learning. In ICML, pages 615–623, Atlanta, GA., 2013. [13] Y.-K. Noh, B.-T. Zhang, and D. Lee. Generative local metric learning for nearest neighbor classification. In NIPS, pages 1822–1830. MIT Press, Cambridge, MA., 2010. [14] Q. Qian, R. Jin, S. Zhu, and Y. Lin. Fine-grained visual categorization via multi-stage metric learning. In CVPR, pages 3716–3724, Boston, MA., 2015. [15] Y. Shi, A. Bellet, and F. Sha. Sparse compositional metric learning. In AAAI, pages 2078–2084, Quebec, Canada, 2014. [16] W. Wang and Z.-H. Zhou. A new analysis of co-training. In ICML, pages 1135–1142, Haifa, Israel, 2010. [17] B. Wang, J. Jiang, W. Wang, Z.-H. Zhou, and Z. Tu. Unsupervised metric fusion by cross diffusion. In CVPR, pages 2997–3004, Providence, RI., 2012. [18] J. Wang, A. Kalousis, and A. Woznica. Parametric local metric learning for nearest neighbor classification. In NIPS, pages 1601–1609. MIT Press, Cambridge, MA., 2012. [19] J. Wang, A. Woznica, and A. Kalousis. Learning neighborhoods for metric learning. In ECML/PKDD, pages 223–236, Bristol, UK, 2012. [20] K. Q. Weinberger and L. K. Saul. Distance metric learning for large margin nearest neighbor classification. JMLR, 10:207–244, 2009. [21] Y. Ying and P. Li. Distance metric learning with eigenvalue optimization. JMLR, 13:1–26, 2012. [22] D.-C. Zhan, M. Li, Y.-F. Li, and Z.-H. Zhou. Learning instance specific distances using metric propagation. In ICML, pages 1225–1232, Montreal, Canada, 2009. [23] M.-L. Zhang and Z.-H. Zhou. ML-KNN: A lazy learning approach to multi-label learning. Pattern Recognition, 40(7):2038–2048, 2007. [24] Z.-H. Zhou. Ensemble methods: foundations and algorithms. Chapman & Hall/CRC, Boca Raton, FL., 2012. [25] Z.-H. Zhou. Learnware: On the future of machine learning. Frontiers of Computer Science, 10(4):589– 590, 2016. 9
2016
333
6,254
Matching Networks for One Shot Learning Oriol Vinyals Google DeepMind vinyals@google.com Charles Blundell Google DeepMind cblundell@google.com Timothy Lillicrap Google DeepMind countzero@google.com Koray Kavukcuoglu Google DeepMind korayk@google.com Daan Wierstra Google DeepMind wierstra@google.com Abstract Learning from a few examples remains a key challenge in machine learning. Despite recent advances in important domains such as vision and language, the standard supervised deep learning paradigm does not offer a satisfactory solution for learning new concepts rapidly from little data. In this work, we employ ideas from metric learning based on deep neural features and from recent advances that augment neural networks with external memories. Our framework learns a network that maps a small labelled support set and an unlabelled example to its label, obviating the need for fine-tuning to adapt to new class types. We then define one-shot learning problems on vision (using Omniglot, ImageNet) and language tasks. Our algorithm improves one-shot accuracy on ImageNet from 87.6% to 93.2% and from 88.0% to 93.8% on Omniglot compared to competing approaches. We also demonstrate the usefulness of the same model on language modeling by introducing a one-shot task on the Penn Treebank. 1 Introduction Humans learn new concepts with very little supervision – e.g. a child can generalize the concept of “giraffe” from a single picture in a book – yet our best deep learning systems need hundreds or thousands of examples. This motivates the setting we are interested in: “one-shot” learning, which consists of learning a class from a single labelled example. Deep learning has made major advances in areas such as speech [7], vision [13] and language [16], but is notorious for requiring large datasets. Data augmentation and regularization techniques alleviate overfitting in low data regimes, but do not solve it. Furthermore, learning is still slow and based on large datasets, requiring many weight updates using stochastic gradient descent. This, in our view, is mostly due to the parametric aspect of the model, in which training examples need to be slowly learnt by the model into its parameters. In contrast, many non-parametric models allow novel examples to be rapidly assimilated, whilst not suffering from catastrophic forgetting. Some models in this family (e.g., nearest neighbors) do not require any training but performance depends on the chosen metric [1]. Previous work on metric learning in non-parametric setups [18] has been influential on our model, and we aim to incorporate the best characteristics from both parametric and non-parametric models – namely, rapid acquisition of new examples while providing excellent generalisation from common examples. The novelty of our work is twofold: at the modeling level, and at the training procedure. We propose Matching Nets, a neural network which uses recent advances in attention and memory that enable rapid learning. Secondly, our training procedure is based on a simple machine learning principle: test and train conditions must match. Thus to train our network to do rapid learning, we train it by 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. Figure 1: Matching Networks architecture showing only a few examples per class, switching the task from minibatch to minibatch, much like how it will be tested when presented with a few examples of a new task. Besides our contributions in defining a model and training criterion amenable for one-shot learning, we contribute by the definition of two new tasks that can be used to benchmark other approaches on both ImageNet and small scale language modeling. We hope that our results will encourage others to work on this challenging problem. We organized the paper by first defining and explaining our model whilst linking its several components to related work. Then in the following section we briefly elaborate on some of the related work to the task and our model. In Section 4 we describe both our general setup and the experiments we performed, demonstrating strong results on one-shot learning on a variety of tasks and setups. 2 Model Our non-parametric approach to solving one-shot learning is based on two components which we describe in the following subsections. First, our model architecture follows recent advances in neural networks augmented with memory (as discussed in Section 3). Given a (small) support set S, our model defines a function cS (or classifier) for each S, i.e. a mapping S →cS(.). Second, we employ a training strategy which is tailored for one-shot learning from the support set S. 2.1 Model Architecture In recent years, many groups have investigated ways to augment neural network architectures with external memories and other components that make them more “computer-like”. We draw inspiration from models such as sequence to sequence (seq2seq) with attention [2], memory networks [29] and pointer networks [27]. In all these models, a neural attention mechanism, often fully differentiable, is defined to access (or read) a memory matrix which stores useful information to solve the task at hand. Typical uses of this include machine translation, speech recognition, or question answering. More generally, these architectures model P(B|A) where A and/or B can be a sequence (like in seq2seq models), or, more interestingly for us, a set [26]. Our contribution is to cast the problem of one-shot learning within the set-to-set framework [26]. The key point is that when trained, Matching Networks are able to produce sensible test labels for unobserved classes without any changes to the network. More precisely, we wish to map from a (small) support set of k examples of input-label pairs S = {(xi, yi)}k i=1 to a classifier cS(ˆx) which, given a test example ˆx, defines a probability distribution over outputs ˆy. Here, ˆx could be an image, and ˆy a distribution over possible visual classes. We define the mapping S →cS(ˆx) to be P(ˆy|ˆx, S) where P is parameterised by a neural network. Thus, when given a new support set of examples S′ from which to one-shot learn, we simply use the parametric neural network defined by P to make predictions about the appropriate label distribution ˆy for each test example ˆx: P(ˆy|ˆx, S′). 2 Our model in its simplest form computes a probability over ˆy as follows: P(ˆy|ˆx, S) = k X i=1 a(ˆx, xi)yi (1) where xi, yi are the inputs and corresponding label distributions from the support set S = {(xi, yi)}k i=1, and a is an attention mechanism which we discuss below. Note that eq. 1 essentially describes the output for a new class as a linear combination of the labels in the support set. Where the attention mechanism a is a kernel on X × X, then (1) is akin to a kernel density estimator. Where the attention mechanism is zero for the b furthest xi from ˆx according to some distance metric and an appropriate constant otherwise, then (1) is equivalent to ‘k −b’-nearest neighbours (although this requires an extension to the attention mechanism that we describe in Section 2.1.2). Thus (1) subsumes both KDE and kNN methods. Another view of (1) is where a acts as an attention mechanism and the yi act as values bound to the corresponding keys xi, much like a hash table. In this case we can understand this as a particular kind of associative memory where, given an input, we “point” to the corresponding example in the support set, retrieving its label. Hence the functional form defined by the classifier cS(ˆx) is very flexible and can adapt easily to any new support set. 2.1.1 The Attention Kernel Equation 1 relies on choosing a(., .), the attention mechanism, which fully specifies the classifier. The simplest form that this takes (and which has very tight relationships with common attention models and kernel functions) is to use the softmax over the cosine distance c, i.e., a(ˆx, xi) = ec(f(ˆx),g(xi))/ Pk j=1 ec(f(ˆx),g(xj)) with embedding functions f and g being appropriate neural networks (potentially with f = g) to embed ˆx and xi. In our experiments we shall see examples where f and g are parameterised variously as deep convolutional networks for image tasks (as in VGG[22] or Inception[24]) or a simple form word embedding for language tasks (see Section 4). We note that, though related to metric learning, the classifier defined by Equation 1 is discriminative. For a given support set S and sample to classify ˆx, it is enough for ˆx to be sufficiently aligned with pairs (x′, y′) ∈S such that y′ = y and misaligned with the rest. This kind of loss is also related to methods such as Neighborhood Component Analysis (NCA) [18], triplet loss [9] or large margin nearest neighbor [28]. However, the objective that we are trying to optimize is precisely aligned with multi-way, one-shot classification, and thus we expect it to perform better than its counterparts. Additionally, the loss is simple and differentiable so that one can find the optimal parameters in an “end-to-end” fashion. 2.1.2 Full Context Embeddings The main novelty of our model lies in reinterpreting a well studied framework (neural networks with external memories) to do one-shot learning. Closely related to metric learning, the embedding functions f and g act as a lift to feature space X to achieve maximum accuracy through the classification function described in eq. 1. Despite the fact that the classification strategy is fully conditioned on the whole support set through P(.|ˆx, S), the embeddings on which we apply the cosine similarity to “attend”, “point” or simply compute the nearest neighbor are myopic in the sense that each element xi gets embedded by g(xi) independently of other elements in the support set S. Furthermore, S should be able to modify how we embed the test image ˆx through f. We propose embedding the elements of the set through a function which takes as input the full set S in addition to xi, i.e. g becomes g(xi, S). Thus, as a function of the whole support set S, g can modify how to embed xi. This could be useful when some element xj is very close to xi, in which case it may be beneficial to change the function with which we embed xi – some evidence of this is discussed in Section 4. We use a bidirectional Long-Short Term Memory (LSTM) [8] to encode xi in the context of the support set S, considered as a sequence (see Appendix). The second issue to make f depend on ˆx and S can be fixed via an LSTM with read-attention over the whole set S, whose inputs are equal to f ′(ˆx) (f ′ is an embedding function, e.g. a CNN). To do 3 so, we define the following recurrence over “processing” steps k, following work from [26]: ˆhk, ck = LSTM(f ′(ˆx), [hk−1, rk−1], ck−1) (2) hk = ˆhk + f ′(ˆx) (3) rk−1 = |S| X i=1 a(hk−1, g(xi))g(xi) (4) a(hk−1, g(xi)) = ehT k−1g(xi)/ |S| X j=1 ehT k−1g(xj) (5) noting that LSTM(x, h, c) follows the same LSTM implementation defined in [23] with x the input, h the output (i.e., cell after the output gate), and c the cell. a is commonly referred to as “content” based attention. We do K steps of “reads”, so f(ˆx, S) = hK where hk is as described in eq. 3. 2.2 Training Strategy In the previous subsection we described Matching Networks which map a support set to a classification function, S →c(ˆx). We achieve this via a modification of the set-to-set paradigm augmented with attention, with the resulting mapping being of the form Pθ(.|ˆx, S), noting that θ are the parameters of the model (i.e. of the embedding functions f and g described previously). The training procedure has to be chosen carefully so as to match inference at test time. Our model has to perform well with support sets S′ which contain classes never seen during training. More specifically, let us define a task T as distribution over possible label sets L. Typically we consider T to uniformly weight all data sets of up to a few unique classes (e.g., 5), with a few examples per class (e.g., up to 5). In this case, a label set L sampled from a task T, L ∼T, will typically have 5 to 25 examples. To form an “episode” to compute gradients and update our model, we first sample L from T (e.g., L could be the label set {cats, dogs}). We then use L to sample the support set S and a batch B (i.e., both S and B are labelled examples of cats and dogs). The Matching Net is then trained to minimise the error predicting the labels in the batch B conditioned on the support set S. This is a form of meta-learning since the training procedure explicitly learns to learn from a given support set to minimise a loss over a batch. More precisely, the Matching Nets training objective is as follows: θ = arg max θ EL∼T  ES∼L,B∼L  X (x,y)∈B log Pθ (y|x, S)    . (6) Training θ with eq. 6 yields a model which works well when sampling S′ ∼T ′ from a different distribution of novel labels. Crucially, our model does not need any fine tuning on the classes it has never seen due to its non-parametric nature. Obviously, as T ′ diverges far from the T from which we sampled to learn θ, the model will not work – we belabor this point further in Section 4.1.2. 3 Related Work 3.1 Memory Augmented Neural Networks A recent surge of models which go beyond “static” classification of fixed vectors onto their classes has reshaped current research and industrial applications alike. This is most notable in the massive adoption of LSTMs [8] in a variety of tasks such as speech [7], translation [23, 2] or learning programs [4, 27]. A key component which allowed for more expressive models was the introduction of “content” based attention in [2], and “computer-like” architectures such as the Neural Turing Machine [4] or Memory Networks [29]. Our work takes the metalearning paradigm of [21], where an LSTM learnt to learn quickly from data presented sequentially, but we treat the data as a set. The one-shot learning task we defined on the Penn Treebank [15] relates to evaluation techniques and models presented in [6], and we discuss this in Section 4. 4 3.2 Metric Learning As discussed in Section 2, there are many links between content based attention, kernel based nearest neighbor and metric learning [1]. The most relevant work is Neighborhood Component Analysis (NCA) [18], and the follow up non-linear version [20]. The loss is very similar to ours, except we use the whole support set S instead of pair-wise comparisons which is more amenable to one-shot learning. Follow-up work in the form of deep convolutional siamese [11] networks included much more powerful non-linear mappings. Other losses which include the notion of a set (but use less powerful metrics) were proposed in [28]. Lastly, the work in one-shot learning in [14] was inspirational and also provided us with the invaluable Omniglot dataset – referred to as the “transpose” of MNIST. Other works used zero-shot learning on ImageNet, e.g. [17]. However, there is not much one-shot literature on ImageNet, which we hope to amend via our benchmark and task definitions in the following section. 4 Experiments In this section we describe the results of many experiments, comparing our Matching Networks model against strong baselines. All of our experiments revolve around the same basic task: an N-way k-shot learning task. Each method is providing with a set of k labelled examples from each of N classes that have not previously been trained upon. The task is then to classify a disjoint batch of unlabelled examples into one of these N classes. Thus random performance on this task stands at 1/N. We compared a number of alternative models, as baselines, to Matching Networks. Let L′ denote the held-out subset of labels which we only use for one-shot. Unless otherwise specified, training is always on ̸=L′, and test in one-shot mode on L′. We ran one-shot experiments on three data sets: two image classification sets (Omniglot [14] and ImageNet [19, ILSVRC-2012]) and one language modeling (Penn Treebank). The experiments on the three data sets comprise a diverse set of qualities in terms of complexity, sizes, and modalities. 4.1 Image Classification Results For vision problems, we considered four kinds of baselines: matching on raw pixels, matching on discriminative features from a state-of-the-art classifier (Baseline Classifier), MANN [21], and our reimplementation of the Convolutional Siamese Net [11]. The baseline classifier was trained to classify an image into one of the original classes present in the training data set, but excluding the N classes so as not to give it an unfair advantage (i.e., trained to classify classes in ̸=L′). We then took this network and used the features from the last layer (before the softmax) for nearest neighbour matching, a strategy commonly used in computer vision [3] which has achieved excellent results across many tasks. Following [11], the convolutional siamese nets were trained on a same-or-different task of the original training data set and then the last layer was used for nearest neighbour matching. Model Matching Fn Fine Tune 5-way Acc 20-way Acc 1-shot 5-shot 1-shot 5-shot PIXELS Cosine N 41.7% 63.2% 26.7% 42.6% BASELINE CLASSIFIER Cosine N 80.0% 95.0% 69.5% 89.1% BASELINE CLASSIFIER Cosine Y 82.3% 98.4% 70.6% 92.0% BASELINE CLASSIFIER Softmax Y 86.0% 97.6% 72.9% 92.3% MANN (NO CONV) [21] Cosine N 82.8% 94.9% – – CONVOLUTIONAL SIAMESE NET [11] Cosine N 96.7% 98.4% 88.0% 96.5% CONVOLUTIONAL SIAMESE NET [11] Cosine Y 97.3% 98.4% 88.1% 97.0% MATCHING NETS (OURS) Cosine N 98.1% 98.9% 93.8% 98.5% MATCHING NETS (OURS) Cosine Y 97.9% 98.7% 93.5% 98.7% Table 1: Results on the Omniglot dataset. 5 We also tried further fine tuning the features using only the support set S′ sampled from L′. This yields massive overfitting, but given that our networks are highly regularized, can yield extra gains. Note that, even when fine tuning, the setup is still one-shot, as only a single example per class from L′ is used. 4.1.1 Omniglot Omniglot [14] consists of 1623 characters from 50 different alphabets. Each of these was hand drawn by 20 different people. The large number of classes (characters) with relatively few data per class (20), makes this an ideal data set for testing small-scale one-shot classification. The N-way Omniglot task setup is as follows: pick N unseen character classes, independent of alphabet, as L. Provide the model with one drawing of each of the N characters as S ∼L and a batch B ∼L. Following [21], we augmented the data set with random rotations by multiples of 90 degrees and used 1200 characters for training, and the remaining character classes for evaluation. We used a simple yet powerful CNN as the embedding function – consisting of a stack of modules, each of which is a 3 × 3 convolution with 64 filters followed by batch normalization [10], a Relu non-linearity and 2 × 2 max-pooling. We resized all the images to 28 × 28 so that, when we stack 4 modules, the resulting feature map is 1 × 1 × 64, resulting in our embedding function f(x). A fully connected layer followed by a softmax non-linearity is used to define the Baseline Classifier. Results comparing the baselines to our model on Omniglot are shown in Table 1. For both 1-shot and 5-shot, 5-way and 20-way, our model outperforms the baselines. There are no major surprises in these results: using more examples for k-shot classification helps all models, and 5-way is easier than 20-way. We note that the Baseline Classifier improves a bit when fine tuning on S′, and using cosine distance versus training a small softmax from the small training set (thus requiring fine tuning) also performs well. Siamese nets fare well versus our Matching Nets when using 5 examples per class, but their performance degrades rapidly in one-shot. Fully Conditional Embeddings (FCE) did not seem to help much and were left out of the table due to space constraints. Like the authors in [11], we also test our method trained on Omniglot on a completely disjoint task – one-shot, 10 way MNIST classification. The Baseline Classifier does about 63% accuracy whereas (as reported in their paper) the Siamese Nets do 70%. Our model achieves 72%. 4.1.2 ImageNet Our experiments followed the same setup as Omniglot for testing, but we considered a rand and a dogs (harder) setup. In the rand setup, we removed 118 labels at random from the training set, then tested only on these 118 classes (which we denote as Lrand). For the dogs setup, we removed all classes in ImageNet descended from dogs (totalling 118) and trained on all non-dog classes, then tested on dog classes (Ldogs). ImageNet is a notoriously large data set which can be quite a feat of engineering and infrastructure to run experiments upon it, requiring many resources. Thus, as well as using the full ImageNet data set, we devised a new data set – miniImageNet – consisting of 60, 000 colour images of size 84 × 84 with 100 classes, each having 600 examples. This dataset is more complex than CIFAR10 [12], but fits in memory on modern machines, making it very convenient for rapid prototyping and experimentation. We used 80 classes for training and tested on the remaining 20 classes. In total, thus, we have randImageNet, dogsImageNet, and miniImageNet. The results of the miniImageNet experiments are shown in Table 2. As with Omniglot, Matching Networks outperform the baselines. However, miniImageNet is a much harder task than Omniglot which allowed us to evaluate Full Contextual Embeddings (FCE) sensibly (on Omniglot it made no difference). As we an see, FCE improves the performance of Matching Networks, with and without fine tuning, typically improving performance by around two percentage points. Next we turned to experiments based upon full size, full scale ImageNet. Our baseline classifier for this data set was Inception [25] trained to classify on all classes except those in the test set of classes (for randImageNet) or those concerning dogs (for dogsImageNet). We also compared to features from an Inception Oracle classifier trained on all classes in ImageNet, as an upper bound. Our Baseline Classifier is one of the strongest published ImageNet models at 79% top-1 accuracy on the standard ImageNet validation set. Instead of training Matching Networks from scratch on these large tasks, we initialised their feature extractors f and g with the parameters from the Inception classifier (pretrained on the appropriate subset of the data) and then further trained the resulting network on random 5-way 6 S’ MatchNet Inception Figure 2: Example of two 5-way problem instance on ImageNet. The images in the set S′ contain classes never seen during training. Our model makes far less mistakes than the Inception baseline. Table 2: Results on miniImageNet. Model Matching Fn Fine Tune 5-way Acc 1-shot 5-shot PIXELS Cosine N 23.0% 26.6% BASELINE CLASSIFIER Cosine N 36.6% 46.0% BASELINE CLASSIFIER Cosine Y 36.2% 52.2% BASELINE CLASSIFIER Softmax Y 38.4% 51.2% MATCHING NETS (OURS) Cosine N 41.2% 56.2% MATCHING NETS (OURS) Cosine Y 42.4% 58.0% MATCHING NETS (OURS) Cosine (FCE) N 44.2% 57.0% MATCHING NETS (OURS) Cosine (FCE) Y 46.6% 60.0% 1-shot tasks from the training data set, incorporating Full Context Embeddings and our Matching Networks and training strategy. The results of the randImageNet and dogsImageNet experiments are shown in Table 3. The Inception Oracle (trained on all classes) performs almost perfectly when restricted to 5 classes only, which is not too surprising given its impressive top-1 accuracy. When trained solely on ̸=Lrand, Matching Nets improve upon Inception by almost 6% when tested on Lrand, halving the errors. Figure 2 shows two instances of 5-way one-shot learning, where Inception fails. Looking at all the errors, Inception appears to sometimes prefer an image above all others (these images tend to be cluttered like the example in the second column, or more constant in color). Matching Nets, on the other hand, manage to recover from these outliers that sometimes appear in the support set S′. Matching Nets manage to improve upon Inception on the complementary subset ̸=Ldogs (although this setup is not one-shot, as the feature extraction has been trained on these labels). However, on the much more challenging Ldogs subset, our model degrades by 1%. We hypothesize this to the fact that the sampled set during training, S, comes from a random distribution of labels (from ̸=Ldogs), whereas the testing support set S′ from Ldogs contains similar classes, more akin to fine grained classification. Thus, we believe that if we adapted our training strategy to samples S from fine grained sets of labels instead of sampling uniformly from the leafs of the ImageNet class tree, improvements could be attained. We leave this as future work. Table 3: Results on full ImageNet on rand and dogs one-shot tasks. Note that ̸=Lrand and ̸=Ldogs are sets of classes which are seen during training, but are provided for completeness. Model Matching Fn Fine Tune ImageNet 5-way 1-shot Acc Lrand ̸=Lrand Ldogs ̸=Ldogs PIXELS Cosine N 42.0% 42.8% 41.4% 43.0% INCEPTION CLASSIFIER Cosine N 87.6% 92.6% 59.8% 90.0% MATCHING NETS (OURS) Cosine (FCE) N 93.2% 97.0% 58.8% 96.4% INCEPTION ORACLE Softmax (Full) Y (Full) ≈99% ≈99% ≈99% ≈99% 7 4.1.3 One-Shot Language Modeling We also introduce a new one-shot language task which is analogous to those examined for images. The task is as follows: given a query sentence with a missing word in it, and a support set of sentences which each have a missing word and a corresponding 1-hot label, choose the label from the support set that best matches the query sentence. Here we show a single example, though note that the words on the right are not provided and the labels for the set are given as 1-hot-of-5 vectors. 1. an experimental vaccine can alter the immune response of people infected with the aids virus a <blank_token> u.s. scientist said. prominent 2. the show one of five new nbc <blank_token> is the second casualty of the three networks so far this fall. series 3. however since eastern first filed for chapter N protection march N it has consistently promised to pay creditors N cents on the <blank_token>. dollar 4. we had a lot of people who threw in the <blank_token> today said <unk> ellis a partner in benjamin jacobson & sons a specialist in trading ual stock on the big board. towel 5. it’s not easy to roll out something that <blank_token> and make it pay mr. jacob says. comprehensive Query: in late new york trading yesterday the <blank_token> was quoted at N marks down from N marks late friday and at N yen down from N yen late friday. dollar Sentences were taken from the Penn Treebank dataset [15]. On each trial, we make sure that the set and batch are populated with sentences that are non-overlapping. This means that we do not use words with very low frequency counts; e.g. if there is only a single sentence for a given word we do not use this data since the sentence would need to be in both the set and the batch. As with the image tasks, each trial consisted of a 5 way choice between the classes available in the set. We used a batch size of 20 throughout the sentence matching task and varied the set size across k=1,2,3. We ensured that the same number of sentences were available for each class in the set. We split the words into a randomly sampled 9000 for training and 1000 for testing, and we used the standard test set to report results. Thus, neither the words nor the sentences used during test time had been seen during training. We compared our one-shot matching model to an oracle LSTM language model (LSTM-LM) [30] trained on all the words. In this setup, the LSTM has an unfair advantage as it is not doing one-shot learning but seeing all the data – thus, this should be taken as an upper bound. To do so, we examined a similar setup wherein a sentence was presented to the model with a single word filled in with 5 different possible words (including the correct answer). For each of these 5 sentences the model gave a log-likelihood and the max of these was taken to be the choice of the model. As with the other 5 way choice tasks, chance performance on this task was 20%. The LSTM language model oracle achieved an upper bound of 72.8% accuracy on the test set. Matching Networks with a simple encoding model achieve 32.4%, 36.1%, 38.2% accuracy on the task with k = 1, 2, 3 examples in the set, respectively. Future work should explore combining parametric models such as an LSTM-LM with non-parametric components such as the Matching Networks explored here. Two related tasks are the CNN QA test of entity prediction from news articles [5], and the Children’s Book Test (CBT) [6]. In the CBT for example, a sequence of sentences from a book are provided as context. In the final sentence one of the words, which has appeared in a previous sentence, is missing. The task is to choose the correct word to fill in this blank from a small set of words given as possible answers, all of which occur in the preceding sentences. In our sentence matching task the sentences provided in the set are randomly drawn from the PTB corpus and are related to the sentences in the query batch only by the fact that they share a word. In contrast to CBT and CNN dataset, they provide only a generic rather than specific sequential context. 5 Conclusion In this paper we introduced Matching Networks, a new neural architecture that, by way of its corresponding training regime, is capable of state-of-the-art performance on a variety of one-shot classification tasks. There are a few key insights in this work. Firstly, one-shot learning is much easier if you train the network to do one-shot learning. Secondly, non-parametric structures in a neural network make it easier for networks to remember and adapt to new training sets in the same tasks. Combining these observations together yields Matching Networks. Further, we have defined new one-shot tasks on ImageNet, a reduced version of ImageNet (for rapid experimentation), and a language modeling task. An obvious drawback of our model is the fact that, as the support set S grows in size, the computation for each gradient update becomes more expensive. Although there are sparse and sampling-based methods to alleviate this, much of our future efforts will concentrate around this limitation. Further, as exemplified in the ImageNet dogs subtask, when the label distribution has obvious biases (such as being fine grained), our model suffers. We feel this is an area with exciting challenges which we hope to keep improving in future work. 8 Acknowledgements We would like to thank Nal Kalchbrenner for brainstorming around the design of the function g, and Sander Dieleman and Sergio Guadarrama for their help setting up ImageNet. We would also like thank Simon Osindero for useful discussions around the tasks discussed in this paper, and Theophane Weber and Remi Munos for following some early developments. Karen Simonyan and David Silver helped with the manuscript, as well as many at Google DeepMind. Thanks also to Geoff Hinton and Alex Toshev for discussions about our results, and to the anonymous reviewers for great suggestions. References [1] C Atkeson, A Moore, and S Schaal. Locally weighted learning. Artificial Intelligence Review, 1997. [2] D Bahdanau, K Cho, and Y Bengio. Neural machine translation by jointly learning to align and translate. ICLR, 2014. [3] J Donahue, Y Jia, O Vinyals, J Hoffman, N Zhang, E Tzeng, and T Darrell. Decaf: A deep convolutional activation feature for generic visual recognition. In ICML, 2014. [4] A Graves, G Wayne, and I Danihelka. Neural turing machines. arXiv preprint arXiv:1410.5401, 2014. [5] K Hermann, T Kocisky, E Grefenstette, L Espeholt, W Kay, M Suleyman, and P Blunsom. Teaching machines to read and comprehend. In NIPS, 2015. [6] F Hill, A Bordes, S Chopra, and J Weston. The goldilocks principle: Reading children’s books with explicit memory representations. arXiv preprint arXiv:1511.02301, 2015. [7] G Hinton et al. Deep neural networks for acoustic modeling in speech recognition: The shared views of four research groups. Signal Processing Magazine, IEEE, 2012. [8] S Hochreiter and J Schmidhuber. Long short-term memory. Neural computation, 1997. [9] E Hoffer and N Ailon. Deep metric learning using triplet network. Similarity-Based Pattern Recognition, 2015. [10] S Ioffe and C Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167, 2015. [11] G Koch, R Zemel, and R Salakhutdinov. Siamese neural networks for one-shot image recognition. In ICML Deep Learning workshop, 2015. [12] A Krizhevsky and G Hinton. Convolutional deep belief networks on cifar-10. Unpublished, 2010. [13] A Krizhevsky, I Sutskever, and G Hinton. Imagenet classification with deep convolutional neural networks. In NIPS, 2012. [14] BM Lake, R Salakhutdinov, J Gross, and J Tenenbaum. One shot learning of simple visual concepts. In CogSci, 2011. [15] MP Marcus, MA Marcinkiewicz, and B Santorini. Building a large annotated corpus of english: The penn treebank. Computational linguistics, 1993. [16] T Mikolov, M Karafiát, L Burget, J Cernock`y, and S Khudanpur. Recurrent neural network based language model. In INTERSPEECH, 2010. [17] M Norouzi, T Mikolov, S Bengio, Y Singer, J Shlens, A Frome, G Corrado, and J Dean. Zero-shot learning by convex combination of semantic embeddings. arXiv preprint arXiv:1312.5650, 2013. [18] S Roweis, G Hinton, and R Salakhutdinov. Neighbourhood component analysis. NIPS, 2004. [19] O Russakovsky, J Deng, H Su, J Krause, S Satheesh, S Ma, Z Huang, A Karpathy, A Khosla, M Bernstein, A Berg, and L Fei-Fei. ImageNet Large Scale Visual Recognition Challenge. IJCV, 2015. [20] R Salakhutdinov and G Hinton. Learning a nonlinear embedding by preserving class neighbourhood structure. In AISTATS, 2007. [21] A Santoro, S Bartunov, M Botvinick, D Wierstra, and T Lillicrap. Meta-learning with memory-augmented neural networks. In ICML, 2016. [22] K Simonyan and A Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014. [23] I Sutskever, O Vinyals, and QV Le. Sequence to sequence learning with neural networks. In NIPS, 2014. [24] C Szegedy, W Liu, Y Jia, P Sermanet, S Reed, D Anguelov, D Erhan, V Vanhoucke, and A Rabinovich. Going deeper with convolutions. In CVPR, 2015. [25] C Szegedy, V Vanhoucke, S Ioffe, J Shlens, and Z Wojna. Rethinking the inception architecture for computer vision. arXiv preprint arXiv:1512.00567, 2015. [26] O Vinyals, S Bengio, and M Kudlur. Order matters: Sequence to sequence for sets. arXiv preprint arXiv:1511.06391, 2015. [27] O Vinyals, M Fortunato, and N Jaitly. Pointer networks. In NIPS, 2015. [28] K Weinberger and L Saul. Distance metric learning for large margin nearest neighbor classification. JMLR, 2009. [29] J Weston, S Chopra, and A Bordes. Memory networks. ICLR, 2014. [30] W Zaremba, I Sutskever, and O Vinyals. Recurrent neural network regularization. arXiv preprint arXiv:1409.2329, 2014. 9
2016
334
6,255
Gradient-based Sampling: An Adaptive Importance Sampling for Least-squares Rong Zhu Academy of Mathematics and Systems Science, Chinese Academy of Sciences, Beijing, China. rongzhu@amss.ac.cn Abstract In modern data analysis, random sampling is an efficient and widely-used strategy to overcome the computational difficulties brought by large sample size. In previous studies, researchers conducted random sampling which is according to the input data but independent on the response variable, however the response variable may also be informative for sampling. In this paper we propose an adaptive sampling called the gradient-based sampling which is dependent on both the input data and the output for fast solving of least-square (LS) problems. We draw the data points by random sampling from the full data according to their gradient values. This sampling is computationally saving, since the running time of computing the sampling probabilities is reduced to O(nd) where n is the full sample size and d is the dimension of the input. Theoretically, we establish an error bound analysis of the general importance sampling with respect to LS solution from full data. The result establishes an improved performance of the use of our gradientbased sampling. Synthetic and real data sets are used to empirically argue that the gradient-based sampling has an obvious advantage over existing sampling methods from two aspects of statistical efficiency and computational saving. 1 Introduction Modern data analysis always addresses enormous data sets in recent years. Facing the increasing large sample data, computational savings play a major role in the data analysis. One simple way to reduce the computational cost is to perform random sampling, that is, one uses a small proportion of the data as a surrogate of the full sample for model fitting and statistical inference. Among random sampling strategies, uniform sampling is simple but trivial way since it fails to exploit the unequal importance of the data points. As an alternative, leverage-based sampling is to perform random sampling with respect to nonuniform sampling probabilities that depend on the empirical statistical leverage scores of the input matrix X. It has been intensively studied in the machine learning community and has been proved to achieve much better results for worst-case input than uniform sampling [1, 2, 3, 4]. However it is known that leverage-based sampling replies on input data but is independent on the output variable, so does not make use of the information of the output. Another shortcoming is that it needs to cost much time to get the leverage scores, although approximating leverage scores has been proposed to further reduce the computational cost [5, 6, 7]. In this paper, we proposed an adaptive importance sampling, the gradient-based sampling, for solving least-square (LS) problem. This sampling attempts to sufficiently make use of the data information including the input data and the output variable. This adaptive process can be summarized as follows: given a pilot estimate (good “guess") for the LS solution, determine the importance of each data point by calculating the gradient value, then sample from the full data by importance sampling according to the gradient value. One key contribution of this sampling is to save more computational time than leverage-based sampling, and the running time of getting the probabilities is reduced to 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. O(nd) where n is the sample size and d is the input dimension. It is worthy noting that, although we apply gradient-based sampling into the LS problem, we believe that it may be extended to fast solve other large-scale optimization problems as long as the gradient of optimization function is obtained. However this is out of the scope so we do not extend it in this paper. Theoretically, we give the risk analysis, error bound of the LS solution from random sampling. [8] and [9] gave the risk analysis of approximating LS by Hadamard-based projection and covariancethresholded regression, respectively. However, no such analysis is studied for importance sampling. The error bound analysis is a general result on any importance sampling as long as the conditions hold. By this result, we establishes an improved performance guarantee on the use of our gradient-based sampling. It is improved in the sense that our gradient-based sampling can make the bound approximately attain its minimum, while previous sampling methods can not get this aim. Additionally, the non-asymptotic result also provides a way of balancing the tradeoff between the subsample size and the statistical accuracy. Empirically, we conduct detailed experiments on datasets generated from the mixture Gaussian and real datasets. We argue by these empirical studies that the gradient-based sampling is not only more statistically efficient than leverage-based sampling but also much computationally cheaper from the computational viewpoint. Another important aim of detailed experiments on synthetic datasets is to guide the use of the sampling in different situations that users may encounter in practice. The remainder of the paper is organized as follows: In Section 2, we formally describe random sampling algorithm to solve LS, then establish the gradient-based sampling in Section 3. The nonasymptotic analysis is provided in Section 4. We study the empirical performance on synthetic and real world datasets in Section 5. Notation: For a symmetric matrix M ∈Rd×d, we define λmin(M) and λmax(M) as its the largest and smallest eigenvalues. For a vector v ∈Rd, we define ∥v∥as its L2 norm. 2 Problem Set-up For LS problem, suppose that there are an n × d matrix X = (x1, · · · , xn)T and an n × 1 response vector y = (y1, · · · , yn)T . We focus on the setting n ≫d. The LS problem is to minimize the sample risk function of parameters β as follows: n X i=1 (yi −xT i β)2/2 =: n X i=1 li. (1) The solution of equation (1) takes the form of ˆβn = (n−1XT X)−1(n−1XT y) =: Σ−1 n bn, (2) where Σn = n−1XT X and bn = n−1XT y. However, the challenge of large sample size also exists in this simple problem, i.e., the sample size n is so large that the computational cost for calculating LS solution (2) is very expensive or even not affordable. We perform the random sampling algorithm as follows: (a) Assign sampling probabilities {πi}n i=1 for all data points such that Pn i=1 πi = 1; (b) Get a subsample S = {(xi, yi) : i is drawn} by random sampling according to the probabilities; (c) Maximize a weighted loss function to get an estimate ˜β ˜β = arg min β∈Rd X i∈S 1 2πi ∥yi −xT i β∥2 = Σ−1 s bs, (3) where Σs = 1 nXT s Φ−1 s Xs, bs = 1 nXT s Φ−1 s ys, and Xs, ys and Φs are the partitions of X, y and Φ = diag{rπi}n i=1 with the subsample size r, respectively, corresponding the subsample S . Note that the last equality in (3) holds under the assumption that Σs is invertible. Throughout this paper, we assume that Σs is invertible for the convenience since p ≪n in our setting and it can be replaced with its regularized version if it is not invertible. How to construct {πi}n i=1 is a key component in random sampling algorithm. One simple method is the uniform sampling, i.e.,πi = n−1, and another method is leverage-based sampling, i.e., πi ∝ 2 xT i (XT X)−1xi. In the next section, we introduce a new efficient method: gradient-based sampling, which draws data points according to the gradient value of each data point. Related Work. [10, 11, 4] developed leverage-based sampling in matrix decomposition. [10, 12] applied the sampling method to approximate the LS solution. [13] derived the bias and variance formulas for the leverage-based sampling algorithm in linear regression using the Taylor series expansion. [14] further provided upper bounds for the mean-squared error and the worst-case error of randomized sketching for the LS problem. [15] proposed a sampling-dependent error bound then implied a better sampling distribution by this bound. Fast algorithms for approximating leverage scores {xT i (XT X)−1xi}n i=1 were proposed to further reduce the computational cost [5, 6, 7]. 3 Gradient-based Sampling Algorithm The gradient-based sampling uses a pilot solution of the LS problem to compute the gradient of the objective function, and then sampling a subsample data set according to the calculated gradient values. It differs from leverage-based sampling in that the sampling probability πi is allowed to depend on input data X as well as y. Given a pilot estimate (good guess) β0 for parameters β, we calculate the gradient for the ith data point gi = ∂li(β0) ∂β0 = xi(yi −xT i β0). (4) Gradient represents the slope of the tangent of the loss function, so logically if gradient of data points are large in some sense, these data points are important to find the optima. Our sampling strategy makes use of the gradient upon observing yi given xi, and specifically, π0 i = ∥gi∥/ n X i=1 ∥gi∥. (5) Equations (4) and (5) mean that, ∥gi∥includes two parts of information: one is ∥xi∥which is the information provided by the input data and the other is |yi −xT i β0| which is considered to provide a justification from the pilot estimate β0 to a better estimate. Figure 1 illustrates the efficiency benefit of the gradient-based sampling by constructing the following simple example. The figure shows that the data points with larger |yi −xiβ0| are probably considered to be more important in approximating the solution. On the other side, given |yi −xiβ0|, we hope to choose the data points with larger ∥xi∥ values, since larger ∥xi∥values probably cause the approximate solution be more efficient. From the computation view, calculating {π0 i }n i=1 costs O(nd), so the gradient-based sampling is much saving computational cost. −3 −2 −1 0 1 2 3 −4 −2 0 2 4 x y G G G G G G G G G G G G Figure 1: An illustration example. 12 data points are generated from yi = xi + ei where xi = (±3, ±2.5, ±2, ±1.5, ±1, ±0.5) and ei ∼N(0, 0.5). The LS solution denoted by the red line ˆβ = P12 i=1 xiyi/ P12 i=1 x2 i . The pilot estimate denoted by dashed line β0 = 0.5. Choosing the pilot estimate β0. In many applications, there may be a natural choice of pilot estimate β0, for instance, the fit from last time is a natural choice for this time. Another simple way is to use a pilot estimate β0 from an initial subsample of size r0 obtained by uniform sampling. The extra computational cost is O(r0d2), which is assumed to be small since a choice r0 ≤r will be good 3 enough. We empirically show the effect of small r0 (r0 ≤r) on the performance of the gradientbased sampling by simulations, and argue that one does not need to be careful when choosing r0 to get a pilot estimate. (see Supplementary Material, Section S1) Poisson sampling v.s. sampling with replacement. In this study, we do not choose sampling with replacement as did in previous studies, but apply Poisson sampling into this algorithm. Poisson sampling is executed in the following way: proceed down the list of elements and carry out one randomized experiment for each element, which results either in the election or in the nonselection of the element [16]. Thus, Poisson sampling can improve the efficiency in some context compared to sampling with replacement since it can avoid repeatedly drawing the same data points, especially when the sampling ratio increases, We empirically illustrates this advantage of Poisson sampling compared to sampling with replacement. (see Supplementary Material, Section S2) Independence on model assumption. LS solution is well known to be statistically efficient under the linear regression model with homogeneous errors, but model misspecification is ubiquitous in real applications. On the other hand, LS solution is also an optimization problem without any linear model assumption from the algorithmic view. To numerically show the independence of the gradient-based sampling on model assumption, we do simulation studies and find that it is an efficient sampling method from the algorithmic perspective. (see Supplementary Material, Section S3) Now as a summary we present the gradient-based sampling in Algorithm 1. Algorithm 1 Gradient-based sampling Algorithm • Pilot estimate β0: (1) Have a good guess as the pilot estimate β0, or use the initial estimate β0 from an initial subsample of size r0 by uniform sampling as the pilot estimate. • Gradient-based sampling: (2) Assign sampling probabilities {πi ∝∥gi∥}n i=1 for all data points such that nP i=1 πi = 1. (3) Generate independent si ∼Bernoulli(1, pi), where pi = rπi and r is the expected subsample size. (4) Get a subsample by selecting the element corresponding to {si = 1}, that is, if si = 1, the ith data is chosen, otherwise not. • Estimation: (5) Solve the LS problem using the subsample using equation (3) then get the subsample estimator ˜β. Remarks on Algorithm 1. (a) The subsample size r∗from Poisson sampling is random in Algorithm 1. Since r∗is multinomial distributed with expectation E(r∗) = Pn i=1 pi = r and variance V ar(r∗) = Pn i=1 pi(1 −pi), the range of probable values of r∗can be assessed by an interval. In practice we just need to set the expected subsample size r. (b) If πi’s are so large that pi = rπi > 1 for some data points, we should take pi = 1, i.e., πi = 1/r for them. 4 Error Bound Analysis of Sampling Algorithms Our main theoretical result establishes the excess risk, i.e., an upper error bound of the subsample estimator ˜β to approximate ˆβn for an random sampling method. Given sampling probabilities {πi}n i=1, the excess risk of the subsample estimator ˜β with respect to ˆβn is given in Theorem 1. (see Section S4 in Supplementary Material for the proof). By this general result, we provide an explanation why the gradient-based sampling algorithm is statistically efficient. Theorem 1 Define σ2 Σ = 1 n2 nP i=1 π−1 i ∥xi∥4, σ2 b = 1 n2 nP i=1 1 πi ∥xi∥2e2 i where ei = yi −xT i ˆβn, and R = max{∥xi∥2}n i=1, if r > σ2 Σ log d δ2(2−1λmin(Σn) −(3nδ)−1R log d)2 4 holds, the excess risk of ˜β for approximating ˆβn is bounded in probability 1 −δ for δ > R log d 3nλmin(Σn) as ∥˜β −ˆβn∥≤Cr−1/2, (6) where C = 2λ−1 min(Σn)δ−1σb. Theorem 1 indicates that, ∥˜β −ˆβn∥can be bounded by Cr−1/2. From (6), the choice of sampling method has no effect on the decreasing rate of the bound, r−1/2, but influences the constant C. Thus, a theoretical measure of efficiency for some sampling method is whether it can make the constant C attain its minimum. In Corollary 1 (see Section S5 in Supplementary Material for the proof), we show that Algorithm 1 can approximately get this aim. Remarks on Theorem 1. (a) Theorem 1 can be used to guide the choice of r in practice so as to guarantee the desired accuracy of the solution with high probability. (b) The constants σb, λmin(Σn) and σΣ can be estimated based on the subsample. (c) The risk of X˜β to predict Xˆβn follows from equation (6) and get that ∥X˜β −Xˆβn∥/n ≤Cr−1/2λ1/2 max(Σn). (d) Although Theorem 1 is established under Poisson sampling, we can easily extend the error bound to sampling with replacement by following the technical proofs in Supplementary Material, since each drawing in sampling with replacement is considered to be independent. Corollary 1 If β0 −ˆβn = op(1), then C is approximately mimimized by Algorithm 1, that is, C(π0 i ) −min π C = op(1), (7) where C(π0 i ) denotes the value C corresponding to our gradient-based sampling. The significance of Corollary 1 is to give an explanation why the gradient-based sampling is statistically efficient. The corollary establishes an improved performance guarantee on the use of the gradient-based sampling. It is improved in the sense that our gradient-based sampling can make the bound approximately attain its minimum as long as the condition is satisfied, while neither uniform sampling nor leverage-based sampling can get this aim. The condition that β0 −ˆβn = op(1) provides a benchmark whether the pilot estimate β0 is a good guess of ˆβn. Note the condition is satisfied by the initial estimate β0 from an initial subsample of size r0 by uniform sampling since β0 −ˆβn = Op(r−1/2 0 ). 5 Numerical Experiments Detailed numerical experiments are conducted to compare the excess risk of ˜β based on L2 loss against the expected subsample size r for different synthetic datasets and real data examples. In this section, we report several representative studies. 5.1 Performance of gradient-based sampling The n × d design matrix X is generated with elements drawn independently from the mixture Gaussian distributions 1 2N(−µ, σ2 x) + 1 2N(µ, θ2 mgσ2 x) below: (1) µ = 0 and θmg = 1, i.e., Gaussian distribution (referred as to GA data); (2) µ = 0 and θmg = 2, i.e.,the mixture between small and relatively large variances (referred as to MG1 data); (3) µ = 0 and θmg = 5, i.e., the mixture between small and highly large variances (referred as to MG2 data); (4) µ = 5 and θmg = 1, i.e., the mixture between two symmetric peaks (referred as to MG3 data). We also do simulations on X generated from multivariate mixture Gaussian distributions with AR(1) covariance matrix, but obtain the similar performance to the setting above, so we do not report them here. Given X, we generate y from the model y = Xβ + ϵ where each element of β is drawn from normal distribution N(0, 1) and then fixed, and ϵ ∼N(0, σ2In), where σ = 10. Note that we also consider the heteroscedasticity setting that ϵ is from a mixture Gaussian, and get the similar results to the homoscedasticity setting. So we do not report them here. We set d as 100, and n as among 20K, 50K, 100K, 200K, 500K. We calculate the full sample LS solution ˆβn for each dataset, and repeatedly apply various sampling methods for B = 1000 times to get subsample estimates ˜βb for b = 1, . . . , B. We calculate the 5 empirical risk based on L2 loss (MSE) as follows: MSE = B−1 B X b=1 ∥˜βb −ˆβn∥2. Two sampling ratio r/n values are considered: 0.01 and 0.05. We compare uniform sampling (UNIF), the leverage-based sampling (LEV) and the gradient-based sampling (GRAD) to these data sets. For GRAD, we set the r0 = r to getting the pilot estimate β0. GGG G G G G GG G G GGGGGG G GGG G G G GGGG GG GG G GG G G G GG G GG G G G GGGG G GGGGG G GGGGGG GG G G GG G GGGG G GGGG G G G GG G GG G GGGG G G G GG GG GG GG G G GG G GG G G G G G G G G G G G G GG GGG G G G G G G G G GGG GGG G GGGGGGGGGGGGGG G GGG GGG GGGGGGGGG G GGGGGG GG G G GGGG G GG GGGG G G GGG GG GG G GG G G G GG G GGG G GGGGG G GG G G G GGGGGGG G GGGG G GGG GGG GGG G GG G G G GGGG G GGGG G G GGGGGGGGGG GG GGG G G G GGG G GG GGGGGG G G G GG G GGGGGG G GGGG G G GG GGG G GG GG G G G G GGGG G GGG G G GG GG G G G GGGGG G G G G G GG GG G G G G G G GGG G G G G G GGG G G G G G G G G G G G G G G GG G G G G G G GG G G G G GG G G G G G G G G GG G GG G G GG GG G G G G G GGG G GGG G G G G G G GGG G G GGG G G GG G G GG G G G G GGGGG G G G G G GG GGG G G G GGG GG G G G G G GG G G G G G G G G G G G G GG G GGG G G G GG G G G G G G G G GGG GG G G G G G G G G G G G GGG G GG G G GG GG G G G GGGG G G G G G G G G G G G G G G G G G G G GGG G G G G G GG GG G GGG G G G G GG G G G G GGG G G GGG G G G G G G G G GG G G G GG G G G G G G G GG GG G G GG G G G G G G GG G G G G G GG G G G G G GG G G GG G G G G G G G G G G G G G G G G G G GG G G G G G GG GG G G G G G G G G G G GG G G G G G G G GG G G GG G G G G G GG GG G GG GG GG GG G G G G G G G GG G G G G G G G GGG G G GG G G G G G GG G GG G GG G G GG G GG G G G G G GG G G G G G G G G G G GGG G G GG GG G G G G G G G GGGG G G G G G G G G G GGG G GG GG G GG G G G GGGG G G G GG G G G G G GGG G G GG G GG G G G GGGG G G G GGG GG G G G G GG G G G G GGG GG G G G G G G G G GG G GG G G G G GG G G G G G GG GGGG G G G G GGG G G GGG G G G G G G G G G GG G GGG G G GG G G GG G GGGG G G G G G G G GGGG G G G G GG G G G G G G GG GG G G G GGG G G G G G G G GG G GG GGG G G G G GGG G G G GG G G GGG G GG G G G G G GG GGGG GG G G G GG G G GGG G GG G G G G G G G GG GG G G G G G G G G G G G GG G G G GG G G GG GG G G GG G G G G G G G GGGG G G G G G G G G G G GG G G G GG GG G GG G G G G G G GG G G GG G GGGG G G G GG G G G GG G G G G G G G G G GGG G G G GG GGGG G G G G G G G G G GG GG G G G G G G G G G G G G G GG G G G G G G G GG GG G G G G G G GGGG G G G G G G G GG G G G GG G G G GG G G G G GGGGG G G G G G GG G GG G G G G GGGG G G GG GGG G G G G G G G G G G G GGG G G G G G GGG G G G G G G GGG G G G G G G G G GG G G G G G G G G G G G G G GG GG GGG G G G G G G GG GG G GG G G G G G GG G GG GG G G G G G G GGG GG G G GG GG G GG G G G G GG G G G GGG GG G G G G G G GG G GGGGG G G GG G G G G GG G G GG G G G G G GG G G GG GG GGG G G G GG G G GGG G G G G GGG GG G G G G G G G G G G G GGGGG G GG G G G G GG GG GG G G G G G G G G G G G G GGGG G GGGGG G GG G G G G G G G G G G G G G G G G GG G G GG GGG G G GG G GG G GGG GG G G G G GG G GG G GGG G G G G G G G G G G G G G G G G G GG G G G GG G G G G GG G GG GG G G G G G G G G G GG G G G G G G G GGG G G G G G G G GGG G GG G G G G G G G GG G G GG G G G G GGG GG GG G G GG G G G G G G G G G G G GG GG G G G GGG G G G G GG G GG G G G G G GG G G G G G GG G G G GGGG G G G G G G GG G G GG G G GG GGG G G G G GGGGG G G GG G G G G G G G G GGG GGG G G G GG G GG G G G G G G G G G G G G GGG G GGG G GG G GG G G G GG G G G G G G GG G G GGGG G G G G G G G G G GG G G GG G G G G G GG G G G GG GGGG GGG G G G G G GG G G G G G GG G G G G G G G G G G G G G G G G G G GG G G G G G GGG G G G G GGG G G G G G G G G G G G G G GG G G G G G G G G G G G G G G G G G G G G G G G GG GGG GG GGG G GGG GGG G G GGG G G G GG G GGG G G G GG G G G G G GGG GG G G G G G G G G G GGG G G GG G G G GG G GG G G G GGGG G G G G G G G G G G G G GGG GGG GGG GG G GG G G GG G GG G G G G G G G G G G G G G GGG G G GG G G G G G G G GG G G GGGG G GG G G G GG GGGGG G G G G G G GGG G GG G G G G GG G G G G G G G GGG G G G G G GG G G GG G GGG GG G G G G G G G G G G G G G GG G G G G G G G G G G G G G G G G G G GGG G G G G G GGGG G GGGG GG GG GG G G G G G LEV GRAD −20 −16 −12 −8 GA GG G GG G G G G G GG GG G GG G GG GGG GG G GG G G G G G G GG G G GG G G GG G GG G GG G GG G G G G G GG G GG G G G G GG GGGG G G G G G GG G G G G GGG G G GGG G G G G G G GG G G G G G G G G GG G G GG GG G G G G G G G GGG G G G GG GG G G G G GGG G G G G G G G GG G G G G G G GG G G GGG GG GG G G G G G G GG GG G G G G GGG G G GG G GG G GGGG G G GG G G G GG G G G GGG G G G G G G G G G G GGG G G G G G G G G G G G GG G G GG G GG G G G GG G G G G G GG G G GG G G GGG GG G G GGG G G G GGG G G G G G G G G G GG G G G G G G GG GG G G GG G G GGG GGG G G G G G G GG G G G G G G G GG G GG GG G G GG GG G GG G G G G G G G G G GG G G G G GG G G G G G G G G G G GG G GG G GGG G G G G G GG GGG GG G G GGG G G G GG GG G G G G G G G G G G G G GG G G G G G G GG G G G GG GG G G G G G G G G GG GG GG GG G G G G G GG G GGG G GG G G G G G G G G GG G G G G GGG G G G G G G G G G G GGG G G G G G G G G GGG G G G G G G GG G G G G GG G G GGG G G GG G G G G G G G GG GGGGG G GGG GG G G G GGG G G GGGG G G G G GG G G G GG GG G GGG G G G GGG G G G G G G GG G G G G GGG G GG G G G G G G GGG G G G G G G GG G GGG G G G G G GG GG G GG G GG G G G GG G GG G GG G G G G G G G G G G G G G G GGG G G G GG G G GGG G G G GGG G G GG G GG G G G G G G GG G G G G G G G GG G G GG G G G G G G G G G G G G G GG G G G G GG G G GGG G G GG G G G G GG G G GG G G G G G G G G G G GGG G G G GG G G G G GG G G G GG GG G G GG G G G G G GGG G G G GG G G G GG GGG GG G G GG G G GGGG G G G GG G G G GG G G G G G G G G G G G GG G G G GG G GG G GG G LEV GRAD −20 −16 −12 −8 MG1 G G GG GG G G G GG GGGG G GGGG G GG G GG G GGGG G G GG G G G GG G GG G G G GGG G G G G G GG G G G G G G G G G G G G G G G GG GG G G G GG GG G G G G G GGG GG G G G G GG G G GGG G G G G G G G G G G GG G GG G G G GG GG G GG GG G G G G G G G G GG G G G GGG G G G G G GG G G GG G G G G G G GGG G GG G GG G G G GG G GG G GGG G G G G G G G G G G G G G G GG G G GG G G G G G G G G G G GG G GGG G GGGGG G G G G G G G G G G GGG G G G GG G G GGG G G G G G G GG G G GG G G G G G G G G GG G G GGGG G GG G G GGG G GG G G G G G GG G G GGG G G G GG G GG GG GG G G GG G G G GG G G G G G G G G G G G G G G GG G G GG G LEV GRAD −20 −16 −12 −8 MG2 GGG G G G GGGGG G G G GG G G G GGG G GGGGGGGG GG GGG G GGGGGG G G GG GGGGG G GG G G G G GG GGG GGGG GGGGGG GG G G GGGG GG GGGGGGG G GGGGG GG GGGG G GGGGGGG G GGGGGG G G G GGGGG GG GG G G G GGGGGG G GGG G GGGGGG G GG G GG GG GGGG G GGGG G G G G GG GGGGGGGGG GG G GG GGGGGGG G GG GG GG GG GGG G GG G GGGGG G GG GG G G GGGG G GG G G GG GGGGGGGGGG G GGGGGGGGGGGGGG GG GGG G GGGGG GGG GGGGGGG G G G G G GGGGGGGGGGGGGGGG GG GGGGG GG GG G GGG GG GGG GGG G G GGGGGGGG G G GG G G GGG G G G G G G G GGG G GGGGG G G GG G GGGG GGG G GGGG GG G G GG GG GG G G G G GG G G G G G G G G G G G GG G G G G G G GG G G G G GG G G G G G G GG G G G G G G G G G G G G G G G G G G G G G G G G GG GG GG GG G G G G G G G G G GGG G G G GG G G G G GG GG G G G GG G G G G G G GG G G GG G G GG GG G G GG G G GG G G G G GG G G G G GG G G G G GG GG G GG GG G GG G G G G G GG GGGGGG G G G G G G G G G G G G GG G G G G G G GG G G G G G G G GGG G G GG G G G G G G G G G G G GG G G G G G G G G G G G G G G G G G G GG G G G G G G G G G G G G G G G GGG G G G G GGG G GG G G G G G GG G G G G G G G GG G G GG G G G G G G G G GG G G G GG G G G G G G G G G G G G G G G G GG G G G GG G G G G G G G G GG G GG G G G G G G G G G GGG G G G G G G G G G G G G G G G GG G GGG G GG G G G G GG GG GG G GG G G GG G G G G G GG G G G G G G G G G G G G G G G GGG G G G GGG G G G G G GGG G G G G G GGGG G G G GG G G G G G GG G G G G G G G G G GG GG G G G G G G G G G G GGG G GG G GGGG GG G G G G G G G GGG G G G G G G G G G G GG G G GG G G GGG G G G G G G G G GG G G G G GG G GG G G GG G GG G G G G G G G G G G G GG G G G G GG GG GG G G GG G GG G G GGG G G GGG G G GGG G GG G G GG G G G G GGGG GGGG GG G G G G GG G G GG G GGG G G G G GG GGG G GG GG GGGG G G GG GGGG G G G G G G G G GGG G G G G G G G GG GG G G G G G G G GGGG G G G G G G G G G GG G GG GGG G G G G G G G G G G G G G G G GG GGGG G G GG G GG G GGG GGGG G G G GG G GG GG G G G GG G G G G G GG G G G G G G G G GG G G G G G GG G G G G G G G G G GG GGG G G G G G G G G G G G G G G G G G G G G G G GGG G G G G G GG G G G G G G GG G G G G G GG G GG G G GGG G G G G GG G G G G G G G G G G G GG G GG G G GG G G G G G G G G G G G G G G G GGG G G G GG GGG G GGG GG G G G G GG G G G G G GG G G G GGG G G G G GG GG G G GG G G G GG G G G G G G G GG G G G G G G G G G G G G G G G G G G G GG G G G G G G GG GG GG GGG G G G G G G GG G G GGGGG G G G GGG G G G G GGGGGG G GG G G G GG GGG G G G G G G G G GGG G G G G G G G G G G G G G G G G G G G G G G G G G GG G GG G GG G G G G G G G G G G GG G G GG G G G G GG G G GGG GGG GG G G G GGG G G GG G G G GGGG G G G G GG G G G G G G G G G G GG G G GG G G G GGG G G G G G G G G G G G G GG G G GG G G G GG G G GG G G G G G G G G G G GG G G G G G G G GG G G G GG GG G G G G G GG GG G G G G GG GG GG GGG G G G GG G G G GGG G G G GGGG GG GG G G G G G GG G G G G G G G G GG G G G GG G G G GG G GG G GGGG G G G G G G G G G G G G G G GG G G GGG G G GG GG GG G GG GGG GGG GGG G GGG G GGG G G G G G G G G G G GGG G G G G G G G G G GG G G G G G G G GG G G GG G G G G G G G G G G G GG G G G G G GG G G G G G G GG G G G G G G G G G G G G G G G G G G G G G G G G G GG G G GG G G G G G GGG G G G G GGG G G G GG G G G G G GGGG G G G G G G G GG G G G G G G GG G G G G GG G G G G G GG G G G G GG G G GG GG GG G GG G G G G G G GG GG G G G GG G GG G G G G G G G GGGG G G GG G G G GG G G G GGGGGG G G GG G G G G G G GG G G G G GG G G GG G G G G G G G G G G G GGG G GG G G G G G GGG G G G G G G G G G G G GG G G G G G GG G G GGG GG G GG G G GG GGGGG G G GGG G G G G G G GG G G GG G G G G G GG G G G G G GGGGGGGG G G G G G G G GGG GGG G GG G GG G G GG G G G G G G G G G G G GG GG GGG G G G G G G G GG G G GGG G G G G G G G G G G G GGG G GGG G G GG G G G G GG G G G G G G G G G G G GG G G GG G GG G G G G G G G G G G G G GG G GG G G G G G G G G GGG G GG G GG G G GGG G G G GG G LEV GRAD −20 −16 −12 −8 MG3 Figure 2: Boxplots of the logarithm of different sampling probabilities of X matrices with n = 50K. From left to right: GA, MG1, MG2 and MG3 data sets. Figure 2 gives boxplots of the logarithm of sampling probabilities of LEV and GRAD, where taking the logarithm is to clearly show their distributions. We have some observations from the figure. (1) For all four datasets, GRAD has heavier tails than LEV, that is, GRAD lets sampling probabilities more disperse than LEV. (2) MG2 tends to have the most heterogeneous sampling probabilities, MG1 has less heterogeneous than MG2, whereas MG3 and GA have the most homogeneous sampling probabilities. This indicates that the mixture of large and small variances has effect on the distributions of sampling probabilities while the mixture of different peak locations has no effect. We plot the logarithm of MSE values for GA, MG1, and MG2 in Figure 3, where taking the logarithm is to clearly show the relative values. We do not report the results for MG3, as there is little difference between MG3 and GA. There are several interesting results shown in Figure 3. (1) GRAD has better performance than others, and the advantage of GRAD becomes obvious as r/n increases. (2) For GA, LEV is shown to have similar performance to UNIF, however GRAD has obviously better performance than UNIF. (3) When r/n increases, the smaller n is needed to make sure that GRAD outperforms others. From the computation view, we compare the computational cost for UNIF, approximate LEV (ALEV) [5, 6] and GRAD in Table 1, since ALEV is shown to be computationally efficient to approximate LEV. From the table, UNIF is the most saving, and the time cost of GRAD is much less than that of ALEV. It indicates that GRAD is also an efficient method from the computational view, since its running time is O(nd). Additionally, Table 2 summaries the computational complexity of several sampling methods for fast solving LS problems. 5.2 Real Data Examples In this section, we compare the performance of various sampling algorithms on two UCI datasets: CASP (n = 45730, d = 9) and OnlineNewsPopularity (NEWS) (n = 39644, d = 59). At first, we plot boxplots of the logarithm of sampling probabilities of LEV and GRAD in Figure 4. From it, similar to synthetic datasets, we know that the sampling probabilities of GRAD looks more dispersed compared to those of LEV. The MSE values are reported in Table 3. From it, we have two observations below. First, GRAD has smaller MSE values than others when r is large. Second, as r increases, the outperformance of Poisson sampling than sampling with replacement gets obvious for various methods. Similar observation is gotten in simulations (see Supplementary Material, Section S2). 6 10.0 10.5 11.0 11.5 12.0 12.5 13.0 −1 0 1 2 3 GA log(sample size) log(MSE) G G G G G G G G G G G G G G G UNIF LEV GRAD 10.0 10.5 11.0 11.5 12.0 12.5 13.0 −4 −3 −2 −1 0 1 2 MG1 log(sample size) log(MSE) G G G G G G G G G G G G G G G 10.0 10.5 11.0 11.5 12.0 12.5 13.0 −5 −4 −3 −2 −1 0 1 MG2 log(sample size) log(MSE) G G G G G G G G G G G G G G G 10.0 10.5 11.0 11.5 12.0 12.5 13.0 −3 −2 −1 0 1 log(sample size) log(MSE) G G G G G G G G G G G G G G G 10.0 10.5 11.0 11.5 12.0 12.5 13.0 −6 −5 −4 −3 −2 log(sample size) log(MSE) G G G G G G G G G G G G G G G 10.0 10.5 11.0 11.5 12.0 12.5 13.0 −7 −6 −5 −4 −3 log(sample size) log(MSE) G G G G G G G G G G G G G G G Figure 3: Empirical mean-squared error of ˜β for approximating ˆβn. From top to bottom: upper panels are r/n = 0.01, and lower panels r/n = 0.05. From left to right: GA, MG1, and MG2 data, respectively. Table 1: The cost time of obtaining ˜β on various subsample sizes r by UNIF, ALEV and GRAD for n = 500K, 5M, where () denotes the time of calculating full sample LS solution ˆβn. We perform the computation by R software in PC with 3 GHz intel i7 processor, 8 GB memory and OS X operation system. n = 500K System Time (0.406) User Time (7.982) r 200 500 2000 200 500 2000 UNIF 0.000 0.002 0.003 0.010 0.018 0.050 ALEV 0.494 0.642 0.797 2.213 2.592 4.353 GRAD 0.099 0.105 0.114 0.338 0.390 0.412 n = 5M System Time (121.4) User Time (129.88) r 500 2000 10000 500 2000 10000 UNIF 0.057 0.115 0.159 2.81 5.94 14.28 ALEV 50.86 53.64 81.85 86.12 88.36 120.15 GRAD 5.836 6.107 6.479 28.85 30.06 37.51 6 Conclusion In this paper we have proposed gradient-based sampling algorithm for approximating LS solution. This algorithm is not only statistically efficient but also computationally saving. Theoretically, we provide the error bound analysis, which supplies a justification for the algorithm and give a tradeoff between the subsample size and approximation efficiency. We also argue from empirical studies that: (1) since the gradient-based sampling algorithm is justified without linear model assumption, it works better than the leverage-based sampling under different model specifications; (2) Poisson sampling is much better than sampling with replacement when sampling ratio r/n increases. 7 Table 2: The running time of obtaining ˜β by various sampling strategy. Stage D1 is computing the weights, D2 is computing the LS based on subsample, “overall" is the total running time. Stage D1 D2 overall Full O(max{nd2, d3}) O(max{nd2, d3}) UNIF O(max{rd2, d3}) O(max{rd2, d3}) LEV O(nd2) O(max{rd2, d3}) O(max{nd2, rd2, d3}) ALEV O(nd log n) O(max{rd2, d3}) O(max{nd log n, rd2, d3}) GRAD O(nd) O(max{rd2, d3}) O(max{nd, rd2, d3}) GGG G G GGGGGGG GG G G G GGGGGG G GG GG GGGG G GG G G GGGG GGG G G G GGGGGGGGGGGGGGG G G G GGGGGGGGGGGGGGG G GGG G GG GGG G GGGGGGG GG G G G GGG GGGGGG GGGG GGGGGGG G G GG G GGGGGGGG GGGGGGG G G G GGG G G GG GGGGGGGG G G G G G GG G GGGGGGGGG G GG G GG GGG G GGGGGGG GGGGGGGGG G GG G G G GGGG GGGGGGGGG G G G GG GGGG G GGGGGGG G GG G GGG G GG GG GGGGGGGG G GG G GGGGGGGG G GGG G GG G GGG G GGG G GGGG G GG G GGG G G GGG G GGG GG GGGGGG G G G G GGGG G G GGGGG G G G GG G G G GGGGGGGGG GG GGG GG G GGGGG GGGGG GG GG G GGGGGGGG GGG G G G GGGGGGGGGGGGG G G G GGGGG G G G GG G G GGGG GG G GGGGGGGG GG G G GGGG GGGGG G GGGGGG G GGGGGGG G GGGGGGGGG GGGGGGGGGGG GGGG GG G G G GGGGGG GG GG GGG GGG G GG G GG G GGGGGGGG GGG GGGGG GGGG GG GGG G GGGGG GG GGGGGGGGGGGGG G GGGG G GG G GGG G GGG GGG GGGGG GGGGGGGGGG G GGGG G GGGGGG G GG G GG G GGG GGGGGG G G GGGGGG GGGGGGG GGGGG G G GG G G G GGGGG G G G GGG G GG G G GGGGGGGGGGG GGG GGGGGG G GG G GG G GGG GG GG G GGGG GGGGG G GGG G GG G G G G G G GG G G GGGGGGGGG G G G GGGGGGGG G G G GGGGGG G G GGG GG GGG G GGGG G GGGG GGG G GGGGG GGG G G G G G G GG G GG G GGGG G G G G GG G G GGG G GGG G GGG G GGGG GG G GGG GG G G G G GG G G G GG G GG GG G GGG G GGGG G GG G GG G G G GG G G G GGGG GG G G G GGGGG G G G G GGG G G GG G G GG G GG G GG G G G GG GGGGGGG G G GGG G G GGGGGGG G G G G GG G G G GGG G G G G G GG G GG G GGG G G G G G G G GGG GGG G GG G G G GG GG G G G G G G G G G G G G G G G G G G GG G G G GGGG G GGGGG G G GGGGG G G G G GG GG G G GGG G GGGG G GG G G GGG G G G GG G GGGGG G G GG G G G G G G G GGG GG G GG G G G G GGG G G G GGGGG G G G G G G G G GG GGG GG G G G GG G G G G G G G G G G GGGGG G G GG G G G GG G G G GGGGG GG G GG GGG GGG GG G G G GGGGGG G GG G G GG GG G G G G GGG GGG G G G G G G G GG G G G G GG G G G G GGG G GG GG G G G G G GGGGGG GG G G GG G GGG G G G G GG G G GG G GGGG G GGGGG G G GG GG G GGG G GG G G G GG G G G G G G GG GGGG G G G GGGGG GGG G G G G G GG GG G GGG G G G G GG G G G G G GG GG G G GG GGG G GGG G G G G GG G G G G G G G G GGG G GG GG G GG G G G G GGGG GGG G G G G GG G G GG G GGGG G G G GGGGG G G G G G GGG G GGGG GG GG GG GG G GGG G G G G GGGG G G G GG GG GG G G G G GG G G GG G G GG G G GG G G GGGGGGG G GGG GGG G GGG G G G G G G G G G G GGG GG G G GG G G G G G G G G G G GG GGG G GGG G GG G G G GG GGG G GGG GG G G GG GGG GGG G G G GG G GG G G G GG G G GGG G G GG G G G G GG GG GGGGGG G GG G GG G GGGGGG G G GGG G G G GG G GGGG G GG G G G GG G G GGG G G GGG GG G GGG G GG G GG G G G GGG G GGGGGGG G G G G G GGG G G G G G G GGG G GG G G GG G GGG G G GG G G GGGGG G GG G GG GGG G GG G GGG GG G GG G G G G GGG GGG G G G G GG G G G G GGGGG GGGGG G G GGGGGG GG GG GG G GGGG G G G GG G G G GG G GGG G G GG GG G G G G GGG G GG GG G G GG G G G G G G GGGGGG G G GGGGGG G GG G GG G G GG G G G GG G GGGGGG G G G G GGG G G G GGGGG G GGG G GGGG G G G G G GG G G G G GG G GG GG GG G G GGGGGGGG GGGGGG G G G GG GGG GG G G G G G G G GG GG G G G GG G GG G GGG G G GGG GGGGGGGG G G G GG G G GG G GG G G G G GGGGGGG GGG G G GG G GG G G G G GG G G G GG G G GG G G G G G G GG G G G G G G G GG G G GG G GGG G G G GGGG G GGGG GGG GG GG G GG G GGG G GG G GG GGG G G GG GGG G GGG GG GG G G G GG G GG GGG G GG G GGGGG G GGGGG G GGG G GGGGGGGGG G GGG G GG G GGG G G G G G GGG G GGG G GG G G G G G G GG G G G G G G G G G G GG G G G GGGGG GGGG G GGG G G G G G G GG G GGGG G G G GG G G G G GGGGGG GG G G G GGGGGG GG G G GGG G G G G G G GGGGG G G G G GG G G G G GGGGGGGGGGGG G G GG G GG G G G G GG GG G GG G G G G GG GGGG G GGG G G G G G GG G GG G G G G G GGG G G G G G GG G G G GG G G G G GG GG G G G GGG GGGG G G G GGG G G G G GG G G GG G G G G G G GG G G G GGGG G G GGG GGG G GG G G G G GG GGGGGGGGG G GG G G GG G G GG G G G G G GGGGG G G GG GGG GG G G G G G GGGGGGGGG G GGGG G GGG GG G G GGG G G G G G GGG G G GG G GG G G GGGGG G G G GG G GGGGG G G G GG G G G G GG G G G G G G G G GG GGG GGG GGG G G GG GGGGGGG G GG G GGGG G G GG G G GGGGGG G G GG G GG GG G G LEV GRAD −20 −15 −10 −5 CASP GG GGGGGGGGGGG G G G GG G GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG GGGGGG G GG GG G G G GGG GGGGGGGGGGGGGG G GGG GGG G GGGGG G G GGGG G G GG G G G G GGG GGGGG G GGGGG G G G G G GG GG GGGGGGGGGGGGGGGGGGG GGGGG GGGGG GGGGGGGGG G GG G GGG G GG G G GGGGGGGG G GGGGGGGG G GGGGGG G GG G GGGGG G GG G G GGGGGG G GGG G GGGGGGGGG G GGGGG G GGGGGGGGGGGGGGGGGG GG GGG G GGGG GG GGG G G G G GGGGGG GG G GGGGGGGG GGGG G G GGG G G G G G GG G G G G G G G GGGGGG GGGG GG G G G GGG GG GGGGGGGGGG GGG GG G G GGGG GGGGGGG G G G GGG GG GGGG GGGGGGGGGGGGG G GG GGGGGGGG GG GGGGG G GGG G GGGGGGG G G G GGG GG G GG G G G G GGG G G G GGG GGGGGG G GGGGG G G G G G GG GG G G G GGGG G G G GGGG G G G G GGGGGGG G G G GG G G G GG G GGGG G GGG G GGGGG GG G GGG G GGG G GG G G GGGGG GG G G G GG G G G GG G GGGG G G G G G GGG GG GGG GGGGGGGG GGGGGGGGGGGGGGGGG G G G G GGGGGGG GGGGG GGGG G GG G GG GG GG GG GGG G GG G GG G G GGGGG G G GGGG G GG GG GGGGG GGGGG G G G G G GGG G G G G G GGG G GGG G GGGGG G GG G GG G G G G GG G G GG G G GG GGG G G GG GGGGGGGGG G GGG G GGGGG G GGG G G G GG G GGGGG G GGGG G G GG GGGGG GG G GGGGG G GG G G GGGGGGGG G G G GGGGGGGGGGGGGGGGG G GG GGG G GGG G GGG G G GGGGGG GG G GGG G GGG G GGG G GG G GGGGG G GGG G G GGGGGGG G GG GGG GGG G GGGGGG GG G GG GG GGGGGG G GGGGGG GG G GGGGGGGGG GG G G GGGGGGGGGGGGGGGG G GGGG G GGGGGGGG G G GGGGGGGGG G GGG G GGG GGGGGGGGGGGG G GG G GG G G G GGGG GG G GGGGG GGGGGGG GG G GG GGGGG G GGGG G GGGGG G GG GG GGGGGGGGG GG GGGGGG GG G G GG GG GG G G G GGGGGGG G G GGG G G GGGGGGG GG G G G G G G G G G G G GG G GG G G G G G G G G G G G G G GG G G G G G G G G G G G GGG GG G G G G G GG G G G G G G G G G GG G G G G G G G G GG G G G G G G G G GG G G GG GGG GG GGGG GG G GG G G GG GGG G G G G G GG G G GG G G G G GG GGG G GG GG G G G G G G G G G GG G GGGG GG G G G G G GGGG G G GG G GGGG G GGG G GG G GGG G GG G G GG G G GG GGGG GGG GGGGG G GGGGGGGG G G GG G G G GG G G G GG GGGGG G G G GGGG G GG G G G GGGG GGG GGGGG G G G G G G GG GG G G G G G GG G G G GGG G G G G GG G G G G GG G G GG G G GGGGGG GGG GGG G GG GGGG GG GGGG G G G G G GG GGG G GG GGGGG G G G G GGGG G GGGGGGG G G G GGGGGG G G G G GGG G G G G GGGG G G G G G G G GG GGGG G G G G GG G G G G G GG G G G GGGG G GGG G GG G GG G GG GG G GG G GGG GG G GGGG G G GGG G GG G GGG G G G GGG G GG G G G G G G G GGGG G G G G G GGGGG G G G G G GG G G G G G GGGGGG G G GGG G G G GGG G G GG G GG G G G GG G G G GG G G G GGG G GGG G GG G G G G GGG G GGG G G GG GGGGGGG G GG G G GGGGGG G G GGGGGGGGG G G GG G GG GGGGGGGG G G G G G G G G GGGGGGGGGG G GGGG G G G GGG G GGGGGG G GG G G G G GG GGG G GGGG G G G GGG G G G GGGG G GGGGGGGG G GGG GG G GG G GG GG GGGG GGG GGG GGG G GGGG GGG G G G G G G GGGG G GGGGGG GGG G GGG G GGGGGG G G GG GGGGG G G G GG G G GG GGGG G G G G GG G G GG G GGG G GGGGGGGG G GGG GG G G G GGGG GGG G GGGGG G GG GGGGGGGG G GG G GGGG G GG GGGGGG G GG G GGGG GG GG GG GGG G G G G G G G G GGG GGGGG GGG GGG G GGGGGGGG G G G G GG G G GGGGGG G GG G GG GGGG G GGG G G G G GGG GG GG G GG G G G GG GGGGG GG G G G G G G GG GGGG G G G G GG G GGGGG G GGGGGG GGG G G G G G G G GG GGGG G GG G GG G G GG G GGGGGGGG G GG GGGG GGG G GGGGGG G G G GGG GG G G G G G GGG GGGGGG G G GGGGGGGG GG GGG G GGG GGG GG GGGGGG G GG G GGGG G GG G GG GGGGGG G GGGG G G GGG G G G GG G G GGGG GGG G G GGG GG GG G G G GG G GG G G GG GGGGGG GGGGG GGG G G G G G GGGG G G G GGGG G G GG G GGGGGG G GG G G GG G G G GG G G G GGGGGG G G G G GGG GG G G GG GGG G G G G G GG G GG G G GG GG G G G G GGGGG G G G G G G G G G GGGG GG G G G G G G G G GG G G G G G G G G G G G G G G GG GG G G G G G G GG GGG GGGG G G G G G GGGGG G GG G G G G G GG GG GG G G G G G G GG G G G G G G G G GGGG G GG G G G G G G G G G G G G GG GG G G G G G G G G G G GG G G G G G G G G GGG G G G G G G G G G G G G G G G GG G GG G GG G G G G G G G G G G GG G G G GGG G G G G G G GGG G G GG G G G G GGG G G GG G G G G G G G G G G G G G G G G G GGGGG GG G G G G G GG G G G G G G G G G G G GG GGG G G GG G G G GG G GG GG G G G G GG G G G GGG G G G G G G G G GGG GG G GG G G G GG GG GGG G G G G GG G G G G G G G G G G G G G G G GG G G GGG GG G G GGG G GG GG G GG G GGGGG GG G G G G G G G GG G GG G GGG G G G GGG G G G G G G G G G G G G G G GGG G G GG G GG G G G G G G GG G G G G G G G G GG GG G G GG G G GGG G G G G GG GG G G G G G G G G G G G G G G G GG G G G G G G G G G GGGG G G G G GG G G GGGG G G G G G G G GG G G G G G GG GG G G GG G G G G GG G G G GG G G G G G G G G G G G G G G G G G G G G G GGGG G G G G G G G G G GG G G GG G G G G G GGGG G GG G G G G GG G G G G G G G G GG G GG G G G GG G G G G G GG G G G GG G G G G G GG GG G G G G G G GG G G G G G G G G G GG G G G G G G G G GG G G GG G G G GG G G G G G GG GG G G G GG G G G G G G G G G GGG G G GGG G G G GG G G GG G G G G G G G G G GG GGGG G GG G G GG G G G G G G G G G G G G G G G GG G G G G G G G G G GG G G GG G G G G G G G G G G G G G GGG G G GGG GGG GG G GGG G GGGG G G G G GGG G G GGGG G G G GGGG G G GGG G GG G G GG GG G GG G G G G G G G G G GG G G G G G G G G G G GG G G GG G G GGG G GG G GGG G G G G G G G G G G G GG GG GG GGG G G G G GG G G GGG GG G GG G G G G G GG G G G GG G G G G GG GGGGG G GG G G GG GGG GG G GG G G G GG G GG G G G GG G GG G G G GG G GG G G G G G G G G G G G G G G G GGGG G GGG G G G G G G G GG GG G G G G G G G G GG G GG GG G GGGG GG G G G GG GG G GG G G G G GG G G G G G GG G GG G G G G G G G GG GG GG G GG G G G G GG GGG G GG G G GG G G G GG G GG G G GG G G G G G G GGG G G G GGG G G G GG G G G G G G G G G G G GG G G G G G G G G GGG G G G G GG G G G G G GG GGG G G GG GG G GG GG G GG G G G G G GG G G G G GG G G GGG GG G G G G G GGG G G G G G G G G G G GGG G G G G GG GG G G G GG GG GG G G G G GG G G GG G G G G G G GGG G G G G G GG GG GG G G G G G G G G G G G G G GGG G G GG G GG G G GG GG G G G G G GG G G G G G G G G G G GG G G G G G GGG G GG G G G G G G G G GGG G G G G G G GGG G G G G G G G G G GG G G G G G G G GGG GGGG G G GG G GG G G G G G GG G G GG G GG G G G G GG GG G G G GGG GG G GGG G G G G G G G G G G G G G G G G G G G G G GG G G G G G G G G GG G G G G G GG G G G GG G G G G G G GG G G GG GG GG G G G G G G GGG GGG G G G G G G G G GG G G G G GGG G GG G G G G G G GG GG GGG G G G G G GG G GG G G GG G GG G G GG G G GG GG G G G G G GGG G G G GG G GG G G G G GGG G GG G GG G G G G GGG GGG GG G GG G G G G G G G G G G G GG G G GG G G G G G G G G G GG G G G G GG G GG G G GGG G G G G G GG G G G GGG G G G G G GGGGG G G G G G G G G G G G GG G G G LEV GRAD −20 −15 −10 −5 NEWS Figure 4: Boxplots of the logarithm of sampling probabilities for LEV and GRAD among datasets CASP and NEWS Table 3: The MSE comparison among various methods for real datasets, where “SR" denotes sampling with replacement, and “PS" denotes Poisson sampling. CASP n = 45730, d = 9 r 45 180 450 1800 4500 UNIF-SR 2.998e-05 9.285e-06 4.411e-06 1.330e-06 4.574e-07 UNIF-PS 2.702e-05 9.669e-06 4.243e-06 1.369e-06 4.824e-07 LEV-SR 1.962e-05 4.379e-06 1.950e-06 4.594e-07 2.050e-07 LEV-PS 2.118e-05 5.240e-06 1.689e-06 4.685e-07 1.694e-07 GRAD-SR 2.069e-05 5.711e-06 1.861e-06 4.322e-07 1.567e-07 GRAD-PS 2.411e-05 5.138e-06 1.678e-06 3.687e-07 1.179e-07 NEWS n = 39644, d = 59 r 300 600 1200 2400 4800 UNIF-SR 22.050 14.832 10.790 7.110 4.722 UNIF-PS 27.215 19.607 15.258 9.504 4.378 LEV-SR 22.487 11.047 5.519 2.641 1.392 LEV-PS 21.971 9.419 4.072 2.101 0.882 GRAD-SR 10.997 5.508 3.074 1.505 0.752 GRAD-PS 9.729 5.252 2.403 1.029 0.399 There is an interesting problem to address in the further study. Although the gradient-based sampling is proposed to approximate LS solution in this paper, we believe that this sampling method can apply into other optimization problems for large-scale data analysis, since gradient is considered to be the steepest way to attain the (local) optima. Thus, applying this idea to other optimization problems is an interesting study. Acknowledgments This research was supported by National Natural Science Foundation of China grants 11301514 and 71532013. We thank Xiuyuan Cheng for comments in a preliminary version. 8 References [1] P. Drineas, R. Kannan, and M.W. Mahoney. Fast monte carlo algorithms for matrices i: approximating matrix multiplication. SIAM Journal on Scientific Computing, 36:132–157, 2006. [2] P. Drineas, R. Kannan, and M.W. Mahoney. Fast monte carlo algorithms for matrices ii: computing a low-rank approximation to a matrix. SIAM Journal on Scientific Computing, 36:158–183, 2006. [3] P. Drineas, R. Kannan, and M.W. Mahoney. Fast monte carlo algorithms for matrices iii: computing a compressed approximate matrix decomposition. SIAM Journal on Scientific Computing, 36:184–206, 2006. [4] M.W. Mahoney and P. Drineas. CUR matrix decompositions for improved data analysis. Proceedings of the National Academy of Sciences, 106:697–702, 2009. [5] P. Drineas, M. Magdon-Ismail, M.W. Mahoney, and D.P. Woodruff. Fast approximation of matrix coherence and statistical leverage. Journal of Machine Learning Research, 13:3475– 3506, 2012. [6] D.P. Clarkson, K.L.and Woodruff. Low rank approximation and regression in input sparsity time. STOC, 2013. [7] M.B. Cohen, Y.T. Lee, C. Musco, C. Musco, R. Peng, and A. Sidford. Uniform sampling for matrix approximation. arXiv:1408.5099, 2014. [8] P. Dhillon, Y. Lu, D.P. Foster, and L. Ungar. New subsampling algorithns for fast least squares regression. In Advances in Neural Information Processing Systems, volume 26, pages 360–368, 2013. [9] D. Shender and J. Lafferty. Computation-risk tradeoffs for covariance-thresholded regression. In Proceedings of the 30th International Conference on Machine Learning, 2013. [10] P. Drineas, M.W. Mahoney, and S. Muthukrishnan. Sampling algorithms for l2 regression and applications. In Proceedings of the 17th Annual ACM-SIAM Symposium on Discrete Algorithms, pages 1127–1136, 2006. [11] P. Drineas, M.W. Mahoney, and S. Muthukrishnan. Relative-error CUR matrix decomposition. SIAM Journal on Matrix Analysis and Applications, 30:844–881, 2008. [12] P. Drineas, M.W. Mahoney, S. Muthukrishnan, and T. Sarlos. Faster least squares approximation. Numerische Mathematik, 117:219–249, 2011. [13] P. Ma, M.W. Mahoney, and B. Yu. A statistical perspective on algorithmic leveraging. In Proceedings of the 31th International Conference on Machine Learning, 2014. [14] G. Raskutti and M.W. Mahoney. A statistical perspective on randomized sketching for ordinary least-squares. In Proc. of the 32nd ICML Conference, 2015. [15] T. Yang, L. Zhang, R. Jin, and S. Zhu. An explicit sampling dependent spectral error bound for column subset selection. In Proc. of the 32nd ICML Conference, 2015. [16] C.E. Särndal, B. Swensson, and J.H. Wretman. Model Assisted Survey Sampling. Springer, New York, 2003. 9
2016
335
6,256
Accelerating Stochastic Composition Optimization Mengdi Wang⇤, Ji Liu⇤, and Ethan X. Fang Princeton University, University of Rochester, Pennsylvania State University mengdiw@princeton.edu, ji.liu.uwisc@gmail.com, xxf13@psu.edu Abstract Consider the stochastic composition optimization problem where the objective is a composition of two expected-value functions. We propose a new stochastic firstorder method, namely the accelerated stochastic compositional proximal gradient (ASC-PG) method, which updates based on queries to the sampling oracle using two different timescales. The ASC-PG is the first proximal gradient method for the stochastic composition problem that can deal with nonsmooth regularization penalty. We show that the ASC-PG exhibits faster convergence than the best known algorithms, and that it achieves the optimal sample-error complexity in several important special cases. We further demonstrate the application of ASC-PG to reinforcement learning and conduct numerical experiments. 1 Introduction The popular stochastic gradient methods are well suited for minimizing expected-value objective functions or the sum of a large number of loss functions. Stochastic gradient methods find wide applications in estimation, online learning, and training of deep neural networks. Despite their popularity, they do not apply to the minimization of a nonlinear function involving expected values or a composition between two expected-value functions. In this paper, we consider the stochastic composition problem, given by min x2<n H(x) := Ev(fv(Ew(gw(x)))) | {z } =:F (x) +R(x) (1) where (f ◦g)(x) = f(g(x)) denotes the function composition, gw(·) : <n 7! <m and fv(·) : <m 7! < are continuously differentiable functions, v, w are random variables, and R(x) : <n 7! < [ {+1} is an extended real-valued closed convex function. We assume throughout that there exists at least one optimal solution x⇤to problem (1). We focus on the case where fv and gw are smooth, but we allow R to be a nonsmooth penalty such as the `1-norm. We do no require either the outer function fv or the inner function gw to be convex or monotone. As a result, the composition problem cannot be reformulated into a saddle point problem in general. Our algorithmic objective is to develop efficient algorithms for solving problem (1) based on random evaluations of fv, gw and their gradients. Our theoretical objective is to analyze the rate of convergence for the stochastic algorithm and to improve it when possible. In the online setting, the iteration complexity of our stochastic methods can be interpreted as a sample-error complexity upper bound for estimating the optimal solution of problem (1). 1.1 Motivating Examples One motivating example is reinforcement learning [Sutton and Barto, 1998]. Consider a controllable Markov chain with states 1, . . . , S. Estimating the value-per-state of a fixed control policy ⇡is known ⇤Equal contribution. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. as on-policy learning. It can be casted into an S ⇥S system of Bellman equations: γP ⇡V ⇡+ r⇡= V ⇡, where γ 2 (0, 1) is a discount factor, P ⇡ s˜s is the transition probability from state s to state ˜s, and r⇡ s is the expected state transition reward at state s. The solution V ⇡to the Bellman equation is the value vector, with V ⇡(s) being the total expected reward starting at state s. In the blackbox simulation environment, P ⇡, r⇡are unknown but can be sampled from a simulator. As a result, solving the Bellman equation becomes a special case of the stochastic composition optimization problem: min x2<S kE[A]x −E[b]k2, (2) where A, b are random matrices and random vectors such that E[A] = I −γP ⇡and E[b] = r⇡. It can be viewed as the composition of the square norm function and the expected linear function. We will give more details on the reinforcement learning application in Section 4. Another motivating example is risk-averse learning. For example, consider the mean-variance minimization problem min x Ea,b[h(x; a, b)] + λVara,b[h(x; a, b)], where h(x; a, b) is some loss function parameterized by random variables a and b, and λ > 0 is a regularization parameter. Its batch version takes the form min x 1 N N X i=1 h(x; ai, bi) + λ N N X i=1 h(x; ai, bi) −1 N N X i=1 h(x; ai, bi) !2 . Here the variance term is the composition of the mean square function and an expected loss function. Although the stochastic composition problem (1) was barely studied, it actually finds a broad spectrum of emerging applications in estimation and machine learning (see Wang et al. [2016] for a list of applications). Fast optimization algorithms with theoretical guarantees will lead to new computation tools and online learning methods for a broader problem class, no longer limited to the expectation minimization problem. 1.2 Related Works and Contributions Contrary to the expectation minimization problem, “unbiased" gradient samples are no longer available for the stochastic composition problem (1). The objective is nonlinear in the joint probability distribution of (w, v), which substantially complicates the problem. In a recent work by Dentcheva et al. [2015], a special case of the stochastic composition problem, i.e., risk-averse optimization, has been studied. A central limit theorem has been established, showing that the K-sample batch problem converges to the true problem at the rate of O(1/ p K) in a proper sense. For the case where R(x) = 0, Wang et al. [2016] has proposed and analyzed a class of stochastic compositional gradient/subgradient methods (SCGD). The SCGD involves two iterations of different time scales, one for estimating x⇤by a stochastic quasi-gradient iteration, the other for maintaining a running estimate of g(x⇤). Wang and Liu [2016] studies the SCGD in the setting where samples are corrupted with Markov noises (instead of i.i.d. zero-mean noises). Both works establish almost sure convergence of the algorithm and several convergence rate results, which are the best-known convergence rate prior to the current paper. The idea of using two-timescale quasi-gradient traced back to the earlier work Ermoliev [1976]. The incremental treatment of proximal gradient iteration has been studied extensively for the expectation minimization problem, see for examples Beck and Teboulle [2009], Bertsekas [2011], Ghadimi and Lan [2015], Gurbuzbalaban et al. [2015], Nedi´c [2011], Nedi´c and Bertsekas [2001], Nemirovski et al. [2009], Rakhlin et al. [2012], Shamir and Zhang [2013], Wang and Bertsekas [2016], Wang et al. [2015]. However, except for Wang et al. [2016] and Wang and Liu [2016], all of these works focus on variants of the expectation minimization problem and do not apply to the stochastic composition problem (1). Another work partially related to this paper is by Dai et al. [2016]. They consider a special case of problem (1) arising in kernel estimation, where they assume that all functions fv’s are convex and their conjugate functions f ? v ’s can be easily obtained/sampled. Under these additional assumptions, they essentially rewrite the problem into a saddle point optimization involving functional variables. 2 In this paper, we propose a new accelerated stochastic compositional proximal gradient (ASC-PG) method that applies to the penalized problem (1), which is a more general problem than the one considered in Wang et al. [2016]. We use a coupled martingale stochastic analysis to show that ASC-PG achieves significantly better sample-error complexity in various cases. We also show that ASC-PG exhibits optimal sample-error complexity in two important special cases: the case where the outer function is linear and the case where the inner function is linear. Our contributions are summarized as follows: 1. We propose the first stochastic proximal-gradient method for the stochastic composition problem. This is the first algorithm that is able to address the nonsmooth regularization penalty R(·) without deteriorating the convergence rate. 2. We obtain a convergence rate O(K−4/9) for smooth optimization problems that are not necessarily convex, where K is the number of queries to the stochastic first-order oracle. This improves the best known convergence rate and provides a new benchmark for the stochastic composition problem. 3. We provide a comprehensive analysis and results that apply to various special cases. In particular, our results contain as special cases the known optimal rate results for the expectation minimization problem, i.e., O(1/ p K) for general objectives and O(1/K) for strongly convex objectives. 4. In the special case where the inner function g(·) is a linear mapping, we show that it is sufficient to use one timescale to guarantee convergence. Our result achieves the non-improvable rate of convergence O(1/K) for optimal strongly convex optimization and O(1/ p K) for nonconvex smooth optimization. It implies that the inner linearity does not bring fundamental difficulty to the stochastic composition problem. 5. We show that the proposed method leads to a new on-policy reinforcement learning algorithm. The new learning algorithm achieves the optimal convergence rate O(1/ p K) for solving Bellman equations (or O(1/K) for solving the least square problem) based on K observations of state-tostate transitions. In comparison with Wang et al. [2016], our analysis is more succinct and leads to stronger results. To the best of our knowledge, Theorems 1 and 2 in this paper provide the best-known rates for the stochastic composition problem. Paper Organization. Section 2 states the sampling oracle and the accelerated stochastic compositional proximal gradient algorithm (ASC-PG). Section 3 states the convergence rate results in the case of general nonconvex objective and in the case of strongly convex objective, respectively. Section 4 describes an application of ASC-PG to reinforcement learning and gives numerical experiments. Notations and Definitions. For x 2 <n, we denote by x0 its transpose, and by kxk its Euclidean norm (i.e., kxk= p x0x). For two sequences {yk} and {zk}, we write yk = O(zk) if there exists a constant c > 0 such that kykkckzkk for each k. We denote by Ivalue condition the indicator function, which returns “value” if the “condition” is satisfied; otherwise 0. We denote by H⇤the optimal objective function value of problem (1), denote by X⇤the set of optimal solutions, and denote by PS(x) the Euclidean projection of x onto S for any convex set S. We also denote by short that f(y) = Ev[fv(y)] and g(x) = Ew[gw(x)]. 2 Algorithm We focus on the black-box sampling environment. Suppose that we have access to a stochastic first-order oracle, which returns random realizations of first-order information upon queries. This is a typical simulation oracle that is available in both online and batch learning. More specifically, assume that we are given a Sampling Oracle (SO) such that • Given some x 2 <n, the SO returns a random vector gw(x) and a noisy subgradient rgw(x). • Given some y 2 <m, the SO returns a noisy gradient rfv(y). Now we propose the Accelerated Stochastic Compositional Proximal Gradient (ASC-PG) algorithm, see Algorithm 1. ASC-PG is a generalization of the SCGD proposed by Wang et al. [2016], in which a proximal step is used to replace the projection step. In Algorithm 1, the extrapolation-smoothing scheme (i.e., the (y, z)-step) is critical to the acceleration of convergence. The acceleration is due to the fast running estimation of the unknown quantity 3 Algorithm 1 Accelerated Stochastic Compositional Proximal Gradient (ASC-PG) Require: x1 2 <n, y0 2 <m, SO, K, stepsize sequences {↵k}K k=1, and {βk}K k=1. Ensure: {xk}K k=1 1: Initialize z1 = x1. 2: for k = 1, · · · , K do 3: Query the SO and obtain gradient samples rfvk(yk), rgwk(zk). 4: Update the main iterate by xk+1 = prox↵kR(·) ( xk −↵krg> wk(xk)rfvk(yk) ) . 5: Update auxillary iterates by an extrapolation-smoothing scheme: zk+1 = ✓ 1 −1 βk ◆ xk + 1 βk xk+1, yk+1 = (1 −βk)yk + βkgwk+1(zk+1), where the sample gwk+1(zk+1) is obtained via querying the SO. 6: end for g(xk) := Ew[gw(xk)]. At iteration k, the running estimate yk of g(xk) is obtained using a weighted smoothing scheme, corresponding to the y-step; while the new query point zk+1 is obtained through extrapolation, corresponding to the z-step. The updates are constructed in a way such that yk is a nearly unbiased estimate of g(xk). To see how the extrapolation-smoothing scheme works, we let the weights be ⇠(k) t = ( βt Qk i=t+1(1 −βi), if k > t ≥0 βk, if k = t ≥0. (3) Then we can verify the following important relations: xk+1 = k X t=0 ⇠(k) t zt+1, yk+1 = k X t=0 ⇠(k) t gwt+1(zt+1), which essentially say that xk+1 is a damped weighted average of {zt+1}k+1 0 and yk+1 is a damped weighted average of {gwt+1(zt+1)}k+1 0 . An Analytical Example of the Extrapolation-Smooth Scheme Now consider the special case where gw(·) is always a linear mapping gw(z) = Awz + bz and βk = 1/(k + 1). We can verify that ⇠(k) t = 1/(k + 1) for all t. Then we have g(xk+1) = 1 k + 1 k X t=0 E[Aw]zt+1 +E[bw], yk+1 = 1 k + 1 k X t=0 Awt+1zt+1 + 1 k + 1 k X t=0 bwt+1. In this way, we can see that the scaled error k(yk+1 −g(xk+1)) = k X t=0 (Awt+1 −E[Aw])zt+1 + k X t=0 (bwt+1 −E[bw]) is a zero-mean and zero-drift martingale. Under additional technical assumptions, we have E[kyk+1 −g(xk+1)k2] O (1/k) . Note that the zero-drift property of the error martingale is the key to the fast convergence rate. The zero-drift property comes from the near-unbiasedness of yk, which is due to the special construction of the extrapolation-smoothing scheme. In the more general case where gw is not necessarily linear, we can use a similar argument to show that yk is a nearly unbiased estimate of g(xk). As a result, the extrapolation-smoothing (y, z)-step ensures that yk tracks the unknown quantity g(xk) efficiently. 4 3 Main Results We present our main theoretical results in this section. Let us begin by stating our assumptions. Note that all assumptions involving random realizations of v, w hold with probability 1. Assumption 1. The samples generated by the SO are unbiased in the following sense: 1. E{wk,vk}(rg> wk(x)rfvk(y)) = rg>(x)rf(y) 8k = 1, 2, · · · , K, 8x, 8y. 2. Ewk(gwk(x)) = g(x) 8x. Note that wk and vk are not necessarily independent. Assumption 2. The sample gradients and values generated by the SO satisfy Ew(kgw(x) −g(x)k2) σ2 8x. Assumption 3. The sample gradients generated by the SO are uniformly bounded, and the penalty function R has bounded gradients. krfv(x)k⇥(1), krgw(x)k⇥(1), k@R(x)k⇥(1) 8x, 8w, 8v Assumption 4. There exist LF , Lf, Lg > 0 such that 1. F(z) −F(x) hrF(x), z −xi + LF 2 kz −xk2 8x 8z. 2. krfv(y) −rfv(w)kLfky −wk 8y 8w 8v. 3. kg(x) −g(z) −rg(z)>(x −z)kLg 2 kx −zk2 8x 8z. Our first main result concerns with general optimization problems which are not necessarily convex. Theorem 1 (Smooth (Nonconvex) Optimization). Let Assumptions 1, 2, 3, and 4 hold. Denote by F(x) := (Ev(fv) ◦Ew(gw))(x) for short and suppose that R(x) = 0 in (1) and E(F(xk)) is bounded from above. Choose ↵k = k−a and βk = 2k−b where a 2 (0, 1) and b 2 (0, 1) in Algorithm 1. Then we have PK k=1 E(krF(xk)k2) K O(Ka−1 + L2 fLgK4b−4aIlog K 4a−4b=1 + L2 fK−b + K−a). (4) If Lg 6= 0 and Lf 6= 0, choose a = 5/9 and b = 4/9, yielding 1 K K X k=1 E(krF(xk)k2) O(K−4/9). (5) If Lg = 0 or Lf = 0, choose a = b = 1/2, yielding 1 K K X k=1 E(krF(xk)k2) O(K−1/2). (6) The result of Theorem 1 strictly improves the best-known results given by Wang et al. [2016]. First the result of (5) improves the finite-sample error bound from O(k−2/7) to O(k−4/9) for general convex and nonconvex optimization. This improves the best known convergence rate and provides a new benchmark for the stochastic composition problem. Note that it is possible to relax the condition “E(F(xk)) is bounded from above" in Theorem 1. However, it would make the analysis more cumbersome and yield an additional term log K in the error bound. Our second main result concerns strongly convex objective functions. We say that the objective function H is optimally strongly convex with parameter λ > 0 if H(x) −H(PX⇤(x)) ≥λkx −PX⇤(x)k2 8x. (7) (see Liu and Wright [2015]). Note that any strongly convex function is optimally strongly convex, but the reverse does not hold. For example, the objective function (2) in on-policy reinforcement learning is always optimally strongly convex (even if E(A) is a rank deficient matrix), but not necessarily strongly convex. 5 Theorem 2. (Strongly Convex Optimization) Suppose that the objective function H(x) in (1) is optimally strongly convex with parameter λ > 0 defined in (7). Set ↵k = Cak−a and βk = Cbk−b where Ca > 4λ, Cb > 2, a 2 (0, 1], and b 2 (0, 1] in Algorithm 1. Under Assumptions 1, 2, 3, and 4, we have E(kxK −PX⇤(xK)k2) O ( K−a + L2 fLgK−4a+4b + L2 fK−b) . (8) If Lg 6= 0 and Lf 6= 0, choose a = 1 and b = 4/5, yielding E(kxK −PX⇤(xK)k2) O(K−4/5). (9) If Lg = 0 or Lf = 0, choose a = 1 and b = 1, yielding E(kxK −PX⇤(xK)k2) O(K−1). (10) Let us discuss the results of Theorem 2. In the general case where Lf 6= 0 and Lg 6= 0, the convergence rate in (9) is consistent with the result of Wang et al. [2016]. Now consider the special case where Lg = 0, i.e., the inner mapping is linear. This result finds an immediate application to Bellman error minimization problem (2) which arises from reinforcement learning problem in (and with `1 norm regularization). The proposed ASC-PG algorithm is able to achieve the optimal rate O(1/K) without any extra assumption on the outer function fv. To the best of our knowledge, this is the best (also optimal) sample-error complexity for on-policy reinforcement learning. Remarks Theorems 1 and 2 give important implications about the special cases where Lf = 0 or Lg = 0. In these cases, we argue that our convergence rate (10) is “optimal" with respect to the sample size K. To see this, it is worth pointing out the O(1/K) rate of convergence is optimal for strongly convex expectation minimization problem. Because the expectation minimization problem is a special case of the problem (1), the O(1/K) convergence rate must be optimal for the stochastic composition problem too. • Consider the case where Lf = 0, which means that the outer function fv(·) is linear with probability 1. Then the stochastic composition problem (1) reduces to an expectation minimization problem since (Evfv ◦Ewgw)(x) = Ev(fv(Ewgw(x))) = EvEw(fv ◦gw)(x). Therefore, it makes a perfect sense to obtain the optimal convergence rate. • Consider the case where Lg = 0, which means that the inner function g(·) is a linear mapping. The result is quite surprising. Note that even g(·) is a linear mapping, it does not reduce problem (1) to an expectation minimization problem. However, the ASC-PG still achieves the optimal convergence rate. This suggests that, when inner linearity holds, the stochastic composition problem (1) is not fundamentally more difficult than the expectation minimization problem. The convergence rate results unveiled in Theorems 1 and 2 are the best known results for the composition problem. We believe that they provide important new result which provides insights into the complexity of the stochastic composition problem. 4 Application to Reinforcement Learning In this section, we apply the proposed ASC-PG algorithm to conduct policy value evaluation in reinforcement learning through attacking Bellman equations. Suppose that there are in total S states. Let the policy of interest be ⇡. Denote the value function of states by V ⇡2 <S, where V ⇡(s) denotes the value of being at state s under policy ⇡. The Bellman equation of the problem is V ⇡(s1) = E⇡{rs1,s2 + γ · V ⇡(s2)|s1} for all s1, s2 2 {1, ..., S}, where rs1,s2 denotes the reward of moving from state s1 to s2, and the expectation is taken over all possible future state s2 conditioned on current state s1 and the policy ⇡. We have that the solution V ⇤2 <S to the above equation satisfies that V ⇤= V ⇡. Here a moderately large S will make solving the Bellman equation directly impractical. To resolve the curse of dimensionality, in many practical applications, we approximate the value of each state by some linear map of its feature φs 2 <m, where d < S to reduce the dimension. In particular, we assume that V ⇡(s) ⇡φT s w⇤for some w⇤2 <m. To compute w⇤, we formulate the problem as a Bellman residual minimization problem that min w S X s=1 (φT s w −q⇡,s0(w))2, 6 k ×104 0 3 6 9 ∥wk −w∗∥ 0 2 4 6 8 ASC-PG SCGD GTD2-MP k ×104 0 3 6 9 ∥Φwk −Xw∗∥ 0 3 6 9 12 ASC-PG SCGD GTD2-MP log(k) 7.5 8 8.5 log(∥wk −w∗∥) -0.5 0 0.5 1 1.5 2 ASC-PG SCGD GTD2-MP log(k) 7.5 8 8.5 log(∥Φwk −w∗∥) 0 0.5 1 1.5 2 2.5 ASC-PG SCGD GTD2-MP Figure 1: Empirical convergence rate of the ASC-PG algorithm and the GTD2-MP algorithm under Experiment 1 averaged over 100 runs, where wk denotes the solution at the k-th iteration. where q⇡,s0(w) = E⇡{rs,s0 + γ · φs0w} = P s0 P ⇡ ss0({rs,s0 + γ · φs0w); γ < 1 is a discount factor, and rs,s0 is the random reward of transition from state s to state s0. It is clearly seen that the proposed ASC-PG algorithm could be directly applied to solve this problem where we take g(w) = (φT 1 w, q⇡,1(w), ..., φT Sw, q⇡,S(w)) 2 <2S, f ⇣ (φT 1 w, q⇡,1(w), ..., φT Sw, q⇡,S(w)) ⌘ = S X s=1 (φsw −q⇡,s0(w))2 2 <. We point out that the g(·) function here is a linear map. By our theoretical analysis, we expect to achieve a faster O(1/k) rate, which is justified empirically in our later simulation study. We consider three experiments, where in the first two experiments, we compare our proposed accelerated ASC-PG algorithm with SCGD algorithm [Wang et al., 2016] and the recently proposed GTD2-MP algorithm [Liu et al., 2015]. Also, in the first two experiments, we do not add any regularization term, i.e. R(·) = 0. In the third experiment, we add an `1-penalization term λkwk1. In all cases, we choose the step sizes via comparison studies as in Dann et al. [2014]: • Experiment 1: We use the Baird’s example [Baird et al., 1995], which is a well-known example to test the off-policy convergent algorithms. This example contains S = 6 states, and two actions at each state. We refer the readers to Baird et al. [1995] for more detailed information of the example. • Experiment 2: We generate a Markov decision problem (MDP) using similar setup as in White and White [2016]. In each instance, we randomly generate an MDP which contains S = 100 states, and three actions at each state. The dimension of the Given one state and one action, the agent can move to one of four next possible states. In our simulation, we generate the transition probabilities for each MDP instance uniformly from [0, 1] and normalize the sum of transitions to one, and we generate the reward for each transition also uniformly in [0, 1]. • Experiment 3: We generate the data same as Experiment 2 except that we have a larger d = 100 dimensional feature space, where only the first 4 components of w⇤are non-zeros. We add an `1-regularization term, λkwk1, to the objective function. Denote by wk the solution at the k-th iteration. For the first two experiments, we report the empirical convergence performance kwk −w⇤k and kΦwk −Φw⇤k, where Φ = (φ1, ..., φS)T 2 <S⇥d and Φw⇤= V , and all wk’s are averaged over 100 runs, in the first two subfigures of Figures 1 and 2. It is seen that the ASC-PG algorithm achieves the fastest convergence rate empirically in both experiments. To further evaluate our theoretical results, we plot log(t) vs. log(kwk −w⇤k) (or log(kΦwk −Φ⇤k) averaged over 100 runs for the first two experiments in the second two subfigures of Figures 1 and 7 k ×104 0 3 6 9 ∥wk −w∗∥ 0 2 4 6 ASC-PG SCGD GTD2-MP k ×104 0 2 4 6 8 ∥Φwk −Φw∗∥ 0 10 20 30 40 50 ASC-PG SCGD GTD2-MP log(k) 7.5 8 8.5 9 9.5 10 log(∥wk −w∗∥) -2 -1 0 1 2 ASC-PG SCGD GTD2-MP log(k) 7.5 8 8.5 9 9.5 10 log(∥Φwk −Φw∗∥) 0 1 2 3 4 ASC-PG SCGD GTD2-MP Figure 2: Empirical convergence rate of the ASC-PG algorithm and the GTD2-MP algorithm under Experiment 2 averaged over 100 runs, where wk denotes the solution at the k-th iteration. 2. The empirical results further support our theoretical analysis that kwk −w⇤k2= O(1/k) for the ASC-PG algorithm when g(·) is a linear mapping. For Experiment 3, as the optimal solution is unknown, we run the ASC-PG algorithm for one million iterations and take the corresponding solution as the optimal solution ˆw⇤, and we report kwk −ˆw⇤k and kΦwk −Φ ˆw⇤k averaged over 100 runs in Figure 3. It is seen the the ASC-PG algorithm achieves fast empirical convergence rate. k ×104 0 2 4 6 8 ∥wt −ˆw∗∥ 0 1 2 3 4 5 lambda = 1e-3 lambda = 5e-4 t ×104 0 2 4 6 8 ∥Φwk −Φ ˆw∗∥ 0 5 10 15 20 25 lambda = 1e-3 lambda = 5e-4 Figure 3: Empirical convergence rate of the ASC-PG algorithm with the `1-regularization term λkwk1 under Experiment 3 averaged over 100 runs, where wk denotes the solution at the t-th iteration. 5 Conclusion We develop a proximal gradient method for the penalized stochastic composition problem. The algorithm updates by interacting with a stochastic first-order oracle. Convergence rates are established under a variety of assumptions, which provide new rate benchmarks. Application of the ASCPG to reinforcement learning leads to a new on-policy learning algorithm, which achieves faster convergence than the best known algorithms. For future research, it remains open whether or under what circumstances the current O(K−4/9) can be further improved. Another direction is to customize and adapt the algorithm and analysis to more specific problems arising from reinforcement learning and risk-averse optimization, in order to fully exploit the potential of the proposed method. Acknowledgments This project is in part supported by NSF grants CNS-1548078 and DMS-10009141. 8 References L. Baird et al. Residual algorithms: Reinforcement learning with function approximation. In Proceedings of the twelfth international conference on machine learning, pages 30–37, 1995. A. Beck and M. Teboulle. A fast iterative shrinkage-thresholding algorithm for linear inverse problems. SIAM journal on imaging sciences, 2(1):183–202, 2009. D. P. Bertsekas. Incremental proximal methods for large scale convex optimization. Mathematical Programming, Ser. B, 129:163–195, 2011. B. Dai, N. He, Y. Pan, B. Boots, and L. Song. Learning from conditional distributions via dual kernel embeddings. arXiv preprint arXiv:1607.04579, 2016. C. Dann, G. Neumann, and J. Peters. Policy evaluation with temporal differences: A survey and comparison. The Journal of Machine Learning Research, 15(1):809–883, 2014. D. Dentcheva, S. Penev, and A. Ruszczynski. Statistical estimation of composite risk functionals and risk optimization problems. arXiv preprint arXiv:1504.02658, 2015. Y. M. Ermoliev. Methods of Stochastic Programming. Monographs in Optimization and OR, Nauka, Moscow, 1976. S. Ghadimi and G. Lan. Accelerated gradient methods for nonconvex nonlinear and stochastic programming. Mathematical Programming, pages 1–41, 2015. M. Gurbuzbalaban, A. Ozdaglar, and P. Parrilo. On the convergence rate of incremental aggregated gradient algorithms. arXiv preprint arXiv:1506.02081, 2015. B. Liu, J. Liu, M. Ghavamzadeh, S. Mahadevan, and M. Petrik. Finite-sample analysis of proximal gradient td algorithms. In Proc. The 31st Conf. Uncertainty in Artificial Intelligence, Amsterdam, Netherlands, 2015. J. Liu and S. J. Wright. Asynchronous stochastic coordinate descent: Parallelism and convergence properties. SIAM Journal on Optimization, 25(1):351–376, 2015. A. Nedi´c. Random algorithms for convex minimization problems. Mathematical Programming, Ser. B, 129:225–253, 2011. A. Nedi´c and D. P. Bertsekas. Incremental subgradient methods for nondifferentiable optimization. SIAM Journal on Optimization, 12:109–138, 2001. A. Nemirovski, A. Juditsky, G. Lan, and A. Shapiro. Robust stochastic approximation approach to stochastic programming. SIAM Journal on Optimization, 19:1574–1609, 2009. A. Rakhlin, O. Shamir, and K. Sridharan. Making gradient descent optimal for strongly convex stochastic optimization. In Proceedings of the 29th International Conference on Machine Learning, pages 449–456, 2012. O. Shamir and T. Zhang. Stochastic gradient descent for non-smooth optimization: Convergence results and optimal averaging schemes. In Proceedings of The 30th International Conference on Machine Learning, pages 71–79, 2013. R. S. Sutton and A. G. Barto. Reinforcement Learning: An Introduction. MIT press, 1998. M. Wang and D. P. Bertsekas. Stochastic first-order methods with random constraint projection. SIAM Journal on Optimization, 26(1):681–717, 2016. M. Wang and J. Liu. A stochastic compositional subgradient method using Markov samples. Proceedings of Winter Simulation Conference, 2016. M. Wang, Y. Chen, J. Liu, and Y. Gu. Random multi-constraint projection: Stochastic gradient methods for convex optimization with many constraints. arXiv preprint arXiv:1511.03760, 2015. M. Wang, X. Fang, and H. Liu. Stochastic compositional gradient descent: Algorithms for minimizing compositions of expected-value functions. Mathematical Programming Series A, 2016. A. White and M. White. Investigating practical, linear temporal difference learning. arXiv preprint arXiv:1602.08771, 2016. 9
2016
336
6,257
Variational Inference in Mixed Probabilistic Submodular Models Josip Djolonga Sebastian Tschiatschek Andreas Krause Department of Computer Science, ETH Z¨urich {josipd,tschiats,krausea}@inf.ethz.ch Abstract We consider the problem of variational inference in probabilistic models with both log-submodular and log-supermodular higher-order potentials. These models can represent arbitrary distributions over binary variables, and thus generalize the commonly used pairwise Markov random fields and models with log-supermodular potentials only, for which efficient approximate inference algorithms are known. While inference in the considered models is #P-hard in general, we present efficient approximate algorithms exploiting recent advances in the field of discrete optimization. We demonstrate the effectiveness of our approach in a large set of experiments, where our model allows reasoning about preferences over sets of items with complements and substitutes. 1 Introduction Probabilistic inference is one of the main building blocks for decision making under uncertainty. In general, however, this problem is notoriously hard even for deceptively simple-looking models and approximate inference techniques are necessary. There are essentially two large classes in which we can categorize approximate inference algorithms — those based on variational inference or on sampling. However, these methods typically do not scale well to large numbers of variables, or exhibit an exponential dependence on the model order, rendering them intractable for models with large factors, which can naturally arise in practice. In this paper we focus on the problem of inference in point processes, i.e. distributions P(A) over subsets A ⊆V of some finite ground set V . Equivalently, these models can represent arbitrary distributions over |V | binary variables1. Specifically, we consider models that arise from submodular functions. Recently, Djolonga and Krause [1] discussed inference in probabilistic submodular models (PSMs), those of the form P(A) ∝exp(±F(A)), where F is submodular. These models are called log-submodular (with the plus) and log-supermodular (with the minus) respectively. They generalize widely used models, e.g., pairwise purely attractive or repulsive Ising models and determinantal point processes (DPPs) [2]. Approximate inference in these models via variational techniques [1, 3] and sampling based methods [4, 5] has been investigated. However, many real-world problems have neither purely log-submodular nor log-supermodular formulations, but can be naturally expressed in the form P(A) ∝exp(F(A) −G(A)), where both F(A) and G(A) are submodular functions — we call these types of models mixed PSMs. For instance, in a probabilistic model for image segmentation there can be both attractive (log-supermodular) potentials, e.g., potentials modeling smoothness in the segmentation, and repulsive (log-submodular) potentials, e.g., potentials indicating that certain pixels should not be assigned to the same class. While the sampling based approaches for approximate inference are in general applicable to models 1Distributions over sets A ⊆V are isomorphic to distributions over |V | binary variables, where each binary variable corresponds to an indicator whether a certain element is included in A or not. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. with both types of factors, fast mixing is only guaranteed for a subclass of all possible models and these methods may not scale well to large ground sets. In contrast, the variational inference techniques were only developed for either log-submodular or log-supermodular models. In this paper we close this gap and develop variational inference techniques for mixed PSMs. Note that these models can represent arbitrary positive distributions over sets as any set function can be represented as the difference of a submodular and a supermodular function [6].2 By exploiting recent advances in submodular optimization we formulate efficient algorithms for approximate inference that easily scale to large ground sets and enable the usage of large mixed factors. Applications/Models. Mixed PSMs are natural models for a variety of applications — modeling of user preferences, 3D stereo reconstruction [7], and image segmentation [8, 9] to name a few. For instance, user preferences over items can be used for recommending products in an online marketing application and naturally capture the economic notions of substitutes and complements. Informally, item a is a substitute for another item b if, given item b, the utility of a diminishes (log-submodular potentials); on the other hand, an item c is a complement for item d if, given item d, the utility of c increases (log-supermodular potentials). Probabilistic models that can model substitutes of items are for example DPPs [2] and the facility location diversity (FLID) model [10]. In §4 we extend FLID to model both substitutes and complements which results in improved performance on a real-world product recommendation task. In terms of computer vision problems, non-submodular binary pairwise MRFs are widely used [8], e.g., as discussed above in image segmentation. Our contributions. We generalize the variational inference procedure proposed in [1] to models containing both log-submodular and log-supermodular potentials, enabling inference in arbitrary distributions over binary variables. Furthermore, we provide efficient approximate algorithms for factor-wise coordinate descent updates enabling faster inference for certain types of models, in particular for rich scalable diversity models. In a large set of experiments we demonstrate the effectiveness of mixed higher-order models on a product recommendation task and illustrate the merit of the proposed variational inference scheme. 2 Background: Variational Inference in PSMs Submodularity. Let F : 2V →R be a set function, i.e., a function mapping sets A ⊆V to real numbers. We will furthermore w.l.o.g assume that V = {1, 2, . . . , n}. Formally, a function F is called submodular if it satisfies the following diminishing returns property for all A ⊆B ⊆V \ {i}: F(A ∪{i}) −F(A) ≥F(B ∪{i}) −F(B). Informally, this property states that the gain of an item i in the context of a smaller set A is larger than its gain in the context of a larger set B. A function G is called supermodular if −G is submodular. A function F is modular, if it is both submodular and supermodular. Modular functions F can be written as F(A) = P i∈A mi for some numbers mi ∈R, and can be thus parameterized by vectors m ∈Rn. As a shorthand we will frequently use m(A) = P i∈A mi. Probabilistic submodular models (PSMs). PSMs are distributions over sets of the form P(A) = 1 Z exp(±F(A)), where Z = P A⊆V exp(±F(A)) ensures that P(A) is normalized, and is often called the partition function. The distribution P(A) is called log-submodular if the sign in the above definition is positive and log-supermodular if the sign is negative. These distributions generalize many well known classical models and have been effectively used for image segmentation [11], and for modeling diversity of item sets in recommender systems [10]. When F(A) = m(A) is a modular function, P(A) ∝exp(F(A)) is called log-modular and corresponds to a fully factorized distribution over n binary random variables X1, . . . , Xn, where we have for each element i ∈V an associated variable Xi indicating if this element is included in A or not. The resulting distribution can be written as P(A) = 1 Z exp(m(A)) = Y i∈A σ(mi) Y i/∈A σ(−mi), 2As the authors in [6] note, such a decomposition can be in general hard to find. 2 where σ(u) = 1/(1 + e−u) is the sigmoid function. Variational inference and submodular polyhedra. Djolonga and Krause [1] considered variational inference for PSMs, whose idea we will present here in a slightly generalized manner. Their approach starts by bounding F(A) using functions of the form m(A) + t, where m(A) is a modular function and t ∈R. Let us first analyze the log-supermodular case. If for all A ⊆V it holds that m(A) + t ≤F(A), then we can bound the partition function Z as log Z = log X A⊆V e−F (A) ≤log X A⊆V e−m(A)−t = n X i=1 log(1 + e−mi) −t. Then, the idea is to optimize over the free parameters m and t to find the best upper bound, or to equivalently solve the optimization problem min (m,t)∈L(F ) n X i=1 log(1 + exp(−mi)) −t, (1) where L(F) is the set of all lower bounds of F, also known as the generalized submodular lower polyhedron [12] L(F) := {(x, t) ∈Rn+1 | ∀A ⊆V : x(A) + t ≤F(A)}. (2) Djolonga and Krause [1] show that one obtains the same optimum if we restrict ourselves to t = 0 and one additional constraint, i.e., if we instead of L(F) use the base polytope B(F) defined as B(F) := L(F) ∩{(x, 0) ∈Rn+1 | x(V ) = F(V )}. In words, it contains all modular lower bounds of F that are tight at V and ∅. Thanks to the celebrated result of Edmonds [13], one can optimize linear functions over B(F) in time O(n log n). This, together with the fact that log(1 + e−u) is 1 4-smooth, in turn renders the optimization problem (1) solvable via the Frank-Wolfe procedure [14, 15]. In the log-submodular case, we have to replace in problem (1) the minuses with pluses and use instead of L(F) the set of upper bounds. This set, denoted as U(F), defined by reversing the inequality sign in Equation (2), is called the generalized submodular upper polyhedron [12]. Unfortunately, in contrast to L(F), one can not easily optimize over U(F) and asking membership queries is an NPhard problem. As discussed by Iyer and Bilmes [12] there are some special cases, like M ♮-concave functions [16], where one can describe U(F), which we will discuss in § 3. Alternatively, which is the approach taken by [3], one can select a specific subfamily of U(F) and optimize over them. 3 Inference in Mixed PSMs We consider mixed PSMs, i.e. probability distributions over sets that can be written in the form P(A) ∝exp(F(A) −G(A)), where F(A) and G(A) are both submodular functions. Furthermore, we assume that F and G decompose as F(A) = PmF i=1 Fi(A), and G(A) = PmG i=1 Gi(A), where the functions Fi and Gi are all submodular. Note that this is not a limiting assumption, as submodular functions are closed under addition and we can always take mF = mG = 1, but such a decomposition will sometimes allow us to obtain better bounds. The corresponding distribution has the form P(A) ∝ mF Y j=1 exp(Fj(A)) mG Y j=1 exp(−Gj(A)). (3) Similarly to the approach by Djolonga and Krause [1], we perform variational inference by upper bounding F(A) −G(A) by a modular function parameterized by m and a constant t such that F(A) −G(A) ≤m(A) + t for all A ⊆V. (4) This upper bound induces the log-modular distribution Q(A) ∝exp(m(A) + t). Ideally, we would like to select (m, t) such that the partition function of Q(A) is as small as possible (and thus our approximation of the partition function of P(A) is as tight as possible), i.e., we aim to solve min (m,t)∈U(F −G) t + |V | X i=1 log(1 + exp(mi)). (5) 3 Optimization (and even membership checks) over U(F −G) is in general difficult, mainly because of the structure of U(F −G), which is given by 2n inequalities. Thus, we seek to perform a series of inner approximations of U(F −G) that make the optimization more tractable. Approximating U(F −G). In a first step we approximate U(F −G) as U(F)−L(G) ⊆U(F −G), where the summation is understood as a Minkowski sum. Then, we can replace L(G) by B(G) without losing any expressive power, as shown by the following lemma (see [3][Lemma 6]). Lemma 1. Optimizing problem (5) over U(F) −L(G) and over U(F) −B(G) yields the same optimum value. This lemma will turn out to be helpful when we shortly describe our strategy for minimizing (5) over U(F) −B(G) as it will render some of our subproblems convex optimization problems over B(G)— these subproblems can then be efficiently solved using the Frank-Wolfe algorithm as proposed in [1] by noting that a greedy algorithm can be used to solve linear optimization problems over B(G) [17]. By assumption, F(A) and G(A) are composed of simpler functions. First, because G = PmG j=1 Gj, it holds that B(G) = PmG j=1 B(Gj) (see e.g. [18]). Second, even though it is hard to describe U(F), it might hold that U(Fi) has a tractable description, which leads to the natural inner approximation U(F) ⊇PmF j=1 U(Fj). To wrap up, we performed the following series of inner approximations U(F −G) ⊇ U(F) − B(G) ⊇ = ⊇ PmF j=1 U(Fj) − PmG j=1 B(Gj) , which we then use to approximate U(F −G) in problem (5) before solving it. Optimization. To solve the resulting problem we use a block coordinate descent procedure. Let us first rewrite the problem in a form that enables us to easily describe the algorithm. Let us write our resulting approximation as (m, t) = mF X j=1 (fj, tj) − mG X j=1 (gj, 0), where we have constrained (fj, tj) ∈U(Fj) and gj ∈B(Gj). The resulting problem is then to solve min (fj,tj)∈U(Fj),gj∈B(Gj) mF X j=1 tj + n X i=1 log h 1 + exp( mF X j=1 fj,i − mG X j=1 gj,i) i | {z } =:T ((fj,tj)j=1,...,mF ,(gj)j=1,...,mG) . (6) Then, until convergence, we pick one of the mG + mF blocks uniformly at random and solve the resulting optimization problem, which we now show how to do. Log-supermodular blocks. For a log-supermodular block j, minimizing (6) over gj is a smooth convex optimization problem and we can either use the Frank-Wolfe procedure as in [1], or the divide-and-conquer algorithm (see e.g. [19]). In particular, if we use the Frank-Wolfe procedure we perform a block coordinate descent step with respect to (6) by iterating the following until we achieve some desired precision ϵ: Given the current gj, we compute ∇gjT and use the greedy algorithm to solve arg minx∈B(Gj)⟨x, ∇gjT⟩in O(n log n) time. We then update gj to (1 − 2 k+2)x + 2 k+2gj, where k is the iteration number. Log-submodular blocks. As we have already mentioned, this optimization step is much more challenging. One procedure, which is taken by [1], is to consider a set of 2n points inside U(Fj) and optimize over them, which turns out to be a submodular minimization problem. However, for specific subfamilies, we can better describe U(Fj). One particularly interesting subfamily is that of M ♮-concave functions [16], which have been studied in economics [20]. A set function H is called M ♮-concave if ∀A, B ⊆V, i ∈A \ B it satisfies H(A) + H(B) ≤H(A \ {i}) + H(B ∪{i}) or ∃j ∈B \ A : H(A) + H(B) ≤H((A \ {i}) ∪{j}) + H((B ∪{i}) \ {j}). 4 Equivalently, these functions can be defined through the so called gross substitutability property known in economics. It turns out that M ♮-concave set functions are also submodular. Examples of these functions include facility location functions, matroid rank functions, monotone concave over cardinality functions, etc. [16]. For example, H(A) = maxi∈A hi for hi ≥0 is M ♮-concave, which we will exploit in our models in the experimental section. Returning to our discussion of optimizing (6), if Fj is an M ♮-concave function, we can minimize (6) over (fj, tj) ∈U(Fj) to arbitrary precision in polynomial time. Therefore, we can, similarly as in [1], use the Frank-Wolfe algorithm by noting that a polynomial time algorithm for computing arg minx∈U(Fj)⟨x, ∇(fj,tj)T⟩exists [20]. Although the minimization can be performed in polynomial time, it is a very involved algorithm. We therefore consider an inner approximation ˇU(Fj) := {(m, 0) ∈Rn+1 | ∀A ⊆V : F(A) ≤m(A)} ⊆U(Fj) of U(Fj) over which we can more efficiently approximately minimize (6). As pointed out by Iyer and Bilmes [12], for M ♮ functions Fj the polyhedron ˇU(Fj) can be characterized by O(n2) inequalities as follows: ˇU(Fj) := ∪A⊆V {(m, 0) ∈Rn+1 | ∀i ∈A : mi ≤Fj(A) −Fj(A \ {i}), ∀k ̸∈A : mj ≥Fj(A ∪{k}) −Fj(A), ∀i ∈A, k ̸∈A : mi −mk ≤Fj(A) −Fj((X ∪{i}) \ {k})}. We propose to use Algorithm 1 for minimizing over ˇU(Fj). Given a set A where we want our modular approximation to be exact at, the algorithm iteratively minimizes the partition function of a modular upper bound on Fj. Clearly, after the first iteration of the algorithm (m, 0) is an upper bound on Fj. Furthermore, the partition function corresponding to that bound decreases monotonically over the iterations of the algorithm. Several heuristics can be used to select A—in the experiments we determined A as follows: We initialized B = ∅and then, while 0 < maxi∈V \A F(B ∪{i}) −F(B), added i to B, i.e. B ∪{arg maxi∈V \B F(B ∪{i}) −F(B)}. We used the final B of this iteration as our tight set A. Algorithm 1 Modular upper bound for M ♮-concave functions Require: M ♮function F, tight set A s.t. m(A) = F(A) for the returned m Initialize m randomly for l = 1, 2, . . . , max. nr. of iterations do ▷Alt. minimize m over coeff. corresponding to A and V \ A ∀i ∈A : mi = min{F(A) −F(A \ {i}), mink∈V \A mk + F(A) −F((A ∪{i}) \ {k})} ∀k ̸∈A : mk = max{F(A ∪{k}) −F(A), maxi∈A mi −F(A) + F((A ∪{i}) \ {k})} end for return Modular upper bound m on F 4 Examples of Mixed PSMs for Modelling Substitutes and Complements In our experiments we consider probabilistic models that take the following form: H(A; α, β) = X i∈A ui + α L X l=1 max i∈A rl,i − X i∈A rl,i  | {z } Fl(A) −β K X k=1 max i∈A ak,i − X i∈A ak,i  | {z } Gk(A) , (7) where α, β ∈{0, 1} switch on/off the repulsive and attractive capabilities of the model, respectively. We would like to point out that even though PL l=1 Fl(A) is not M ♮-concave, each summand Fl is, which we will exploit in the next section. The model is parameterized by the vector u ∈R|V |, and the weights (rl)l∈[L], rl ∈R|V | ≥0 and (ak)k∈[K], ak ∈R|V | ≥0, which will be explained shortly. From the general model (7) we instantiate four different models as explained in the following. Log-modular model. The log-modular model Pmod(A) is instantiated from (7) by setting α = β = 0, i.e. Fmod(A) := H(A; 0, 0) and serves as a baseline model. This model cannot capture any dependencies between items and corresponds to a fully factorized distribution over the items in V . Facility location diversity model (FLID). This model is instantiated from (7) by setting α = 1, β = 0, i.e. FFLID(A) := H(A; 1, 0), and is known as facility location diversity model (FLID) [10]. Note that 5 this induces a log-submodular distribution. The FLID model parameterizes all items i by an item quality ui and an L-dimensional vector r·,i ∈RL ≥0 of latent properties. The model assigns a negative penalty Fl(A) = maxi∈A rl,i −P i∈A rl,i whenever at least two items in A have the same latent property (the corresponding dimensions of rl are > 0) — thus the model explicitly captures repulsive dependencies between items.3 Speaking in economic terms, items with similar latent representations can be considered as substitutes for each other. The FLID model has been shown to perform on par with DPPs on product recommendation tasks [10]. Facility location complements model (FLIC). This model is instantiated from (7) by setting α = 0, β = 1, i.e. FFLIC(A) := H(A; 0, 1) and defines a log-supermodular probability distribution. Similar to FLID, the model parameterizes all items i by an item quality ui and a K-dimensional vector a·,i ∈RK ≥0 of latent properties. In particular, there is a gain of Gk(A) = P i∈A ak,i −maxi∈A ak,i if at least two items in A have the same property k (i.e. for both items the corresponding dimensions of ak are > 0). In this way, FLIC captures attractive dependencies among items and assigns high probabilities to sets of items that have similar latent representations — items with similar latent representations would be considered as complements in economics. Facility location diversity and complements model (FLDC). This model is instantiated from (7) via FFLDC(A) := H(A; 1, 1). Hence it combines the modelling power of the log-submodular and log-supermodular models and can explicitly represent attractive and repulsive dependencies. In this way, FLDC can represent complements and subsitutes for the items in V . The induced probability distribution is neither log-submodular nor log-supermodular. 5 Experiments 5.1 Experimental Setup Dataset. We use the Amazon baby registry dataset [21] for evaluating our proposed variational inference scheme. This dataset is a standard dataset for benchmarking diversity models and consists of baby registries collected from Amazon. These registries are split into sub-registries according to 13 different product categories, e.g. safety and carseats. Every category contains 32 to 100 different items and there are ≈5.000 to ≈13.300 sub-registries per category. Product recommendation task. We construct a realistic product recommendation task from the registries of every category as follows. Let D = (S1, . . . , Sn) denote the registries from one category. From this data, we create a new dataset ˆD = {(S \ {i}, i) | S ∈D, |S| ≥2, i ∈S}, (8) i.e., ˆD consists of tuples, where the first element is a registry from D with one item removed, and the second element is the removed item. The product recommendation task is to predict i given S \ {i}. For evaluating the performance of different models on this task we use the following two metrics: accuracy and mean reciprocal rank. Let us denote the recommendations of a model given a partial basket A by σA : V →[n], where σA(a) = 1 means that product a is recommended highest, σA(b) = 2 means that product b is recommended second highest, etc. Then, the accuracy is computed as Acc = 1 | ˆ D| P (S′,i)∈ˆ D[i = σ−1 S′ (1)]. The mean reciprocal rank (MRR) is defined as MRR = 1 | ˆ D| P (S′,i)∈ˆ D 1 σ−1 S′ (i). For our models we consider predictions according to the posterior probability of the model given a partial basket A under the constraint that exactly a single item is to be added, i.e. σA(i) = k if product i achieves the k-th largest value of P(j|A) = P ({j}∪A) P j′∈V \A P ({j′}∪A) for j ∈V \ A (ties are broken arbitrarily). 5.2 Mixed Models for Product Recommendation We learned the models described in the previous section using the training data of the different categories. In case of the modular model, the parameters u were set according to the item frequencies in the training data. FLID, FLIC and FLDC were learned using noise contrastive estimation (NCE) [22, 10]. We used stochastic gradient descent for optimizing the NCE objective, created 200.000 noise 3Clearly, also attractive dependencies between items can thereby be modeled implicitly. 6 0 5 10 15 20 25 30 35 40 furniture N=32 carseats N=34 safety N=36 strollers N=40 media N=58 health N=62 toys N=62 bath N=100 bedding N=100 diaper N=100 apparel N=100 gear N=100 feeding N=100 furniture N=32 carseats N=34 safety N=36 strollers N=40 media N=58 health N=62 toys N=62 bath N=100 bedding N=100 diaper N=100 apparel N=100 gear N=100 feeding N=100 furniture N=32 carseats N=34 safety N=36 strollers N=40 media N=58 health N=62 toys N=62 bath N=100 bedding N=100 diaper N=100 apparel N=100 gear N=100 feeding N=100 furniture N=32 carseats N=34 safety N=36 strollers N=40 media N=58 health N=62 toys N=62 bath N=100 bedding N=100 diaper N=100 apparel N=100 gear N=100 feeding N=100 furniture N=32 carseats N=34 safety N=36 strollers N=40 media N=58 health N=62 toys N=62 bath N=100 bedding N=100 diaper N=100 apparel N=100 gear N=100 feeding N=100 (a) Accuracy 0 10 20 30 40 50 (b) Mean reciprocal rank modular DPP FLID (L = 10) FLIC (K = 10) FLDC (L = 10, K = 10) (c) Accuracy of the mixed model for varying L and K Figure 1: (a,b) Accuracy and MRR on the product recommendation task. For all datasets, the mixed FLDC model has the best performance. For datasets with small ground set (furniture, carseats, safety) FLID performs better than FLIC. For most other datasets, FLIC outperforms FLID. (c) Accuracy of FLDC for different numbers of latent dimensions L and K on the diaper dataset. FLDC (L, K > 0) performs better than FLID (K = 0) and FLIC (L = 0) for the same value of L + K. samples from the modular model and made 100 passes through the data and noise samples. We then used the trained models for the product recommendation task from the previous section and estimated the performance metrics using 10-fold cross-validation. We used K = 10, L = 10 dimensions for the weights (if applicable for the corresponding model). The results are shown in Figure 1. For reference, we also report the performance of DPPs trained with EM [21]. Note that for all categories the mixed FLDC models achieve the best performance, followed by FLIC and FLID. For categories with more than 40 items (with the exception of health), FLIC performs better than FLID. The modular model performs worst in all cases. As already observed in the literature, the performance of FLID is similar to that of DPPs [10]. For categories with small ground sets (safety, furniture, carseats), there is no advantage of using the higher-order attractive potentials but the repulsive higher-order potentials improve performance significantly. However, in combination with repulsive potentials the attractive potentials enable the model to improve performance over models with only repulsive higher-order potentials. 5.3 Impact of the Dimension Assignment In Figure 1c we show the accuracy of FLDC for different numbers of latent dimensions L and K for the category diaper, averaged over the 10 cross-validation folds. Similar results can be observed for the other categories (not shown here because of space constraints). We note that the best performance is achieved only for models that have both repulsive and attractive components (i.e. L, K > 0). For instance, if one is constrained to use only 10 latent dimensions in total, i.e. L + K = 10, the best performance is achieved for the settings L = 3, K = 7 and L = 2, K = 8. 5.4 Quality of the Marginals In this section we analyze the quality of the marginals obtained by the algorithm proposed in Section 3. Therefore we repeat the following experiment for all baskets S, |S| ≥2 in the the held out test data. We randomly select a subset S′ ⊂S of 1 to |S| −1 items and a subset S′′ ⊂V \ S with |S′′| = ⌊| V \ S|/2⌋, of items not present in the basket. Then we condition our distribution on the event that the items in S′ are present and the items S′′ are not present i.e. we consider the distribution P(A | S′ ⊆A, S′′ ∩A = ∅). This conditioning is supposed to resemble a fictitious product recommendation task in which we condition on items already selected by a user and exclude items which are of no interest to the user (for instance, according to the user’s preferences). We then compute a modular approximation to the posterior distribution using the algorithm from Section 3, 7 Table 1: AUC for the considered models on the product recommendation task based on the posterior marginals. The best result for every dataset is printed in bold. For datasets with at most 62 items, FLDC has the highest AUC, while for larger datasets FLIC and FLDC have similar AUC. This indicates a good quality of the marginals computed by the proposed approximate inference procedure. Dataset Modular FLID FLIC FLDC safety 0.731304 0.756981 0.731269 0.761168 furniture 0.701840 0.739646 0.702100 0.759979 carseats 0.717463 0.770085 0.735472 0.781642 strollers 0.727055 0.794655 0.827800 0.849767 health 0.750271 0.754185 0.756873 0.758586 bath 0.692423 0.705051 0.730443 0.732407 media 0.666509 0.667848 0.758552 0.780634 toys 0.724763 0.729089 0.765474 0.777729 bedding 0.741786 0.744443 0.771159 0.764595 apparel 0.700694 0.696010 0.778067 0.779665 diaper 0.685051 0.700543 0.787457 0.787274 gear 0.687686 0.688116 0.687501 0.688885 feeding 0.686240 0.686845 0.744043 0.739921 Average 0.708698 0.725653 0.752016 0.766327 and recommend items according to these approximate marginals. For evaluation, we compute the AUC for the product recommendation task and average over the test set data. We found that for different models different modular upper/lower bounds gave the best results. In particular, for FLID we used the upper bound given by Algorithm 1 to bound each summand Fl(A) in the facility location term separately. For FLIC and FLID we optimized the lower bound on the partition function by lowerbounding PL l=1 Fl(A) and upper bounding PK k=1 Gk(A), as suggested in [1]. For approximate inference in FLIC and FLDC we did not split the facility location terms and bounded them as a whole. The results are summarized in Table 1. We observe that FLDC has the highest AUC for all datasets with at most 62 items. For larger datasets, FLDC and FLIC have roughly the same performance and are superior to FLID and the modular model. These findings are similar to those from the previous section and confirm a good quality of the marginals computed from FLDC and FLIC by the proposed approximate inference procedure. 6 Related Work Variational inference in general probabilistc log-submodular models has been first studied in [1]. The authors propose L-FIELD, an approach for approximate inference in both log-submodular and log-supermodular models based on super- and sub-differentials of submodular functions. In [3] they extended their work by relating L-FIELD to the minimum norm problem for submodular minimization, rendering better scalable algorithms applicable to variational inference in log-submodular models. The forementioned works can only be applied to models that contain either log-submodular or log-supermodular potentials and hence do not cover the models considered in this paper. While the MAP solution in mixed models is known to be NP-hard, there are approximate methods for its computation based on iterative majorization-minimization (or minorization-maximization) procedures [23, 24]. In [9] the authors consider mixed models in which the supermodular component is restricted to a tree-structured cut, and provide several algorithms for approximate MAP computation. In contrast to our work, these methods are non-probabilistic and only provide an approximate MAP solution without any notion of uncertainty. 7 Conclusion We proposed efficient algorithms for approximate inference in mixed submodular models based on inner approximations of the set of modular bounds on the corresponding energy functions. For many higher-order potentials, optimizing a modular bound over this inner approximation is tractable. As a consequence, the approximate inference problem can be approached by a block coordinate descent procedure, tightening a modular upper bound over the individual higher-order potentials in an iterative manner. Our approximate inference algorithms enable the computation of approximate marginals and can easily scale to large ground sets. In a large set of experiments, we demonstrated the effectiveness of our approach. 8 Acknowledgements. The authors acknowledge fruitful discussions with Diego Ballesteros. This research was supported in part by SNSF grant CRSII2-147633, ERC StG 307036, a Microsoft Research Faculty Fellowship and a Google European Doctoral Fellowship. References [1] Josip Djolonga and Andreas Krause. From MAP to Marginals: Variational Inference in Bayesian Submodular Models. In Advances in Neural Information Processing Systems (NIPS), pages 244–252, 2014. [2] Alex Kulesza and Ben Taskar. Determinantal Point Processes for Machine Learning. Foundations and Trends R⃝in Machine Learning, 5(2–3):123–286, 2012. [3] Josip Djolonga and Andreas Krause. Scalable Variational Inference in Log-supermodular Models. In International Conference on Machine Learning (ICML), 2015. [4] Alkis Gotovos, Hamed Hassani, and Andreas Krause. Sampling from Probabilistic Submodular Models. In Advances in Neural Information Processing Systems (NIPS), pages 1936–1944, 2015. [5] Patrick Rebeschini and Amin Karbasi. Fast Mixing for Discrete Point Processes. In Proceedings of the Conference on Learning Theory (COLT), pages 1480—-1500, 2015. [6] Mukund Narasimhan and Jeff Bilmes. A Submodular-Supermodular Procedure with Applications to Discriminative Structure Learning. In Uncertainty in Artificial Intelligence (UAI), 2005. [7] Oliver Woodford, Philip Torr, Ian Reid, and Andrew Fitzgibbon. Global stereo reconstruction under second-order smoothness priors. Pattern Analysis and Machine Intelligence, IEEE Transactions on, 31 (12), 2009. [8] Carsten Rother, Vladimir Kolmogorov, Victor Lempitsky, and Martin Szummer. Optimizing binary mrfs via extended roof duality. In Computer Vision and Pattern Recognition, 2007. CVPR’07. IEEE Conference on. IEEE, 2007. [9] Yoshinobu Kawahara, Rishabh Iyer, and Jeffrey A. Bilmes. On Approximate Non-submodular Minimization via Tree-Structured Supermodularity. In Proceedings of the Eighteenth International Conference on Artificial Intelligence and Statistics (AISTATS), 2015. [10] Sebastian Tschiatschek, Josip Djolonga, and Andreas Krause. Learning probabilistic submodular diversity models via noise contrastive estimation. In Proceedings of the International Conference on Artificial Intelligence and Statistics (AISTATS), 2016. [11] Jian Zhang, Josip Djolonga, and Andreas Krause. Higher-order inference for multi-class log-supermodular models. In International Conference on Computer Vision (ICCV), 2015. [12] Rishabh Iyer and Jeff Bilmes. Polyhedral aspects of submodularity, convexity and concavity. arXiv preprint arXiv:1506.07329, 2015. [13] Jack Edmonds. Matroids and the greedy algorithm. Mathematical programming, 1(1):127–136, 1971. [14] Marguerite Frank and Philip Wolfe. An algorithm for quadratic programming. Naval research logistics quarterly, 3(1-2):95–110, 1956. [15] Martin Jaggi. Revisiting frank-wolfe: Projection-free sparse convex optimization. In Proceedings of the 30th International Conference on Machine Learning (ICML-13), pages 427–435, 2013. [16] Kazuo Murota. Discrete convex analysis. SIAM, 2003. [17] Jack Edmonds. Submodular functions, matroids, and certain polyhedra. In Combinatorial Optimization—Eureka, You Shrink!, pages 11–26. Springer, 2003. [18] S. Fujishige. Submodular Functions and Optimization. Elsevier, 2005. [19] Francis R. Bach. Learning with submodular functions: A convex optimization perspective. Foundations and Trends in Machine Learning, 6(2-3):145–373, 2013. [20] Akiyoshi Shioura. Polynomial-time approximation schemes for maximizing gross substitutes utility under budget constraints. Mathematics of Operations Research, 40(1), 2014. [21] Jennifer A Gillenwater, Alex Kulesza, Emily Fox, and Ben Taskar. Expectation-maximization for learning determinantal point processes. In Advances in Neural Information Processing Systems, 2014. [22] Michael U Gutmann and Aapo Hyv¨arinen. Noise-contrastive estimation of unnormalized statistical models, with applications to natural image statistics. The Journal of Machine Learning Research, 13(1), 2012. [23] Mukund Narasimhan and Jeff Bilmes. A submodular-supermodular procedure with applications to discriminative structure learning. arXiv preprint arXiv:1207.1404, 2012. [24] Rishabh Iyer and Jeff Bilmes. Algorithms for approximate minimization of the difference between submodular functions, with applications. arXiv preprint arXiv:1207.0560, 2012. 9
2016
337
6,258
The Limits of Learning with Missing Data Brian Bullins Elad Hazan Princeton University Princeton, NJ {bbullins,ehazan}@cs.princeton.edu Tomer Koren Google Brain Mountain View, CA tkoren@google.com Abstract We study linear regression and classification in a setting where the learning algorithm is allowed to access only a limited number of attributes per example, known as the limited attribute observation model. In this well-studied model, we provide the first lower bounds giving a limit on the precision attainable by any algorithm for several variants of regression, notably linear regression with the absolute loss and the squared loss, as well as for classification with the hinge loss. We complement these lower bounds with a general purpose algorithm that gives an upper bound on the achievable precision limit in the setting of learning with missing data. 1 Introduction The primary objective of linear regression is to determine the relationships between multiple variables and how they may affect a certain outcome. A standard example is that of medical diagnosis, whereby the data gathered for a given patient provides information about their susceptibility to certain illnesses. A major drawback to this process is the work necessary to collect the data, as it requires running numerous tests for each person, some of which may be discomforting. In such cases it may be necessary to impose limitations on the amount of data available for each example. For medical diagnosis, this might mean having each patient only undergo a small subset of tests. A formal setting for capturing regression and learning with limits on the number of attribute observations is known as the Limited Attribute Observation (LAO) setting, first introduced by Ben-David and Dichterman [1]. For example, in a regression problem, the learner has access to a distribution D over data (x, y) 2 Rd ⇥R, and fits the best (generalized) linear model according to a certain loss function, i.e., it approximately solves the optimization problem min w:kwkp B LD(w), LD(w) = E(x,y)⇠D f `(w>x −y) g . In the LAO setting, the learner does not have complete access to the examples x, which the reader may think of as attributes of a certain patient. Rather, the learner can observe at most a fixed number of these attributes, denoted k d. If k = d, this is the standard regression problem which can be solved to arbitrary precision. The main question we address: is it possible to compute an arbitrarily accurate solution if the number of observations per example, k, is strictly less than d? More formally, given any " > 0, can one compute a vector w for which LD(w)  min kw⇤kp B LD(w⇤) + ". Efficient algorithms for regression with squared loss when k < d have been shown in previous work [2], and the sample complexity bounds have since been tightened [6, 8]. However, similar results for 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. other common loss functions such as e.g. absolute loss have only been shown by relaxing the hard limit of k attributes per example [3, 6]. In this paper we show, for the first time, that in fact this problem cannot be solved in general. Our main result shows that even for regression with the absolute loss function, for any k d −1, there is an information-theoretic lower bound on the error attainable by any algorithm. That is, there is some "0 > 0 for which an "0-optimal solution cannot be determined, irrespective of the number of examples the learner sees. Formally, with constant probability, any algorithm returning a vector w 2 Rd must satisfy LD(w) > min kw⇤kp B LD(w⇤) + "0. We further show that this ultimate achievable precision parameter is bounded from below by a polynomial in the dimension, i.e., "0 = ⌦(d−3/2). Additionally, for the basic setting of Ridge regression (with the squared loss), we give a tight lower bound for the LAO setting. Cesa-Bianchi et al. [2] provided the first efficient algorithm for this setting with sample complexity of O(d2/k"2) for " error. Hazan and Koren [6] improved upon this result and gave a tight sample complexity of O(d/k"2) to achieve " error. In both cases, however, the algorithms only work when k ≥2. We complete the picture and show that k ≥2 attributes are in fact necessary to obtain arbitrarily low error. That is, with only one attribute per example, there is an information-theoretic limit on the accuracy attainable by any regression algorithm. We remark that a similar impossibility result was proven by Cesa-Bianchi et al. [3] in the related setting of learning with noisy examples. Classification may be similarly cast in the LAO setting. For classification with the hinge loss, namely soft-margin SVM, we give a related lower bound, showing that it is impossible to achieve arbitrarily low error if the number of observed attributes is bounded by k d −1. However, unlike our lower bound for regression, the lower bound we prove for classification scales exponentially with the dimension. Although Hazan et al. [7] showed how classification may be done with missing data, their work includes low rank assumptions and so it is not in contradiction with the lower bounds presented here. Similar to the LAO setting, the setting of learning with missing data [9, 4, 10, 11] presents the learner with examples where the attributes are randomly observed. Since the missing data setting is at least as difficult as the LAO setting, our lower bounds extend to this case as well. We complement these lower bounds with a general purpose algorithm for regression and classification with missing data that, given a sufficient number of samples, can achieve an error of O(1/ p d). This result leaves only a small polynomial gap compared to the information-theoretic lower bound that we prove. 2 Setup and Statement of Results The general framework of linear regression involves a set of instances, each of the form (x, y) where x 2 Rd is the attribute vector and y 2 R is the corresponding target value. Under the typical statistical learning framework [5], each (x, y) pair is drawn from a joint distribution D over Rd ⇥R. The learner’s objective is to determine some linear predictor w such that w>x does well in predicting y. The quality of prediction is measured according to a loss function ` : R 7! R. Two commonly used loss functions for regression are the squared loss `(w>x −y) = 1 2 (w>x −y)2 and the absolute loss `(w>x −y) = |w>x −y|. Since our examples are drawn from some arbitrary distribution D, it is best to consider the expected loss LD(w) = E(x,y)⇠D ⇥`(w>x −y)⇤. The learner’s goal then is to determine a regressor w that minimizes the expected loss LD(w). To avoid overfitting, a regularization term is typically added, which up to some constant factor is equivalent to min w2Rd LD(w) s.t. kwkp B for some regularization parameter B > 0, where k · kp is the standard `p norm, p ≥1. Two common variants of regression are Ridge regression (p = 2 with squared loss) and Lasso regression (p = 1 with squared loss). 2 The framework for classification is nearly identical to that of linear regression. The main distinction comes from a different meaning of y 2 R, namely that y acts as a label for the corresponding example. The loss function also changes when learning a classifier, and in this paper we are interested in the hinge loss `(y · w>x) = max{0, 1 −y · w>x}. The overall goal of the learner, however, remains the same: namely, to determine a classifier w such that LD(w) is minimized. Throughout the paper, we let w⇤denote the minimizer of LD(w). 2.1 Main Results As a first step, for Lasso and Ridge regressions, we show that one always needs to observe at least two attributes to be able to learn a regressor to arbitrary precision. This is given formally in Theorem 1. Theorem 1. Let 0 < " < 1 32 and let ` be the squared loss. Then there exists a distribution D over {x : ||x||1 1} ⇥[−1, 1] such that kw⇤k1 2, and any regression algorithm that can observe at most one attribute of each training example of a training set S cannot output a regressor ˆw such that ES[LD( ˆw)] < LD(w⇤) + ". Corollary 2. Let 0 < " < 1 64 and let ` be the squared loss. Then there exists a distribution D over {x : ||x||2 1} ⇥[−1, 1] such that kw⇤k2 2, and any regression algorithm that can observe at most one attribute of each training example of a training set S cannot output a regressor ˆw such that ES[LD( ˆw)] < LD(w⇤) + ". The lower bounds are tight—recall that with two attributes, it is indeed possible to learn a regressor to within arbitrary precision [2, 6]. Also, notice the order of quantification in the theorems: it turns out that there exists a distribution which is hard for all algorithms (rather than a different hard distribution for any algorithm). For regression with absolute loss, we consider the setting where the learner is limited to seeing k or fewer attributes of each training sample. Theorem 3 below shows that in the case where k < d the learner cannot hope to learn an "-optimal regressor for some " > 0. Theorem 3. Let d ≥4, d ⌘0 (mod 2), 0 < " < 1 60d−3 2 , and let ` be the absolute loss. Then there exists a distribution D over {x : ||x||1 1} ⇥[−1, 1] such that kw⇤k1 2, and any regression algorithm that can observe at most d −1 attributes of each training example of a training set S cannot output a regressor ˆw such that ES[LD( ˆw)] < LD(w⇤) + ". Corollary 4. Let 0 < " < 1 60d−2, and let ` be the absolute loss. Then there exists a distribution D over {x : ||x||2 1} ⇥[−1, 1] such that kw⇤k2 1, and any regression algorithm that can observe at most d −1 attributes of each training example of a training set S cannot output a regressor ˆw such that ES[LD( ˆw)] < LD(w⇤) + ". We complement our findings for regression with the following analogous lower bound for classification with the hinge loss (a.k.a., soft margin SVM). Theorem 5. Let d ≥4, d ⌘0 (mod 2), and let ` be the hinge loss. Then there exists an "0 > 0 such that the following holds: there exists a distribution D over {x : ||x||2 1} ⇥[−1, 1] such that kw⇤k2 1, and any classification algorithm that can observe at most d −1 attributes of each training example of a training set S cannot output a regressor ˆw such that ES[LD( ˆw)] < LD(w⇤) + "0. 3 Lower Bounds In this section we discuss our lower bounds for regression with missing attributes. As a warm-up, we first prove Theorem 1 for regression with the squared loss. While the proof is very simple, it illustrates some of the main ideas used in all of our lower bounds. Then, we give a proof of Theorem 3 for regression with the absolute loss. The proofs of the remaining bounds are deferred to the supplementary material. 3.1 Lower bounds for the squared loss Proof of Theorem 1. It is enough to prove the theorem for deterministic learning algorithms, namely, for algorithms that do not use any external randomization (i.e., any randomization besides the random samples drawn from the data distribution itself). This is because any randomized algorithm can 3 be thought of as a distribution over deterministic algorithms, which is independent of the data distribution. Now, suppose 0 < " < 1 32. Let X1 = {(0, 0), (1, 1)}, X2 = {(0, 1), (1, 0)}, and let D1 and D2 be uniform distributions over X1 ⇥{1} and X2 ⇥{1}, respectively. The main observation is that any learner that can observe at most one attribute of each example cannot distinguish between the two distributions with probability greater than 1 2, no matter how many samples it is given. This is because the marginal distributions of the individual attributes under both D1 and D2 are exactly the same. Thus, to prove the theorem it is enough to show that the sets of "-optimal solutions under the distributions D1 and D2 are disjoint. Indeed, suppose that there is a learning algorithm that emits a vector ˆw such that E[LD( ˆw) −LD(w⇤)] < "/2 (where the expectation is over the random samples from D used by the algorithm). By Markov’s inequality, it holds that LD( ˆw) < LD(w⇤) + " with probability > 1/2. Hence, the output of the algorithm allows one to distinguish between the two distributions with probability > 1/2, contradicting the indistinguishability property. We set to characterize the sets of "-optimal solutions under D1 and D2. For D1, we have LD1(w) = 1 2 X x2X1 1 2 (w>x −1)2 = 1 4 + 1 4 (w1 + w2 −1)2, while for D2, LD2(w) = 1 2 X x2X2 1 2 (w>x −1)2 = 1 4 (w1 −1)2 + 1 4 (w2 −1)2. Note that the set of "-optimal regressors for LD1 is S1 = {w : |w>1 −1| 2p"}, whereas for LD2 the set is S2 = {w : kw −1k2 2p"}. Let S0 2 = {w : |w>1 −2| 2 p 2"}. Then S2 ✓S0 2, so it is sufficient to show that S1 and S0 2 are disjoint. Since " < 1 32, for any w 2 S1, |w>1 −1| < 1 2, meaning w>1 < 3 2. However, for any w 2 S0 2, |w>1 −2| < 1 2 meaning w>1 > 3 2, and so w cannot be a member of both S1 and S2. As we argued earlier, this suffices to prove the theorem. ⇤ 3.2 Lower bounds for the absolute loss As in the proof of Theorem 1, the main idea is to show that one can design two distributions that are indistinguishable to a learner who can observe no more than d −1 attributes of any sample given by the distribution (i.e., that their marginals over any choice of d −1 attributes are identical), but whose respective sets of "-optimal regressors are disjoint. However, in contrast to Theorem 1, both handling general d along with switching to the absolute loss introduce additional complexities to the proof that require different techniques. We start by constructing these two distributions D1 and D2. Let X1 = {x = (x1, . . ., xd) : x 2 {0, 1}d, kxk1 ⌘0 (mod 2)} and X2 = {x = (x1, . . ., xd) : x 2 {0, 1}d, kxk1 ⌘1 (mod 2)}, and let D1 and D2 be uniform over X1 ⇥{1} and X2 ⇥{1}, respectively. From this construction, it is not hard to see that for any choice of k d −1 attributes, the marginals over the k attributes of both distributions are identical: they are both a uniform distribution over k bits. Thus, the distributions D1 and D2 are indistinguishable to a learner that can only observe at most d −1 attributes of each example. Let `(w>x −y) = |w>x −y|, and let LD1(w) = E(x,y)⇠D1[`(w>x, y)] = 1 2d−1 X x2X1 |w>x −1|, and LD2(w) = E(x,y)⇠D2[`(w>x, y)] = 1 2d−1 X x2X2 |w>x −1|. It turns out that the subgradients of LD1(w) and LD2(w), which we denote by @LD1(w) and @LD2(w) respectively, can be expressed precisely. In fact, the full subgradient set at every point in the domain for both functions can be made explicit. With these representations in hand, we can show that w⇤ 1 = 2 d 1d and w⇤ 2 = 2 d+21d are minimizers of LD1(w) and LD2(w), respectively. 4 Figure 1: Geometric intuition for Lemmas 6 and 7. The lower bounding absolute value function acts as a relaxation of the true expected loss LD (depicted here as a cone). In fact, using the subgradient sets we can prove a much stronger property of the expected losses LD1 and LD2, akin to a “directional strong convexity” property around their respective minimizers. The geometric idea behind this property is shown in Figure 1, whereby LD is lower bounded by an absolute value function. Lemma 6. Let w⇤ 1 = 2 d 1d. For any w 2 Rd we have LD1(w) −LD1(w⇤ 1) ≥ p 2⇡ e4p d · ###1> d (w −w⇤ 1)### . Lemma 7. Let w⇤ 2 = 2 d+21d. For any w 2 Rd we have LD2(w) −LD2(w⇤ 2) ≥ p 2⇡ e4p d · ###1> d (w −w⇤ 2)### . Given Lemmas 6 and 7, the proof of Theorem 3 is immediate. Proof of Theorem 3. As a direct consequence of Lemmas 6 and 7, we obtain that the sets S1 = 8><>: w : ###### p 2⇡ e4p d · 1> d (w −w⇤ 1) ###### " 9>=>; and S2 = 8><>: w : ###### p 2⇡ e4p d · 1> d (w −w⇤ 2) ###### " 9>=>; contain the sets of "-optimal regressors for LD1(w) and LD2(w), respectively. All that is needed now is to show a separation of their "-optimal sets for 0 < " < 1 60d−3 2 , and this is done by showing a separation of the more manageable sets S1 and S2. Indeed, fix 0 < " < 1 60d−3 2 and observe that for any w 2 S1 we have − p 2⇡ e4p d · 1> d (w −w⇤ 1)  1 60d−3 2 and so, for d ≥4, 1> dw ≥2 −1 2d > 2 − 1 d + 2 = 2d + 3 d + 2 . On the other hand, for any w 2 S2 we have p 2⇡ e4p d · 1> d (w −w⇤ 2)  1 60d−3 2 , thus 1> dw  2d d + 2 + 1 2d < 2d d + 2 + 1 d + 2 = 2d + 1 d + 2 . We see that no w can exist in both S1 and S2, so these sets are disjoint. Theorem 3 follows by the same reasoning used to conclude the proof of Theorem 1. ⇤ 5 It remains to prove Lemmas 6 and 7. As the proofs are very similar, we will only prove Lemma 6 here and defer the proof of Lemma 7 to the supplementary material. Proof of Lemma 6. We first write @LD1(w) = 1 2d−1 X x2X1 @`(w>x, 1) = 1 2d−1 X x2X1 sign(w>x −1) · x. Letting w⇤ 1 = 2 d · 1d, we have that @LD1(w⇤ 1) = 1 2d−1 X x2X1 sign(w⇤> 1 x −1) · x = 1 2d−1 ✓ X x2X1, kxk1= d 2 sign(w⇤> 1 x −1) · x + X x2X1, kxk1> d 2 sign(w⇤> 1 x −1) · x + X x2X1, kxk1< d 2 sign(w⇤> 1 x −1) · x ◆ = 1 2d−1 ✓ X x2X1, kxk1= d 2 sign(0) · x + X x2X1, kxk1> d 2 x − X x2X1, kxk1< d 2 x ◆ , where sign(0) can be any number in [−1, 1]. Next, we compute X x2X1, kxk1> d 2 x − X x2X1, kxk1< d 2 x = d 2X i= d 4 +1 d −1 2i −1 ! · 1d − d 4 −1 X i=1 d −1 2i −1 ! · 1d = d 2 −2 X i=0 (−1)i d −1 i ! · 1d = d −2 d 2 −2 ! · 1d , where the last equality follows from the elementary identity Pk i=0(−1)i ⇣n i ⌘ = (−1)k ⇣n−1 k ⌘ , which we prove in Lemma 9 in the supplementary material. Now, let X⇤= {x 2 X1 : kxk1 = d 2 }, let m = |X⇤|, and let X = [x1, . . ., xm] 2 Rd⇥m be the matrix formed by all x 2 X⇤. Then we may express the entire subgradient set explicitly as @LD1(w⇤ 1) = ⇢ 1 2d−1 ✓ Xr + d −2 d 2 −2 ! · 1d ◆#### r 2 [−1, 1]m, . Thus, any choice of r 2 [−1, 1]m will result in a specific subgradient of LD1(w⇤ 1). Consider two such choices: r1 = 0 and r2 = −1d. Note that Xr1 = 0 and Xr2 = − ⇣d−1 d 2 −1 ⌘ · 1d; to see the last equality, consider any fixed coordinate i and notice that the number of elements in X⇤with non-zero values in the i’th coordinate is equal to the number of ways to choose the remaining d 2 −1 non-zero coordinates from the other d −1 coordinates. We then observe that the corresponding subgradients are h+ = 1 2d−1 Xr1 + d −2 d 2 −2 ! · 1d ! = 1 2d−1 d −2 d 2 −2 ! · 1d, and h−= 1 2d−1 Xr2 + d −2 d 2 −2 ! · 1d ! = − 1 2d−1 d −2 d 2 −1 ! · 1d. Note that, since the set of subgradients of LD1(w⇤ 1) is a convex set, by taking a convex combination of h+ and h−it follows that 0 2 @LD1(w⇤ 1) and so we see that w⇤ 1 is a minimizer of LD1(w). 6 Given a handle on the subgradient set, we now show that these coefficients are polynomial in d. Observe that, using the fact that p 2⇡n( n e )n n! epn( n e )n, we have 1 2d−1 d −2 d 2 −2 ! ≥ 1 2d−1 *... , p2⇡(d −2) ⇣d−2 e ⌘d−2 e2 q d−4 2 q d 2 ⇣d−4 2e ⌘d 2 −2 ⇣d 2e ⌘d 2 +/// ≥ 1 2d−1 *. , p 2⇡ e2p d ⇣ 1 2d−1 ⌘+/ d −2 d !d−2 ≥* , p 2⇡ e2p d + 1 − 2 d −2 !d−2 ≥ p 2⇡ e4p d . Let h⇤= p 2⇡ e4p d · 1d. Since h⇤can be written as a convex combination of h+ and 0, we see that h⇤2 @LD1(w⇤ 1). Similarly we may see that − 1 2d−1 d −2 d 2 −1 ! − 1 2d−1 *.. , p2⇡(d −2) ⇣d−2 e ⌘d−2 e2( d 2 −1) ⇣d−2 2e ⌘d−2 +// = − p 2⇡ e2p d −2 − p 2⇡ e4p d . Again, since −h⇤can be written as a convex combination of the vectors h−and 0 in the subgradient set, we may conclude that −h⇤2 @LD1(w⇤ 1) as well. By the subgradient inequality it follows that, for all w 2 Rd, LD1(w) −LD1(w⇤ 1) ≥h⇤>(w −w⇤ 1) = p 2⇡ e4p d · 1> d (w −w⇤ 1) and LD1(w) −LD1(w⇤ 1) ≥−h⇤>(w −w⇤ 1) = − p 2⇡ e4p d · 1> d (w −w⇤ 1), which taken together imply that LD1(w) −LD1(w⇤ 1) ≥ p 2⇡ e4p d · ###1> d (w −w⇤ 1)### as required. ⇤ 4 General Algorithm for Limited Precision Although we have established limits on the attainable precision for some learning problems, there is still the possibility of reaching this limit. In this section we provide a general algorithm, whereby a learner that can observe k < d attributes can always achieve an expected loss of O(p1 −k/d). We provide the pseudo-code in Algorithm 1. Although similar to the AERR algorithm of Hazan and Koren [6]—which is designed to work only with the squared loss—Algorithm 1 avoids the necessity of an unbiased gradient estimator by replacing the original loss function with a slightly biased one. As long as the new loss function is chosen carefully (and the functions are Lipschitz bounded), and given enough samples, the algorithm can return a regressor of limited precision. This is in contrast to AERR whereby an arbitrarily precise regressor can always be achieved with enough samples. Formally, for Algorithm 1 we prove the following (proof in the supplementary material). Theorem 8. Let ` : R 7! R be an H-Lipschitz function defined over [−2B, 2B]. Assume the distribution D is such that kxk2 1 and |y| B with probability 1. Let ˜B = max{B, 1}, and let ˆw be the output of Algorithm 1, when run with ⌘= 2B Gpm . Then, k ˆwk2 B, and for any w⇤2 Rd with kw⇤k2 B, E[LD( ˆw)] LD(w⇤) + 2HB pm + 2H ˜B2 r 1 −k d . 7 Algorithm 1 General algorithm for regression/classification with missing attributes Input: Loss function `, training set S = {(xt, yt)}t 2[m], k, B, ⌘> 0 Output: Regressor ˆw with k ˆwk2 B 1: Initialize w1 , 0, kw1k2 B arbitrarily 2: for t = 1 to m do 3: Uniformly choose subset of k indices {it,r }r 2[k] from [d] without replacement 4: Set ˜xt = Pk r=1 x[it,r] · eit,r 5: Regression case: 6: Choose ˆφt 2 @`(w> t ˜xt −yt) 7: Classification case: 8: Choose ˆφt 2 @`(yt · w> t ˜xt) 9: Update wt+1 = B max{kwt −⌘( ˆφt · ˜xt)k2, B} · (wt −⌘( ˆφt · ˜xt)) 10: end for 11: Return ˆw = 1 m Pm t=1 wt In particular, for m = d/(d −k) we have E[LD( ˆw)] LD(w⇤) + 4H ˜B2 r 1 −k d, and so when the learner observes k = d −1 attributes, the expected loss is O(1/ p d)-away from optimum. 5 Conclusions and Future Work In the limited attribute observation setting, we have shown information-theoretic lower bounds for some variants of regression, proving that a distribution-independent algorithm for regression with absolute loss that attains " error cannot exist and closing the gap for ridge regression as suggested by Hazan and Koren [6]. We have also shown that the proof technique applied for regression with absolute loss can be extended to show a similar bound for classification with the hinge loss. In addition, we have described a general purpose algorithm which complements these results by providing a means of achieving error up to a certain precision limit. An interesting possibility for future work would be to try to bridge the gap between the upper and lower bounds of the precision limits, particularly in the case of the exponential gap for classification with hinge loss. Another direction would be to develop a more comprehensive understanding of these lower bounds in terms of more general functions, one example being classification with logistic loss. References [1] S. Ben-David and E. Dichterman. Learning with restricted focus of attention. Journal of Computer and System Sciences, 56(3):277–298, 1998. [2] N. Cesa-Bianchi, S. Shalev-Shwartz, and O. Shamir. Efficient learning with partially observed attributes. In Proceedings of the 27th International Conference on Machine Learning, 2010. [3] N. Cesa-Bianchi, S. Shalev-Shwartz, and O. Shamir. Online learning of noisy data. IEEE Transactions on Information Theory, 57(12):7907–7931, 2011. [4] O. Dekel, O. Shamir, and L. Xiao. Learning to classify with missing and corrupted features. Machine Learning Journal, 81(2):149–178, 2010. [5] D. Haussler. Decision theoretic generalizations of the PAC model for neural net and other learning applications. Information and Computation, 100(1):78–150, 1992. [6] E. Hazan and T. Koren. Linear regression with limited observation. In Proceedings of the 29th International Conference on Machine Learning (ICML’12), Edinburgh, Scotland, UK, 2012. 8 [7] E. Hazan, R. Livni, and Y. Mansour. Classification with low rank and missing data. In Proceedings of the 32nd International Conference on Machine Learning, 2015. [8] D. Kukliansky and O. Shamir. Attribute efficient linear regression with data-dependent sampling. In Proceedings of the 32nd International Conference on Machine Learning, 2015. [9] R. J. A. Little and D. B. Rubin. Statistical Analysis with Missing Data, 2nd Edition. WileyInterscience, 2002. [10] P.-L. Loh and M. J. Wainwright. High-dimensional regression with noisy and missing data: Provable guarantees with non-convexity. In Advances in Neural Information Processing Systems, 2011. [11] A. Rostamizadeh, A. Agarwal, and P. Bartlett. Learning with missing features. In The 27th Conference on Uncertainty in Artificial Intelligence, 2011. [12] R. Tibshirani. Regression shrinkage and selection via the lasso. Journal of the Royal Statistical Society, Series B, 58(1):267–288, 1996. [13] M. Zinkevich. Online convex programming and generalized infinitesimal gradient ascent. In Proceedings of the 20th International Conference on Machine Learning, 2003. 9
2016
338
6,259
Clustering with Same-Cluster Queries Hassan Ashtiani , Shrinu Kushagra and Shai Ben-David David R. Cheriton School of Computer Science University of Waterloo, Waterloo, Ontario, Canada {mhzokaei,skushagr,shai}@uwaterloo.ca Abstract We propose a framework for Semi-Supervised Active Clustering framework (SSAC), where the learner is allowed to interact with a domain expert, asking whether two given instances belong to the same cluster or not. We study the query and computational complexity of clustering in this framework. We consider a setting where the expert conforms to a center-based clustering with a notion of margin. We show that there is a trade off between computational complexity and query complexity; We prove that for the case of k-means clustering (i.e., when the expert conforms to a solution of k-means), having access to relatively few such queries allows efficient solutions to otherwise NP hard problems. In particular, we provide a probabilistic polynomial-time (BPP) algorithm for clustering in this setting that asks O k2 log k + k log n) same-cluster queries and runs with time complexity O kn log n) (where k is the number of clusters and n is the number of instances). The algorithm succeeds with high probability for data satisfying margin conditions under which, without queries, we show that the problem is NP hard. We also prove a lower bound on the number of queries needed to have a computationally efficient clustering algorithm in this setting. 1 Introduction Clustering is a challenging task particularly due to two impediments. The first problem is that clustering, in the absence of domain knowledge, is usually an under-specified task; the solution of choice may vary significantly between different intended applications. The second one is that performing clustering under many natural models is computationally hard. Consider the task of dividing the users of an online shopping service into different groups. The result of this clustering can then be used for example in suggesting similar products to the users in the same group, or for organizing data so that it would be easier to read/analyze the monthly purchase reports. Those different applications may result in conflicting solution requirements. In such cases, one needs to exploit domain knowledge to better define the clustering problem. Aside from trial and error, a principled way of extracting domain knowledge is to perform clustering using a form of ‘weak’ supervision. For example, Balcan and Blum [BB08] propose to use an interactive framework with ’split/merge’ queries for clustering. In another work, Ashtiani and Ben-David [ABD15] require the domain expert to provide the clustering of a ’small’ subset of data. At the same time, mitigating the computational problem of clustering is critical. Solving most of the common optimization formulations of clustering is NP-hard (in particular, solving the popular k-means and k-median clustering problems). One approach to address this issues is to exploit the fact that natural data sets usually exhibit some nice properties and likely to avoid the worst-case scenarios. In such cases, optimal solution to clustering may be found efficiently. The quest for notions 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. of niceness that are likely to occur in real data and allow clustering efficiency is still ongoing (see [Ben15] for a critical survey of work in that direction). In this work, we take a new approach to alleviate the computational problem of clustering. In particular, we ask the following question: can weak supervision (in the form of answers to natural queries) help relaxing the computational burden of clustering? This will add up to the other benefit of supervision: making the clustering problem better defined by enabling the accession of domain knowledge through the supervised feedback. The general setting considered in this work is the following. Let X be a set of elements that should be clustered and d a dissimilarity function over it. The oracle (e.g., a domain expert) has some information about a target clustering C∗ X in mind. The clustering algorithm has access to X, d, and can also make queries about C∗ X. The queries are in the form of same-cluster queries. Namely, the algorithm can ask whether two elements belong to the same cluster or not. The goal of the algorithm is to find a clustering that meets some predefined clusterability conditions and is consistent with the answers given to its queries. We will also consider the case that the oracle conforms with some optimal k-means solution. We then show that access to a ’reasonable’ number of same-cluster queries can enable us to provide an efficient algorithm for otherwise NP-hard problems. 1.1 Contributions The two main contributions of this paper are the introduction of the semi-supervised active clustering (SSAC) framework and, the rather unusual demonstration that access to simple query answers can turn an otherwise NP hard clustering problem into a feasible one. Before we explain those results, let us also mention a notion of clusterability (or ‘input niceness’) that we introduce. We define a novel notion of niceness of data, called γ-margin property that is related to the previously introduced notion of center proximity [ABS12]. The larger the value of γ, the stronger the assumption becomes, which means that clustering becomes easier. With respect to that γ parameter, we get a sharp ‘phase transition’ between k-means being NP hard and being optimally solvable in polynomial time1. We focus on the effect of using queries on the computational complexity of clustering. We provide a probabilistic polynomial time (BPP) algorithm for clustering with queries, that succeeds under the assumption that the input satisfies the γ-margin condition for γ > 1. This algorithm makes O k2 log k + k log n) same-cluster queries to the oracle and runs in O kn log n) time, where k is the number of clusters and n is the size of the instance set. On the other hand, we show that without access to query answers, k-means clustering is NP-hard even when the solution satisfies γ-margin property for γ = √ 3.4 ≈1.84 and k = Θ(nϵ) (for any ϵ ∈(0, 1)). We further show that access to Ω(log k + log n) queries is needed to overcome the NP hardness in that case. These results, put together, show an interesting phenomenon. Assume that the oracle conforms to an optimal solution of k-means clustering and that it satisfies the γ-margin property for some 1 < γ ≤ √ 3.4. In this case, our lower bound means that without making queries k-means clustering is NP-hard, while the positive result shows that with a reasonable number of queries the problem becomes efficiently solvable. This indicates an interesting (and as far as we are aware, novel) trade-off between query complexity and computational complexity in the clustering domain. 1.2 Related Work This work combines two themes in clustering research; clustering with partial supervision (in particular, supervision in the form of answers to queries) and the computational complexity of clustering tasks. Supervision in clustering (sometimes also referred to as ‘semi-supervised clustering’) has been addressed before, mostly in application-oriented works [BBM02, BBM04, KBDM09]. The most 1The exact value of such a threshold γ depends on some finer details of the clustering task; whether d is required to be Euclidean and whether the cluster centers must be members of X. 2 common method to convey such supervision is through a set of pairwise link/do-not-link constraints on the instances. Note that in contrast to the supervision we address here, in the setting of the papers cited above, the supervision is non-interactive. On the theory side, Balcan et. al [BB08] propose a framework for interactive clustering with the help of a user (i.e., an oracle). The queries considered in that framework are different from ours. In particular, the oracle is provided with the current clustering, and tells the algorithm to either split a cluster or merge two clusters. Note that in that setting, the oracle should be able to evaluate the whole given clustering for each query. Another example of the use of supervision in clustering was provided by Ashtiani and Ben-David [ABD15]. They assumed that the target clustering can be approximated by first mapping the data points into a new space and then performing k-means clustering. The supervision is in the form of a clustering of a small subset of data (the subset provided by the learning algorithm) and is used to search for such a mapping. Our proposed setup combines the user-friendliness of link/don’t-link queries (as opposed to asking the domain expert to answer queries about whole data set clustering, or to cluster sets of data) with the advantages of interactiveness. The computational complexity of clustering has been extensively studied. Many of these results are negative, showing that clustering is computationally hard. For example, k-means clustering is NP-hard even for k = 2 [Das08], or in a 2-dimensional plane [Vat09, MNV09]. In order to tackle the problem of computational complexity, some notions of niceness of data under which the clustering becomes easy have been considered (see [Ben15] for a survey). The closest proposal to this work is the notion of α-center proximity introduced by Awasthi et. al [ABS12]. We discuss the relationship of that notion to our notion of margin in Appendix B. In the restricted scenario (i.e., when the centers of clusters are selected from the data set), their algorithm efficiently recovers the target clustering (outputs a tree such that the target is a pruning of the tree) for α > 3. Balcan and Liang [BL12] improve the assumption to α > √ 2 + 1. Ben-David and Reyzin [BDR14] show that this problem is NP-Hard for α < 2. Variants of these proofs for our γ-margin condition yield the feasibility of k-means clustering when the input satisfies the condition with γ > 2 and NP hardness when γ < 2, both in the case of arbitrary (not necessarily Euclidean) metrics2 . 2 Problem Formulation 2.1 Center-based clustering The framework of clustering with queries can be applied to any type of clustering. However, in this work, we focus on a certain family of common clusterings – center-based clustering in Euclidean spaces3. Let X be a subset of some Euclidean space, Rd. Let CX = {C1, . . . , Ck} be a clustering (i.e., a partitioning) of X. We say x1 CX ∼x2 if x1 and x2 belong to the same cluster according to CX . We further denote by n the number of instances (|X|) and by k the number of clusters. We say that a clustering CX is center-based if there exists a set of centers µ = {µ1, . . . , µk} ⊂Rn such that the clustering corresponds to the Voroni diagram over those center points. Namely, for every x in X and i ≤k, x ∈Ci ⇔i = arg minj d(x, µj). Finally, we assume that the centers µ∗corresponding to C∗are the centers of mass of the corresponding clusters. In other words, µ∗ i = 1 |Ci| P x∈C∗ i x. Note that this is the case for example when the oracle’s clustering is the optimal solution to the Euclidean k-means clustering problem. 2.2 The γ-margin property Next, we introduce a notion of clusterability of a data set, also referred to as ‘data niceness property’. 2In particular, the hardness result of [BDR14] relies on the ability to construct non-Euclidean distance functions. Later in this paper, we prove hardness for γ ≤ √ 3.4 for Euclidean instances. 3In fact, our results are all independent of the Euclidean dimension and apply to any Hilbert space. 3 Definition 1 (γ-margin). Let X be set of points in metric space M. Let CX = {C1, . . . , Ck} be a center-based clustering of X induced by centers µ1, . . . , µk ∈M. We say that CX satisfies the γ-margin property if the following holds. For all i ∈[k] and every x ∈Ci and y ∈X \ Ci, γd(x, µi) < d(y, µi) Similar notions have been considered before in the clustering literature. The closest one to our γ-margin is the notion of α-center proximity [BL12, ABS12]. We discuss the relationship between these two notions in appendix B. 2.3 The algorithmic setup For a clustering C∗= {C∗ 1, . . . C∗ k}, a C∗-oracle is a function OC∗that answers queries according to that clustering. One can think of such an oracle as a user that has some idea about its desired clustering, enough to answer the algorithm’s queries. The clustering algorithm then tries to recover C∗by querying a C∗-oracle. The following notion of query is arguably most intuitive. Definition 2 (Same-cluster Query). A same-cluster query asks whether two instances x1 and x2 belong to the same cluster, i.e., OC∗(x1, x2) =  true if x1 C∗ ∼x2 false o.w. (we omit the subscript C∗when it is clear from the context). Definition 3 (Query Complexity). An SSAC instance is determined by the tuple (X, d, C∗). We will consider families of such instances determined by niceness conditions on their oracle clusterings C∗. 1. A SSAC algorithm A is called a q-solver for a family G of such instances, if for every instance (X, d, C∗) ∈G, it can recover C∗by having access to (X, d) and making at most q queries to a C∗-oracle. 2. Such an algorithm is a polynomial q-solver if its time-complexity is polynomial in |X| and |C∗| (the number of clusters). 3. We say G admits an O(q) query complexity if there exists an algorithm A that is a polynomial q-solver for every clustering instance in G. 3 An Efficient SSAC Algorithm In this section we provide an efficient algorithm for clustering with queries. The setting is the one described in the previous section. In particular, it is assumed that the oracle has a center-based clustering in his mind which satisfies the γ-margin property. The space is Euclidean and the center of each cluster is the center of mass of the instances in that cluster. The algorithm not only makes same-cluster queries, but also another type of query defined as below. Definition 4 (Cluster-assignment Query). A cluster-assignment query asks the cluster index that an instance x belongs to. In other words OC∗(x) = i if and only if x ∈C∗ i . Note however that each cluster-assignment query can be replaced with k same-cluster queries (see appendix A in supplementary material). Therefore, we can express everything in terms of the more natural notion of same-cluster queries, and the use of cluster-assignment query is just to make the representation of the algorithm simpler. Intuitively, our proposed algorithm does the following. In the first phase, it tries to approximate the center of one of the clusters. It does this by asking cluster-assignment queries about a set of randomly (uniformly) selected point, until it has a sufficient number of points from at least one cluster (say Cp). It uses the mean of these points, µ′ p, to approximate the cluster center. In the second phase, the algorithm recovers all of the instances belonging to Cp. In order to do that, it first sorts all of the instances based on their distance to µ′ p. By showing that all of the points in Cp lie inside a sphere centered at µ′ p (which does not include points from any other cluster), it tries to find 4 the radius of this sphere by doing binary search using same-cluster queries. After that, the elements in Cp will be located and can be removed from the data set. The algorithm repeats this process k times to recover all of the clusters. The details of our approach is stated precisely in Algorithm 1. Note that β is a small constant4. Theorem 7 shows that if γ > 1 then our algorithm recovers the target clustering with high probability. Next, we give bounds on the time and query complexity of our algorithm. Theorem 8 shows that our approach needs O(k log n + k2 log k) queries and runs with time complexity O(kn log n). Algorithm 1: Algorithm for γ(> 1)-margin instances with queries Input: Clustering instance X, oracle O, the number of clusters k and parameter δ ∈(0, 1) Output: A clustering C of the set X C = {}, S1 = X, η = β log k+log(1/δ) (γ−1)4 for i = 1 to k do Phase 1 l = kη + 1; Z ∼U l[Si] // Draws l independent elements from Si uniformly at random For 1 ≤t ≤i, Zt = {x ∈Z : O(x) = t}. //Asks cluster-assignment queries about the members of Z p = arg maxt |Zt| µ′ p := 1 |Zp| P x∈Zp x. Phase 2 // We know that there exists ri such that ∀x ∈Si, x ∈Ci ⇔d(x, µ′ i) < ri. // Therefore, ri can be found by simple binary search bSi = Sorted({Si}) // Sorts elements of {x : x ∈Si} in increasing order of d(x, µ′ p). ri = BinarySearch( bSi) //This step takes up to O(log |Si|) same-cluster queries C′ p = {x ∈Si : d(x, µ′ p) ≤ri}. Si+1 = Si \ C′ p. C = C ∪{C′ p} end Lemma 5. Let (X, d, C) be a clustering instance, where C is center-based and satisfies the γ-margin property. Let µ be the set of centers corresponding to the centers of mass of C. Let µ′ i be such that d(µi, µ′ i) ≤r(Ci)ϵ, where r(Ci) = maxx∈Ci d(x, µi) . Then γ ≥1 + 2ϵ implies that ∀x ∈Ci, ∀y ∈X \ Ci ⇒d(x, µ′ i) < d(y, µ′ i) Proof. Fix any x ∈Ci and y ∈Cj. d(x, µ′ i) ≤d(x, µi) + d(µi, µ′ i) ≤r(Ci)(1 + ϵ). Similarly, d(y, µ′ i) ≥d(y, µi) −d(µi, µ′ i) > (γ −ϵ)r(Ci). Combining the two, we get that d(x, µ′ i) < 1+ϵ γ−ϵd(y, µ′ i). Lemma 6. Let the framework be as in Lemma 5. Let Zp, Cp, µp, µ′ p and η be defined as in Algorhtm 1, and ϵ = γ−1 2 . If |Zp| > η, then the probability that d(µp, µ′ p) > r(Cp)ϵ is at most δ k. Proof. Define a uniform distribution U over Cp. Then µp and µ′ p are the true and empirical mean of this distribution. Using a standard concentration inequality (Thm. 12 from Appendix D) shows that the empirical mean is close to the true mean, completing the proof. Theorem 7. Let (X, d, C) be a clustering instance, where C is center-based and satisfies the γmargin property. Let µi be the center of mass of Ci. Assume δ ∈(0, 1) and γ > 1. Then with probability at least 1 −δ, Algorithm 1 outputs C. 4It corresponds to the constant appeared in generalized Hoeffding inequality bound, discussed in Theorem 12 in appendix D in supplementary materials. 5 Proof. In the first phase of the algorithm we are making l > kη cluster-assignment queries. Therefore, using the pigeonhole principle, we know that there exists cluster index p such that |Zp| > η. Then Lemma 6 implies that the algorithm chooses a center µ′ p such that with probability at least 1 −δ k we have d(µp, µ′ p) ≤r(Cp)ϵ. By Lemma 5, this would mean that d(x, µ′ p) < d(y, µ′ p) for all x ∈Cp and y ̸∈Cp. Hence, the radius ri found in the phase two of Alg. 1 is such that ri = max x∈Cp d(x, µ′ p). This implies that C′ p (found in phase two) equals to Cp. Hence, with probability at least 1 −δ k one iteration of the algorithm successfully finds all the points in a cluster Cp. Using union bound, we get that with probability at least 1 −k δ k = 1 −δ, the algorithm recovers the target clustering. Theorem 8. Let the framework be as in theorem 7. Then Algorithm 1 • Makes O k log n + k2 log k+log(1/δ) (γ−1)4  same-cluster queries to the oracle O. • Runs in O kn log n + k2 log k+log(1/δ) (γ−1)4  time. Proof. In each iteration (i) the first phase of the algorithm takes O(η) time and makes η + 1 clusterassignment queries (ii) the second phase takes O(n log n) times and makes O(log n) same-cluster queries. Each cluster-assignment query can be replaced with k same-cluster queries; therefore, each iteration runs in O(kη + n log n) and uses O(kη + log n) same-cluster queries. By replacing η = β log k+log(1/δ) (γ−1)4 and noting that there are k iterations, the proof will be complete. Corollary 9. The set of Euclidean clustering instances that satisfy the γ-margin property for some γ > 1 admits query complexity O k log n + k2 log k+log(1/δ) (γ−1)4  . 4 Hardness Results 4.1 Hardness of Euclidean k-means with Margin Finding k-means solution without the help of an oracle is generally computationally hard. In this section, we will show that solving Euclidean k-means remains hard even if we know that the optimal solution satisfies the γ-margin property for γ = √ 3.4. In particular, we show the hardness for the case of k = Θ(nϵ) for any ϵ ∈(0, 1). In Section 3, we proposed a polynomial-time algorithm that could recover the target clustering using O(k2 log k + k log n) queries, assuming that the clustering satisfies the γ-margin property for γ > 1. Now assume that the oracle conforms to the optimal k-means clustering solution. In this case, for 1 < γ ≤ √ 3.4 ≈1.84, solving k-means clustering would be NP-hard without queries, while it becomes efficiently solvable with the help of an oracle 5. Given a set of instances X ⊂Rd, the k-means clustering problem is to find a clustering C = {C1, . . . , Ck} which minimizes f(C) = P Ci min µi∈Rd P x∈Ci ∥x −µi∥2 2. The decision version of k-means is, given some value L, is there a clustering C with cost ≤L? The following theorem is the main result of this section. Theorem 10. Finding the optimal solution to Euclidean k-means objective function is NP-hard when k = Θ(nϵ) for any ϵ ∈(0, 1), even when the optimal solution satisfies the γ-margin property for γ = √ 3.4. This results extends the hardness result of [BDR14] to the case of Euclidean metric, rather than arbitrary one, and to the γ-margin condition (instead of the α-center proximity there). The full proof is rather technical and is deferred to the supplementary material (appendix C). 5To be precise, note that the algorithm used for clustering with queries is probabilistic, while the lower bound that we provide is for deterministic algorithms. However, this implies a lower bound for randomized algorithms as well unless BPP ̸= P 6 4.1.1 Overview of the proof Our method to prove Thm. 10 is based on the approach employed by [Vat09]. However, the original construction proposed in [Vat09] does not satisfy the γ-margin property. Therefore, we have to modify the proof by setting up the parameters of the construction more carefully. To prove the theorem, we will provide a reduction from the problem of Exact Cover by 3-Sets (X3C) which is NP-Complete [GJ02], to the decision version of k-means. Definition 11 (X3C). Given a set U containing exactly 3m elements and a collection S = {S1, . . . , Sl} of subsets of U such that each Si contains exactly three elements, does there exist m elements in S such that their union is U? We will show how to translate each instance of X3C, (U, S), to an instance of k-means clustering in the Euclidean plane, X. In particular, X has a grid-like structure consisting of l rows (one for each Si) and roughly 6m columns (corresponding to U) which are embedded in the Euclidean plane. The special geometry of the embedding makes sure that any low-cost k-means clustering of the points (where k is roughly 6ml) exhibits a certain structure. In particular, any low-cost k-means clustering could cluster each row in only two ways; One of these corresponds to Si being included in the cover, while the other means it should be excluded. We will then show that U has a cover of size m if and only if X has a clustering of cost less than a specific value L. Furthermore, our choice of embedding makes sure that the optimal clustering satisfies the γ-margin property for γ = √ 3.4 ≈1.84. 4.1.2 Reduction design Given an instance of X3C, that is the elements U = {1, . . . , 3m} and the collection S, we construct a set of points X in the Euclidean plane which we want to cluster. Particularly, X consists of a set of points Hl,m in a grid-like manner, and the sets Zi corresponding to Si. In other words, X = Hl,m ∪(∪l−1 i=1Zi). The set Hl,m is as described in Fig. 1. The row Ri is composed of 6m + 3 points {si, ri,1, . . . , ri,6m+1, fi}. Row Gi is composed of 3m points {gi,1, . . . , gi,3m}. The distances between the points are also shown in Fig. 1. Also, all these points have weight w, simply meaning that each point is actually a set of w points on the same location. Each set Zi is constructed based on Si. In particular, Zi = ∪j∈[3m]Bi,j, where Bi,j is a subset of {xi,j, x′ i,j, yi,j, y′ i,j} and is constructed as follows: xi,j ∈Bi,j iff j ̸∈Si, and x′ i,j ∈Bi,j iff j ∈Si. Similarly, yi,j ∈Bi,j iff j ̸∈Si+1, and y′ i,j ∈Bi,j iff j ∈Si+1. Furthermore, xi,j, x′ i,j, yi,j and y′ i,j are specific locations as depicted in Fig. 2. In other words, exactly one of the locations xi,j and x′ i,j, and one of yi,j and y′ i,j will be occupied. We set the following parameters. h = √ 5, d = √ 6, ϵ = 1 w2 , λ = 2 √ 3h, k = (l −1)3m + l(3m + 2) L1 = (6m + 3)wl, L2 = 3m(l −1)w, L = L1 + L2 −mα, α = d w − 1 2w3 Lemma 12. The set X = Hl,n ∪Z has a k-clustering of cost less or equal to L if and only if there is an exact cover for the X3C instance. Lemma 13. Any k-clustering of X = Hl,n ∪Z with cost ≤L has the γ-margin property where γ = √ 3.4. Furthermore, k = Θ(nϵ). The proofs are provided in Appendix C. Lemmas 12 and 13 together show that X has a k-clustering of cost ≤L satisfying the γ-margin property (for γ = √ 3.4) if and only if there is an exact cover by 3-sets for the X3C instance. This completes the proof of our main result (Thm. 10). 4.2 Lower Bound on the Number of Queries In the previous section we showed that k-means clustering is NP-hard even under γ-margin assumption (for γ < √ 3.4 ≈1.84). On the other hand, in Section 3 we showed that this is not the case if the algorithm has access to an oracle. In this section, we show a lower bound on the number of queries needed to provide a polynomial-time algorithm for k-means clustering under margin assumption. 7 ⋄ R1 • • • • . . . • • ⋄ G1 ◦ ◦ . . . ◦ ⋄ R2 • • • • . . . • • ⋄ Gl−1 ◦ ◦ . . . ◦ ⋄ Rl • • • • . . . • • ⋄ d 2 2 d −ϵ 4 Figure 1: Geometry of Hl,m. This figure is similar to Fig. 1 in [Vat09]. Reading from letf to right, each row Ri consists of a diamond (si), 6m + 1 bullets (ri,1, . . . , ri,6m+1), and another diamond (fi). Each rows Gi consists of 3m circles (gi,1, . . . , gi,3m). • ri,2j−1 • ri,2j • ri,2j+1 √ h2 −1 • xi,j h • x′ i,j ◦ gi,j • yi,j • y′ i,j • ri+1,2j−1 • ri+1,2j • ri+1,2j+1 √ h2 −1 α 1 2 Figure 2: The locations of xi,j, x′ i,j, yi,j and y′ i,j in the set Zi. Note that the point gi,j is not vertically aligned with xi,j or ri,2j. This figure is adapted from [Vat09]. Theorem 14. For any γ ≤ √ 3.4, finding the optimal solution to the k-means objective function is NP-Hard even when the optimal clustering satisfies the γ-margin property and the algorithm can ask O(log k + log |X|) same-cluster queries. Proof. Proof by contradiction: assume that there is polynomial-time algorithm A that makes O(log k + log |X|) same-cluster queries to the oracle. Then, we show there exists another algorithm A′ for the same problem that is still polynomial but uses no queries. However, this will be a contradiction to Theorem 10, which will prove the result. In order to prove that such A′ exists, we use a ‘simulation’ technique. Note that A makes only q < β(log k + log |X|) binary queries, where β is a constant. The oracle therefore can respond to these queries in maximum 2q < kβ|X|β different ways. Now the algorithm A′ can try to simulate all of kβ|X|β possible responses by the oracle and output the solution with minimum k-means clustering cost. Therefore, A′ runs in polynomial-time and is equivalent to A. 5 Conclusions and Future Directions In this work we introduced a framework for semi-supervised active clustering (SSAC) with samecluster queries. Those queries can be viewed as a natural way for a clustering mechanism to gain domain knowledge, without which clustering is an under-defined task. The focus of our analysis was the computational and query complexity of such SSAC problems, when the input data set satisfies a clusterability condition – the γ-margin property. Our main result shows that access to a limited number of such query answers (logarithmic in the size of the data set and quadratic in the number of clusters) allows efficient successful clustering under conditions (margin parameter between 1 and √ 3.4 ≈1.84) that render the problem NP-hard without the help of such a query mechanism. We also provided a lower bound indicating that at least Ω(log kn) queries are needed to make those NP hard problems feasibly solvable. With practical applications of clustering in mind, a natural extension of our model is to allow the oracle (i.e., the domain expert) to refrain from answering a certain fraction of the queries, or to make a certain number of errors in its answers. It would be interesting to analyze how the performance guarantees of SSAC algorithms behave as a function of such abstentions and error rates. Interestingly, we can modify our algorithm to handle a sub-logarithmic number of abstentions by chekcing all possible orcale answers to them (i.e., similar to the “simulation” trick in the proof of Thm. 14). 8 Acknowledgments We would like to thank Samira Samadi and Vinayak Pathak for helpful discussions on the topics of this paper. References [ABD15] Hassan Ashtiani and Shai Ben-David. Representation learning for clustering: A statistical framework. In Uncertainty in AI (UAI), 2015. [ABS12] Pranjal Awasthi, Avrim Blum, and Or Sheffet. Center-based clustering under perturbation stability. Information Processing Letters, 112(1):49–54, 2012. [BB08] Maria-Florina Balcan and Avrim Blum. Clustering with interactive feedback. In Algorithmic Learning Theory, pages 316–328. Springer, 2008. [BBM02] Sugato Basu, Arindam Banerjee, and Raymond Mooney. Semi-supervised clustering by seeding. In In Proceedings of 19th International Conference on Machine Learning (ICML-2002, 2002. [BBM04] Sugato Basu, Mikhail Bilenko, and Raymond J Mooney. A probabilistic framework for semi-supervised clustering. In Proceedings of the tenth ACM SIGKDD international conference on Knowledge discovery and data mining, pages 59–68. ACM, 2004. [BDR14] Shalev Ben-David and Lev Reyzin. Data stability in clustering: A closer look. Theoretical Computer Science, 558:51–61, 2014. [Ben15] Shai Ben-David. Computational feasibility of clustering under clusterability assumptions. CoRR, abs/1501.00437, 2015. [BL12] Maria Florina Balcan and Yingyu Liang. Clustering under perturbation resilience. In Automata, Languages, and Programming, pages 63–74. Springer, 2012. [Das08] Sanjoy Dasgupta. The hardness of k-means clustering. Department of Computer Science and Engineering, University of California, San Diego, 2008. [GJ02] Michael R Garey and David S Johnson. Computers and intractability, volume 29. wh freeman New York, 2002. [KBDM09] Brian Kulis, Sugato Basu, Inderjit Dhillon, and Raymond Mooney. Semi-supervised graph clustering: a kernel approach. Machine learning, 74(1):1–22, 2009. [MNV09] Meena Mahajan, Prajakta Nimbhorkar, and Kasturi Varadarajan. The planar k-means problem is np-hard. In WALCOM: Algorithms and Computation, pages 274–285. Springer, 2009. [Vat09] Andrea Vattani. The hardness of k-means clustering in the plane. Manuscript, accessible at http://cseweb. ucsd. edu/avattani/papers/kmeans_hardness. pdf, 617, 2009. 9
2016
339
6,260
Single-Image Depth Perception in the Wild Weifeng Chen Zhao Fu Dawei Yang Jia Deng University of Michigan, Ann Arbor {wfchen,zhaofu,ydawei,jiadeng}@umich.edu Abstract This paper studies single-image depth perception in the wild, i.e., recovering depth from a single image taken in unconstrained settings. We introduce a new dataset “Depth in the Wild” consisting of images in the wild annotated with relative depth between pairs of random points. We also propose a new algorithm that learns to estimate metric depth using annotations of relative depth. Compared to the state of the art, our algorithm is simpler and performs better. Experiments show that our algorithm, combined with existing RGB-D data and our new relative depth annotations, significantly improves single-image depth perception in the wild. Deep Network with Pixel-wise Prediction Metric Depth RGB-D Data Relative Depth Annotations train Input Image Figure 1: We crowdsource annotations of relative depth and train a deep network to recover depth from a single image taken in unconstrained settings (“in the wild”). 1 Introduction Depth from a single RGB image is a fundamental problem in vision. Recent years have seen rapid progress thanks to data-driven methods [1, 2, 3], in particular, deep neural networks trained on large RGB-D datasets [4, 5, 6, 7, 8, 9, 10]. But such advances have yet to broadly impact higher-level tasks. One reason is that many higher-level tasks must operate on images “in the wild”—images taken with no constraints on cameras, locations, scenes, and objects—but the RGB-D datasets used to train and evaluate image-to-depth systems are constrained in one way or another. Current RGB-D datasets were collected by depth sensors [4, 5], which are limited in range and resolution, and often fail on specular or transparent objects [11]. In addition, because there is no Flickr for RGB-D images, researchers have to manually capture the images. As a result, current RGB-D datasets are limited in the diversity of scenes. For example, NYU depth [4] consists mostly of indoor scenes with no human presence; KITTI [5] consists mostly of road scenes captured from a car; Make3D [3, 12] consists mostly of outdoor scenes of the Stanford campus (Figure. 2). While these datasets are pivotal in driving research, it is unclear whether systems trained on them can generalize to images in the wild. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. Is it possible to collect ground-truth depth for images in the wild? Using depth sensors in unconstrained settings is not yet feasible. Crowdsourcing seems viable, but humans are not good at estimating metric depth, or 3D metric structure in general [13]. In fact, metric depth from a single image is fundamentally ambiguous: a tree behind a house can be slightly bigger but further away, or slightly smaller but closer—the absolute depth difference between the house and the tree cannot be uniquely determined. Furthermore, even in cases where humans can estimate metric depth, it is unclear how to elicit the values from them. But humans are better at judging relative depth [13]: “Is point A closer than point B?” is often a much easier question for humans. Recent work by Zoran et al. [14] shows that it is possible to learn to estimate metric depth using only annotations of relative depth. Although such metric depth estimates are only accurate up to monotonic transformations, they may well be sufficiently useful for high-level tasks, especially for occlusion reasoning. The seminal results by Zoran et al. point to two fronts for further progress: (1) collecting a large amount of relative depth annotations for images in the wild and (2) improving the algorithms that learn from annotations of relative depth. In this paper, we make contributions on both fronts. Our first contribution is a new dataset called “Depth in the Wild” (DIW). It consists of 495K diverse images, each annotated with randomly sampled points and their relative depth. We sample one pair of points per image to minimize the redundancy of annotation 1. To the best of our knowledge this is the first large-scale dataset consisting of images in the wild with relative depth annotations. We demonstrate that this dataset can be used as an evaluation benchmark as well as a training resource 2. Our second contribution is a new algorithm for learning to estimate metric depth using only annotations of relative depth. Our algorithm not only significantly outperforms that of Zoran et al. [14], but is also simpler. The algorithm of Zoran et al. [14] first learns a classifier to predict the ordinal relation between two points in an image. Given a new image, this classifier is repeatedly applied to predict the ordinal relations between a sparse set of point pairs (mostly between the centers of neighboring superpixels). The algorithm then reconstructs depth from the predicted ordinal relations by solving a constrained quadratic optimization that enforces additional smoothness constraints and reconciles potentially inconsistent ordinal relations. Finally, the algorithm estimates depth for all pixels assuming a constant depth within each superpixel. In contrast, our algorithm consists of a single deep network that directly predicts pixel-wise depth (Fig. 1). The network takes an entire image as input, consists of off-the-shelf components, and can be trained entirely with annotations of relative depth. The novelty of our approach lies in the combination of two ingredients: (1) a multi-scale deep network that produces pixel-wise prediction of metric depth and (2) a loss function using relative depth. Experiments show that our method produces pixel-wise depth that is more accurately ordered, outperforming not only the method by Zoran et al. [14] but also the state-of-the-art image-to-depth system by Eigen et al. [8] trained with ground-truth metric depth. Furthermore, combing our new algorithm, our new dataset, and existing RGB-D data significantly improves single-image depth estimation in the wild. 2 Related work RGB-D Datasets: Prior work on constructing RGB-D datasets has relied on either Kinect [15, 4, 16, 17] or LIDAR [5, 3]. Existing Kinect-based datasets are limited to indoor scenes; existing LIDARbased datasets are biased towards scenes of man-made structures [5, 3]. In contrast, our dataset covers a much wider variety of scenes; it can be easily expanded with large-scale crowdsourcing and the virually umlimited Internet images. Intrinsic Images in the Wild: Our work draws inspiration from Intrinsic Images in the Wild [18], a seminal work that crowdsources annotations of relative reflectance on unconstrained images. Our work differs in goals as well as in several design decisions. First, we sample random points instead of centers of superpixels, because unlike reflectance, it is unreasonable to assume a constant depth within a superpixel. Second, we sample only one pair of points per image instead of many to maximize the value of human annotations. Depth from a Single Image: Image-to-depth is a long-standing problem with a large body of literature [19, 20, 12, 1, 6, 7, 8, 9, 10, 19, 21, 22, 23, 24, 25, 26]. The recent convergence of deep 1A small percentage of images have duplicates and thus have multiple pairs. 2Project website: http://www-personal.umich.edu/~wfchen/depth-in-the-wild. 2 Our Dataset NYU V2 Dataset KITTI Dataset Make3D Dataset Figure 2: Example images from current RGB-D datasets and our Depth in the Wild (DIW) dataset. Figure 3: Annotation UI. The user presses ’1’ or ’2’ to pick the closer point. Figure 4: Relative image location (normalized to [-1,1]) and relative depth of two random points. neural networks and RGB-D datasets [4, 5] has led to major advances [27, 6, 28, 8, 10, 14]. But the networks in these previous works, with the exception of [14], were trained exclusively using ground-truth metric depth, whereas our approach uses relative depth. Our work is inspired by that of Zoran et al. [14], which proposes to use a deep network to repeatedly classify pairs of points sampled based on superpixel segmentation, and to reconstruct per-pixel metric depth by solving an additional optimization problem. Our approach is different: it consists of a single deep network trained end-to-end that directly predicts per-pixel metric depth; there is no intermediate classification of ordinal relations and as a result no optimization needed to resolve inconsistencies. Learning with Ordinal Relations: Several recent works [29, 30] have used the ordinal relations from the Intrinsic Images in the Wild dataset [18] to estimate surface refletance. Similar to Zoran et al. [14], Zhou et al. [29] first learn a deep network to classify the ordinal relations between pairs of points and then make them globally consistent through energy minimization. Narihira et al. [30] learn a “lightness potential” network that takes an image patch and predicts the metric reflectance of the center pixel. But this network is applied to only a sparse set of pixels. Although in principle this lightness potential network can be applied to every pixel to produce pixel-wise reflectance, doing so would be quite expensive. Making it fully convolutional (as the authors mentioned in [30]) only solves it partially: as long as the lightness potential network has downsampling layers, which is the case in [30], the final output will be downsampled accordingly. Additional resolution augmentation (such as the “shift and stitch” approach [31]) is thus needed. In contrast, our approach completely avoids such issues and directly outputs pixel-wise estimates. Beyond intrinsic images, ordinal relations have been used widely in computer vision and machine learning, including object recognition [32] and learning to rank [33, 34]. 3 Dataset construction We gather images from Flickr. We use random query keywords sampled from an English dictionary and exclude artificial images such as drawings and clip arts. To collect annotations of relative depth, we present a crowd worker an image and two highlighted points (Fig. 3), and ask “which point is closer, point 1, point 2, or hard to tell?” The worker presses a key to respond. How Many Pairs? How many pairs of points should we query per image? We sample just one per image because this maximizes the amount of information from human annotators. Consider the other extreme—querying all possible pairs of points in the same image. This is wasteful because pairs of points in close proximity are likely to have the same relative depth. In other words, querying one 3 unconstrained pairs symmetric pairs hard-to-tell pairs Figure 5: Example images and annotations. Green points are those annotated as closer in depth. more pair from the same image may add less information than querying one more pair from a new image. Thus querying only one pair per image is more cost-effective. Which Pairs? Which two points should we query given an image? The simplest way would be to sample two random points from the 2D plane. But this results in a severe bias that can be easily exploited: if an algorithm simply classifies the lower point in the image to be closer in depth, it will agree with humans 85.8% of the time (Fig. 4). Although this bias is natural, it makes the dataset less useful as a benchmark. An alternative is to sample two points uniformly from a random horizontal line, which makes it impossible to use the y image coordinate as a cue. But we find yet another bias: if an algorithm simply classifies the point closer to the center of the image to be closer in depth, it will agree with humans 71.4% of the time. This leads to a third approach: uniformly sample two symmetric points with respect to the center from a random horizontal line (the middle column of Fig. 5). With the symmetry enforced, we are not able to find a simple yet effective rule based purely on image coordinates: the left point is almost equally likely (50.03%) to be closer than the right one. Our final dataset consists of a roughly 50-50 combination of unconstrained pairs and symmetric pairs, which strikes a balance between the need for representing natural scene statistics and the need for performance differentiation. Protocol and Results: We crowdsource the annotations using Amazon Mechanical Turk (AMT). To remove spammers, we insert into all tasks gold-standard images verified by ourselves, and reject workers whose accumulative accuracy on the gold-standard images is below 85%. We assign each query (an image and a point pair) to two workers, and add the query to our dataset if both workers can tell the relative depth and agree with each other; otherwise the query is discarded. Under this protocol, the chance of adding a wrong answer to our dataset is less than 1% as measured on the gold-standard images. We processed 1.24M images on AMT and obtained 0.5M valid answers (both workers can tell the relative depth and agree with each other). Among the valid answers, 261K are for unconstrained pairs and 240K are for symmetric pairs. For unconstrained pairs, It takes a median of 3.4 seconds for a worker to decide, and two workers agree on the relative depth 52% of the time; for symmetric pairs, the numbers are 3.8s and 32%. These numbers suggest that the symmetric pairs are indeed harder. Fig. 5 presents examples of different kinds of queries. 4 Learning with relative depth How do we learn to predict metric depth given only annotations of relative depth? Zoran et al. [14] first learn a classifier to predict ordinal relations between centers of superpixels, and then reconcile the relations to recover depth using energy minimization, and then interpolate within each superpixel to produce per-pixel depth. We take a simpler approach. The idea is that any image-to-depth algorithm would have to compute a function that maps an image to pixel-wise depth. Why not represent this function as a neural network and learn it from end to end? We just need two ingredients: (1) a network design that outputs the same resolution as the input, and (2) a way to train the network with annotations of relative depth. Network Design: Networks that output the same resolution as the input are aplenty, including the recent designs for depth estimation [8, 35] and those for semantic segmentation [36] and edge detection [37]. A common element is processing and passing information across multiple scales. In this work, we use a variant of the recently introduced “hourglass” network (Fig. 6), which has been used to achieve state-of-the-art results on human pose estimation [38]. It consists of a series 4 upsample pool pool pool pool upsample upsample upsample A B C D E F G H Figure 6: Network design. Each block represents a layer. Blocks sharing the same color are identical. The ⊕sign denotes the element-wise addition. Block H is a convolution with 3x3 filter. All other blocks denote the Inception module shown in Figure 7. Their parameters are detailed in Tab. 1 Filter concatenation Conv1 Conv2 Conv3 Conv4 1x1 Conv 1x1 Conv 1x1 Conv Previous layer Figure 7: Variant of Inception Module [39] used by us. Table 1: Parameters for each type of layer in our network. Conv1 to Conv4 are sizes of the filters used in the components of Inception module shown in Figure.7. Conv2 to 4 share the same number of input and is specified in Inter Dim. Block Id A B C D E F G #In/#Out 128/64 128/128 128/128 128/256 256/256 256/256 256/128 Inter Dim 64 32 64 32 32 64 32 Conv1 1x1 1x1 1x1 1x1 1x1 1x1 1x1 Conv2 3x3 3x3 3x3 3x3 3x3 3x3 3x3 Conv3 7x7 5x5 7x7 5x5 5x5 7x7 5x5 Conv4 11x11 7x7 11x11 7x7 7x7 11x11 7x7 of convolutions (using a variant of the inception [39] module) and downsampling, followed by a series of convolutions and upsampling, interleaved with skip connections that add back features from high resolutions. The symmetric shape of the network resembles a “hourglass”, hence the name. We refer the reader to [38] for comparing the design to related work. For our purpose, this particular choice is not essential, as the various designs mainly differ in how information from different scales is dispersed and aggregated, and it is possible that all of them can work equally well for our task. Loss Function: How do we train the network using only ordinal annotations? All we need is a loss function that encourages the predicted depth map to agree with the ground-truth ordinal relations. Specifically, consider a training image I and its K queries R = {(ik, jk, rk)}, k = 1, . . . , K, where ik is the location of the first point in the k-th query, jk is the location of the second point in the k-th query, and rk ∈{+1, −1, 0} is the ground-truth depth relation between ik and jk: closer (+1), further (−1), and equal (0). Let z be the predicted depth map and zik, zjk be the depths at point ik and jk. We define a loss function L(I, R, z) = K X k=1 ψk(I, ik, jk, r, z), (1) where ψk(I, ik, jk, z) is the loss for the k-th query ψk(I, ik, jk, z) =    log (1 + exp(−zik + zjk)) , rk = +1 log (1 + exp(zik −zjk)) , rk = −1 (zik −zjk)2, rk = 0. (2) This is essentially a ranking loss: it encourages a small difference between depths if the ground-truth relation is equality; otherwise it encourages a large difference. Novelty of Our Approach: Our novelty lies in the combination of a deep network that does pixelwise prediction and a ranking loss placed on the pixel-wise prediction. A deep network that does pixel-wise prediction is not new, nor is a ranking loss. But to the best of our knowledge, such a combination has not been proposed before, and in particular not for estimating depth. 5 Experiments on NYU Depth We evaluate our method using NYU Depth [4], which consists of indoor scenes with ground-truth Kinect depth. We use the same setup as that of Zoran et al. [14]: point pairs are sampled from the 5 Input image Our Depth Zoran Eigen Ground Truth Figure 8: Qualitative results on NYU Depth by our method, the method of Eigen et al. [8], and the method of Zoran et al. [14]. All depth maps except ours are directly from [14]. More results are in the supplementary material. training images (the subset of NYU Depth consisting of 795 images with semantic labels) using superpixel segmentation and their ground-truth ordinal relations are generated by comparing the ground-truth Kinect depth; the same procedure is applied to the test set to generate the point pairs for evaluation (around 3K pairs per image). We use the same training and test data as Zoran et al. [14]. Table 2: Left table: ordinal error measures (disagreement rate with ground-truth depth ordering) on NYU Depth. Right able: metric error measures on NYU Depth. Details for each metric can be found in [8]. There are two versions of results by Eigen et al. [8], one using AlexNet (Eigen(A)) and one using VGGNet (Eigen(V)). Lower is better for all error measures. Method WKDR WKDR= WKDR̸= Ours 35.6% 36.1% 36.5% Zoran [14] 43.5% 44.2% 41.4% rand_12K 34.9% 32.4% 37.6% rand_6K 36.1% 32.2% 39.9% rand_3K 35.8% 28.7% 41.3% Ours_Full 28.3% 30.6% 28.6% Eigen(A) [8] 37.5% 46.9% 32.7% Eigen(V) [8] 34.0% 43.3% 29.6% Method RMSE RMSE RMSE a absrel sqrrel (log) (s.inv) Ours 1.13 0.39 0.26 0.36 0.46 Ours_Full 1.10 0.38 0.24 0.34 0.42 Zoran [14] 1.20 0.42 0.40 0.54 Eigen(A) [8] 0.75 0.26 0.20 0.21 0.19 Eigen(V) [8] 0.64 0.21 0.17 0.16 0.12 Wang [28] 0.75 0.22 Liu [6] 0.82 0.23 Li [10] 0.82 0.23 Karsch [1] 1.20 0.35 Baig [40] 1.0 0.3 As the system by Zoran et al. [14], our network predicts one of the three ordinal relations on the test pairs: equal (=), closer (<), or farther (>). We report WKDR, the weighted disagreement rate between the predicted ordinal relations and ground-truth ordinal relations 3. We also report WKDR= (disagreement rate on pairs whose ground-truth relations are =) and WKDR̸= (disagreement rate on pairs whose ground-truth relations are < or >). Since two ground-truth depths are almost never exactly the same, there needs to be a relaxed definition of equality. Zoran et al. [14] define two points to have equal depths if the ratio between their groundtruth depths is within a pre-determined range. Our network predicts an equality relation if the depth difference is smaller than a threshold τ. The choice of this threshold will result in different values for the error metrics (WKDR, WKDR=, WKDR̸=): if τ is too small, most pairs will be predicted to be unequal and the error metric on equality relations (WKDR=) will be large; if τ is too big, most pairs will be predicted to be equal and the error metric on inequality relations (WKDR̸=) will be large. We choose the threshold τ that minimizes the maximum of the three error metrics on a validation set held out from the training set. Tab. 2 compares our network (ours) versus that of Zoran et al. [14]. Our network is trained with the same data 4 but outperforms [14] on all three metrics. Following [14], we also compare with the state-of-art image-to-depth system by Eigen et al. [8], which is trained on pixel-wise ground-truth metric depth from the full NYU Depth training set (220K images). To compare fairly, we give our network access to the full NYU Depth training set. In addition, we remove the limit of 800 point pairs per training image placed by Zoran et al and use all available pairs. The results in Tab. 2 show that our network (ours_full) achieves superior performance in estimating depth ordering. Granted, this comparison is not entirely fair because [8] is not optimized for predicting ordinal relations. But this comparison is still significant in that it shows aComputed using our own implementation based on the definition given in [35]. 3WKDR stands for “Weighted Kinect Disagreement Rate”; the weight is set to 1 as in [14] 4The code released by Zoran et al. [14] indicates that they train with a random subset of 800 pairs per image instead of all the pairs. We follow the same procedure and only use a random subset of 800 pairs per image. 6 Figure 9: Point pairs generated through superpixel segmentation [14] (left) versus point pairs generated through random sampling with distance constraints (right). that we can train on only relative depth and rival the state-of-the-art system in estimating depth up to monotonic transformations. In Figure. 8 we show qualitative results on the same example images used by Zoran et al. [14]. We see that although imperfect, the recovered metric depth by our method is overall reasonable and qualitatively similar to that by the state-of-art system [8] trained on ground-truth metric depth. Metric Error Measures. Our network is trained with relative depth, so it is unsurprising that it does well in estimating depth up to ordering. But how good is the estimated depth in terms of metric error? We thus evaluate conventional error measures such as RMSE (the root mean squared error), which compares the absolute depth values to the ground truths. Because our network is trained only on relative depth and does not know the range of the ground-truth depth values, to make these error measures meaningful we normalize the depth predicted by our network such that the mean and standard deviation are the same as those of the mean depth map of the training set. Tab. 2 reports the results. We see that under these metric error measures our network still outperforms the method of Zoran et al. [14]. In addition, while our metric error is worse than the current state-of-the-art, it is comparable to some of the earlier methods (e.g. [1]) that have access to ground-truth metric depth. Superpixel Sampling versus Random Sampling. To compare with the method by Zoran et al. [14], we train our network using the same point pairs, which are pairs of centers of superpixels (Fig. 9). But is superpixel segmentation necessary? That is, can we simply train with randomly sampled points? To answer this question, we train our network with randomly sampled points. We constrain the distance between the two points to be between 13 and 19 pixels (out of a 320×240 image) such that the distance is similar to that between the centers of neighboring superpixels. The results are included in Tab. 2. We see that using 3.3k pairs per image (rand_3K) already achieves comparable performance to the method by Zoran et al. [14]. Using twice or four times as many pairs (rand_6K, rand_12K) further improves performance and significantly outperforms [14]. It is worth noting that in all these experiments the test pairs are still from superpixels, so training on random pairs incurs a mismatch between training and testing distributions. Yet we can still achieve comparable performance despite this mismatch. This shows that our method can indeed operate without superpixel segmentation. 6 Experiments on Depth in the Wild In this section we experiment on our new Depth in the Wild (DIW) dataset. We split the dataset into 421K training images and 74K test images 5. We report the WHDR (Weighted Human Disagreement Rate) 6 of 5 methods in Tab. 3: (1) the state-of-the-art system by Eigen et al. [8] trained on full NYU Depth; (2) our network trained on full NYU Depth (Ours_Full); (3) our network pre-trained on full NYU Depth and fine-tuned on DIW (Ours_NYU_DIW); (4) our network trained from scratch on DIW (Ours_DIW); (5) a baseline method that uses only the location of the query points: classify the lower point to be closer or guess randomly if the two points are at the same height (Query_Location_Only). We see that the best result is achieved by pre-training on NYU Depth and fine-tuning on DIW. Training only on NYU Depth (Ours_NYU and Eigen) does not work as well, which is expected because NYU Depth only has indoor scenes. Training from scratch on DIW achieves slightly better performance 54.38% of images are duplicates downloaded using different query keywords and have more than one pairs of points. We have removed test images that have duplicates in the training set. 6All weights are 1. A pair of points can only have two possible ordinal relations (farther or closer) for DIW. 7 Input Eigen Ours_NYU_DIW Input Eigen Ours_NYU_DIW Figure 10: Qualitative results on our Depth in the Wild (DIW) dataset by our method and the method of Eigen et al. [8]. More results are in the supplementary material. Table 3: Weighted Human Disagreement Rate (WHDR) of various methods on our DIW dataset, including Eigen(V), the method of Eigen et al. [8] (VGGNet [41] version) Method Eigen(V) [8] Ours_Full Ours_NYU_DIW Ours_DIW Query_Location_Only WHDR 25.70% 31.31% 14.39% 22.14% 31.37% than those trained on only NYU Depth despite using much less supervision. Pre-training on NYU Depth and fine-tuning on DIW leaverages all available data and achieves the best performance. As shown in Fig. 10, the quality of predicted depth is notably better with fine-tuning on DIW, especially for outdoor scenes. These results suggest that it is promising to combine existing RGB-D data and crowdsourced annotations to advance the state-of-the art in single-image depth estimation. 7 Conclusions We have studied single-image depth perception in the wild, recovering depth from a single image taken in unconstrained settings. We have introduced a new dataset consisting of images in the wild annotated with relative depth and proposed a new algorithm that learns to estimate metric depth supervised by relative depth. We have shown that our algorithm outperforms prior art and our algorithm, combined with existing RGB-D data and our new relative depth annotations, significantly improves single-image depth perception in the wild. Acknowledgments This work is partially supported by the National Science Foundation under Grant No. 1617767. References [1] K. Karsch, C. Liu, and S. B. Kang, “Depthtransfer: Depth extraction from video using non-parametric sampling,” TPAMI, 2014. [2] D. Hoiem, A. A. Efros, and M. Hebert, “Automatic photo pop-up,” TOG, 2005. [3] A. Saxena, M. Sun, and A. Ng, “Make3d: Learning 3d scene structure from a single still image,” TPAMI, 2009. [4] N. Silberman, D. Hoiem, P. Kohli, and R. Fergus, “Indoor segmentation and support inference from rgbd images,” in ECCV, Springer, 2012. [5] A. Geiger, P. Lenz, C. Stiller, and R. Urtasun, “Vision meets robotics: The kitti dataset,” The International Journal of Robotics Research, p. 0278364913491297, 2013. [6] F. Liu, C. Shen, and G. Lin, “Deep convolutional neural fields for depth estimation from a single image,” in CVPR, 2015. [7] L. Ladicky, J. Shi, and M. Pollefeys, “Pulling things out of perspective,” in CVPR, IEEE, 2014. [8] D. Eigen and R. Fergus, “Predicting depth, surface normals and semantic labels with a common multi-scale convolutional architecture,” in ICCV, 2015. [9] M. H. Baig and L. Torresani, “Coupled depth learning,” arXiv preprint arXiv:1501.04537, 2015. [10] B. Li, C. Shen, Y. Dai, A. van den Hengel, and M. He, “Depth and surface normal estimation from monocular images using regression on deep features and hierarchical crfs,” in CVPR, 2015. 8 [11] W. W.-C. Chiu, U. Blanke, and M. Fritz, “Improving the kinect by cross-modal stereo.,” in BMVC, 2011. [12] A. Saxena, S. H. Chung, and A. Y. Ng, “Learning depth from single monocular images,” in NIPS, 2005. [13] J. T. Todd and J. F. Norman, “The visual perception of 3-d shape from multiple cues: Are observers capable of perceiving metric structure?,” Perception & Psychophysics, pp. 31–47, 2003. [14] D. Zoran, P. Isola, D. Krishnan, and W. T. Freeman, “Learning ordinal relationships for mid-level vision,” in ICCV, 2015. [15] A. Janoch, S. Karayev, Y. Jia, J. T. Barron, M. Fritz, K. Saenko, and T. Darrell, “A category-level 3d object dataset: Putting the kinect to work,” in Consumer Depth Cameras for Computer Vision, Springer, 2013. [16] S. Song, S. P. Lichtenberg, and J. Xiao, “Sun rgb-d: A rgb-d scene understanding benchmark suite,” in CVPR, 2015. [17] S. Choi, Q.-Y. Zhou, S. Miller, and V. Koltun, “A large dataset of object scans,” arXiv preprint arXiv:1602.02481, 2016. [18] S. Bell, K. Bala, and N. Snavely, “Intrinsic images in the wild,” TOG, 2014. [19] J. T. Barron and J. Malik, “Shape, illumination, and reflectance from shading,” TPAMI, 2015. [20] A. Saxena, S. H. Chung, and A. Y. Ng, “3-d depth reconstruction from a single still image,” IJCV, 2008. [21] Y. Xiong, A. Chakrabarti, R. Basri, S. J. Gortler, D. W. Jacobs, and T. Zickler, “From shading to local shape,” TPAMI, 2015. [22] C. Hane, L. Ladicky, and M. Pollefeys, “Direction matters: Depth estimation with a surface normal classifier,” in CVPR, 2015. [23] B. Liu, S. Gould, and D. Koller, “Single image depth estimation from predicted semantic labels,” in CVPR, 2010. [24] E. Shelhamer, J. Barron, and T. Darrell, “Scene intrinsics and depth from a single image,” in ICCV Workshops, 2015. [25] J. Shi, X. Tao, L. Xu, and J. Jia, “Break ames room illusion: depth from general single images,” TOG, 2015. [26] W. Zhuo, M. Salzmann, X. He, and M. Liu, “Indoor scene structure analysis for single image depth estimation,” in CVPR, 2015. [27] Z. Zhang, A. G. Schwing, S. Fidler, and R. Urtasun, “Monocular object instance segmentation and depth ordering with cnns,” in ICCV, 2015. [28] P. Wang, X. Shen, Z. Lin, S. Cohen, B. Price, and A. L. Yuille, “Towards unified depth and semantic prediction from a single image,” in CVPR, 2015. [29] T. Zhou, P. Krahenbuhl, and A. A. Efros, “Learning data-driven reflectance priors for intrinsic image decomposition,” in ICCV, 2015. [30] T. Narihira, M. Maire, and S. X. Yu, “Learning lightness from human judgement on relative reflectance,” in CVPR, IEEE, 2015. [31] P. Sermanet, D. Eigen, X. Zhang, M. Mathieu, R. Fergus, and Y. LeCun, “Overfeat: Integrated recognition, localization and detection using convolutional networks,” arXiv preprint arXiv:1312.6229, 2013. [32] D. Parikh and K. Grauman, “Relative attributes,” in ICCV, IEEE, 2011. [33] Z. Cao, T. Qin, T.-Y. Liu, M.-F. Tsai, and H. Li, “Learning to rank: from pairwise approach to listwise approach,” in ICML, ACM, 2007. [34] T. Joachims, “Optimizing search engines using clickthrough data,” in Proceedings of the eighth ACM SIGKDD international conference on Knowledge discovery and data mining, ACM, 2002. [35] D. Eigen, C. Puhrsch, and R. Fergus, “Depth map prediction from a single image using a multi-scale deep network,” in NIPS, 2014. [36] J. Long, E. Shelhamer, and T. Darrell, “Fully convolutional networks for semantic segmentation,” in CVPR, 2015. [37] S. Xie and Z. Tu, “Holistically-nested edge detection,” CoRR, vol. abs/1504.06375, 2015. [38] A. Newell, K. Yang, and J. Deng, “Stacked hourglass networks for human pose estimation,” arXiv preprint arXiv:1603.06937, 2016. [39] C. Szegedy, W. Liu, Y. Jia, P. Sermanet, S. Reed, D. Anguelov, D. Erhan, V. Vanhoucke, and A. Rabinovich, “Going deeper with convolutions,” in CVPR, 2015. [40] M. H. Baig, V. Jagadeesh, R. Piramuthu, A. Bhardwaj, W. Di, and N. Sundaresan, “Im2depth: Scalable exemplar based depth transfer,” in WACV, IEEE, 2014. [41] K. Simonyan and A. Zisserman, “Very deep convolutional networks for large-scale image recognition,” arXiv preprint arXiv:1409.1556, 2014. 9
2016
34
6,261
Deconvolving Feedback Loops in Recommender Systems Ayan Sinha Purdue University sinhayan@mit.edu David F. Gleich Purdue University dgleich@purdue.edu Karthik Ramani Purdue University ramani@purdue.edu Abstract Collaborative filtering is a popular technique to infer users’ preferences on new content based on the collective information of all users preferences. Recommender systems then use this information to make personalized suggestions to users. When users accept these recommendations it creates a feedback loop in the recommender system, and these loops iteratively influence the collaborative filtering algorithm’s predictions over time. We investigate whether it is possible to identify items affected by these feedback loops. We state sufficient assumptions to deconvolve the feedback loops while keeping the inverse solution tractable. We furthermore develop a metric to unravel the recommender system’s influence on the entire user-item rating matrix. We use this metric on synthetic and real-world datasets to (1) identify the extent to which the recommender system affects the final rating matrix, (2) rank frequently recommended items, and (3) distinguish whether a user’s rated item was recommended or an intrinsic preference. Our results indicate that it is possible to recover the ratings matrix of intrinsic user preferences using a single snapshot of the ratings matrix without any temporal information. 1 Introduction Recommender systems have been helpful to users for making decisions in diverse domains such as movies, wines, food, news among others [19, 23]. However, it is well known that the interface of these systems affect the users’ opinion, and hence, their ratings of items [7, 24].Thus, broadly speaking, a user’s rating of an item is either his or her intrinsic preference or the influence of the recommender system (RS) on the user [2]. As these ratings implicitly affect recommendations to other users through feedback, it is critical to quantify the role of feedback in content personalization [22]. Thus the primary motivating question for this paper is: Given only a user-item rating matrix, is it possible to infer whether any preference values are influenced by a RS? Secondary questions include: Which preference values are influenced and to what extent by the RS? Furthermore, how do we recover the true preference value of an item to a user? We develop an algorithm to answer these questions using the singular value decomposition (SVD) of the observed ratings matrix (Section 2). The genesis of this algorithm follows by viewing the observed ratings at any point of time as union of true ratings and recommendations: Robs = Rtrue + Rrecom (1) where Robs is the observed rating matrix at a given instant of time, Rtrue is the rating matrix due to users’ true preferences of items (along with any external influences such as ads, friends, and so on) and Rrecom is the rating matrix which indicates the RS’s contribution to the observed ratings. Our more formal goal is to recover Rtrue from Robs. But this is impossible without strong modeling assumptions; any rating is just as likely to be a true rating as due to the system. Thus, we make strong, but plausible assumptions about a RS. In essence, these assumptions prescribe a precise model of the recommender and prevent its effects from completely dominating the future. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. With these assumptions, we are able to mathematically relate Rtrue and Robs. This enables us to find the centered rating matrix Rtrue (up to scaling). We caution readers that these assumptions are designed to create a model that we can tractably analyze, and they should not be considered limitations of our ideas. Indeed, the strength of this simplistic model is that we can use its insights and predictions to analyze far more complex real-world data. One example of this model is that the notion of Rtrue is a convenient fiction that represents some idealized, unperturbed version of the ratings matrix. Our model and theory suggests that Rtrue ought to have some relationship with the observed ratings, Robs. By studying these relationships, we will show that we gain useful insights into the strength of various feedback and recommendation processes in real-data. In that light, we use our theory to develop a heuristic, but accurate, metric to quantitatively infer the influence of a RS (or any set of feedback effects) on a ratings matrix (Section 3). Additionally, we propose a metric for evaluating the influence of a recommender system on each user-item rating pair. Aggregating these scores over all users helps identify putative highly recommended items. The final metrics for a RS provide insight into the quality of recommendations and argue that Netflix had a better recommender than MovieLens, for example. This score is also sensitive to all cases where we have ground-truth knowledge about feedback processes akin to recommenders in the data. 2 Deconvolving feedback We first state equations ans assumptions under which the true rating matrix is recoverable (or deconvolvable) from the observed matrix, and provide an algorithm to deconvolve using the SVD. Figure 1: Subfigure A shows a ratings matrix with recommender induced ratings and true ratings; Figure B: Feedback loop in RS wherein the observed ratings is a function of the true ratings and ratings induced by a RS 2.1 A model recommender system Consider a ratings matrix R of dimension m × n where m is the number of users and n is the number of items being rated. Users are denoted by subscript u, and items are denoted by subscript i, i.e., Ru,i denotes user u’s rating for item i. As stated after equation (1), our objective is to decouple Rtrue from Rrecom given the matrix Robs. Although this problem seems intractable, we list a series of assumptions under which a closed form solution of Rtrue is deconvolvable from Robs alone. Assumption 1 The feedback in the RS occurs through the iterative process involving the observed ratings and an item-item similarity matrix S: 1 Robs = Rtrue + H ⊙(RobsS). (2) Here ⊙indicates Hadamard, or entrywise product, given as: (H ⊙R)u,i = Hu,i · Ru,i. This assumption is justified because in many collaborative filtering techniques, Rrecom is a function of the observed ratings Robs and the item-item similarity matrix, S . The matrix H is an indicator matrix over a set of items where the user followed the recommendation and agreed with it. This matrix is essentially completely unknown and is essentially unknowable without direct human interviews. The model RS equation (2) then iteratively updates Robs based on commonly rated items by users. This key idea is illustrated in Figure 1. The recursion progressively fills all missing entries in matrix Robs starting from Rtrue. The recursions do not update Rtrue in our model of a RS. If we were to explicitly consider the state of matrix Robs after k iterations, Rk+1 obs we get: Rk+1 obs = Rtrue + H(k) ⊙(Rk obsSk) = Rtrue + H(k) ⊙ Rtrue + H(k−1) ⊙(Rk−1 obs Sk−1)Sk  = . . . (3) Here Sk is the item-item similarity matrix induced by the observed matrix at state k. The above equation 3 is naturally initialized as R1 obs = Rtrue along with the constraint S1 = Strue, i.e, the similarity 1For an user-user similarities, ˆS, the derivations in this paper can be extended by considering the expression: RT obs = RT true + HT ⊙(RT obs ˆS). We restrict to item-item similarity which is more popular in practice. 2 matrix at the first iteration is the similarity matrix induced by the matrix of true preferences, Rtrue. Thus, we see that Robs is an implicit function of Rtrue and the set of similarity matrices Sk, Sk−1, . . . S1. Assumption 2 Hadamard product H(k) is approximated with a probability parameter αk ∈(0, 1]. We model the selection matrix H(k) and it’s Hadamard problem in expectation and replace the successive matrices H(k) with independent Bernoulli random matrices with probability αk. Taking the expectation allows us to replace the matrix H(k) with the probability parameter αk itself: Rk+1 obs = Rtrue + αk(Rk obsSk) = Rtrue + αk Rtrue + αk−1(Rk−1 obs Sk−1)Sk  = . . . (4) The set of Sk, Sk−1, · · · are apriori unknown. We are now faced with the task of constructing a valid similarity metric. Towards this end, we make our next assumption. Assumption 3 The user mean ¯Ru in the observed and true matrix are roughly equal: ¯R(obs) u ≈¯R(true) u . The Euclidean item norms ∥Ri∥are also roughly equal: ∥R(obs) i ∥≈∥R(true) i ∥. These assumptions are justified because ultimately we are interested in relative preferences of items for a user and unbiased relative ratings of items by users. These can be achieved by centering users and the normalizing item ratings, respectively, in the true and observed ratings matrices. We quantitatively investigate this assumption in the supplementary material. Using this assumption, the similarity metric then becomes: S(i, j) = P u∈U(Ru,i −¯Ru)(Ru,j −¯Ru) qP u∈U(Ru,i −¯Ru)2 qP u∈U(Ru, j −¯Ru)2 (5) This metric is known as the adjusted cosine similarity, and preferred over cosine similarity because it mitigates the effect of rating schemes over users [25]. Using the relations ˜Ru,i = Ru,i −¯Ru, and, ˆRu,i = ˜Ru,i ∥˜Ri∥= Ru,i−¯Ru √P u∈U(Ru,i−¯Ru)2 , the expression of our recommender (4) becomes: ˆRobs = ˆRtrue(I + f1(a1) ˆR T true ˆRtrue + f2(a2)( ˆR T true ˆRtrue)2 + f3(a3)( ˆR T true ˆRtrue)3 + . . .) (6) Here, f1, f2, f3 . . . are functions of the probability parameters ak = [α1, α2, . . . αk, . . .] of the form fz(az) = cαc1 1 αc2 1 . . . αck k . . . such that P k ck = z, and c is a constant. The proof of equation 6 is in the supplementary material. We see that the centering and normalization results in ˆRobs being explicitly represented in terms of ˆRtrue and coefficients f(a). It is now possible to recover ˆRtrue, but the coefficients f(a) are apriori unknown. Thus, our next assumption. Assumption 4 fz(az) = αz, i.e., the coefficients of the series (6) are induced by powers of a constant probability parameter α ∈(0, 1]. Note that in recommender (3), Robs becomes denser with every iteration, and hence the higher order Hadamard products in the series fill fewer missing terms. The effect of absorbing the unknowable probability parameters, αk’s into single probability parameter α is similar. Powers of α, produce successively less of an impact, just as in the true model. The governing expression now becomes: ˆRobs = ˆRtrue(I + α ˆR T true ˆRtrue + α2( ˆR T true ˆRtrue)2 + α3( ˆR T true ˆRtrue)3 + . . .) (7) In order to ensure convergence of this equation, we make our final assumption. Assumption 5 The spectral radius of the similarity matrix α ˆR T true ˆRtrue is less than 1. This assumption enables us to write the infinite series representing ˆRobs, ˆRtrue(I + α ˆR T true ˆRtrue + α2( ˆR T true ˆRtrue)2 + α3( ˆR T true ˆRtrue)3 + . . .) as (1 −α ˆR T true ˆRtrue)−1. It states that given α, we scale the matrix ˆR T true ˆRtrue such that the spectral radius of α ˆR T true ˆRtrue is less than 1 2. Then we are then able to recover ˆR T true up to a scaling constant. Discussion of assumptions. We now briefly discuss the implications of our assumptions. First, assumption 1 states the recommender model. Assumption 2 states that we are modeling expected 2See [10] for details on scaling similarity matrices to ensure convergence 3 Figure 2: (a) to (f): Our procedure for scoring ratings based on the deconvolved scores with true initial ratings in cyan and ratings due to recommender in red. (a) The observed and deconvolved ratings. (b) The RANSAC fit to extract straight line passing through data points for each item. (c) Rotation and translation of data points using fitted line such that the scatter plot is approximately parallel to y-axis and recommender effects are distinguishable along x-axis. (d) Scaling of data points used for subsequent score assignment. (e) Score assignment using the vertex of the hyperbola with slope θ = 1 that passes through the data point. (f) Increasing α deconvolves implicit feedback loops to a greater extent and better discriminates recommender effects as illustrated by the red points which show more pronounced deviation when α = 1. behavior rather than actual behavior. Assumptions 3-5 are key to our method working. They essentially state that the RS’s effects are limited in scope so that they cannot dominate the world. This has a few interpretations on real-world data. The first would be that we are considering the impact of the RS over a short time span. The second would be that the recommender effects are essentially second-order and that there is some other true effect which dominates them. We discuss the mechanism of solving equation 7 using the above set of five assumptions next. 2.2 The algorithm for deconvolving feedback loops Theorem 1 Assuming the RS follows (7), α is between 0 and 1, and the singular value decomposition of the observed rating matrix is, ˆRobs = UΣobsVT, the deconvolved matrix Rtrue of true ratings is given as UΣtrueVT, where the Σtrue is a diagonal matrix with elements: σtrue i = −1 2ασobs i + s 1 4α2(σobs i )2 + 1 α (8) The proof of the theorem is in the supplementary material. In practical applications, the feedback loops are deconvolved by taking a truncated-SVD (low rank approximation) instead of the complete decomposition. In this process, we naturally concede accuracy for performance. We consider the matrix of singular values ˜Σobs to only contain the k largest singular values (the other singular values are replaced by zero). We now state Algorithm 1 for deconvolving feedback loops. The algorithm is simple to compute as it just involves a singular value decomposition of the observed ratings matrix. 3 Results and recommender system scoring We tested our approach for deconvolving feedback loops on synthetic RS, and designed a metric to identify the ratings most affected by the RS. We then use the same automated technique to study real-world ratings data, and find that the metric is able to identify items influenced by a RS. 4 Algorithm 1 Deconvolving Feedback Loops Input: Robs, α, k, where Robs is observed ratings matrix, α is parameter governing feedback loops and k is number of singular values Output: ˆRtrue, True rating matrix 1: Compute ˜Robs given Robs, where ˜Robs is user centered observed matrix 2: Compute ˆRobs ←˜RobsD−1 N , where ˆRobs is item-normalized rating matrix, and D−1 N is diagonal matrix of item-norms DN(i, i) = qP u∈U(Ru,i −¯Ru)2 3: Solve UΣobsVT ←S VD( ˆRobs, k), the truncated SVD corresponding to k largest singular values. 4: Perform σtrue i ←−1 2ασobs i + r 1 4α2(σobs i )2 + 1 α  for all i 5: return U, Σtrue, VT Figure 3: Results for a synthetic RS with controllable effects. (Left to right): (a) ROC curves by varying data sparsity (b) ROC curves by varying the parameter α (c) ROC curves by varying feedback exponent (d) Score assessing the overall recommendation effects as we vary the true effect. 3.1 Synthetic data simulating a real-world recommender system We use item response theory to generate a sparse true rating matrix Rtrue using a model related to that in [12]. Let au be the center of user u’s rating scale, and bu be the rating sensitivity of user u. Let ti be the intrinsic score of item i. We generate a user-item rating matrix as: Ru,i = L[au + buti + ηu,i] (9) where L[ω] is the discrete levels function assigning a score in the range 1 to 5: L[ω] = max(min(round(ω), 5), 1) and ηu,i is a noise parameter. In our experiment, we draw au ∼N(3, 1), bu ∼N(0.5, 0.5), tu ∼N(0.1, 1), and ηu,i ∼ϵN(0, 1), where N is a standard normal, and ϵ is a noise parameter. We sample these ratings uniformly at random by specifying a desired level of rating sparsity γ which serves as the input, Rtrue, to our RS. We then run a cosine similarity based RS, progressively increasing the density of the rating matrix. The unknown ratings are iteratively updated using the standard item-item collaborative filtering technique [8] as Rk+1 u,i = P j∈i(sk i,jRk u, j) P j∈i(|sk i,j|) , where k is the iteration number and R0 = Rtrue, and the similarity measure at the kth iteration is given as sk i, j = P u∈U Rk u,iRk u, j √P u∈U (Rk u,i)2 qP u∈U (Rk u,j)2 . After the kth iteration, each synthetic user accepts the top r recommendations with probability proportional to (Rk+1 u,i )e, where e is an exponent controlling the frequency of acceptance. We fix the number of iterative updates to be 10, r to be 10 and the resulting rating matrix is Robs. We deconvolve Robs as per Algorithm 1 to output ˆRtrue. Recall, ˆRtrue is user-centered and item-normalized. In the absence of any recommender effects Rrecom, the expectation is that ˆRtrue is perfectly correlated with ˆRobs. The absence of a linear correlation hints at factors extraneous to the user, i.e., the recommender. Thus, we plot ˆRtrue (the deconvolved ratings) against the ˆRobs, and search for characteristic signals that exemplify recommender effects (see Figure 2a and inset). 3.2 A metric to assess a recommender system We develop an algorithm guided by the intuition that deviation of ratings from a straight line suggest recommender effects (Algorithm 2). The procedure is visually elucidated in Figure 2. We consider fitting a line to the observed and deconvolved (equivalently estimated true) ratings; however, our experiments indicate that least square fit of a straight line in the presence of severe recommender effects is not robust. The outliers in our formulation correspond to recommended items. Hence, we use random sample consensus or the RANSAC method [11] to fit a straight line on a per item basis 5 Table 1: Datasets and parameters Dataset Users Items Min RPI Rating k in SVD Score Jester-1 24.9K 100 1 615K 100 0.0487 Jester-2 50.6K 140 1 1.72M 140 0.0389 MusicLab-Weak 7149 48 1 25064 48 0.1073 MusicLab-Strong 7192 48 1 23386 48 0.1509 MovieLens-100K 943 603 50 83.2K 603 0.2834 MovieLens-1M 6.04K 2514 50 975K 2514 0.3033 MovieLens-10M 69.8K 7259 50 9.90M 1500 0.3821 BeerAdvocate 31.8K 9146 20 1.35M 1500 0.2223 RateBeer 28.0K 20129 20 2.40M 1500 0.1526 Fine Foods 130K 5015 20 329K 1500 0.1209 Wine Ratings 21.0K 8772 20 320K 1500 0.1601 Netflix 480K 16795 100 100M 1500 0.2661 (Figure 2b). All these straight lines are translated and rotated so as to coincide with the y-axis as displayed in Figure 2c. Observe that the data points corresponding to recommended ratings pop out as a bump along the x-axis. Thus, the effect of the RANSAC and rotation is to place the ratings into a precise location. Next, the ratings are scaled so as to make the maximum absolute values of the rotated and translated ˘Rtrue, ˘Robs, values to be equal (Figure 2d). The scores we design are to measure “extent” into the x-axis. But we want to consider some allowable vertical displacement. The final score we assign is given by fitting a hyperbola through each rating viewed as a point: ˘Rtrue, ˘Robs. A straight line of slope, θ = 1 passing through the origin is fixed as an asymptote to all hyperbolas. The vertex of this hyperbola serves as the score of the corresponding data point. The higher the value of the vertex of the associated hyperbola to a data point, the more likely is the data point to be recommended item. Using the relationship between slope of asymptote, and vertex of hyperbola, the score s( ˘Rtrue, ˘Robs) is given by: s( ˘Rtrue, ˘Robs) = real( q ˘R 2 true −˘R 2 obs) (10) We set the slope of the asymptote, θ = 1, because the maximum magnitudes of ˘Rtrue, ˘Robs are equal (see Figure 2 d,e). The overall algorithm is stated in the supplementary material. Scores are zero if the point is inside the hyperbola with vertex 0. 3.3 Identifying high recommender effects in the synthetic system We display the ROC curve of our algorithm to identify recommended products in our synthetic simulation by varying the sparsity, γ in Rtrue (Figure 3a), varying α (Figure 3b), and varying exponent e (Figure 3c) for acceptance probability. The dimensions of the rating matrix is fixed at [1000, 100] with 1000 users and 100 items. Decreasing α as well as γ has adversarial effects on the ROC curve, and hence, AUC values, as is natural. The fact that high values of α produce more discriminative deconvolved ratings is clearly illustrated in Figure 2 f. Additionally, Figure 3 d shows that the calculated score varies linearly with the true score as we change the recommender exponent, e, color coded in the legend. Overall, our algorithm is remarkably successful in extracting recommended items from Robs without any additional information. Also, we can score the overall impact of the RS (see the upcoming section RS scores) and it accurately tracks the true effect of the RS. 3.4 Real data In this subsection we validate our approach for deconvolving feedback loops on a real-world RS. First, we demonstrate that the deconvolved ratings are able to distinguish datasets that use a RS against those that do not. Second, we specify a metric that reflects the extent of RS effects on the final ratings matrix. Finally, we validate that the score returned by our algorithm is indicative of the recommender effects on a per item basis. We use α = 1 in all experiments because it models the case when the recommender effects are strong and thus produces the highest discriminative effect between the observed and true ratings (see Figure 2 f). This is likely to be the most useful as our model is only an approximation. 6 Figure 4: (Left to Right) A density plot of deconvolved and observed ratings on the Jester joke dataset (Left) that had no feedback loops and on the Netflix dataset (Left Center) where their Cinematch algorithm was running. The Netflix data shows dispersive effects indicative of a RS whereas the Jester data is highly correlated indicating no feedback system. A scatter plot of deconvolved and observed ratings on the MusicLab dataset- Weak (Right Center) that had no downloads counts and on the MusicLab dataset- Strong (Right) which displayed the download counts. The MusicLab-Strong scatter plot shows higher dispersive effects indicative of feedback effects. Datasets. Table 1 lists all the datasets we use to validate our approach for deconvolving a RS (from [21, 4, 13]). The columns detail name of the dataset, number of users, the number of items, the lower threshold for number of ratings per item (RPI) considered in the input ratings matrix and the number of singular vectors k (as many as possible based on the limits of computer memory), respectively. The datasets are briefly discussed in the supplementary material. Classification of ratings matrix. An example of the types of insights our method enables is shown in Figure 4. This figure shows four density plots of the estimated true ratings (y-axis) compared with the observed ratings (x-axis) for two datasets, Jester and Netflix. Higher density is indicated by darker shades in the scatter plot of observed and deconvolved ratings. If there is no RS, then these should be highly correlated. If there is a system with feedback loops, we should see a dispersive plot. In the first plot (Jester) we see the results for a real-world system without any RS or feedback loops; the second plot (Netflix) shows the results on the Netflix ratings matrix, which did have a RS impacting the data. A similar phenomenon is observed in the third and fourth plots corresponding to the MusicLab dataset in Figure 4. We display the density plot of observed (y-axis) vs. deconvolved or expected true (x-axis) ratings for all datasets considered in our evaluation in the supplementary material. Figure 5: (Top to bottom) (a) Deconvolved ranking as a bar chart for T.V. shows. (b) Deconvolved ranking as a bar chart for Indian movies. Recommender system scores. The RS scores we displayed in Table 1 are based on the fraction of ratings with non-zero score (using the score metric (10)). Recall that a zero score indicates that the data point lies outside the associated hyperbola and does not suffer from recommender effect. Hence, the RS score is indicative of the fraction of ratings affected by the recommender. Looking at Table 1, we see that the two Jester datasets have low RS scores validating that the Jester dataset did not run a RS. The MusicLab datasets show a weak effect because they do not include any type of item-item recommender. Nevertheless, the strong social influence condition scored higher for a RS because the simple download count feedback will elicit comparable effects. These cases give us confidence in our scores because we have a clear understanding of feedback processes in the true data. Interestingly, the RS score progressively increases for the three versions of the MovieLens datasets: MovieLens-100K, MovieLens-1M and MovieLens-10M. This is expected as the RS effects would have progressively accrued over time in these datasets. Note that Netflix is also lower than Movielens, indicating that Netflix’s recommender likely correlated better with users’ true tastes. The RS scores associated with alcohol datasets (RateBeer, BeerAdvocate and Wine Ratings) are higher compared to the Fine Foods dataset. This is surprising. We conjecture that this effect is due to common features that correlate with evaluations of alcohol such as the age of wine or percentage of alcohol in beer. Ranking of items based on recommendation score. We associate a RS rating to each item as our mean score of an item over all users. All items are ranked in ascending order of RS score and we 7 first look at items with low RS scores. The Netflix dataset comprises of movies as well as television shows. We expect that television shows are less likely to be affected by a RS because each season of a T.V. show requires longer time commitment, and they have their own following. To validate this expectation, we first identify all T.V. shows in the ranked list and compute the number of occurrences of a T.V. show in equally spaced bins of size 840. Figure 5 shows a bar chart for the number of occurrences and we see that there are ≈90 T.V.shows in the first bin (or top 840 items as per the score). This is highest compared to all bins and the number of occurrences progressively decrease as we move further down the list, validating our expectation. Also unsurprisingly, the seasons of the popular sitcom Friends comprised of 10 out of the top 20 T.V. seasons with lowest RS scores. It is also expected that the Season 1 of a T.V. show is more likely to be recommended relative to subsequent seasons. We identified the top 40 T.V shows with multiple (at least 2) seasons, and observed that 31 of these have a higher RS score for Season 1 relative to Season 2. The 9 T.V. shows where the converse is true are mostly comedies like Coupling, That 70’s Show etc., for which the seasons can be viewed independently of each other. Next, we looked at items with high RS score. At the time the dataset was released, Netflix operated exclusively in the U.S., and one plausible use is that immigrants might use Netflix’s RS to watch movies from their native country. We specifically looked at Indian films in the ranked list to validate this expectation. Figure 5b shows a bar chart similar to the one plotted for T.V. shows and we observe an increasing trend along the ranked list for the number of occurrences of Indian films. The movie with lowest recommendation score is Lagaan, the only Indian movie to be nominated for the Oscars in last 25 years. 4 Discussion, related work and future work Discussion:In this paper we propose a mechanism to deconvolve feedback effects on RS, similar in spirit to the network deconvolution method to distinguish direct dependencies in biological networks [10, 3]. Indeed, our approach can be viewed as a generalization of their methods for general rectangular matrices. We do so by only considering a ratings matrix at a given instant of time. Our approach depends on a few reasonable assumptions that enable us to create a tractable model of a RS. When we evaluate the resulting methods on synthetic and real-world datasets, we find that we are able to assess the degree of influence that a RS has had on those ratings. This analysis is also easy to compute and just involves a singular value decomposition of the ratings matrix. Related Work: User feedback in collaborative filtering systems is categorized as either explicit feedback which includes input by users regarding their interest in products [1], or implicit feedback such as purchase and browsing history, search patterns, etc. [14]. Both types of feedback affect the item-item or user-user similarities used in the collaborative filtering algorithm for predicting future recommendations [16]. There has been a considerable amount of work on incorporating the information from these types of user feedback mechanisms in collaborative filtering algorithms in order to improve and personalize recommendations [15, 6]. Here, we do not focus on improving collaborative filtering algorithms for recommender systems by studying user feedback, but instead, our thrust is to recover each user’s true preference of an item devoid of any rating bias introduced by the recommender system due to feedback. Another line of work based on user feedback in recommender systems is related to understanding the exploration and exploitation tradeoff[20] associated with the training feedback loop in collaborative filtering algorithms [9]. This line of research evaluates ‘what-if’ scenarios such as evaluating the performance of alternative collaborative filtering models or, adapting the algorithm based on user-click feedbacks to maximize reward, using approaches like the multi-armed bandit setting [17, 18] or counterfactual learning systems [5]. In contrast, we tackle the problem of recovering the true ratings matrix if feedback loops were absent. Future Work: In the future we wish to analyze the effect of feeding the derived deconvolved ratings without putative feedback effects back into the RS. Some derivatives of our method include setting the parameters considered unknown in our current approach with known values (such as S ) if known a priori. Incorporating temporal information at different snapshots of time while deconvolving the feedback loops is also an interesting line of future work. From another viewpoint, our approach can serve as a supplement to the active learning community to unbias the data and reveal additional insights regarding feedback loops considered in this paper. Overall, we believe that deconvolving feedback loops opens new gateways for understanding ratings and recommendations. Acknowledgements: David Gleich would like to acknowledge the support of the NSF via awards CAREER CCF-1149756, IIS-1422918, IIS-1546488, and the Center for Science of Information STC, CCF-093937, as well as the support of DARPA SIMPLEX. 8 References [1] G. Adomavicius and A. Tuzhilin. Toward the next generation of recommender systems: A survey of the state-of-the-art and possible extensions. IEEE Trans. on Knowl. and Data Eng., 17(6):734–749, June 2005. [2] X. Amatriain, J. M. Pujol, N. Tintarev, and N. Oliver. Rate it again: Increasing recommendation accuracy by user re-rating. In RecSys, pp. 173–180, 2009. [3] B. Barzel and A.-L. Barabási. Network link prediction by global silencing of indirect correlations. Nature biotechnology, 31(8):720–725, 2013. [4] J. Bennett and S. Lanning. The Netflix prize. In Proceedings of the KDD Cup Workshop, pp. 3–6, 2007. [5] L. Bottou, J. Peters, J. Quiñonero-Candela, D. X. Charles, D. M. Chickering, E. Portugaly, D. Ray, P. Simard, and E. Snelson. Counterfactual reasoning and learning systems: The example of computational advertising. Journal of Machine Learning Research, 14:3207–3260, 2013. [6] L. Chen, G. Chen, and F. Wang. Recommender systems based on user reviews: the state of the art. User Modeling and User-Adapted Interaction, 25(2):99–154, 2015. [7] D. Cosley, S. K. Lam, I. Albert, J. A. Konstan, and J. Riedl. Is seeing believing?: How recommender system interfaces affect users’ opinions. In CHI, pp. 585–592, 2003. [8] M. Deshpande and G. Karypis. Item-based top-n recommendation algorithms. ACM Trans. Inf. Syst., 22(1):143–177, Jan. 2004. [9] B. Edelman, M. Ostrovsky, and M. Schwarz. Internet advertising and the generalized second-price auction: Selling billions of dollars worth of keywords. American Economic Review, 97(1):242–259, 2007. [10] S. Feizi, D. Marbach, M. Medard, and M. Kellis. Network deconvolution as a general method to distinguish direct dependencies in networks. Nature Biotechnology, 31(8):726–733, July 2013. [11] M. A. Fischler and R. C. Bolles. Random sample consensus: A paradigm for model fitting with applications to image analysis and automated cartography. Commun. ACM, 24(6):381–395, June 1981. [12] D. F. Gleich and L.-H. Lim. Rank aggregation via nuclear norm minimization. In KDD, pp. 60–68, 2011. [13] K. Goldberg, T. Roeder, D. Gupta, and C. Perkins. Eigentaste: A constant time collaborative filtering algorithm. Inf. Retr., 4(2):133–151, July 2001. [14] Y. Hu, Y. Koren, and C. Volinsky. Collaborative filtering for implicit feedback datasets. In ICDM, pp. 263–272, 2008. [15] G. Jawaheer, M. Szomszor, and P. Kostkova. Comparison of implicit and explicit feedback from an online music recommendation service. In Proceedings of the Workshop on Information Heterogeneity and Fusion in Recommender Systems, pp. 47–51, 2010. [16] N. Lathia, S. Hailes, L. Capra, and X. Amatriain. Temporal diversity in recommender systems. In SIGIR, pp. 210–217, 2010. [17] L. Li, W. Chu, J. Langford, and R. E. Schapire. A contextual-bandit approach to personalized news article recommendation. In WWW, pp. 661–670, 2010. [18] W. Li, X. Wang, R. Zhang, Y. Cui, J. Mao, and R. Jin. Exploitation and exploration in a performance based contextual advertising system. In KDD, pp. 27–36, 2010. [19] G. Linden, B. Smith, and J. York. Amazon.com recommendations: Item-to-item collaborative filtering. IEEE Internet Computing, 7(1):76–80, Jan. 2003. [20] J. G. March. Exploration and exploitation in organizational learning. Organiz. Science, 2(1):pp. 71–87, 1991. [21] J. J. McAuley and J. Leskovec. From amateurs to connoisseurs: Modeling the evolution of user expertise through online reviews. In WWW, pp. 897–908, 2013. [22] R. S. Poston and C. Speier. Effective use of knowledge management systems: A process model of content ratings and credibility indicators. MIS Quarterly, 29(2):pp. 221–244, 2005. [23] F. Ricci, L. Rokach, B. Shapira, and P. B. Kantor. Recommender Systems Handbook. Springer-Verlag, New York, 2010. [24] M. J. Salganik, P. S. Dodds, and D. J. Watts. Experimental study of inequality and unpredictability in an artificial cultural market. Science, 311(5762):854–856, 2006. [25] B. Sarwar, G. Karypis, J. Konstan, and J. Riedl. Item-based collaborative filtering recommendation algorithms. In WWW, pp. 285–295, 2001. 9
2016
340
6,262
Recovery Guarantee of Non-negative Matrix Factorization via Alternating Updates Yuanzhi Li, Yingyu Liang, Andrej Risteski Computer Science Department at Princeton University 35 Olden St, Princeton, NJ 08540 {yuanzhil, yingyul, risteski}@cs.princeton.edu Abstract Non-negative matrix factorization is a popular tool for decomposing data into feature and weight matrices under non-negativity constraints. It enjoys practical success but is poorly understood theoretically. This paper proposes an algorithm that alternates between decoding the weights and updating the features, and shows that assuming a generative model of the data, it provably recovers the groundtruth under fairly mild conditions. In particular, its only essential requirement on features is linear independence. Furthermore, the algorithm uses ReLU to exploit the non-negativity for decoding the weights, and thus can tolerate adversarial noise that can potentially be as large as the signal, and can tolerate unbiased noise much larger than the signal. The analysis relies on a carefully designed coupling between two potential functions, which we believe is of independent interest. 1 Introduction In this paper, we study the problem of non-negative matrix factorization (NMF), where given a matrix Y ∈Rm×N, the goal to find a matrix A ∈Rm×n and a non-negative matrix X ∈Rn×N such that Y ≈AX.1 A is often referred to as feature matrix and X referred as weights. NMF has been extensively used in extracting a parts representation of the data (e.g., [LS97, LS99, LS01]). It has been shown that the non-negativity constraint on the coefficients forcing features to combine, but not cancel out, can lead to much more interpretable features and improved downstream performance of the learned features. Despite all the practical success, however, this problem is poorly understood theoretically, with only few provable guarantees known. Moreover, many of the theoretical algorithms are based on heavy tools from algebraic geometry (e.g., [AGKM12]) or tensors (e.g. [AKF+12]), which are still not as widely used in practice primarily because of computational feasibility issues or sensitivity to assumptions on A and X. Some others depend on specific structure of the feature matrix, such as separability [AGKM12] or similar properties [BGKP16]. A natural family of algorithms for NMF alternate between decoding the weights and updating the features. More precisely, in the decoding step, the algorithm represents the data as a non-negative combination of the current set of features; in the updating step, it updates the features using the decoded representations. This meta-algorithm is popular in practice due to ease of implementation, computational efficiency, and empirical quality of the recovered features. However, even less theoretical analysis exists for such algorithms. 1In the usual formulation of the problem, A is also assumed to be non-negative, which we will not require in this paper. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. This paper proposes an algorithm in the above framework with provable recovery guarantees. To be specific, the data is assumed to come from a generative model y = A∗x∗+ ν. Here, A∗is the ground-truth feature matrix, x∗are the non-negative ground-truth weights generated from an unknown distribution, and ν is the noise. Our algorithm can provably recover A∗under mild conditions, even in the presence of large adversarial noise. Overview of main results. The existing theoretical results on NMF can be roughly split into two categories. In the first category, they make heavy structural assumptions on the feature matrix A∗ such as separability ([AGM12]) or allowing running time exponential in n ( [AGKM12]). In the second one, they impose strict distributional assumptions on x∗([AKF+12]), where the methods are usually based on the method of moments and tensor decompositions and have poor tolerance to noise, which is very important in practice. In this paper, we present a very simple and natural alternating update algorithm that achieves the best of both worlds. First, we have minimal assumptions on the feature matrix A∗: the only essential condition is linear independence of the features. Second, it is robust to adversarial noise ν which in some parameter regimes be potentially be on the same order as the signal A∗x∗, and is robust to unbiased noise potentially even higher than the signal by a factor of O(√n). The algorithm does not require knowing the distribution of x∗, and allows a fairly wide family of interesting distributions. We get this at a rather small cost of a mild “warm start”. Namely, we initialize each of the features to be “correlated” with the ground-truth features. This type of initialization is often used in practice as well, for example in LDA-c, the most popular software for topic modeling ([lda16]). A major feature of our algorithm is the significant robustness to noise. In the presence of adversarial noise on each entry of y up to level Cν, the noise level ∥ν∥1 can be in the same order as the signal A∗x∗. Still, our algorithm is able to output a matrix A such that the final ∥A∗−A∥1 ≤O(∥ν∥1) in the order of the noise in one data point. If the noise is unbiased (i.e., E[ν|x∗] = 0), the noise level ∥ν∥1 can be Ω(√n) times larger than the signal A∗x∗, while we can still guarantee ∥A∗−A∥1 ≤ O (∥ν∥1 √n) – so our algorithm is not only tolerant to noise, but also has very strong denoising effect. Note that even for the unbiased case the noise can potentially be correlated with the ground-truth in very complicated manner, and also, all our results are obtained only requiring the columns of A∗are independent. Technical contribution. The success of our algorithm crucially relies on exploiting the non-negativity of x∗by a ReLU thresholding step during the decoding procedure. Similar techniques have been considered in prior works on matrix factorization, however to the best of our knowledge, the analysis (e.g., [AGMM15]) requires that the decodings are correct in all the intermediate iterations, in the sense that the supports of x∗are recovered with no error. Indeed, we cannot hope for a similar guarantee in our setting, since we consider adversarial noise that could potentially be the same order as the signal. Our major technical contribution is a way to deal with the erroneous decoding through out all the intermediate iterations. We achieve this by a coupling between two potential functions that capture different aspects of the working matrix A. While analyzing iterative algorithms like alternating minimization or gradient descent in non-convex settings is a popular topic in recent years, the proof usually proceeds by showing that the updates are approximately performing gradient descent on an objective with some local or hidden convex structure. Our technique diverges from the common proof strategy, and we believe is interesting in its own right. Organization. After reviewing related work, we define the problem in Section 3 and describe our main algorithm in Section 4. To emphasize the key ideas, we first present the results and the proof sketch for a simplified yet still interesting case in Section 5, and then present the results under much more general assumptions in Section 6. The complete proof is provided in the appendix. 2 Related work Non-negative matrix factorization relates to several different topics in machine learning. Non-negative matrix factorization. The area of non-negative matrix factorization (NMF) has a rich empirical history, starting with the practical algorithm of [LS97].On the theoretical side, [AGKM12] provides a fixed-parameter tractable algorithm for NMF, which solves algebraic equations and thus has poor noise tolerance. [AGKM12] also studies NMF under separability assumptions about the features. 2 [BGKP16] studies NMF under heavy noise, but also needs assumptions related to separability, such as the existence of dominant features. Also, their noise model is different from ours. Topic modeling. A closely related problem to NMF is topic modeling, a common generative model for textual data [BNJ03, Ble12]. Usually, ∥x∗∥1 = 1 while there also exist work that assume x∗ i ∈[0, 1] and are independent [ZX12]. A popular heuristic in practice for learning A∗is variational inference, which can be interpreted as alternating minimization in KL divergence norm. On the theory front, there is a sequence of works by based on either spectral or combinatorial approaches, which need certain “non-overlapping” assumptions on the topics. For example, [AGH+13] assume the topic-word matrix contains “anchor words”: words which appear in a single topic. Most related is the work of [AR15] who analyze a version of the variational inference updates when documents are long. However, they require strong assumptions on both the warm start, and the amount of “non-overlapping” of the topics in the topic-word matrix. ICA. Our generative model for x∗will assume the coordinates are independent, therefore our problem can be viewed as a non-negative variant of ICA with high levels of noise. Results here typically are not robust to noise, with the exception of [AGMS12] that tolerates Gaussian noise. However, to best of our knowledge, no result in this setting is provably robust to adversarial noise. Non-convex optimization. The framework of having a “decoding” for the samples, along with performing an update for the model parameters has proven successful for dictionary learning as well. The original empirical work proposing such an algorithm (in fact, it suggested that the V1 layer processes visual signals in the same manner) was due to [OF97]. Even more, similar families of algorithms based on “decoding” and gradient-descent are believed to be neurally plausible as mechanisms for a variety of tasks like clustering, dimension-reduction, NMF, etc ([PC15, PC14]). A theoretical analysis came latter for dictionary learning due to [AGMM15] under the assumption that the columns of A∗are incoherent. The technique is not directly applicable to our case, as we don’t wish to have any assumptions on the matrix A∗. For instance, if A∗is non-negative and columns with l1 norm 1, incoherence effectively means the the columns of A∗have very small overlap. 3 Problem definition and assumptions Given a matrix Y ∈Rm×N, the goal of non-negative matrix factorization (NMF) is to find a matrix A ∈Rm×n and a non-negative matrix X ∈Rn×N, so that Y ≈AX. The columns of Y are called data points, those of A are features, and those of X are weights. We note that in the original NMF, A is also assumed to be non-negative, which is not required here. We also note that typically m ≫n, i.e., the features are a few representative components in the data space. This is different from dictionary learning where overcompleteness is often assumed. The problem in the worst case is NP-hard [AGKM12], so some assumptions are needed to design provable efficient algorithms. In this paper, we consider a generative model for the data point y = A∗x∗+ ν (1) where A∗is the ground-truth feature matrix, x∗is the ground-truth non-negative weight from some unknown distribution, and ν is the noise. Our focus is to recover A∗given access to the data distribution, assuming some properties of A∗, x∗, and ν. To describe our assumptions, we let [M]i denote the i-th row of a matrix M, [M]j its i-th column, Mi,j its (i, j)-th entry. Denote its column norm, row norm, and symmetrized norm as ∥M∥1 = maxj P i |Mi,j|, ∥M∥∞= maxi P j |Mi,j|, and ∥M∥s = max {∥M∥1, ∥M∥∞} , respectively. We assume the following hold for parameters C1, c2, C2, ℓ, Cν to be determined in our theorems. (A1) The columns of A∗are linearly independent. (A2) For all i ∈[n], x∗ i ∈[0, 1], E[x∗ i ] ≤C1 n and c2 n ≤E[(x∗ i )2] ≤C2 n , and x∗ i ’s are independent. (A3) The initialization A(0) = A∗(Σ(0) + E(0)) + N(0), where Σ(0) is diagonal, E(0) is offdiagonal, and Σ(0) ⪰(1 −ℓ)I, E(0) s ≤ℓ. We consider two noise models. 3 (N1) Adversarial noise: only assume that maxi |νi| ≤Cν almost surely. (N2) Unbiased noise: maxi |νi| ≤Cν almost surely, and E[ν|x∗] = 0. Remarks. We make several remarks about each of the assumptions. (A1) is the assumption about A∗. It only requires the columns of A∗to be linear independent, which is very mild and needed to ensure identifiability. Otherwise, for instance, if (A∗)3 = λ1(A∗)1 + λ2(A∗)2, it is impossible to distinguish between the case when x∗ 3 = 1 and the case when x∗ 2 = λ1 and x∗ 1 = λ2. In particular, we do not restrict the feature matrix to be non-negative, which is more general than the traditional NMF and is potentially useful for many applications. We also do not make incoherence or anchor word assumptions that are typical in related work. (A2) is the assumption on x∗. First, the coordinates are non-negative and bounded by 1; this is simply a matter of scaling. Second, the assumption on the moments requires that, roughly speaking, each feature should appear with reasonable probability. This is expected: if the occurrences of the features are extremely unbalanced, then it will be difficult to recover the rare ones. The third requirement on independence is motivated by that the features should be different so that their occurrences are not correlated. Here we do not stick to a specific distribution, since the moment conditions are more general, and highlight the essential properties our algorithm needs. Example distributions satisfying our assumptions will be discussed later. The warm start required by (A3) means that each feature A(0) i has a large fraction of the groundtruth feature A∗ i and a small fraction of the other features, plus some noise outside the span of the ground-truth features. We emphasize that N(0) is the component of A(0) outside the column space of A∗, and is not the difference between A(0) and A∗. This requirement is typically achieved in practice by setting the columns of A(0) to reasonable “pure” data points that contains one major feature and a small fraction of some other features (e.g. [lda16, AR15]); in this initialization, it is generally believed that N(0) = 0. But we state our theorems to allow some noise N(0) for robustness in the initialization. The adversarial noise model (N1) is very general, only imposing an upper bound on the entry-wise noise level. Thus, ν can be correlated with x∗in some complicated unknown way. (N2) additionally requires it to be zero mean, which is commonly assumed and will be exploited by our algorithm to tolerate larger noise. 4 Main algorithm Algorithm 1 Purification Input: initialization A(0), threshold α, step size η, scaling factor r, sample size N, iterations T 1: for t = 0, 1, 2, ..., T −1 do 2: Draw examples y1, . . . , yN. 3: (Decode) Compute A†, the pseudo-inverse of A(t) with minimum ∥(A)†∥∞. Set x = φα(A†y) for each example y. // φα is ReLU activation; see (2) for the definition 4: (Update) Update the feature matrix A(t+1) = (1 −η) A(t) + rηˆE  (y −y′)(x −x′)⊤ where ˆE is over independent uniform y, y′ from {y1, . . . , yN}, and x, x′ are their decodings. Output: A = A(T ) Our main algorithm is presented in Algorithm 1. It keeps a working feature matrix and operates in iterations. In each iteration, it first compute the weights for a batch of N examples (decoding), and then uses the computed weights to update the feature matrix (updating). The decoding is simply multiplying the example by the pseudo-inverse of the current feature matrix and then passing it through the rectified linear unit (ReLU) φα with offset α. The pseudo-inverse with minimum infinity norm is used so as to maximize the robustness to noise (see the theorems). The ReLU function φα operates element-wisely on the input vector v, and for an element vi, it is 4 defined as φα(vi) = max {vi −α, 0} . (2) To get an intuition why the decoding makes sense, suppose the current feature matrix is the groundtruth. Then A†y = A†A∗x∗+ A†ν = x∗+ A†ν. So we would like to use a small A† and use threshold to remove the noise term. In the encoding step, the algorithm move the feature matrix along the direction E  (y −y′)(x −x′)⊤ . To see intuitively why this is a good direction, note that when the decoding is perfect and there is no noise, E  (y −y′)(x −x′)⊤ = A∗, and thus it is moving towards the ground-truth. Without those ideal conditions, we need to choose a proper step size, which is tuned by the parameters η and r. 5 Results for a simplified case Our intuitions can be demonstrated in a simplified setting with (A1), (A2’), (A3), and (N1), where (A2’) x∗ i ’s are independent, and x∗ i = 1 with probability s/n and 0 otherwise for a constant s > 0. Furthermore, let N(0) = 0. This is a special case of our general assumptions, with C1 = c2 = C2 = s where s is the parameter in (A2’). It is still an interesting setting; as far as we know, there is no existing guarantee of alternating type algorithms for it. To present our results, we let (A∗)† denote the matrix satisfying (A∗)†A∗= I; if there are multiple such matrices we let it denote the one with minimum ∥(A∗)†∥∞. Theorem 1 (Simplified case, adversarial noise). There exists a absolute constant G such that when Assumption (A1)(A2’)(A3) and (N1) are satisfied with l = 1/10, Cν ≤ Gc max{m,n∥(A∗)†∥∞} for some 0 ≤c ≤1, and N(0) = 0, then there exist α, η, r such that for every 0 < ϵ, δ < 1 and N = poly(n, m, 1/ϵ, 1/δ) the following holds with probability at least 1 −δ. After T = O ln 1 ϵ  iterations, Algorithm 1 outputs a solution A = A∗(Σ + E) + N where Σ ⪰(1 −ℓ)I is diagonal, ∥E∥1 ≤ϵ + c is off-diagonal, and ∥N∥1 ≤c. Remarks. Consequently, when ∥A∗∥1 = 1, we can do normalization ˆAi = Ai/∥Ai∥1, and the normalized output ˆA satisfies ∥ˆA −A∗∥1 ≤ϵ + 2c. So under mild conditions and with proper parameters, our algorithm recovers the ground-truth in a geometric rate. It can achieve arbitrary small recovery error in the noiseless setting, and achieve error up to the noise limit even with adversarial noise whose level is comparable to the signal. The condition on ℓmeans that a constant warm start is sufficient for our algorithm to converge, which is much better than previous work such as [AR15]. Indeed, in that work, the ℓneeds to even depend on the dynamic range of the entries of A∗which is problematic in practice. It is shown that with large adversarial noise, the algorithm can still recover the features up to the noise limit. When m ≥n∥(A∗)† ∥∞, each data point has adversarial noise with ℓ1 norm as large as ∥ν∥1 = Cνm = Ω(c), which is in the same order as the signal ∥A∗x∗∥1 = O(1). Our algorithm still works in this regime. Furthermore, the final error ∥A −A∗∥1 is O(c), in the same order as the adversarial noise in one data point. Note the appearance of ∥(A∗)† ∥∞is not surprising. The case when the columns are the canonical unit vectors for instance, which corresponds to ∥(A∗)† ∥∞= 1, is expected to be easier than the case when the columns are nearly the same, which corresponds to large ∥(A∗)† ∥∞. A similar theorem holds for the unbiased noise model. Theorem 2 (Simplified case, unbiased noise). If Assumption (A1)(A2’)(A3) and (N2) are satisfied with Cν = Gc√n max{m,n∥(A∗)†∥∞} and the other parameters set as in Theorem 1, then the same guarantee in holds. 5 Remarks. With unbiased noise which is commonly assumed in many applications, the algorithm can tolerate noise level √n larger than the adversarial case. When m ≥n∥(A∗)† ∥∞, each data point has adversarial noise with ℓ1 norm as large as ∥ν∥1 = Cνm = Ω(c√n), which can be Ω(√n) times larger than the signal ∥A∗x∗∥1 = O(1). The algorithm can recover the ground-truth in this heavy noise regime. Furthermore, the final error ∥A −A∗∥1 is O (∥ν∥1/√n), which is only O(1/√n) fraction of the noise in one data point. This is very strong denoising effect and a bit counter-intuitive. It is possible since we exploit the average of the noise for cancellation, and also use thresholding to remove noise spread out in the coordinates. 5.1 Analysis: intuition A natural approach typically employed to analyze algorithms for non-convex problems is to define a function on the intermediate solution A and the ground-truth A∗measuring their distance and then show that the function decreases at each step. However, a single potential function will not be enough in our case, as we argue below, so we introduce a novel framework of maintaining two potential functions which capture different aspects of the intermediate solutions. Let us denote the intermediate solution and the update as (omitting the superscript (t)) A = A∗(Σ + E) + N, ˆE[(y −y′)(x −x′)⊤] = A∗(eΣ + eE) + eN, where Σ and eΣ are diagonal, E and eE are off-diagonal, and N and eN are the terms outside the span of A∗which is caused by the noise. To cleanly illustrate the intuition behind ReLU and the coupled potential functions, we focus on the noiseless case and assume that we have infinite samples. Since Ai = Σi,iA∗ i +P j̸=i Ej,iA∗ j, if the ratio between ∥Ei∥1 = P j̸=i |Ej,i| and Σi,i gets smaller, then the algorithm is making progress; if the ratio is large at the end, a normalization of Ai gives a good approximation of A∗ i . So it suffices to show that Σi,i is always about a constant while ∥Ei∥1 decreases at each iteration. We will focus on E and consider the update rule in more detail to argue this. After some calculation, we have E ←(1 −η)E + rηeE, eE = E[(x∗−(x′)∗) (x −x′)⊤], (3) where x, x′ are the decoding for x∗, (x′)∗respectively: x = φα (Σ + E)−1x∗ , x′ = φα (Σ + E)−1(x′)∗ . (4) To see why the ReLU function matters, consider the case when we do not use it. eE = E(x∗−(x′)∗)  A†A∗(x∗−(x′)∗) ⊤= E  (x∗−(x′)∗)(x∗−(x′)∗)⊤  (Σ + E)−1⊤ ∝  (Σ + E)−1⊤≈Σ−1 −Σ−1EΣ−1. where we used Taylor expansion and the fact that E  (x∗−(x′)∗)(x∗−(x′)∗)⊤ is a scaling of identity. Hence, if we think of Σ as approximately I and take an appropriate r, the update to the matrix E is approximately E ←E −ηE⊤. Since we do not have control over the signs of E throughout the iterations, the problematic case is when the entries of E⊤and E roughly match in signs, which would lead to the entries of E increasing. Now we consider the decoding to see why ReLU is important. Ignoring the higher order terms and regarding Σ = I, we have x = φα (Σ + E)−1x∗ ≈φα Σ−1x∗−Σ−1EΣ−1x∗ ≈φα (x∗−Ex∗) . (5) The problematic term is Ex∗. These errors when summed up will be comparable or even larger than the signals, and the algorithm will fail. However, since the signals are non-negative and most coordinates with errors only have small values, thresholding with ReLU properly can remove those errors while keeping a large fraction of the signals. This leads to large eΣi,i and small eEj,i’s, and then we can choose an r such that Ej,i’s keep decreasing while Σi,i’s stay in a certain range. To get a quantitative bound, we divide E into its positive part E+ and its negative part E−: [E+]i,j = max {Ei,j, 0} , [E−]i,j = max {−Ei,j, 0} . (6) 6 The reason to do so is the following: when Ei,j is negative, by the Taylor expansion approximation,  (Σ + E)−1x∗ i will tend to be more positive and will not be thresholded most of the time. Therefore, Ej,i will turn more positive at next iteration. On the other hand, when Ei,j is positive,  (Σ + E)−1x∗ i will tend to be more negative and zeroed out by the threshold function. Therefore, Ej,i will not be more negative at next iteration. We will show for positive and negative parts of E: postive(t+1) ←(1−η)positive(t)+(η)negative(t), negative(t+1) ←(1−η)negative(t)+(εη)positive(t) for a small ε ≪1. Due to ϵ, we can couple the two parts so that a weighted average of them will decrease, which implies that ∥E∥s is small at the end. This leads to our coupled potential function.2 5.2 Analysis: proof sketch Here we describe a proof sketch for the simplified case while the complete proof for the general case is presented in the appendix. The lemmas here are direct corollaries of those in the appendix. One iteration. We focus on one update and omit the superscript (t). Recall the definitions of E, Σ and N in (5.1), and eE, eΣ and eN in (5.1). Our goal is to derive lower and upper bounds for eE, eΣ and eN, assuming that Σi,i falls into some range around 1, while E and N are small. This will allow doing induction on them. First, begin with the decoding. Some calculation shows that, the decoding for y = A∗x∗+ ν is x = φα (Zx∗+ ξ) , where Z = (Σ + E)−1 , ξ = −A†NZx∗+ A†ν. (7) Now, we can present our key lemmas bounding eE, eΣ, and eN. Lemma 3 (Simplified bound on eE, informal). (1) if Zi,j < 0, then eEj,i ≤O 1 n2 (|Zi,j| + c)  , (2) if Zi,j ≥0, then −O c n2 + c n|Zi,j| + 1 n2 |Zi,j|  ≤ eEj,i ≤O 1 n∥Zi,j∥  . Note that Z ≈Σ−1 −Σ−1EΣ−1, so Zi,j < 0 corresponds roughly to Ei,j > 0. In this case, the upper bound on |eEj,i| is very small and thus |Ej,i| decreases, as described in the intuition. What is most interesting is the case when Zi,j ≥0 (roughly Ei,j < 0). The upper bound is much larger, corresponding to the intuition that negative Ei,j can contribute a large positive value to Ej,i. Fortunately, the lower bounds are of much smaller absolute value, which allows us to show that a potential function that couples Case (1) and Case (2) in Lemma 3 actually decreases; see the induction below. Lemma 4 (Simplified bound on eΣ, informal). eΣi,i ≥Ω(Σ−1 i,i −α)/n. Lemma 5 (Simplified bound on eN, adversarial noise, informal). eNi,j ≤O(Cν/n). Induction by iterations. We now show how to use the three lemmas to prove the theorem for the adversarial noise, and that for the unbiased noise is similar. Let at := E(t) + s and bt := E(t) − s, and choose η = ℓ/6. We begin with proving the following three claims by induction on t: at the beginning of iteration t, (1) (1 −ℓ)I ⪯Σ(t) (2) E(t) s ≤1/8, and if t > 0, then at + βbt ≤ 1 −1 25η  (at−1 + βbt−1) + ηh, for some β ∈(1, 8), and some small value h, (3) N(t) s ≤c/10. The most interesting part is the second claim. At a high level, by Lemma 3, we can show that at+1 ≤  1 −3 25η  at + 7ηbt + ηh, bt+1 ≤  1 −24 25η  bt + 1 100ηat + ηh. 2Note that since intuitively, Ei,j gets affected by Ej,i after an update, if we have a row which contains negative entries, it is possible that ∥Ai −A∗ i ∥1 increases. So we cannot simply use maxi ∥Ai −A∗ i ∥1 as a potential function. 7 Notice that the contribution of bt to at+1 is quite large (due to the larger upper bound in Case (2) in Lemma 3), but the other terms are much nicer, such as the small contribution of at to bt+1. This allows to choose a β ∈(1, 8) so that at+1 + βbt+1 leads to the desired recurrence in the second claim. In other words, at+1 + βbt+1 is our potential function which decreases at each iteration up to the level h. The other claims can also be proved by the corresponding lemmas. Then the theorem follows from the induction claims. 6 More general results More general weight distributions. Our argument holds under more general assumptions on x∗. Theorem 6 (Adversarial noise). There exists an absolute constant G such that when Assumption (A0)(A3) and (N1) are satisfied with l = 1/10, C2 ≤2c2, C3 1 ≤Gc2 2n, Cν ≤  c2 2Gc C2 1m, c4 2Gc C5 1n∥(A∗)†∥∞  for 0 ≤c ≤1, and N(0) ∞≤ c2 2Gc C3 1∥(A∗)†∥∞, then there exist α, η, r such that for every 0 < ϵ, δ < 1 and N = poly(n, m, 1/ϵ, 1/δ), with probability at least 1 −δ the following holds. After T = O ln 1 ϵ  iterations, Algorithm 1 outputs a solution A = A∗(Σ + E) + N where Σ ⪰(1 −ℓ)I is diagonal, ∥E∥1 ≤ϵ + c/2 is off-diagonal, and ∥N∥1 ≤c/2. Theorem 7 (Unbiased noise). If Assumption (A0)-(A3) and (N2) are satisfied with Cν = c2G√cn C1 max{m,n∥(A∗)†∥∞} and the other parameters set as in Theorem 6, then the same guarantee holds. The conditions on C1, c2, C2 intuitively mean that each feature needs to appear with reasonable probability. C2 ≤2c2 means that their proportions are reasonably balanced. This may be a mild restriction for some applications, and additionally we propose a pre-processing step that can relax this in the next subsection. The conditions allow a rather general family of distributions, so we point out an important special case to provide a more concrete sense of the parameters. For example, for the uniform independent distribution considered in the simplified case, we can actually allow s to be much larger than a constant; our algorithm just requires s ≤Gn for a fixed constant G. So it works for uniform sparse distributions even when the sparsity is linear, which is an order of magnitude larger than in the dictionary learning regime. Furthermore, the distributions of x∗ i can be very different, since we only require C3 1 = O(c2 2n). Moreover, all these can be handled without specific structural assumptions on A∗. More general proportions. A mild restriction in Theorem 6 and 7 is that C2 ≤2c2, that is, maxi∈[n] E[(x∗ i )2] ≤2 mini∈[n] E[(x∗ i )2]. To satisfy this, we propose a preprocessing algorithm for balancing E[(x∗ i )2]. The idea is quite simple: instead of solving Y ≈A∗X, we could also solve Y ≈[A∗D][(D)−1X] for a positive diagonal matrix D, where E[(x∗ i )2]/D2 i,i is with in a factor of 2 from each other. We show in the appendix that this can be done under assumptions as the above theorems, and additionally Σ ⪯(1 + ℓ)I and E(0) ≥entry-wise. After balancing, one can use Algorithm 1 on the new ground-truth matrix [A∗D] to get the final result. 7 Conclusion A simple and natural algorithm that alternates between decoding and updating is proposed for non-negative matrix factorization and theoretical guarantees are provided. The algorithm provably recovers a feature matrix close to the ground-truth and is robust to noise. Our analysis provides insights on the effect of the ReLU units in the presence of the non-negativity constraints, and the resulting interesting dynamics of the convergence. Acknowledgements This work was supported in part by NSF grants CCF-1527371, DMS-1317308, Simons Investigator Award, Simons Collaboration Grant, and ONR-N00014-16-1-2329. 8 References [AGH+13] S. Arora, R. Ge, Y. Halpern, D. Mimno, A. Moitra, D. Sontag, Y. Wu, and M. Zhu. A practical algorithm for topic modeling with provable guarantees. In ICML, 2013. [AGKM12] Sanjeev Arora, Rong Ge, Ravindran Kannan, and Ankur Moitra. Computing a nonnegative matrix factorization–provably. In STOC, pages 145–162. ACM, 2012. [AGM12] S. Arora, R. Ge, and A. Moitra. Learning topic models – going beyond svd. In FOCS, 2012. [AGMM15] S. Arora, R. Ge, T. Ma, and A. Moitra. Simple, efficient, and neural algorithms for sparse coding. In COLT, 2015. [AGMS12] Sanjeev Arora, Rong Ge, Ankur Moitra, and Sushant Sachdeva. Provable ica with unknown gaussian noise, with implications for gaussian mixtures and autoencoders. In NIPS, pages 2375–2383, 2012. [AKF+12] A. Anandkumar, S. Kakade, D. Foster, Y. Liu, and D. Hsu. Two svds suffice: Spectral decompositions for probabilistic topic modeling and latent dirichlet allocation. Technical report, 2012. [AR15] Pranjal Awasthi and Andrej Risteski. On some provably correct cases of variational inference for topic models. In NIPS, pages 2089–2097, 2015. [BGKP16] Chiranjib Bhattacharyya, Navin Goyal, Ravindran Kannan, and Jagdeep Pani. Nonnegative matrix factorization under heavy noise. In Proceedings of the 33nd International Conference on Machine Learning, 2016. [Ble12] David M Blei. Probabilistic topic models. Communications of the ACM, 2012. [BNJ03] David M Blei, Andrew Y Ng, and Michael I Jordan. Latent dirichlet allocation. JMLR, 3:993–1022, 2003. [lda16] Lda-c software. https://github.com/blei-lab/lda-c/blob/master/readme. txt, 2016. Accessed: 2016-05-19. [LS97] Daniel D Lee and H Sebastian Seung. Unsupervised learning by convex and conic coding. NIPS, pages 515–521, 1997. [LS99] Daniel D Lee and H Sebastian Seung. Learning the parts of objects by non-negative matrix factorization. Nature, 401(6755):788–791, 1999. [LS01] Daniel D Lee and H Sebastian Seung. Algorithms for non-negative matrix factorization. In NIPS, pages 556–562, 2001. [OF97] Bruno A Olshausen and David J Field. Sparse coding with an overcomplete basis set: A strategy employed by v1? Vision research, 37(23):3311–3325, 1997. [PC14] Cengiz Pehlevan and Dmitri B Chklovskii. A hebbian/anti-hebbian network derived from online non-negative matrix factorization can cluster and discover sparse features. In Asilomar Conference on Signals, Systems and Computers, pages 769–775. IEEE, 2014. [PC15] Cengiz Pehlevan and Dmitri Chklovskii. A normative theory of adaptive dimensionality reduction in neural networks. In NIPS, pages 2260–2268, 2015. [ZX12] Jun Zhu and Eric P Xing. Sparse topical coding. arXiv preprint arXiv:1202.3778, 2012. 9
2016
341
6,263
Threshold Learning for Optimal Decision Making Nathan F. Lepora Department of Engineering Mathematics, University of Bristol, UK n.lepora@bristol.ac.uk Abstract Decision making under uncertainty is commonly modelled as a process of competitive stochastic evidence accumulation to threshold (the drift-diffusion model). However, it is unknown how animals learn these decision thresholds. We examine threshold learning by constructing a reward function that averages over many trials to Wald’s cost function that defines decision optimality. These rewards are highly stochastic and hence challenging to optimize, which we address in two ways: first, a simple two-factor reward-modulated learning rule derived from Williams’ REINFORCE method for neural networks; and second, Bayesian optimization of the reward function with a Gaussian process. Bayesian optimization converges in fewer trials than REINFORCE but is slower computationally with greater variance. The REINFORCE method is also a better model of acquisition behaviour in animals and a similar learning rule has been proposed for modelling basal ganglia function. 1 Introduction The standard view of perceptual decision making across psychology and neuroscience is of a competitive process that accumulates sensory evidence for the choices up to a threshold (bound) that triggers the decision [1, 2, 3]. While there is debate about whether humans and animals are ‘optimal’, nonetheless the standard psychological model of this process for two-alternative forced choices (the drift-diffusion model [1]) is a special case of an optimal statistical test for selecting between two hypotheses (the sequential probability ratio test, or SPRT [4]). Formally, this sequential test optimizes a cost function linear in the decision time and type I/II errors averaged over many trials [4]. Thus, under broad assumptions about the decision process, the optimal behaviour is simply to stop gathering data after reaching a threshold independent of the data history and collection time. However, there remains the problem of how to set these decision thresholds. While there is consensus that an animal tunes its decision making by maximizing mean reward ([3, Chapter 5],[5, 6, 7, 8, 9, 10]), the learning rule is not known. More generally, it is unknown how an animal tunes its propensity towards making choices while also tuning its overall speed-accuracy balance. Here we show that optimization of the decision thresholds can be considered as reinforcement learning over single trial rewards derived from Wald’s trial averaged cost function considered previously. However, these single trial rewards are highly stochastic and their average has a broad flat peak (Fig. 1B), constituting a challenging optimization problem that will defeat standard methods. We address this challenge by proposing two distinct ways to learn the decision thresholds, with one approach closer to learning rules from neuroscience and the other to machine learning. The first approach is a learning rule derived from Williams’ REINFORCE algorithm for training neural networks [11], which we here combine with an appropriate policy for controlling the thresholds for optimal decision making. The second is a Bayesian optimization method that fits a Gaussian process to the reward function and samples according to the mean reward and reward variance [12, 13, 14]. We find that both methods can successfully learn the thresholds, as validated by comparison against an exhaustive optimization of the reward function. Bayesian optimization converges in fewer trials 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. 0 5 10 15 20 25 30 decision time, t -10 -5 0 5 10 evidence, z Drift-diffusion model threshold, θ1 threshold, -θ0 A 0 2 4 6 8 10 equal thresholds, θ0=θ1 -2 -1.5 -1 -0.5 0 reward, R Reward with threshold optimal threshold θ0 * =θ1* B Figure 1: (A) Drift-diffusion model, representing a noisy stochastic accumulation until reaching a threshold when the decision is made. The optimal threshold maximizes the mean reward (equation 5). (B) Sampled rewards over 1000 trials with equal thresholds θ0 = θ1 (dotted markers); the average reward function is estimated from Gaussian process regression (red curve). Optimizing the thresholds is a challenging problem, particularly when the two thresholds are not equal. (∼102) than REINFORCE (∼103) but is 100-times more computationally expensive with about triple the variance in the threshold estimates. Initial validation is with one decision threshold, corresponding to equal costs of type I/II errors. The methods scale well to two thresholds (unequal costs), and we use REINFORCE to map the full decision performance over both costs. Finally, we compare both methods with experimental two-alternative forced choice data, and find that REINFORCE gives a better account of the acquisition (learning) phase, such as converging over a similar number of trials. 2 Background to the drift-diffusion model and SPRT The drift-diffusion model (DDM) of Ratcliff and colleagues is a standard approach for modeling the results of two-alternative forced choice (2AFC) experiments in psychophysics [1, 15]. A decision variable z(t) represents the sensory evidence accumulated to time t from a starting bias z(0) = z0. Discretizing time in uniform steps (assumed integer without losing generality), the update equation is z(t + 1) = z(t) + ∆z, ∆z ∼N(µ, σ2), (1) where ∆z is the increment of sensory evidence at time t, which is conventionally assumed drawn from a normal distribution N(µ, σ2) of mean µ and variance σ2. The decision criterion is that the accumulated evidence crosses one of two decision thresholds, assumed at −θ0 < 0 < θ1. Wald’s sequential probability ratio test (SPRT) optimally determines whether one of two hypotheses H0, H1 is supported by gathering samples x(t) until a confident decision can be made [4]. It is optimal in that it minimizes the average sample size among all sequential tests to the same error probabilities. The SPRT can be derived from applying Bayes’ rule recursively to sampled data, from when the log posterior ratio log PR(t) passes one of two decision thresholds −θ0 < 0 < θ1: log PR(t + 1) = log PR(t) + log LR(t), PR(t) = p(H1|x(t)) p(H0|x(t)), LR(t) = p(x(t)|H1) p(x(t)|H0), (2) beginning from priors at time zero: PR(0) = p(H1)/p(H0). The right-hand side of equation (2) can also be written as a log likelihood ratio log LR(t) summed over time t (by iterative substitution). The DDM is recognized as a special case of SPRT by setting the likelihoods as two equi-variant Gaussians N(µ1, σ), N(µ0, σ), so that log p(x|H1) p(x|H0) = log e−(x−µ1)2/2σ2 e−(x−µ0)2/2σ2 = ∆µ σ2 x + d, ∆µ = µ1 −µ0, d = µ2 0 −µ2 1 2σ2 . (3) The integrated evidence z(t) in (1) then coincides with the log posterior ratio in (2) and the increments ∆z with the log likelihood ratio in (2). 3 Methods to optimize the decision threshold 3.1 Reinforcement learning for optimal decision making A general statement of decision optimality can be made in terms of minimizing the Bayes risk [4]. This cost function is linear in the type I and II error probabilities α1 = P(H1|H0) = E1(e) and 2 α0 = P(H0|H1) = E0(e), where the decision error e = {0, 1} for correct/incorrect trials, and is also linear in the expected stopping times for each decision outcome 1 Crisk := 1 2(W0α0 + c E0[T]) + 1 2(W1α1 + c E1[T]), (4) with type I/II error costs W0, W1 > 0 and cost of time c. That the Bayes risk Crisk has a unique minimum follows from the error probabilities α0, α1 monotonically decreasing and the expected stopping times E0[T], E1[T] monotonically increasing with increasing threshold θ0 or θ1. For each pair (W0/c, W1/c), there is thus a unique threshold pair (θ∗ 0, θ∗ 1) that minimizes Crisk. We introduce reward into the formalism by supposing that an application of the SPRT with thresholds (θ0, θ1) has a penalty proportional to the stopping time T and decision outcome R = ( −W0 −cT, incorrect decision of hypothesis H0 −W1 −cT, incorrect decision of hypothesis H1 −cT, correct decision of hypothesis H0 or H1. (5) Over many decision trials, the average reward is thus ⟨R⟩= −Crisk, the negative of the Bayes risk. Reinforcement learning can then be used to find the optimal thresholds to maximize reward and thus optimize the Bayes risk. Over many trials n = 1, 2, . . . , N with reward R(n), the problem is to estimate these optimal thresholds (θ∗ 0, θ∗ 1) while maintaining minimal regret: the difference between the reward sum of the optimal decision policy and the sum of the collected rewards ρ(N) = −NCrisk(θ∗ 0, θ∗ 1) −PN n=1R(n). (6) This is recognized as a multi-armed bandit problem with a continuous two-dimensional action space parametrized by the threshold pairs (θ0, θ1). The optimization problem of finding the thresholds that maximize mean reward is highly challenging because of the stochastic decision times and errors. Standard approaches such as gradient ascent fail and even state-of-the-art approaches such as cross-entropy or natural evolution strategies are ineffective. A successful approach must combine reward averaging with learning (in a more sophisticated way than batch-averaging or filtering). We now consider two distinct approaches for this. 3.2 REINFORCE method The first approach to optimize the decision threshold is a standard 2-factor learning rule derived from Williams’ REINFORCE algorithm for training neural networks [11], but modified to the novel application of continuous bandits. From a modern perspective, the REINFORCE algorithm is seen as an example of a policy gradient method [16, 17]. These are well-suited to reinforcement learning with continuous action spaces, because they use gradient descent to optimize continuously parameterized policies with respect to cumulative reward. We consider the decision thresholds (θ0, θ1) to parametrize actions that correspond to making a single decision with those thresholds. Here we use a policy that expresses the threshold as a linear combination of binary unit outputs, with fixed coefficients specifying the contribution of each unit θ0 = ns X j=1 sjyj, θ1 = 2ns X j=ns+1 sjyj. (7) Exponential coefficients were found to work well (equivalent to binary encoding), scaled to give a range of thresholds from zero to θmax: sj = sns+j = (1/2)j 1 −(1/2)ns θmax, (8) where here we use ns = 10 units per threshold with maximum threshold θmax = 10. The benefit of this policy (7,8) is that the learning rule can be expressed in terms of the binary unit outputs yj = {0, 1}, which are the variables considered in the REINFORCE learning rule [11]. Following Williams, the policy choosing the threshold on a trial is stochastic by virtue of the binary unit outputs yj = {0, 1} being distributed according to a logistic function of weights wj, such that yj ∼p(yj|wj) = f(wj)yj + (1 −f(wj))(1 −yj), f(wj) = 1 1 + e−wj . (9) 1The full expression has prior probabilities for the frequency of each outcome, which are here assumed equal. 3 The REINFORCE learning rule for these weights is determined by the reward R(n) on trial n ∆wj = β [yj(t) −f(wj)] R(n), (10) with learning rate β (here generally taken as 0.1). An improvement to the learning rule can be made with reinforcement comparison, with a reference reward ¯R(n) = γR(n) + (1 −γ) ¯R(n −1) subtracted from R(n); a value γ = 0.5 was found to be effective, and is used in all simulations using the REINFORCE rule in this paper. The power of the REINFORCE learning rule is that the weight change is equal to the gradient of the expected return J(www) = E[R{θ}] over all possible threshold sequences {θ}. Thus, a single-trial learning rule performs like stochastic gradient ascent averaged over many trials. Note also that the neural network input xi of the original formalism [11] is here set to x1 = 1, but a non-trivial input could be used to aid learning recall and generalization (see discussion). Overall, the learning follows a reward-modulated two-factor rule that recruits units distributed according to an exponential size principle, and thus resembles models of biological motor learning. 3.3 Bayesian optimization method The second approach is to use Bayesian optimization to find the optimal thresholds from iteratively building a probabilistic model of the reward function that is used to guide future sampling [12, 13, 14]. Bayesian optimization typically uses a Gaussian process model, which provides a nonlinear regression model both of the mean reward and the reward variance with decision threshold. This model can then be used to guide future threshold choice via maximising an acquisition function of these quantities. The basic algorithm for Bayesian optimization is as follows: Algorithm Bayesian optimization applied to optimal decision making for n=1 to N do New thresholds from optimizing acquisition function (θ0, θ1)n = argmax (θ0,θ1) α(θ0, θ1; Dn−1) Make the decision with thresholds (θ0, θ1)n to find reward R(n) Augment data by including new samples Dn = (Dn−1; (θ0, θ1)n, R(n)) Update the statistical (Gaussian process) model of the rewards end for Following other work on Bayesian optimization, we model the reward dependence on the decision thresholds with a Gaussian process R(θ0, θ1) ∼GP[m(θ0, θ1), k(θ0, θ1; θ′ 0, θ′ 1)], (11) with mean m(θ0, θ1) = E[R(θ0, θ1)] and covariance modelled by a squared-exponential function k(θ0, θ1; θ′ 0, θ′ 1) = σ2 f exp −λ 2 ||(θ0, θ1) −(θ′ 0, θ′ 1)||2 . (12) The fitting of the hyperparameters σ2 f, λ used standard methods [18] (GPML toolbox and a quasiNewton optimizer in MATLAB). In principle, the two thresholds could each have distinct hyperparameters, but we use one to maintain the symmetry θ0 ↔θ1 of the decision problem. The choice of decision thresholds is viewed as a sampling problem, and represented by maximizing an acquisition function of the decision thresholds that trades off exploration and exploitation. Here we use the probability of improvement, which guides the sampling towards regions of high uncertainty and reward by maximizing the chance of improving the present best estimate: (θ0, θ1)n = argmax (θ0,θ1) α(θ0, θ1), α(θ0, θ1) = Φ m(θ0, θ1) −R(θ∗ 0, θ∗ 1) k(θ0, θ1; θ0, θ1)  , (13) where (θ∗ 0, θ∗ 1) are the threshold estimates that have given the greatest reward and Φ is the normal cumulative distribution function. Usually one would include a noise parameter for exploration, but because the decision making is stochastic we use the noise from that process instead. 4 0 1000 2000 3000 4000 5000 trials, N 0 0.1 0.2 0.3 0.4 0.5 decision error, e Decision accuracy A 0 1000 2000 3000 4000 5000 trials, N 0 5 10 15 20 decision time, T Decision time B 0 1000 2000 3000 4000 5000 trials, N -1 -0.8 -0.6 -0.4 -0.2 0 reward, R Reward C 0 1000 2000 3000 4000 5000 trials, N 0 2 4 6 8 10 thresholds Decision threshold D θ1 θ0 Figure 2: REINFORCE learning (exponential coefficients) of the two decision thresholds over a single learning episode. Decision costs c = 0.05, W0 = 0.1 and W1 = 1. Plots are smoothed over 50 trials. The red curve is the average accuracy by trial number (fitted to a cumulative Weibull function). Optimal values (from exhaustive optimization) are shown as dashed lines. 0 100 200 300 400 500 trials, N 0 0.1 0.2 0.3 0.4 0.5 decision error, e Decision accuracy A 0 100 200 300 400 500 trials, N 0 5 10 15 20 decision time, T Decision time B 0 100 200 300 400 500 trials, N -1 -0.8 -0.6 -0.4 -0.2 0 reward, R Reward C 0 100 200 300 400 500 trials, N 0 2 4 6 8 10 thresholds Decision threshold D θ1 θ0 Figure 3: Bayesian optimization of the two decision thresholds over a single learning episode. Other details are the same as in Fig. 2, other than only 500 trials were used with smoothing over 20 trials. 4 Results 4.1 Single learning episode The learning problem is to find the pair of optimal decision thresholds (θ∗ 0, θ∗ 1) that maximize the reward function (5), which is a linear combination of penalties for delays and type I and II errors. The reward function has two free parameters that affect the optimal thresholds: the costs W0/c and W1/c of making type I and II errors relative to time. The methods apply generally, although for concreteness we consider a drift-diffusion model equivalent to the SPRT with distribution means µ0 =−µ1 =1/3 and standard deviation σ = 1. Both the REINFORCE method and Bayesian optimization can converge to approximations of the optimal decision thresholds, as shown in Figures 2D,3D above for a typical learning episode. The decision error e, decision time T and reward R are all highly variable from the stochastic nature of the evidence, although displayed plots have their variance reduced by smoothing over 50 trials (to help interpret the results). There is a gradual convergence towards near optimal decision performance. Clearly the main difference between the REINFORCE method and the Bayesian optimization method is the speed of convergence to the decision thresholds (c.f. Figures 2D vs 3D). REINFORCE gradually converges over ∼5000 trials whereas Bayesian optimization converges in ≲500 trials. However, there are other differences between the two methods that are only revealed for multiple learning episodes, which act to balance the pros and cons across the two methods. 4.2 Multiple learning episodes: one decision threshold For validation purposes, we reduce the learning problem to the simpler case where there is only one decision threshold θ0 = θ1, by setting costs equal for type I and II errors W0/c = W1/c so that the error probabilities are equal α0 = α1. This will allow us to compare the two methods in a representative scenario that is simpler to visualize and can be validated against an exhaustive optimization of the reward function (which takes too long to calculate for two thresholds). 5 Figure 4: REINFORCE learning of one decision threshold (for equal thresholds θ1 = θ0) over 200 learning episodes with costs c/W1 = c/W0 sampled uniformly from [0, 0.1]. Results are after 5000 learning trials (averaged over 100 trials). The mean and standard deviation of these results (red line and shaded region) are compared with an exhaustive optimization over 106 episodes (blue curves). Figure 5: Bayesian optimization of one decision threshold (for equal thresholds θ1 = θ0) over 200 learning episodes with costs c/W1 = c/W0 sampled uniformly from [0, 0.1]. Results are after 500 learning trials (averaged over 100 trials). The mean and standard deviation of these results (red line and shaded region) are compared with an exhaustive optimization over 106 episodes (blue curves). We consider REINFORCE over 5000 trials and Bayesian optimization over 500 trials, which are sufficient for convergence (Figures 2,3). Costs were considered over a range W/c > 10 via random uniform sampling of c/W over the range [0, 0.1]. Mean decision errors e, decision times T, rewards and thresholds are averaged over the final 50 trials, combining the results for both choices. Both the REINFORCE and Bayesian optimization methods estimate near-optimal decision thresholds for all considered cost parameters (Figures 4,5; red curves) as verified from comparison with an exhaustive search of the reward function (blue curves) over 106 decision trials (randomly sampling the threshold range to estimate an average reward function, as in Fig 1B). In both cases, the exhaustive search lies within one standard deviation of the decision threshold from the two learning methods. There are, however, differences in performance between the two methods. Firstly, the variance of the threshold estimates is greater for Bayesian optimization than for REINFORCE (c.f. Figures 4D vs 5D). The variance of the decision thresholds feeds through into larger variances for the decision error, time and reward. Secondly, although Bayesian optimization converges in fewer trials (500 vs 5000), it comes at the expense of greater computational cost of the algorithm (Table 1). The above results were checked for robustness across reasonable ranges of the various metaparameters for each learning method. For REINFORCE, the results were not appreciably affected by having any learning rate β within the range 0.1-1; similarly, increasing the unit number n did not affect the threshold variances, but scales the computation time. 4.3 Multiple learning episodes: two decision thresholds We now consider the learning problem with two decision thresholds (θ0, θ1) that optimize the reward function 5 with differing W0/c and W1/c values. We saw above that REINFORCE produces the more accurate estimates relative to the computational cost, so we concentrate on that method only. 6 0 0.02 0.04 0.06 0.08 0.1 cost parameter, c/W0 0 0.02 0.04 0.06 0.08 0.1 cost parameter, c/W1 Decision accuracy decision error , e A 0 0.1 0.2 0.3 0.4 0.5 0 0.02 0.04 0.06 0.08 0.1 cost parameter, c/W0 0 0.02 0.04 0.06 0.08 0.1 cost parameter, c/W1 Decision time decision time, T B 0 4 8 12 16 20 0 0.02 0.04 0.06 0.08 0.1 cost parameter, c/W0 0 0.02 0.04 0.06 0.08 0.1 cost parameter, c/W1 Reward reward, R C -0.5 -0.4 -0.3 -0.2 -0.1 0 0 0.02 0.04 0.06 0.08 0.1 cost parameter, c/W0 0 0.02 0.04 0.06 0.08 0.1 cost parameter, c/W1 Decision threshold threshold, θ1 D 0 2 4 6 8 10 Figure 6: Reinforcement learning of two decision thresholds. Method same as Figure 4 except that 2002 learning episodes are considered with costs (c/W0, c/W1) sampled from [0, 0.1] × [0, 0.1]. The threshold θ0 results are just reflections of those for θ1 in the axis c/W0 ↔c/W1 and thus not shown. Table 1: Comparison of threshold learning methods. Results for one decision threshold, averaging over the data in Figures 4,5. (Benchmarked on an i7 2.7GHz CPU.) REINFORCE Bayesian Exhaustive method optimization optimization computation time 0.5 sec (5000 trials) 50 sec (500 trials) 44 sec (106 trials) computation time/trial 0.1 msec/trial 100 msec/trial 0.04 msec/trial uncertainty, ∆θ (1 s.d.) 0.23 0.75 0.01 The REINFORCE method can find the two decision thresholds (Figure 6), as demonstrated by estimating the thresholds over 2002 instances of the reward function with (c/W0, c/W1) sampled uniformly from [0, 0.1]×[0, 0.1]. Because of the high compute time, we cannot compare the results to those from an exhaustive search, apart from that the plot diagonals (W0/c = W1/c) reduce to the single threshold results which matched an exhaustive optimization (Figure 4). Figure 6 is of general interest because it maps the drift-diffusion model (SPRT) decision performance over a main portion of its parameter space. Results for the two decision thresholds (θ0, θ1) are reflections of each other about W0 ↔W1, while the decision error, time and reward are reflection symmetric (consistent with these symmetries of the decision problem). All quantities depend on both weight parameters (W0/c, W1/c) in a smooth but non-trivial manner. To our knowledge, this is the first time the full decision performance has been mapped. 4.4 Comparison with animal learning The relation between reward and decision optimality is directly relevant to the psychophysics of two alternative forced choice tasks in the tradeoff between decision accuracy and speed [3]. Multiple studies support that the decision threshold is set to maximize reward [7, 8, 9]. However, the mechanism by which subjects learn the optimal thresholds has not been addressed. Our two learning methods are candidate mechanisms, and thus should be compared with experiment. We have found a couple of studies showing data over the acquisition phase of two-alternative forced choice behavioural experiments: one for rodent whisker vibrotactile discrimination [19, Figure 4] and the other for bat echoacoustic discrimination [20]. Studies detailing the acquisition phase are rare compared to those of the proficient phase, even though they are a necessary component of all such behavioural experiments (and successful studies rest on having a well-designed acquisition phase). In both behavioural studies, the animals acquired proficient decision performance after 5000-10000 trials: in rodent, this was after 25-50 sessions of ∼200 trials [19, Figure 4]; and in bat, after about 6000 trials for naive animals [20, Figure 4]. The typical progress of learning was to begin with random choices (mean decision error e = 0.5) and then gradually converge on the appropriate balance of decision time vs accuracy. There was considerable variance in final performance across different animals (in rodent, mean decision errors were e ∼0.05-0.15). 7 That acquisition takes 5000 or more trials is consistent with the REINFORCE learning rule (Figure 2), and not with Bayesian optimization (Figure 3). Moreover, the shape of the acquisition curve for the REINFORCE method resembles that of the animal learning, in also having a good fit to a cumulative Weibull function over a similar number of trials (red line, Figure 2). That being said, the animals begin making random choices and gradually improve in accuracy with longer decision times, whereas both artificial learning methods (Figures 2,3) begin with accurate choices and then decrease in accuracy and decision time. Taken together, this evidence supports that the REINFORCE learning rule is a plausible model of animal learning, although further theoretical and experimental study is required. 5 Discussion We examined how to learn decision thresholds in the drift-diffusion model of perceptual decision making. A key step was to use single trial rewards derived from Wald’s trial-averaged cost function for the equivalent sequential probability ratio test, which took the simple form of a linear weighting of penalties due to time and type I/II errors. These highly stochastic rewards are challenging to optimize, which we addressed with two distinct methods to learn the decision thresholds. The first approach for learning the thresholds was based on a method for training neural networks known as Williams’ REINFORCE rule [11]. In modern terminology, this can be viewed as a policy gradient method [16, 17] and here we proposed an appropriate policy for optimal decision making. The second method was a modern Bayesian optimization method that samples and builds a probabilistic model of the reward function to guide further sampling [12, 13, 14]. Both learning methods converged to nearby the optimum decision thresholds, as validated against an exhaustive optimization (over 106 trials). The Bayesian optimization method converged much faster (∼500 trials) than the REINFORCE method (∼5000 trials). However, Bayesian optimization is three-times as variable in the threshold estimates and 40-times slower in computation time. It appears that the faster convergence for Bayesian optimization leads to less averaging over the stochastic rewards, and hence greater variance than with the REINFORCE method. We expect that both the REINFORCE and Bayesian optimization methods used here can be improved to compensate for some of their individual drawbacks. For example, the full REINFORCE learning rule has a third factor corresponding to the neural network input, which could represent a context signal to allow recall and generalization over past learnt thresholds; also, information on past trial performance is discarded by REINFORCE, which could be partially retained to improve learning. Bayesian optimization could be improved in computational speed by updating the Gaussian process with just the new samples after each decision, rather than refitting the entire Gaussian process; also, the variance of the threshold estimates may improve with other choices of acquisition function for sampling the rewards or other assumptions for the Gaussian process covariance function. In addition, the optimization methods may have broader applicability when the optimal decision thresholds vary with time [10], such as tasks with deadlines or when there are multiple (three or more) choices. Several more factors support the REINFORCE method as a model of reward-driven learning during perceptual decision making. First, REINFORCE is based on a neural network and is thus better suited as a connectionist model of brain function. Second, the REINFORCE model results (Fig. 2) resemble acquisition data from behavioural experiments in rodent [19] and bat [20] (Sec. 4.4). Third, the site of reward learning would plausibly be the basal ganglia, and a similar 3-factor learning rule has already been used to model cortico-striatal plasticity [21]. In addition, multi-alternative (MSPRT) versions of the drift-diffusion model offer a model of action selection in the basal ganglia [22, 23], and so the present REINFORCE model of decision acquisition would extend naturally to encompass a combined model of reinforcement learning and optimal decision making in the brain. Acknowledgements I thank Jack Crago, John Lloyd, Kirsty Aquilina, Kevin Gurney and Giovanni Pezzulo for discussions related to this research. The code used to generate the results and figures for this paper is at http://lepora.com/publications.htm 8 References [1] R. Ratcliff. A theory of memory retrieval. Psychological Review, 85:59–108, 1978. [2] J. Gold and M. Shadlen. The neural basis of decision making. Annu. Rev. Neurosci., 30:535–574, 2007. [3] R. Bogacz, E. Brown, J. Moehlis, P. Holmes, and J.D. Cohen. The physics of optimal decision making: A formal analysis of models of performance in two-alternative forced-choice tasks. Psychological Review, 113(4):700, 2006. [4] A. Wald and J. Wolfowitz. Optimum character of the sequential probability ratio test. The Annals of Mathematical Statistics, 19(3):326–339, 1948. [5] J. Gold and M. Shadlen. Banburismus and the brain: decoding the relationship between sensory stimuli, decisions, and reward. Neuron, 36(2):299–308, 2002. [6] P. Simen, J. Cohen, and P. Holmes. Rapid decision threshold modulation by reward rate in a neural network. Neural networks, 19(8):1013–1026, 2006. [7] P. Simen, D. Contreras, C. Buck, P. Hu, and J. Holmes, P.and Cohen. Reward rate optimization in twoalternative decision making: empirical tests of theoretical predictions. Journal of Experimental Psychology: Human Perception and Performance, 35(6):1865, 2009. [8] R. Bogacz, P. Hu, P. Holmes, and J. Cohen. Do humans produce the speed–accuracy trade-off that maximizes reward rate? The Quarterly Journal of Experimental Psychology, 63(5):863–891, 2010. [9] F. Balci, P. Simen, R. Niyogi, A. Saxe, J. Hughes, P. Holmes, and J. Cohen. Acquisition of decision making criteria: reward rate ultimately beats accuracy. Attention, Perception, & Psychophysics, 73(2):640–657, 2011. [10] J. Drugowitsch, R. Moreno-Bote, A. Churchland, M. Shadlen, and A. Pouget. The cost of accumulating evidence in perceptual decision making. The Journal of Neuroscience, 32(11):3612–3628, 2012. [11] R. Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine learning, 8(3-4):229–256, 1992. [12] M. Pelikan. Bayesian optimization algorithm. In Hierarchical Bayesian optimization algorithm, pages 31–48. Springer, 2005. [13] E. Brochu, V. Cora, and N. De Freitas. A tutorial on bayesian optimization of expensive cost functions, with application to active user modeling and hierarchical reinforcement learning. arXiv preprint arXiv:1012.2599, 2010. [14] J. Snoek, H. Larochelle, and R. Adams. Practical bayesian optimization of machine learning algorithms. In Advances in neural information processing systems, pages 2951–2959, 2012. [15] R. Ratcliff and G. McKoon. The diffusion decision model: theory and data for two-choice decision tasks. Neural computation, 20(4):873–922, 2008. [16] J. Peters and S. Schaal. Reinforcement learning of motor skills with policy gradients. Neural networks, 21(4):682–697, 2008. [17] R. Sutton, D. McAllester, S. Singh, and Y. Mansour. Policy gradient methods for reinforcement learning with function approximation. In Neural Information Processing Systems 12, pages 1057–1063, 2000. [18] C. Rasmussen and C. Williams. Gaussian Processes for Machine Learning. the MIT Press, 2006. [19] J. Mayrhofer, V. Skreb, W. von der Behrens, S. Musall, B. Weber, and F. Haiss. Novel two-alternative forced choice paradigm for bilateral vibrotactile whisker frequency discrimination in head-fixed mice and rats. Journal of neurophysiology, 109(1):273–284, 2013. [20] K. Stich and Y. Winter. Lack of generalization of object discrimination between spatial contexts by a bat. Journal of experimental biology, 209(23):4802–4808, 2006. [21] M. Frank and E. Claus. Anatomy of a decision: striato-orbitofrontal interactions in reinforcement learning, decision making, and reversal. Psychological review, 113(2):300, 2006. [22] R. Bogacz and K. Gurney. The basal ganglia and cortex implement optimal decision making between alternative actions. Neural computation, 19(2):442–477, 2007. [23] N. Lepora and K. Gurney. The basal ganglia optimize decision making over general perceptual hypotheses. Neural Computation, 24(11):2924–2945, 2012. 9
2016
342
6,264
Joint M-Best-Diverse Labelings as a Parametric Submodular Minimization Alexander Kirillov1 Alexander Shekhovtsov2 Carsten Rother1 Bogdan Savchynskyy1 1 TU Dresden, Dresden, Germany 2 TU Graz, Graz, Austria alexander.kirillov@tu-dresden.de Abstract We consider the problem of jointly inferring the M-best diverse labelings for a binary (high-order) submodular energy of a graphical model. Recently, it was shown that this problem can be solved to a global optimum, for many practically interesting diversity measures. It was noted that the labelings are, so-called, nested. This nestedness property also holds for labelings of a class of parametric submodular minimization problems, where different values of the global parameter γ give rise to different solutions. The popular example of the parametric submodular minimization is the monotonic parametric max-flow problem, which is also widely used for computing multiple labelings. As the main contribution of this work we establish a close relationship between diversity with submodular energies and the parametric submodular minimization. In particular, the joint M-best diverse labelings can be obtained by running a non-parametric submodular minimization (in the special case - max-flow) solver for M different values of γ in parallel, for certain diversity measures. Importantly, the values for γ can be computed in a closed form in advance, prior to any optimization. These theoretical results suggest two simple yet efficient algorithms for the joint M-best diverse problem, which outperform competitors in terms of runtime and quality of results. In particular, as we show in the paper, the new methods compute the exact M-best diverse labelings faster than a popular method of Batra et al., which in some sense only obtains approximate solutions. 1 Introduction A variety of tasks in machine learning, computer vision and other disciplines can be formulated as energy minimization problems, also known as Maximum-a-Posteriori (MAP) or Maximum Likelihood (ML) estimation problems in undirected graphical models (Markov or Conditional Random Fields). The importance of this problem is well-recognized, which can be seen by the many specialized benchmarks [36, 21] and computational challenges [10] for its solvers. This motivates the task of finding the most probable solution. Recently, a slightly different task has gained popularity, both from a practical and theoretical perspective. The task is not only to find the most probable solution but multiple diverse solutions, all with low energy, see e.g., [4, 31, 22, 23]. The task is referred to as the “M-best-diverse problem” [4], and it has been used in a variety of scenarios, such as: (a) Expressing uncertainty of the computed solutions [33]; (b) Faster training of model parameters [16]; (c) Ranking of inference results [40]; (d) Empirical risk minimization [32]; (e) Loss-aware optimization [1]; (f) Using diverse proposals in a cascading framework [39, 35]. This project has received funding from the European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation programme (grant agreement No 647769). A. Shekhovtsov was supported by ERC starting grant agreement 640156. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. In this work we build on the recently proposed formulation of [22] for the M-best-diverse problem. In this formulation all M configurations are inferred jointly, contrary to the well-known method [4, 31], where a sequential, greedy procedure is used. Hence, we term it “joint M-best-diverse problem”. As shown in [22, 23], the joint approach qualitatively outperforms the sequential approach [4, 31] in a number of applications. This is explained by the fact that the sequential method [4] can be considered as an approximate and greedy optimization technique for solving the joint M-best-diverse problem. While the joint approach is superior with respect to quality of its results, it is inferior to the sequential method [4] with respect to runtime. For the case of binary submodular energies, the approximate solver in [22] and the exact solver in [23] are several times slower than the sequential technique [4] for a normally sized image. Obviously, this is a major limitation when using it in a practical setting. Furthermore, the difference in runtime grows with the number M of configurations. In this work, we show that in case of binary submodular energies an exact solution to the joint Mbest-diverse problem can be obtained significantly faster than the approximate one with the sequential method [4]. Moreover, the difference in runtime grows with the number M of configurations. Related work The importance of the considered problem can be justified by the fact that a procedure of computing M-best solutions to discrete optimization problems was proposed over 40 years ago, in [28]. Later, more efficient specialized procedures were introduced for MAP-inference on a tree [34], junctiontrees [30] and general graphical models [41, 13, 3]. However, such methods are however not suited for the scenario where diversity of the solutions is required, since they do not enforce it explicitly. Structural Determinant Point Processes [27] is a tool for modelling probability distributions of structured models. Unfortunately, an efficient sampling procedure to obtain diverse configurations is feasible only for tree-structured graphical models. The recently proposed algorithm [8] to find M best modes of a distribution is also limited to chains and junction chains of bounded width. Training of M independent graphical models to produce multiple diverse solutions was proposed in [15], and was further explored in [17, 9]. In contrast, we assume a single fixed model where configurations with low energy (hopefully) correspond to the desired output. The work of [4] defines the M-best-diverse problem, and proposes a solver for it. However, the diversity of the solutions is defined sequentially, with respect to already extracted labelings. In contrast to [4], the work [22] defined the “joint M-best-diverse problem” as an optimization problem of a single joint energy. The most related work to ours is [23], where an efficient method for the joint M-best-diverse problem was proposed for submodular energies. The method is based on the fact that for submodular energies and a family of diversity measures (which includes e.g., Hamming distance) the set of M diverse solutions can be totally ordered with respect to the partial labeling order. In the binary labeling case, the M-best-diverse solutions form a nested set. However, although the method [23] is a considerably more efficient way to solve the problem, compared to the general algorithm proposed in [22], it is still considerably slower than the sequential method [4]. Furthermore, the runtime difference grows with the number M of configurations. Interestingly, the above-mentioned “nestedness property” is also fulfilled by minimizers of a parametric submodular minimization problem [12]. In particular, it holds for the monotonic max-flow method [25], which is also widely used for obtaining diverse labelings in practice [7, 20, 19]. Naturally, we would like to ask questions about the relationship of these two techniques, such as: “Do the joint M-best-diverse configurations form a subset of the configurations returned by a parametric submodular minimization problem?”, and conversely “Can the parametric submodular minimization be used to (efficiently) produce the M-best-diverse configurations?” We give positive answers to both these questions. Contribution • For binary submodular energies we provide a relationship between the joint M-best-diverse and the parametric submodular minimization problems. In case of “concave node-wise diversity measures” 1 we give a closed-form formula for the parameters values, which corresponds to the joint M-best-diverse labelings. The values can be computed in advance, prior to any optimization, which allows to obtain each labeling independently. • Our theoretical results suggest a number of efficient algorithms for the joint M-best-diverse 1Precise definition is given in Sections 2 and 3. 2 problem. We describe and experimentally evaluate the two simplest of them, sequential and parallel. Both are considerably faster than the popular technique [4] and are as easy to implement. We demonstrate the effectiveness of these algorithms on two publicly available datasets. 2 Background and Problem Definition Energy Minimization Let 2A denote the powerset of a set A. The pair G = (V, F) is called a hyper-graph and has V as a finite set of variable nodes and F ⊆2V as a set of factors. Each variable node v ∈V is associated with a variable yv taking its values in a finite set of labels Lv. The set LA = Q v∈A Lv denotes the Cartesian product of sets of labels corresponding to a subset A ⊆V of variables. Functions θf : Lf →R, associated with factors f ∈F, are called potentials and define local costs on values of variables and their combinations. Potentials θf with |f| = 1 are called unary, with |f| = 2 pairwise and |f| > 2 high-order. Without loss of generality we will assume that there is a unary potential θv assigned to each variable v ∈V. This implies that F = V ∪F, where F = {f ∈F : |f| ≥2}. For any non-unary factor f ∈F the corresponding set of variables {yv : v ∈f} will be denoted by yf. The energy minimization problem consists in finding a labeling y∗= (yv : v ∈V) ∈LV, which minimizes the total sum of corresponding potentials: arg min y∈LV E(y) = arg min y∈L X v∈V θv(yv) + X f∈F θf(yf) . (1) Problem (1) is also known as MAP-inference. Labeling y∗satisfying (1) will be later called a solution of the energy-minimization or MAP-inference problem, shortly MAP-labeling or MAP-solution. Unless otherwise specified, we will assume that Lv = {0, 1}, v ∈V, i.e. each variable may take only two values. Such energies will be called binary. We also assume that the logical operations ≤and ≥ are defined in a natural way on the sets Lv. The case, when the energy E decomposes into unary and pairwise potentials only, we will term as pairwise case or pairwise energy. In the following, we use brackets to distinguish between upper index and power, i.e. (A)n means the n-th power of A, whereas n is an upper index in the expression An. We will keep, however, the standard notation Rn for the n-dimensional vector space and skip the brackets if an upper index does not make mathematical sense such as in the expression {0, 1}|V|. Joint-DivMBest Problem Instead of searching for a single labeling with the lowest energy, one might ask for a set of labelings with low energies, yet being significantly different from each other. In [22] it was proposed to infer such M diverse labelings {y1, . . . , yM} ∈(L)M jointly by minimizing EM({y}) = M X i=1 E(yi) −λ∆M({y}) (2) w.r.t. {y} := y1, . . . , yM for some λ > 0. Following [22] we use the notation {y} and {y}v as shortcuts for y1, . . . , yM and y1 v, . . . , yM v correspondingly. Function ∆M defines diversity of arbitrary M labelings, i.e. ∆M({y}) takes a large value if labelings {y} are in a certain sense diverse, and a small value otherwise. In the following, we will refer to the problem (1) of minimizing the energy E itself as to the master problem for (2). Node-Wise Diversity In what follows we will consider only node-wise diversity measures, i.e. those which can be represented in the form ∆M({y}) = X v∈V ∆M v ({y}v) (3) for some node diversity measure ∆M v : {0, 1}M →R. Moreover, we will stick to permutation invariant diversity measures. In other words, such measures that ∆M v ({y}v) = ∆M v (π({y}v)) for any permutation π of variables {y}v. Let the expression JAK be equal to 1 if A is true and 0 otherwise. Let also m0 v = PM m=1Jym v = 0K count the number of 0’s in {y}v. In the binary case Lv = {0, 1}, any permutation invariant measure can be represented as ∆M v ({y}v) = ¯ ∆M v (m0 v) . (4) To keep notation simple, we will use ∆M v for both representations: ∆M v ({y}v) and ¯ ∆M v (m0 v). 3 Example 1 (Hamming distance diversity). Consider the common node diversity measure, the sum of Hamming distances between each pair of labels: ∆M v ({y}v) = M X i=1 M X j=i+1 Jyi v ̸= yj vK. (5) This measure is permutation invariant. Therefore, it can be written as a function of the number m0 v: ∆M v (m0 v) = m0 v · (M −m0 v). (6) Minimization Techniques for Joint-DivMBest Problem Direct minimization of (2) has so far been considered as a difficult problem even when the master problem (1) is easy to solve. We refer to [22] for a detailed investigation of using general MAP-inference solvers for (2). In this paragraph we briefly summarize existing efficient minimization approaches for (2). As shown in [22] the sequential method DivMBest [4] can be seen as a greedy algorithm for approximate minimization of (2), by finding one solution after another. The sequential method [4] is used for diversity measures that can be represented by sum of diversity measures between each pair of solutions, i.e. ∆M({y}) = PM m1=1 PM m2=m1+1 ∆2(ym1, ym2). For each m = 1, . . . , M the method sequentially computes ym = arg min y∈LV " E(y) −λ m−1 X i=1 ∆2(y, yi) # . (7) In case of a node diversity measure (3), this algorithm requires sequentially solving M energy minimization problems (1), with only modified unary potentials comparing to the master problem (1). It typically implies that an efficient solver for the master problem can also be used to obtain its diverse solutions. In [23] an efficient approach for (2) was proposed for submodular energies E. An energy E(y) is called submodular if for any two labelings y, y′ ∈LV it holds E(y ∨y′) + E(y ∧y′) ≤E(y) + E(y′) , (8) where y ∨y′ and y ∧y′ denote correspondingly the node-wise maximum and minimum with respect to the natural order on the label set Lv. In the following, we will use the term the higher labeling. The labeling y is higher than the labeling y′ if yv ≥y′ v for all v ∈V. So, the labeling y ∨y′ is higher than y and y′. Since the set of all labelings is a lattice w.r.t. the operation ≥, we will speak also about the highest labeling. It was shown in [23] that for submodular energies, under certain technical conditions on the diversity measure ∆M v (see Lemma 2 in [23]), the problem (2) can be reformulated as a submodular energy minimization and, therefore, can be solved either exactly or approximately by efficient optimization techniques (e.g., by reduction to the min-cut/max-flow in the pairwise case). However, the size of the reformulated problem grows at least linearly with M (quadratically in the case of the Hamming distance diversity (5)) and therefore even approximate algorithms require longer time than the DivMBest (7) method. Moreover, this difference in runtime grows with M. The mentioned transformation of (2) into a submodular energy minimization problem is based on the theorem below, which plays a crucial role in obtaining the main results of this work. We first give a definition of the “nestedness property”, which is also important for the rest of the paper. Definition 1. An M-tuple (y1, . . . , yM) ∈(LV)M is called nested if for each v ∈V the inequality yi v ≤yj v holds for 1 ≤i ≤j ≤M, i.e. for LV = {0, 1}, yi v = 1 implies yj v = 1 for j > i. Theorem 1. [Special case of Thm. 1 of [23]] For a binary submodular energy and a node-wise permutation invariant diversity, there exists a nested minimizer to the Joint-DivMBest objective (2). Parametric submodular minimization Let γ ∈R|V|, i = {1, . . . , k} be a vector of parameters with the coordinates indexed by the node index v ∈V. We define the parametric energy minimization as the problem of evaluating the function min y∈LV Eγ(y) := min y∈L " E(y) + X v∈V γvyv # (9) for all values of the parameter γ ∈Γ ⊆R|V|. The most important cases of the parametric energy minimization are 4 0 1 2 3 4 5 m 0 2 4 6 ∆M v (m) 0 1 2 3 4 5 m −5 −3 −1 ∆M v (m) Figure 1: Hamming distance (left) and linear (right) diversity measures for M = 5. Value m is defined as PM m=1Jym v = 0K. Both diversity measures are concave. • the monotonic parametric max-flow problem [14, 18], which corresponds to the case when E is a binary submodular pairwise energy and Γ = {ν ∈R|V| : νv = γv(λ)} and functions γv : Λ →R are non-increasing for Λ ⊆R. • a subclass of the parametric submodular minimization [12, 2], where E is submodular and Γ = {γ1, γ2, . . . , γk ∈R|V| : γ1 ≥γ2 ≥. . . ≥γk}, where operation ≥is applied coordinate-wise. It is known [38] that in these two cases, (i) the highest minimizers y1, . . . , yk ∈LV of Eγi, i = {1, . . . , k} are nested and (ii) the parametric problem (9) is solvable efficiently by respective algorithms [14, 18, 12]. In the following, we will show that for a submodular energy E the JointDivMBest problem (2) reduces to the parametric submodular minimization with the values γ1 ≥ γ2 ≥. . . ≥γM ∈R|V| given in closed form. 3 Joint M-Best-Diverse Problem as a Parametric Submodular Minimization Our results hold for the following subclass of the permutation invariant node-wise diversity measures: Definition 2. A node-wise diversity measure ∆M v (m) is called concave if for any 1 ≤i ≤j ≤M it holds ∆M v (i) −∆M v (i −1) ≥∆M v (j) −∆M v (j −1). (10) There are a number of practically relevant concave diversity measures: Example 2. Hamming distance diversity (6) is concave, see Fig. 1 for illustration. Example 3. Diversity measures of the form ∆M v (m0 v) = − |m0 v −(M −m0 v)| p= − |2m0 v −M| p (11) are concave for any p ≥1. Here M −m0 v is the number of variables labeled as 1. Hence, |m0 v −(M −m0 v)| is an absolute value of the difference between the numbers of variables labeled as 0 and 1. It expresses the natural fact that a distribution of 0’s and 1’s is more diverse, when their amounts are similar. For p = 1 we call the measure (11) linear; for p = 2 the measure (11) coincides with the Hamming distance diversity (6). An illustration of these two cases is given in Fig. 1. Our main theoretical result is given by the following theorem: Theorem 2. Let E be binary submodular and ∆M be a node-wise diversity measure with each component ∆M v , v ∈V , being permutation invariant and concave. Then a nested M-tuple (ym)M m=1 minimizing the Joint-DivMBest objective (2) can be found as the solutions of the following M problems: ym = arg min yV " E(y) + X v∈V γm v yv # , (12) where γm v = λ ∆M v (m) −∆M v (m −1)  . In the case of multiple solutions in (12) the highest minimizer must be selected. We refer to the supplement for the proof of Theorem 2 and discuss its practical consequences below. First note that the sequence (γm)M m=1 is monotone due to concavity of ∆M v . Each of the M optimization problems (12) has the same size as the master problem (1) and differs from it by 5 unary potentials only. Theorem 2 implies that γm in (12) satisfy the monotonicity condition: γ1 ≥γ2 ≥. . . ≥γM. Therefore, equations (12) constitute the parametric submodular minimization problem as defined above, which reduces to the monotonic parametric max-flow problem for pairwise E. Let ⌊·⌋denote the largest integer not exceeding an argument of the operation. Corollary 1. Let ∆M v in Theorem 2 be the Hamming distance diversity (6). Then it holds: 1. γm v = λ(M −2m + 1). 2. The values γm v , m = 1, . . . , M are symmetrically distributed around 0: −γm v = γM+1−m v ≥0, for m ≤⌊(M + 1)/2⌋ and γm v = 0, if m = (M + 1)/2 . 3. Moreover, this distribution is uniform, that is γm+1 v −γm v = 2λ, m = 1, . . . , M. 4. When M is odd, the MAP-solution (corresponding to γ(M+1)/2 = 0) is always among the M-best-diverse labelings minimizing (2). Corollary 2. Implications 2 and 4 of Corollary 1 hold for any symmetrical concave ∆M v , i.e., those where ∆M v (m) = ∆M v (M + 1 −m) for m ≤⌊(M + 1)/2⌋. Corollary 3. For linear diversity measure the value γm v in (12) is equal to λ · sgn M 2 −m  , where sgn(x) is a sign function, i.e., sgn(x) = Jx > 0K −Jx < 0K. Since all γm v for m < M 2 are the same, this diversity measure can give only up to 3 different diverse labelings. Therefore, this diversity measure is not useful for M > 3, and can be seen as a limit of useful concave diversity measures. 4 Efficient Algorithmic Solutions Theorem 2 suggests several new computational methods for minimizing the Joint-DivMBest objective (2). All of them are more efficient than those proposed in [23]. Indeed, as we show experimentally in Section 5, they outperform even the sequential DivMBest method (7). The simplest algorithm applies a MAP-inference solver to each of the M problems (12) sequentially and independently. This algorithm has the same computational cost as DivMBest (7) since it also sequentially solves M problems of the same size. However, already its slightly improved version, described below, performs faster than DivMBest (7). Sequential Algorithm Theorem 2 states that solutions of (12) are nested. Therefore, from ym−1 v = 1 it follows that ym v = 1 for labelings ym−1 and ym obtained according to (12). This allows to reduce the size and computing time for each subsequent problem in the sequence.2 Reusing the flow from the previous step gives an additional speedup. In fact, when applying a push relabel or pseudoflow algorithm in this fashion the total work complexity is asymptotically the same as of a single minimum cut [14, 18] of the master problem. In practice, this strategy is efficient with other min-cut solvers (without theoretical guarantees) as well. In our experiments we evaluated it with the dynamic augmenting path method [6, 24]. Parallel Algorithm The M problems (12) are completely independent, and their highest minimizers recover the optimal M-tuple (ym)m according to Theorem 2. They can be solved fully in parallel or, using p < M processors, in parallel groups of M/p problems per processor, incrementally within each group. The overhead is only in copying data costs and sharing the memory bandwidth. Alternative approaches One may suggest that for large M it would be more efficient to solve the full parametric maxflow problem [18, 14] and then “read out” solutions corresponding to the desired values γm. However, the known algorithms [18, 14] would perform exactly the incremental computation described in the sequential approach above plus an extra work of identifying all breakpoints. This is only sensible when M is larger than the number of breakpoints or the diversity measure is not known in advance (e.g., is itself parametric). Similarly, parametric submodular function minimization can be solved in the same worst case complexity [12] as non-parametric, but the algorithm is again incremental and would just perform less work when the parameters of interest are known in advance. 5 Experimental Evaluation We base our experiments on two datasets: (i) The interactive foreground/background image segmentation dataset utilized in several papers [4, 31, 22, 23] for comparing diversity techniques; (ii) A new 2By applying “symmetric reasoning” for the label 0, further speed-ups can be achieved. However, we stick to the first variant in our experiments. 6 Table 1: Interactive segmentation. The quality measure is a per-pixel accuracy of the best segmentation, out of M, averaged over all test images. The runtime is in milliseconds (ms). The quality for M = 1 is 91.57. Parametric-parallel is the fastest method followed by Parametric-sequential. Both achieve higher quality than DivMBest, and return the same solution as Joint-DivMBest. M=2 M=6 M=10 quality time (ms) quality time (ms) quality time (ms) DivMBest [4] 93.16 2.6 95.02 11.6 95.16 15.4 Joint-DivMBest [23] 95.13 5.5 96.01 17.2 96.19 80.3 Parametric-sequential (1 core) 95.13 2.2 96.01 5.5 96.19 8.4 Parametric-parallel (6 cores) 95.13 1.9 96.01 4.3 96.19 6.2 dataset for foreground/background image segmentation with binary pairwise energies derived from the well-known PASCAL VOC 2012 dataset [11]. Energies of the master problem (1) in both cases are binary and pairwise, therefore we use their reduction [26] to the min-cut/max-flow problem to obtain solutions efficiently. Baselines Our main competitor is the fastest known approach for inferring M diverse solutions, the DivMBest method [4]. We made its efficient re-implementation using dynamic graph-cut [24]. We also compare our method with Joint-DivMBest [23], which provides an exact minimum of (2) as our method does. Diversity Measure In all of our experiments we use the Hamming distance diversity measure (5). Note that in [31] more sophisticated diversity measures were used e.g., the Hamming Ball. However, the DivMBest method (7) with this measure requires to run a very time-consuming HOP-MAP [37] inference technique. Moreover, the experimental evaluation in [23] suggests that the exact minimum of (2) with Hamming distance diversity (5) outperforms DivMBest with a Hamming Ball distance diversity. Our Method We evaluate both algorithms described in Section 4, i.e., sequential and parallel. We refer to them as Parametric-sequential and Parametric-parallel respectively. We utilize the dynamic graph-cut [24] technique for Parametric-sequential, which makes it comparable to our implementation of DivMBest. The max-flow solver of [6] is used for Parametric-parallel together with OpenMP directives. For the experiments we use a computer with 6 physical cores (12 virtual cores), and run Parametric-parallel with M threads. Parameters λ (from (7) and (2)) were tuned via cross-validation for each algorithm and each experiment separately. 5.1 Interactive Segmentation The basic idea is that after a user interaction, the system provides the user with M diverse segmentations, instead of a single one. The user can then manually select the best one and add more user scribbles, if necessary. Following [4] we consider only the first iteration of such an interactive procedure, i.e., we consider user scribbles to be given and compare the sets of segmentations returned by the system. The authors of [4] kindly provided us their 50 super-pixel graphical model instances. They are based on a subset of the PASCAL VOC 2010 [11] segmentation challenge with manually added scribbles. An instance has on average 3000 nodes. Pairwise potentials are given by contrast-sensitive Potts terms [5], which are submodular in the binary case. This implies that Theorem 2 is applicable. Quantitative comparison and runtime of the different algorithms are presented in Table 1. As in [4], our quality measure is a per-pixel accuracy of the best solution for each test image, averaged over all test images. As expected, Joint-DivMBest and Parametric-* return the same, exact solution of (2). The measured runtime is also averaged over all test images. Parametric-parallel is the fastest method followed by Parametric-sequential. Note that on a computer with fewer cores, Parametric-sequential may even outperform Parametric-parallel because of the parallelization overheads. 5.2 Foreground/Background Segmentation The Pascal VOC 2012 [11] segmentation dataset has 21 labels. We selected all those 451 images from the validation set for which the ground truth labeling has only two labels (background and one 7 1 2 3 4 5 6 7 8 9 10 M 83 84 85 86 87 88 IoU score Parametric DivMBest (a) Intersection-over-union (IoU) 1 2 3 4 5 6 7 8 9 10 M 0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 time (s) DivMBest Parametric-sequential Parametric-parallel (b) Runtime in seconds Figure 2: Foreground/background segmentation. (a) Intersection-over-union (IoU) score for the best segmentation, out of M. Parametric represents a curve, which is the same for Parametric-sequential, Parametric-parallel and Joint-DivMBest, since they exactly solve the same Joint-DivMBest problem. (b) DivMBest uses dynamic graph-cut [24]. Parametric-sequential uses dynamic graph-cut and a reduced size graph for each consecutive labeling problem. Parametric-parallel solves M problems in parallel using OpenMP. of the 20 object classes) and which were not used for training. As unary potentials we use the output probabilities of the publicly available fully convolutional neural network FCN-8s [29], which is trained for the Pascal VOC 2012 challenge. This CNN gives unary terms for all 21 classes. For each image we pick only two classes: the background and the class-label that is presented in the ground truth. As pairwise potentials we use the contrastive-sensitive Potts terms [5] with a 4-connected grid structure. Quantitative Comparison and Runtime As quality measure we use the standard Pascal VOC measure for semantic segmentation – average intersection-over-union (IoU) [11]. The unary potentials alone, i.e., output of FCN-8s, give 82.12 IoU. The single best labeling, returned by the MAP-inference problem, improves it to 83.23 IoU. The comparisons with respect to runtime and accuracy of results are presented in Fig. 2a and 2b respectively. The increase in runtime with respect to M for Parametric-parallel is due to parallelization overhead costs, which grow with M. Parametric-parallel is a clear winner in this experiment, both in terms of quality and runtime. Parametric-sequential is slower than Parametric-parallel but faster than DivMBest. The difference in runtime between these three algorithms grows with M. 6 Conclusion and Outlook We have shown that the M labelings, which constitute a solution to the Joint-DivMBest problem with binary submodular energies, and concave node-wise permutation invariant diversity measures can be computed in parallel, independently from each other, as solutions of the master energy minimization problem with modified unary costs. This allows to build solvers which run even faster than the approximate method of Batra et al. [4]. Furthermore, we have shown that such Joint-DivMBest problems reduce to the parametric submodular minimization. This shows a clear connection of these two practical approaches to obtaining diverse solutions to the energy minimization problem. References [1] Ahmed, F., Tarlow, D., Batra, D.: Optimizing expected Intersection-over-Union with candidate-constrained CRFs. In: ICCV (2015) [2] Bach, F.: Learning with submodular functions: A convex optimization perspective. Foundations and Trends in Machine Learning 6(2-3), 145–373 (2013) [3] Batra, D.: An efficient message-passing algorithm for the M-best MAP problem. In: UAI (2012) [4] Batra, D., Yadollahpour, P., Guzman-Rivera, A., Shakhnarovich, G.: Diverse M-best solutions in Markov random fields. In: ECCV. Springer Berlin/Heidelberg (2012) [5] Boykov, Y., Jolly, M.P.: Interactive graph cuts for optimal boundary & region segmentation of objects in N-D images. In: ICCV (2001) [6] Boykov, Y., Kolmogorov, V.: An experimental comparison of min-cut/max-flow algorithms for energy minimization in vision. TPAMI 26(9), 1124–1137 (2004) 8 [7] Carreira, J., Sminchisescu, C.: Constrained parametric min-cuts for automatic object segmentation. In: CVPR. pp. 3241–3248 (2010) [8] Chen, C., Kolmogorov, V., Zhu, Y., Metaxas, D.N., Lampert, C.H.: Computing the M most probable modes of a graphical model. In: AISTATS (2013) [9] Dey, D., Ramakrishna, V., Hebert, M., Andrew Bagnell, J.: Predicting multiple structured visual interpretations. In: ICCV (2015) [10] Elidan, G., Globerson, A.: The probabilistic inference challenge (PIC2011) (2011) [11] Everingham, M., Van Gool, L., Williams, C.K.I., Winn, J., Zisserman, A.: The PASCAL Visual Object Classes Challenge 2012 (VOC2012) Results (2012) [12] Fleischer, L., Iwata, S.: A push-relabel framework for submodular function minimization and applications to parametric optimization. Discrete Applied Mathematics 131(2), 311–322 (2003) [13] Fromer, M., Globerson, A.: An LP view of the M-best MAP problem. In: NIPS 22 (2009) [14] Gallo, G., Grigoriadis, M.D., Tarjan, R.E.: A fast parametric maximum flow algorithm and applications. SIAM Journal on Computing 18(1), 30–55 (1989) [15] Guzman-Rivera, A., Batra, D., Kohli, P.: Multiple choice learning: Learning to produce multiple structured outputs. In: NIPS 25 (2012) [16] Guzman-Rivera, A., Kohli, P., Batra, D.: DivMCuts: Faster training of structural SVMs with diverse M-best cutting-planes. In: AISTATS (2013) [17] Guzman-Rivera, A., Kohli, P., Batra, D., Rutenbar, R.A.: Efficiently enforcing diversity in multi-output structured prediction. In: AISTATS (2014) [18] Hochbaum, D.S.: The pseudoflow algorithm: A new algorithm for the maximum-flow problem. Operations research 56(4), 992–1009 (2008) [19] Hower, D., Singh, V., Johnson, S.C.: Label set perturbation for MRF based neuroimaging segmentation. In: ICCV. pp. 849–856. IEEE (2009) [20] Jug, F., Pietzsch, T., Kainmüller, D., Funke, J., Kaiser, M., van Nimwegen, E., Rother, C., Myers, G.: Optimal joint segmentation and tracking of Escherichia Coli in the mother machine. In: BAMBI (2014) [21] Kappes, J.H., Andres, B., Hamprecht, F.A., Schnörr, C., Nowozin, S., Batra, D., Kim, S., Kausler, B.X., Kröger, T., Lellmann, J., Komodakis, N., Savchynskyy, B., Rother, C.: A comparative study of modern inference techniques for structured discrete energy minimization problems. IJCV pp. 1–30 (2015) [22] Kirillov, A., Savchynskyy, B., Schlesinger, D., Vetrov, D., Rother, C.: Inferring M-best diverse labelings in a single one. In: ICCV (2015) [23] Kirillov, A., Schlesinger, D., Vetrov, D.P., Rother, C., Savchynskyy, B.: M-best-diverse labelings for submodular energies and beyond. In: NIPS (2015) [24] Kohli, P., Torr, P.H.: Dynamic graph cuts for efficient inference in Markov random fields. PAMI (2007) [25] Kolmogorov, V., Boykov, Y., Rother, C.: Applications of parametric maxflow in computer vision. In: ICCV. pp. 1–8. IEEE (2007) [26] Kolmogorov, V., Zabih, R.: What energy functions can be minimized via graph cuts? TPAMI (2004) [27] Kulesza, A., Taskar, B.: Structured determinantal point processes. In: NIPS 23 (2010) [28] Lawler, E.L.: A procedure for computing the K best solutions to discrete optimization problems and its application to the shortest path problem. Management Science 18(7) (1972) [29] Long, J., Shelhamer, E., Darrell, T.: Fully convolutional networks for semantic segmentation. CVPR (2015) [30] Nilsson, D.: An efficient algorithm for finding the M most probable configurationsin probabilistic expert systems. Statistics and Computing 8(2), 159–173 (1998) [31] Prasad, A., Jegelka, S., Batra, D.: Submodular meets structured: Finding diverse subsets in exponentiallylarge structured item sets. In: NIPS 27 (2014) [32] Premachandran, V., Tarlow, D., Batra, D.: Empirical minimum bayes risk prediction: How to extract an extra few % performance from vision models with just three more parameters. In: CVPR (2014) [33] Ramakrishna, V., Batra, D.: Mode-marginals: Expressing uncertainty via diverse M-best solutions. In: NIPS Workshop on Perturbations, Optimization, and Statistics (2012) [34] Schlesinger, M.I., Hlavac, V.: Ten lectures on statistical and structural pattern recognition (2002) [35] Sener, O., Saxena, A.: rCRF: Recursive belief estimation over CRFs in RGB-D activity videos. In: Robotics Science and Systems (RSS) (2015) [36] Szeliski, R., Zabih, R., Scharstein, D., Veksler, O., Kolmogorov, V., Agarwala, A., Tappen, M.F., Rother, C.: A comparative study of energy minimization methods for Markov random fields with smoothness-based priors. TPAMI 30(6), 1068–1080 (2008) [37] Tarlow, D., Givoni, I.E., Zemel, R.S.: HOP-MAP: Efficient message passing with high order potentials. In: AISTATS (2010) [38] Topkis, D.M.: Minimizing a submodular function on a lattice. Operations research 26(2), 305–321 (1978) [39] Wang, S., Fidler, S., Urtasun, R.: Lost shopping! monocular localization in large indoor spaces. In: ICCV (2015) [40] Yadollahpour, P., Batra, D., Shakhnarovich, G.: Discriminative re-ranking of diverse segmentations. In: CVPR (2013) [41] Yanover, C., Weiss, Y.: Finding the M most probable configurations using loopy belief propagation. In: NIPS 17 (2004) 9
2016
343
6,265
Confusions over Time: An Interpretable Bayesian Model to Characterize Trends in Decision Making Himabindu Lakkaraju Department of Computer Science Stanford University himalv@cs.stanford.edu Jure Leskovec Department of Computer Science Stanford University jure@cs.stanford.edu Abstract We propose Confusions over Time (CoT), a novel generative framework which facilitates a multi-granular analysis of the decision making process. The CoT not only models the confusions or error properties of individual decision makers and their evolution over time, but also allows us to obtain diagnostic insights into the collective decision making process in an interpretable manner. To this end, the CoT models the confusions of the decision makers and their evolution over time via time-dependent confusion matrices. Interpretable insights are obtained by grouping similar decision makers (and items being judged) into clusters and representing each such cluster with an appropriate prototype and identifying the most important features characterizing the cluster via a subspace feature indicator vector. Experimentation with real world data on bail decisions, asthma treatments, and insurance policy approval decisions demonstrates that CoT can accurately model and explain the confusions of decision makers and their evolution over time. 1 Introduction Several diverse domains such as judiciary, health care, and insurance rely heavily on human decision making. Since decisions of judges, doctors, and other decision makers impact millions of people, it is important to reduce errors in judgement. The first step towards reducing such errors and improving the quality of decision making is to diagnose the errors being made by the decision makers. It is crucial to not only identify the errors made by individual decision makers and how they change over time, but also to determine common patterns of errors encountered in the collective decision making process. This turns out to be quite challenging in practice partly because there is no ground truth which captures the optimal decision in a given scenario. Prior research has mainly focussed on modeling decisions of individual decision makers [2, 12]. For instance, the Dawid-Skene model [2] assumes that each item (eg., a patient) has an underlying true label (eg., a particular treatment) and a decision maker’s evaluation of the item will be masked by her own biases and confusions. Confusions of each individual decision maker j are modeled using a latent confusion matrix Θj, where an entry in the (p, q) cell denotes the probability that an item with true label p will be assigned a label q by the decision maker j. The true labels of items and latent confusion matrices of decision makers are jointly inferred as part of the inference process. However, a major drawback of the Dawid-Skene framework and several of its extensions [16, 17, 12] is that they do not provide any diagnostic insights into the collective decision making process. Furthermore, none of these approaches account for temporal changes in the confusions of decision makers. Here, we propose a novel Bayesian framework, Confusions over Time (CoT), which jointly: 1) models the confusions of individual decision makers 2) captures the temporal dynamics of their decision making 3) provides interpretable insights into the collective decision making process, and 4) 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. infers true labels of items. While there has been prior research on each of the aforementioned aspects independently, there has not been a single framework which ties all of them together in a principled yet simple way. The modeling process of the CoT groups decision makers (and items) into clusters. Each such cluster is associated with a subspace feature indicator vector which determines the most important features that characterize the cluster, and a prototype which is the representative data point for that cluster. The prototypes and the subspace feature indicator vectors together contribute to obtaining interpretable insights into the decision making process. The decisions made by decision makers on items are modeled as interactions between such clusters. More specifically, each pair of (decision maker, item) clusters is associated with a set of latent confusion matrices, one for each discrete time instant. The decisions are then modeled as multinomial variables sampled from such confusion matrices. The inference process involves jointly inferring cluster assignments, the latent confusion matrices, prototypes and feature indicator vectors corresponding to each of the clusters, and true labels of items using a collapsed Gibbs sampling procedure. We analyze the performance of CoT on three real-world datasets: (1) judicial bail decisions; (2) treatment recommendations for asthma patients; (3) decisions to approve/deny insurance requests. Experimental results demonstrate that the proposed framework is very effective at inferring true labels of items, predicting decisions made by decision makers, and providing diagnostic insights into the collective decision making process. 2 Related Work Here, we provide an overview of related research on modeling decision making. We also highlight the connections of this work to two other related yet different research directions: stochastic block models, and interpretable models. Modeling decision making. There has been a renewed interest in analyzing and understanding human decisions due to the recent surge in applications in crowdsourcing, public policy, and education [6]. Prior research in this area has primarily focussed on the following problems: inferring true labels of items from human annotations [17, 6, 18, 3], inferring the expertise of decision makers [5, 19, 21], analyzing confusions or error properties of individual decision makers [2, 12, 10], and obtaining diagnostic insights into the collective decision making process [10]. While some of the prior work has addressed each of these problems independently, there have been very few attempts to unify the aforementioned directions. For instance, Whitehill et. al. [19] proposed a model which jointly infers the true labels and estimate of evaluator’s quality by modeling decisions as functions of the expertise levels of decision makers and the difficulty levels of items. However, this approach neither models the error properties of decision makers, nor provides any diagnostic insights into the process of decision making. Approaches proposed by Skene et al. [2] and Liu et al. [12] model the confusions of individual decision makers and also estimate the true labels of items, but fail to provide any diagnostic insights into the patterns of collective decisions. Recently, Lakkaraju et al. proposed a framework [10] which also provides diagnostic insights but it requires a post-processing step employing Apriori algorithm to obtain these insights. Furthermore, none of the aforementioned approaches model the temporal dynamics of decision making. Stochastic block models. There has been a long line of research on modeling relational data using stochastic block models [15, 7, 20]. These modeling techniques typically involved grouping entities (eg., nodes in a graph) such that interactions between these entities (eg., edges in a graph) are governed by their corresponding clusters. However, these approaches do not model the nuances of decision making such as confusions of decision makers which is crucial to our work. Interpretable models. A large body of machine learning literature focused on developing interpretable models for classification [11, 9, 13, 1] and clustering [8]. To this end, various classes of models such as decision lists [11], decision sets [9], prototype (case) based models [1], and generalized additive models [13] were proposed. However, none of these approaches can be readily applied to determine error properties of decision makers. 2 3 Confusions over Time Model In this section, we present CoT, a novel Bayesian framework which facilitates an interpretable, multi-granular analysis of the decision making process. We begin by discussing the problem setting and then dive into the details of modeling and inference. 3.1 Setting Let J and I denote the sets of decision makers and items respectively. Each item is judged by one or more decision makers. In domains such as judiciary and health care, each defendant or patient is typically assessed by a single decision maker, where as each item is evaluated by multiple decision makers in settings such as crowdsourcing. Our framework can handle either scenarios and does not make any assumptions about the number of decision makers required to evaluate an item. However, we do assume that each item is judged no more than once by any given decision maker. The decision made by a decision maker j about an item i is denoted by ri,j. Each decision ri,j is associated with a discrete time stamp ti,j ∈{1, 2 · · · T} corresponding to the time instant when the item i was evaluated by the decision maker j. Each decision maker has M different features or attributes and a(j) m denotes the value of the mth feature of decision maker j. Similarly, each item has N different features or attributes and b(i) n represents the value of the nth feature of item i. Each item i is associated with a true label zi ∈ {1, 2, · · · K}. zi is not observed in the data and is modeled as a latent variable. This mimics most real-world scenarios where the ground-truth capturing the optimal decision or the true label is often not available. 3.2 Defining Confusions over Time (CoT) model The CoT model jointly addresses the problems of modeling confusions of individual decision makers and how these confusions change over time, and also provides interpretable diagnostic insights into the collective decision making process. Each of these aspects is captured by the generative process of the CoT model, which comprises of the following components: (1) cluster assignments; (2) prototype selection and subspace feature indicator generation for each of the clusters; (3) true label generation for each of the items; (4) time dependent confusion matrices. Below, we describe each of these components and highlight the connections between them. Cluster Assignments. The CoT model groups decision makers and items into clusters. The model assumes that there are L1 decision maker clusters and L2 item clusters. The values of L1, L2 are assumed to be available in advance. Each decision maker j is assigned to a cluster cj, which is sampled from a multinomial distribution with a uniform Dirichlet prior ϵα. Similarly, each item i is associated with a cluster di, sampled from a multinomial distribution with a uniform Dirichlet prior ϵα′. The features of decision makers and the decisions that they make depend on the clusters they belong to. Analogously, the true labels of items, their features and the decisions involving them are influenced by the clusters to which they are affiliated. Prototype and Subspace Feature Indicator. The interpretability of the CoT stems from the following two crucial components: associating each decision maker and item cluster with a prototype or an exemplar, and a subspace feature indicator which is a binary vector indicating which features are important in characterizing the cluster. The prototype pc of a decision maker cluster c is obtained by sampling uniformly over all decision makers 1 · · · |J| i.e., pc ∼Uniform(1, |J|). The subspace feature indicator, ωc, of the cluster c is a binary vector of length M. An element of this vector, ωc,f, corresponds to the feature f and indicates if that feature is important (ωc,f = 1) in characterizing the cluster c. ωc,f ∈{0, 1} is sampled from a Bernoulli distribution. The prototype p′ d and subspace feature indicator vector ω′ d corresponding to an item cluster d are defined analogously. Generating the features: The prototype and the subspace feature indicator vector together provide a template for generating feature values of the cluster members. More specifically, if the mth feature is designated as an important feature for cluster c, then instances in that cluster are very likely to inherit the coresponding feature value from the prototype datapoint pc. 3 We sample the value of a discrete feature m corresponding to decision maker j, a(j) m , from a multinomial distribution φcj,m where cj denotes the cluster to which j belongs. φcj,m is in turn sampled from a Dirichlet distribution parameterized by the vector gpcj ,m,ωcj ,m,λ i.e., φcj,m ∼ Dirichlet(gpcj ,m,ωcj ,m,λ). gpc,m,ωc,m,λ is a vector defined such that the eth element of the vector corresponds to the prior on the eth possible value of the mth feature. The eth element of this vector is defined as: gpc,m,ωc,m,λ(e) = λ (1 + µ1 [ωc,m = 1 and pc,m = Vm,e]) (1) where 1 denotes the indicator function, and λ and µ are the hyperparameters which determine the extent to which the prototype will be copied by the cluster members. Vm,e denotes the eth possible value of the mth feature. For example, let us assume that the mth feature corresponds to gender which can take one of the following values: {male, female, NA}, then Vm,1 represents the value male, Vm,2 denotes the values female and so on. Equation 1 can be explained as follows: if the mth feature is irrelevant to the cluster c (i.e., ωc,m = 0), then φc,m will be sampled from a Dirichlet distribution with a uniform prior λ. On the other hand, if ωc,m = 1, then φc,m has a prior of λ + µ on that feature value which matches the prototype’s feature value, and a prior of just λ on all the other possible feature values. The larger the value of µ, the higher the likelihood that the cluster members assume the same feature value as that of the prototype. Values of continuous features are sampled in an analogous fashion. We model continuous features as Gaussian distributions. If a particular continuous feature is designated as an important feature for some cluster c, then the mean of the Gaussian distribution corresponding to this feature is set to be equal to that of the corresponding feature value of the prototype pc, otherwise the mean is set to 0. The variance of the Gaussian distribution is set to σ for all continuous features. Though the above exposition focused on clusters of decision makers, we can generate feature values of items in a similar manner. Feature values of items belonging to some cluster d are sampled from the corresponding feature distributions φ′ d, which are in turn sampled from priors which account for the prototype p′ d and subspace feature indicator ω′ d. True Labels of Items. Our model assumes that every item i is associated with a true label zi. This true label is sampled from a multinomial distribution ρdi where di is the cluster to which i belongs. ρdi is sampled from a Dirichlet prior which ensures that the true labels of the members of cluster di conform to the true label of the prototype. The prior is defined using a vector g′ p′ d and each element of this vector can be computed as: g′ p′ d(e) = λ  1 + µ1 h zp′ d = e i (2) Note that Equation 2 assigns a higher prior to the label which is the same as that of the cluster’s prototype. The larger the value of µ, the higher the likelihood that the true labels of all the cluster members will be the same as that of the prototype. Time Dependent Confusion Matrices. Each pair of decision maker-item clusters (c, d) is associated with a set of latent confusion matrices Θ(t) c,d, one for each discrete time instant t. These confusion matrices influence how the decision makers in the cluster c judge the items in d and also allow us to study how decision maker confusions change with time. Each confusion matrix is of size K × K where K denotes the number of possible values that an item can be labeled with. Each entry (p, q) in a confusion matrix Θ determines the probability that an item with true label p will be assigned the label q. Higher probability mass on the diagonal signifies accurate decisions. Let us consider the confusion matrix corresponding to decision maker cluster c, item cluster d, and time instant 1 (first time instant): Θ(1) c,d. Each row of this matrix denoted by Θ(1) c,d,z (z is the row index) is sampled from a Dirichlet distribution with a uniform prior ∧. The CoT framework also models the dependencies between the confusion matrices at consecutive time instants via a trade-off parameter π. The magnitude of π determines how similar Θ(t+1) c,d is to Θ(t) c,d. The eth element in the row z of the confusion matrix Θ(t+1) c,d,z is sampled as follows: Θ(t+1) c,d,z (e) ∼Dirichlet(hΘ(t) c,d,z(e),∧) where hΘ(t) c,d,z(e),∧= ∧  1 + π h Θ(t) c,d,z(e) i (3) 4 di |J| |I| |J| x |I| cj L2 !0 d p0 d φ0 d rj,i tj,i ⇥(t) ⇥(t+1) T a(j) L1 pc !c φc β |J| |I| β0 ↵ ↵0 T ⇢ ✏β ✏↵ ✏0 ↵ ✏0 β b(i) zi Prototypes & Subspace Feature Indicators for Decision Maker Clusters Prototypes & Subspace Feature Indicators for Item Clusters Features of Decision Makers Features and Labels of Items Decisions Time-dependent Confusion Matrices ^, ⇡ Figure 1: Plate notation for the CoT model. Each block is annotated with descriptive text. The hyperparameters λ, µ are omitted to improve readability. Generating the decisions: Our model assumes that the decision rj,i made by a decision maker j about an item i depends on the clusters cj, di that j and i belong to, the time instant tj,i when the decision was made, and the true label zi of item i. More specifically, rj,i ∼Multinomial(Θ(ti,j) cj,di,zi). Complete Generative Process. Please refer to the Appendix for the complete generative process of CoT. The graphical representation of CoT is shown in Figure 1. 3.3 Inference We use collapsed Gibbs sampling [4] approach to infer the latent variables of the CoT framework. This technique involves integrating out all the intermediate latent variables Θ, φ, φ′, ρ and sampling only the variables corersponding to prototypes pc, p′ d, subspace feature indicator vectors ωc,m, ω′ d,n, cluster assignments cj, di and item labels zi. The update equation for pc is given by: 1. p(pc = q|z, c, d, ω, ω′, p′, p(−c)) ∝ M Y m=1 1 (ωc,m = 1) × uc,m,qm (4) where uc,m,qm denotes the number of instances belonging to cluster c for which the discrete feature m takes the value qm. qm denotes the value of the feature m corresponding to the decision maker q. The update equation for p′ d can be derived analogously. The conditional distribution for ωc,m obtained by integrating out φ variables is: p(ωc,m = s|z, c, d, ω−(c,m), ω′, p′, p, λ) ∝    β × B(gpc,m,1,λ+˜uc) B(gpc,m,1,λ) if s = 1 (1 −β) × B(gpc,m,0,λ+˜uc) B(gpc,m,0,λ) otherwise (5) where ˜uc denotes the number of decision makers belonging to cluster c and B denotes the Beta function. The conditional distribution for ω′ d,n can be written in an analogous manner. The conditional distributions for cj, di and zi can be derived as described in [10]. 4 Experimental Evaluation In this section, we present the evaluation of the CoT model on a variety of datasets. Our experiments are designed to evaluate the performance of our model on a variety of tasks such as recovering confusion matrices, predicting item labels and decisions made by decision makers. We also study the interpretability aspects of our model by evaluating the insights obtained. 1Due to space limitations, we present the update equations assuming that the features of decision makers and items are discrete. 5 Dataset # of # of # of Evaluator Item Evaluators Items Decisions Features Features Bail 252 250,500 250,500 # of felony, misd., Previous arrests, offenses, minor offense cases pays rent, children, gender Asthma 48 60,048 62,497 Gender, age, experience, Gender, age, asthma history, specialty, # of patients seen BMI, allergies Insurance 74 49,876 50,943 # of policy decisions, domain, previous losses, # of construction, chemical, premium amount quoted technology decisions Table 1: Summary statistics of our datasets. Datasets. We evaluate CoT on the following real-world datasets: (1) Bail dataset comprising of information about criminal court judges deciding if defendants should be released without any conditions, asked to pay bail amount, or be locked up (K = 3); Here, decision makers are judges and items are defendants. (2) Asthma dataset which captures the treatment recommendations given by doctors to patients. Patients are recommended one of the two possible categories of treatments: mild (mild drugs/inhalers), strong (nebulizers/immunomodulators) (K = 2). (3) Insurance data which contains information about client managers deciding if a client company’s insurance request should be approved or denied (K = 2). Each of the datasets spans about three years in time. We do have the ground-truth of true labels associated with defendants/patients/insurance clients in the form of expert decisions and observed consequences for each of the datasets. Note, however, that we only use a small fraction (5%) of the available true labels during the learning process. The decision makers and items are associated with a variety of features in each of these datasets (Table 1). Baselines & Ablations. We benchmark the performance of CoT against the following state-of-theart baselines: Dawid-Skene Model (DS) [2], Single Confusion model (SC) [12], Hybrid Confusion Model (HC) [12], Joint Confusion Model (JC) [10]. DS, SC and HC models focus only on modeling decisions of individual decision makers and do not provide any diagnostic insights into the decision making process JC model, on the other hand, also provides diagnostic insights (via post processing) None of the baselines account for the temporal aspects. To evaluate the importance of the various components of our model, we also consider multiple ablations of CoT. Non-temporal CoT (NT-CoT) is a variant of CoT which does not incorporate the temporal component and hence is applicable to a single time instance. Non-intepretable CoT (NI-CoT) is another ablation which does not involve the prototype or subspace feature indicator vector generation, instead φ, φ′, and ρ are sampled from symmetric Dirichlet priors. Experimental Setup. In most real-world settings involving human decision making, the true labels of items are available for very few instances. We mimic this setting in our experiments by employing weak supervision. We let the all models (including the baselines) access the true labels of about 5% of the items (selected randomly) in the data during the learning phase. In all of our experiments, we divide each dataset into three discrete time chunks. Each time chunk corresponds to a year in the data. While our model can handle the temporal aspects explicitly, the same is not true for any of the baselines as well as the ablation Non-temporal CoT. To work around this, we run each of these models separately on data from each time slice. We run the collapsed Gibbs sampling inference until the approximate convergence of log-likelihood. All the hyperparameters of our model are initialized to standard values: ϵβ = ϵ′ β = ∧= π = ϵα = ϵ′ α = λ = µ = 1, σ = 0.1. The number of decision maker and item clusters L1 and L2 were set using the Bayesian Information Criterion (BIC) metric [14]. The parameters of all the other baselines were chosen similarly. 4.1 Evaluating Estimated Confusion Matrices and Predictive Power We evaluate CoT on estimating confusion matrices, predicting item labels, and predicting decisions of decision makers. We first present the details of each task and then discuss the results. Recovering Confusion Matrices. We experiment with the CoT model to determine how accurately it can recover decision maker confusion matrices. To measure this, we use the Mean Absolute Error 6 Task Predicting item labels Inferring confusion matrices Predicting decisions Method Bail Asthma Insurance Bail Asthma Insurance Bail Asthma Insurance SC 0.53 0.59 0.51 0.38 0.31 0.40 0.52 0.51 0.55 DS 0.61 0.63 0.64 0.32 0.28 0.36 0.56 0.58 0.58 HC 0.62 0.65 0.66 0.31 0.26 0.33 0.59 0.64 0.61 JC 0.64 0.68 0.69 0.26 0.19 0.29 0.64 0.67 0.66 LR 0.56 0.60 0.57 0.58 0.60 0.57 NT-CoT 0.65 0.68 0.69 0.24 0.19 0.28 0.66 0.68 0.66 NI-CoT 0.69 0.70 0.70 0.21 0.18 0.26 0.67 0.70 0.68 CoT 0.71 0.72 0.74 0.19 0.16 0.23 0.69 0.74 0.71 Gain % 9.86 5.56 6.76 36.84 18.75 26.09 7.25 9.46 7.04 Table 2: Experimental results: CoT consistently performs best across all tasks and datasets. Bottom row of the table indicates percentage gain of the CoT over the best performing baseline JC. (MAE) metric to compare the elements of the estimated confusion matrix (Θ′) and the observed confusion matrix (Θ). MAE of two such matrices is the sum of element wise differences: MAE(Θ, Θ′) = 1 K2 K X u=1 K X v=1 |Θu,v −Θ′ u,v| While the baseline models SC, DS, HC associate a single confusion matrix with each decision maker, the baseline JC and our model assume that each decision maker can have multiple confusion matrices (one per each item cluster). To ensure a fair comparison, we apply the MAE metric every time a decision maker judges an item choosing the appropriate confusion matrix and then compute the average MAE. Predicting Item Labels. We also evaluate the CoT on the task of predicting item labels. We use the AUC ROC metric to measure the predictive performance. In addition to the previously discussed baselines, we also compare the performance against Logistic Regression (LR) classifier. The LR model was provided decision maker and item features, time stamps, and decision maker decisions as input features. Predicting Evaluator Decisions. The CoT model can also be used to predict decision maker decisions. Recall that the decision maker decisions are regarded as observed variables through out the inference. However, we can leverage the values of all the latent variables learned during inference to predict the decision maker decisions. In order to execute this task, we divide the data into 10 folds and carry out the Gibbs sampling inference procedure on the first 9 folds where the decision maker decisions are observed. We then use the estimated latent variables to sample the decision maker decisions for the remaining fold. We repeat this process over each of the 10 folds and report average AUC. Results and Discussion. Results of all the tasks are presented in Table 2. CoT outperforms all the other baselines and ablations on all the tasks. The SC model which assumes that all the decision makers share a single confusion matrix performs extremely poorly compared to the other baselines, indicating that its assumptions are not valid in real-world datasets. The JC model, which groups similar decision makers and items together turns out to be one of the best performing baseline. The performance of our ablation models indicates that excluding the temporal aspects of the CoT causes a dip in the performance of the model on all the tasks. Furthermore, leaving out the interpretability components affects the model performance slightly. These results demonstrate the utility of the joint inference of temporal, interpretable aspects alongside decision maker confusions and cluster assignments. 4.2 Evaluating Interpretability In this section, we first present an evaluation of the quality of the clusters generated by the CoT model. We then discuss some of the qualitative insights obtained using CoT. 7 Model Purity Inverse Purity Bail Asthma Insurance Bail Asthma Insurance JC 0.67 0.71 0.74 0.63 0.66 0.67 NT-CoT 0.74 0.78 0.79 0.72 0.73 0.76 NI-CoT 0.72 0.76 0.78 0.67 0.71 0.72 CoT 0.83 0.84 0.81 0.78 0.79 0.82 Table 3: Average purity and inverse purity computed across all decision maker and item clusters. Figure 2: Estimated (top) and observed (bottom) confusion matrices for asthma dataset: These matrices correspond to the group of decision makers who have relatively little experience (# of years practising medicine = 0/1) and the group of patients with allergies but no past asthma attacks. Cluster Quality. The prototype and the subspace feature indicator vector of a cluster allow us to understand the nature of the instances in the cluster. For instance, if the subspace feature indicator vector signifies that gender is the one and only important feature for some decision maker cluster c and if the prototype of that cluster has value gender = female, then we can infer that c constitutes of female decision makers. Since we are able to associate each cluster with such patterns, we can readily define the notions of purity and inverse purity of a cluster. Consider cluster c from the example above again. Since the defining pattern of this cluster is gender = female, we can compute the purity of the cluster by calculating what fraction of the decision makers in the cluster are female. Similarly, we can also compute what fraction of all decision makers who are female and are assigned to cluster c. This is referred to as inverse purity. While purity metric captures the notion of cluster homogeneity, the inverse purity metric ensures cluster completeness. We compute the average purity and inverse purity metrics for the CoT, its ablation and a baseline JC across all the decision maker and item clusters and the results are presented in Table 3. Notice that CoT outperforms all the other ablations and the JC baseline. It is interesting to note that the non-interpretable CoT (NI-CoT) has much lower purity and inverse purity compared to non-temporal CoT (NT-CoT) as well as the CoT. This is partly due to the fact that the NI-CoT does not model prototypes or feature indicators which leads to less pure clusters. Qualitative Inspection of Insights. We now inspect the cluster descriptions and the corresponding confusion matrices generated by our approach. Figure 2 shows one of the insights obtained by our model on the asthma dataset. The confusion matrices presented in Figure 2 correspond to the group of doctors with 0/1 years of experience evaluating patients who have allergies but did not suffer from previous asthma attacks. The three confusion matrices, one for each year (from left to right), shown on the top row in Figure 2 correspond to our estimates and those on the bottom row are computed from the data. It can be seen that the estimated confusion matrices match very closely with the ground truth thus demonstrating the effectiveness of the CoT framework. Interpreting results in Figure 2, we find that doctors within the first year of their practice (left most confusion matrix) were recommending stronger treatments (nebulizers and immunomodulators) to patients who are likely to get better with milder treatments such as low impact drugs and inhalers. As time passed, they were able to better identify patients who could get better with milder options. This is a very interesting insight and we also found that such a pattern holds for client managers with relatively little experience. This could possibly mean that inexperienced decision makers are more likely to be risk averse, and therefore opt for safer choices. 8 References [1] J. Bien and R. Tibshirani. Prototype selection for interpretable classification. The Annals of Applied Statistics, pages 2403–2424, 2011. [2] A. P. Dawid and A. M. Skene. Maximum likelihood estimation of observer error-rates using the em algorithm. Applied Statistics, (1):20–28, 1979. [3] O. Dekel and O. Shamir. Vox populi: Collecting high-quality labels from a crowd. In COLT, 2009. [4] T. L. Griffiths and M. Steyvers. Finding scientific topics. Proceedings of the National Academy of Sciences, 101(suppl 1):5228–5235, 2004. [5] M. Joglekar, H. Garcia-Molina, and A. Parameswaran. Evaluating the crowd with confidence. In KDD, pages 686–694, 2013. [6] E. Kamar, S. Hacker, and E. Horvitz. Combining human and machine intelligence in large-scale crowdsourcing. In AAMAS, pages 467–474, 2012. [7] C. Kemp, J. B. Tenenbaum, T. L. Griffiths, T. Yamada, and N. Ueda. Learning systems of concepts with an infinite relational model. In AAAI, page 5, 2006. [8] B. Kim, C. Rudin, and J. A. Shah. The bayesian case model: A generative approach for case-based reasoning and prototype classification. In NIPS, pages 1952–1960. 2014. [9] H. Lakkaraju, S. H. Bach, and J. Leskovec. Interpretable decision sets: A joint framework for description and prediction. In KDD, pages 1675–1684, 2016. [10] H. Lakkaraju, J. Leskovec, J. Kleinberg, and S. Mullainathan. A bayesian framework for modeling human evaluations. In SDM, pages 181–189, 2015. [11] B. Letham, C. Rudin, T. H. McCormick, D. Madigan, et al. Interpretable classifiers using rules and bayesian analysis: Building a better stroke prediction model. The Annals of Applied Statistics, 9(3):1350–1371, 2015. [12] C. Liu and Y.-M. Wang. Truelabel + confusions: A spectrum of probabilistic models in analyzing multiple ratings. In ICML, pages 225–232, 2012. [13] Y. Lou, R. Caruana, and J. Gehrke. Intelligible models for classification and regression. In KDD, pages 150–158, 2012. [14] A. A. Neath and J. E. Cavanaugh. The bayesian information criterion: background, derivation, and applications. Wiley Interdisciplinary Reviews: Computational Statistics, 4(2):199–203, 2012. [15] K. Nowicki and T. A. B. Snijders. Estimation and prediction for stochastic blockstructures. Journal of the American Statistical Association, 96(455):1077–1087, 2001. [16] V. C. Raykar, S. Yu, L. H. Zhao, A. Jerebko, C. Florin, G. H. Valadez, L. Bogoni, and L. Moy. Supervised learning from multiple experts: Whom to trust when everyone lies a bit. In ICML, pages 889–896, 2009. [17] V. C. Raykar, S. Yu, L. H. Zhao, G. H. Valadez, C. Florin, L. Bogoni, and L. Moy. Learning from crowds. JMLR, pages 1297–1322, 2010. [18] R. Snow, B. O’Connor, D. Jurafsky, and A. Y. Ng. Cheap and fast—but is it good?: Evaluating non-expert annotations for natural language tasks. In EMNLP, pages 254–263, 2008. [19] J. Whitehill, P. Ruvolo, T. Wu, J. Bergsma, and J. R. Movellan. Whose vote should count more: Optimal integration of labels from labelers of unknown expertise. In NIPS, pages 2035–2043, 2009. [20] K. S. Xu and A. O. Hero III. Dynamic stochastic blockmodels: Statistical models for time-evolving networks. In International Conference on Social Computing, Behavioral-Cultural Modeling, and Prediction, pages 201–210. Springer, 2013. [21] D. Zhou, J. C. Platt, S. Basu, and Y. Mao. Learning from the wisdom of crowds by minimax entropy. In NIPS, pages 2204–2212, 2012. 9
2016
344
6,266
Measuring Neural Net Robustness with Constraints Osbert Bastani Stanford University obastani@cs.stanford.edu Yani Ioannou University of Cambridge yai20@cam.ac.uk Leonidas Lampropoulos University of Pennsylvania llamp@seas.upenn.edu Dimitrios Vytiniotis Microsoft Research dimitris@microsoft.com Aditya V. Nori Microsoft Research adityan@microsoft.com Antonio Criminisi Microsoft Research antcrim@microsoft.com Abstract Despite having high accuracy, neural nets have been shown to be susceptible to adversarial examples, where a small perturbation to an input can cause it to become mislabeled. We propose metrics for measuring the robustness of a neural net and devise a novel algorithm for approximating these metrics based on an encoding of robustness as a linear program. We show how our metrics can be used to evaluate the robustness of deep neural nets with experiments on the MNIST and CIFAR-10 datasets. Our algorithm generates more informative estimates of robustness metrics compared to estimates based on existing algorithms. Furthermore, we show how existing approaches to improving robustness “overfit” to adversarial examples generated using a specific algorithm. Finally, we show that our techniques can be used to additionally improve neural net robustness both according to the metrics that we propose, but also according to previously proposed metrics. 1 Introduction Recent work [21] shows that it is often possible to construct an input mislabeled by a neural net by perturbing a correctly labeled input by a tiny amount in a carefully chosen direction. Lack of robustness can be problematic in a variety of settings, such as changing camera lens or lighting conditions, successive frames in a video, or adversarial attacks in security-critical applications [18]. A number of approaches have since been proposed to improve robustness [6, 5, 1, 7, 20]. However, work in this direction has been handicapped by the lack of objective measures of robustness. A typical approach to improving the robustness of a neural net f is to use an algorithm A to find adversarial examples, augment the training set with these examples, and train a new neural net f ′ [5]. Robustness is then evaluated by using the same algorithm A to find adversarial examples for f ′—if A discovers fewer adversarial examples for f ′ than for f, then f ′ is concluded to be more robust than f. However, f ′ may have overfit to adversarial examples generated by A—in particular, a different algorithm A′ may find as many adversarial examples for f ′ as for f. Having an objective robustness measure is vital not only to reliably compare different algorithms, but also to understand robustness of production neural nets—e.g., when deploying a login system based on face recognition, a security team may need to evaluate the risk of an attack using adversarial examples. In this paper, we study the problem of measuring robustness. We propose to use two statistics of the robustness ρ(f, x∗) of f at point x∗(i.e., the L∞distance from x∗to the nearest adversarial example) [21]. The first one measures the frequency with which adversarial examples occur; the other measures the severity of such adversarial examples. Both statistics depend on a parameter ϵ, which intuitively specifies the threshold below which adversarial examples should not exist (i.e., points x with L∞distance to x∗less than ϵ should be assigned the same label as x∗). 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. The key challenge is efficiently computing ρ(f, x∗). We give an exact formulation of this problem as an intractable optimization problem. To recover tractability, we approximate this optimization problem by constraining the search to a convex region Z(x∗) around x∗. Furthermore, we devise an iterative approach to solving the resulting linear program that produces an order of magnitude speed-up. Common neural nets (specifically, those using rectified linear units as activation functions) are in fact piecewise linear functions [15]; we choose Z(x∗) to be the region around x∗on which f is linear. Since the linear nature of neural nets is often the cause of adversarial examples [5], our choice of Z(x∗) focuses the search where adversarial examples are most likely to exist. We evaluate our approach on a deep convolutional neural network f for MNIST. We estimate ρ(f, x∗) using both our algorithm ALP and (as a baseline) the algorithm AL-BFGS introduced by [21]. We show that ALP produces a substantially more accurate estimate of ρ(f, x∗) than AL-BFGS. We then use data augmentation with each algorithm to improve the robustness of f, resulting in fine-tuned neural nets fLP and fL-BFGS. According to AL-BFGS, fL-BFGS is more robust than f, but not according to ALP. In other words, fL-BFGS overfits to adversarial examples computed using AL-BFGS. In contrast, fLP is more robust according to both AL-BFGS and ALP. Furthermore, to demonstrate scalability, we apply our approach to evaluate the robustness of the 23-layer network-in-network (NiN) neural net [13] for CIFAR-10, and reveal a surprising lack of robustness. We fine-tune NiN and show that robustness improves, albeit only by a small amount. In summary, our contributions are: • We formalize the notion of pointwise robustness studied in previous work [5, 21, 6] and propose two statistics for measuring robustness based on this notion (§2). • We show how computing pointwise robustness can be encoded as a constraint system (§3). We approximate this constraint system with a tractable linear program and devise an optimization for solving this linear program an order of magnitude faster (§4). • We demonstrate experimentally that our algorithm produces substantially more accurate measures of robustness compared to algorithms based on previous work, and show evidence that neural nets fine-tuned to improve robustness (§5) can overfit to adversarial examples identified by a specific algorithm (§6). 1.1 Related work The susceptibility of neural nets to adversarial examples was discovered by [21]. Given a test point x∗with predicted label ℓ∗, an adversarial example is an input x∗+ r with predicted label ℓ̸= ℓ∗ where the adversarial perturbation r is small (in L∞norm). Then, [21] devises an approximate algorithm for finding the smallest possible adversarial perturbation r. Their approach is to minimize the combined objective loss(f(x∗+ r), ℓ) + c∥r∥∞, which is an instance of box-constrained convex optimization that can be solved using L-BFGS-B. The constant c is optimized using line search. Our formalization of the robustness ρ(f, x∗) of f at x∗corresponds to the notion in [21] of finding the minimal ∥r∥∞. We propose an exact algorithm for computing ρ(f, x∗) as well as a tractable approximation. The algorithm in [21] can also be used to approximate ρ(f, x∗); we show experimentally that our algorithm is substantially more accurate than [21]. There has been a range of subsequent work studying robustness; [17] devises an algorithm for finding purely synthetic adversarial examples (i.e., no initial image x∗), [22] searches for adversarial examples using random perturbations, showing that adversarial examples in fact exist in large regions of the pixel space, [19] shows that even intermediate layers of neural nets are not robust to adversarial noise, and [3] seeks to explain why neural nets may generalize well despite poor robustness properties. Starting with [5], a major focus has been on devising faster algorithms for finding adversarial examples. Their idea is that adversarial examples can then be computed on-the-fly and used as training examples, analogous to data augmentation approaches typically used to train neural nets [10]. To find adversarial examples quickly, [5] chooses the adversarial perturbation r to be in the direction of the signed gradient of loss(f(x∗+ r), ℓ) with fixed magnitude. Intuitively, given only the gradient of the loss function, this choice of r is most likely to produce an adversarial example with ∥r∥∞≤ϵ. In this direction, [16] improves upon [5] by taking multiple gradient steps, [7] extends this idea to norms beyond the L∞norm, [6] takes the approach of [21] but fixes c, and [20] formalizes [5] as robust optimization. A key shortcoming of these lines of work is that robustness is typically measured using the same algorithm used to find adversarial examples, in which case the resulting neural net may have overfit 2 to adversarial examples generating using that algorithm. For example, [5] shows improved accuracy to adversarial examples generated using their own signed gradient method, but do not consider whether robustness increases for adversarial examples generated using more precise approaches such as [21]. Similarly, [7] compares accuracy to adversarial examples generated using both itself and [5] (but not [21]), and [20] only considers accuracy on adversarial examples generated using their own approach on the baseline network. The aim of our paper is to provide metrics for evaluating robustness, and to demonstrate the importance of using such impartial measures to compare robustness. Additionally, there has been work on designing neural network architectures [6] and learning procedures [1] that improve robustness to adversarial perturbations, though they do not obtain state-of-theart accuracy on the unperturbed test sets. There has also been work using smoothness regularization related to [5] to train neural nets, focusing on improving accuracy rather than robustness [14]. Robustness has also been studied in more general contexts; [23] studies the connection between robustness and generalization, [2] establishes theoretical lower bounds on the robustness of linear and quadratic classifiers, and [4] seeks to improve robustness by promoting resiliance to deleting features during training. More broadly, robustness has been identified as a desirable property of classifiers beyond prediction accuracy. Traditional metrics such as (out-of-sample) accuracy, precision, and recall help users assess prediction accuracy of trained models; our work aims to develop analogous metrics for assessing robustness. 2 Robustness Metrics Consider a classifier f : X →L, where X ⊆Rn is the input space and L = {1, ..., L} are the labels. We assume that training and test points x ∈X have distribution D. We first formalize the notion of robustness at a point, and then describe two statistics to measure robustness. Our two statistics depend on a parameter ϵ, which captures the idea that we only care about robustness below a certain threshold—we disregard adversarial examples x whose L∞distance to x∗is greater than ϵ. We use ϵ = 20 in our experiments on MNIST and CIFAR-10 (on the pixel scale 0-255). Pointwise robustness. Intuitively, f is robust at x∗∈X if a “small” perturbation to x∗does not affect the assigned label. We are interested in perturbations sufficiently small that they do not affect human classification; an established condition is ∥x −x∗∥∞≤ϵ for some parameter ϵ. Formally, we say f is (x∗, ϵ)-robust if for every x such that ∥x −x∗∥∞≤ϵ, f(x) = f(x∗). Finally, the pointwise robustness ρ(f, x∗) of f at x∗is the minimum ϵ for which f fails to be (x∗, ϵ)-robust: ρ(f, x∗) def = inf{ϵ ≥0 | f is not (x∗, ϵ)-robust}. (1) This definition formalizes the notion of robustness in [5, 6, 21]. Adversarial frequency. Given a parameter ϵ, the adversarial frequency φ(f, ϵ) def = Prx∗∼D[ρ(f, x∗) ≤ϵ] measures how often f fails to be (x∗, ϵ)-robust. In other words, if f has high adversarial frequency, then it fails to be (x∗, ϵ)-robust for many inputs x∗. Adversarial severity. Given a parameter ϵ, the adversarial severity µ(f, ϵ) def = Ex∗∼D[ρ(f, x∗) | ρ(f, x∗) ≤ϵ] measures the severity with which f fails to be robust at x∗conditioned on f not being (x∗, ϵ)-robust. We condition on pointwise robustness since once f is (x∗, ϵ)-robust at x∗, then the degree to which f is robust at x∗does not matter. Smaller µ(f, ϵ) corresponds to worse adversarial severity, since f is more susceptible to adversarial examples if the distances to the nearest adversarial example are small. The frequency and severity capture different robustness behaviors. A neural net may have high adversarial frequency but low adversarial severity, indicating that most adversarial examples are about ϵ distance away from the original point x∗. Conversely, a neural net may have low adversarial frequency but high adversarial severity, indicating that it is typically robust, but occasionally severely fails to be robust. Frequency is typically the more important metric, since a neural net with low adversarial frequency is robust most of the time. Indeed, adversarial frequency corresponds to the 3 (a) (b) Figure 1: Neural net with a single hidden layer and ReLU activations trained on dataset with binary labels. (a) The training data and loss surface. (b) The linear region corresponding to the red training point. (a) (b) (c) (d) (e) (f) Figure 2: For MNIST, (a) an image classified 1, (b) its adversarial example classifed 3, and (c) the (scaled) adversarial perturbation. For CIFAR-10, (d) an image classified as “automobile”, (e) its adversarial example classified as “truck”, and (f) the (scaled) adversarial perturbation. accuracy on adversarial examples used to measure robustness in [5, 20]. Severity can be used to differentiate between neural nets with similar adversarial frequency. Given a set of samples X ⊆X drawn i.i.d. from D, we can estimate φ(f, ϵ) and µ(f, ϵ) using the following standard estimators, assuming we can compute ρ: ˆφ(f, ϵ, X) def = |{x∗∈X | ρ(f, x∗) ≤ϵ}| |X| ˆµ(f, ϵ, X) def = P x∗∈X ρ(f, x∗)I[ρ(f, x∗) ≤ϵ] |{x∗∈X | ρ(f, x∗) ≤ϵ}| . An approximation ˆρ(f, x∗) ≈ρ(f, x∗) of ρ, such as the one we describe in Section 4, can be used in place of ρ. In practice, X is taken to be the test set Xtest. 3 Computing Pointwise Robustness 3.1 Overview Consider the training points in Figure 1 (a) colored based on the ground truth label. To classify this data, we train a two-layer neural net f(x) = arg maxℓ{(W2g(W1x))ℓ}, where the ReLU function g is applied pointwise. Figure 1 (a) includes contours of the per-point loss function of this neural net. Exhaustively searching the input space to determine the distance ρ(f, x∗) to the nearest adversarial example for input x∗(labeled ℓ∗) is intractable. Recall that neural nets with rectified-linear (ReLU) units as activations are piecewise linear [15]. Since adversarial examples exist because of this linearity in the neural net [5], we restrict our search to the region Z(x∗) around x∗on which the neural net is linear. This region around x∗is defined by the activation of the ReLU function: for each i, if (W1x∗)i ≥0 (resp., (W1x∗) ≤0), we constrain to the half-space {x | (W1x)i ≥0} (resp., {x | (W1x)i ≤0}). The intersection of these half-spaces is convex, so it admits efficient search. Figure 1 (b) shows one such convex region 1. Additionally, x is labeled ℓexactly when f(x)ℓ≥f(x)ℓ′ for each ℓ′ ̸= ℓ. These constraints are linear since f is linear on Z(x∗). Therefore, we can find the distance to the nearest input with label ℓ̸= ℓ∗ by minimizing ∥x −x∗∥∞on Z(x∗). Finally, we can perform this search for each label ℓ̸= ℓ∗, though for efficiency we take ℓto be the label assigned the second-highest score by f. Figure 1 (b) shows the adversarial example found by our algorithm in our running example. In Figure 1 note that the direction of the nearest adversarial example is not necessary aligned with the signed gradient of the loss function, as observed by others [7]. 1Our neural net has 8 hidden units, but for this x∗, 6 of the half-spaces entirely contain the convex region. 4 3.2 Formulation as Optimization We compute ρ(f, ϵ) by expressing (1) as constraints C, which consist of • Linear relations; specifically, inequalities C ≡(wT x + b ≥0) and equalities C ≡(wT x + b = 0), where x ∈Rm (for some m) are variables and w ∈Rm, b ∈R are constants. • Conjunctions C ≡C1 ∧C2, where C1 and C2 are themselves constraints. Both constraints must be satisfied for the conjunction to be satisfied. • Disjunctions C ≡C1∨C2, where C1 and C2 are themselves constraints. One of the constraints must be satisfied for the disjunction to be satisfied. The feasible set F(C) of C is the set of x ∈Rm that satisfy C; C is satisfiable if F(C) is nonempty. In the next section, we show that the condition f(x) = ℓcan be expressed as constraints Cf(x, ℓ); i.e., f(x) = ℓif and only if Cf(x, ℓ) is satisfiable. Then, ρ(f, ϵ) can be computed as follows: ρ(f, x∗) = min ℓ̸=ℓ∗ρ(f, x∗, ℓ) (2) ρ(f, x∗, ℓ) def = inf{ϵ ≥0 | Cf(x, ℓ) ∧∥x −x∗∥∞≤ϵ satisfiable}. (3) The optimization problem is typically intractable; we describe a tractable approximation in §4. 3.3 Encoding a Neural Network We show how to encode the constraint f(x) = ℓas constraints Cf(x, ℓ) when f is a neural net. We assume f has form f(x) = arg maxℓ∈L  f (k)(f (k−1)(...(f (1)(x))...))  ℓ , where the ith layer of the network is a function f (i) : Rni−1 →Rni, with n0 = n and nk = |L|. We describe the encoding of fully-connected and ReLU layers; convolutional layers are encoded similarly to fully-connected layers and max-pooling layers are encoded similarly to ReLU layers. We introduce the variables x(0), . . . , x(k) into our constraints, with the interpretation that x(i) represents the output vector of layer i of the network; i.e., x(i) = f (i)(x(i−1)). The constraint Cin(x) ≡(x(0) = x) encodes the input layer. For each layer f (i), we encode the computation of x(i) given x(i−1) as a constraint Ci. Fully-connected layer. In this case, x(i) = f (i)(x(i−1)) = W (i)x(i−1) + b(i), which we encode using the constraints Ci ≡Vni j=1 n x(i) j = W (i) j x(i−1) + b(i) j o , where W (i) j is the j-th row of W (i). ReLU layer. In this case, x(i) j = max {x(i−1) j , 0} (for each 1 ≤j ≤ni), which we encode using the constraints Ci ≡Vni j=1 Cij, where Cij = (x(i−1) j <0 ∧x(i) j =0) ∨(x(i−1) j ≥0 ∧x(i) j =x(i−1) j ). Finally, the constraints Cout(ℓ) ≡V ℓ′̸=ℓ n x(k) ℓ ≥x(k) ℓ′ o ensure that the output label is ℓ. Together, the constraints Cf(x, ℓ) ≡Cin(x) ∧ Vk i=1 Ci  ∧Cout(ℓ) encodes the computation of f: Theorem 1 For any x ∈X and ℓ∈L, we have f(x) = ℓif and only if Cf(x, ℓ) is satisfiable. 4 Approximate Computation of Pointwise Robustness Convex restriction. The challenge to solving (3) is the non-convexity of the feasible set of Cf(x, ℓ). To recover tractability, we approximate (3) by constraining the feasible set to x ∈Z(x∗), where Z(x∗) ⊆X is carefully chosen so that the constraints ˆCf(x, ℓ) ≡Cf(x, ℓ) ∧(x ∈Z(x∗)) have convex feasible set. We call ˆCf(x, ℓ) the convex restriction of Cf(x, ℓ). In some sense, convex restriction is the opposite of convex relaxation. Then, we can approximately compute robustness: ˆρ(f, x∗, ℓ) def = inf{ϵ ≥0 | ˆCf(x, ℓ) ∧∥x −x∗∥∞≤ϵ satisfiable}. (4) The objective is optimized over x ∈Z(x∗), which approximates the optimum over x ∈X. 5 Choice of Z(x∗). We construct Z(x∗) as the feasible set of constraints D(x∗); i.e., Z(x∗) = F(D(x∗)). We now describe how to construct D(x∗). Note that F(wT x + b = 0) and F(wT x + b ≥0) are convex sets. Furthermore, if F(C1) and F(C2) are convex, then so is their conjunction F(C1 ∧C2). However, their disjunction F(C1 ∨C2) may not be convex; for example, F((x ≥0) ∨(y ≥0)). The potential non-convexity of disjunctions makes (3) difficult to optimize. We can eliminate disjunction operations by choosing one of the two disjuncts to hold. For example, note that for C1 ≡C2 ∨C3, we have both F(C2) ⊆F(C1) and F(C3) ⊆F(C1). In other words, if we replace C1 with either C2 or C3, the feasible set of the resulting constraints can only become smaller. Taking D(x∗) ≡C2 (resp., D(x∗) ≡C3) effectively replaces C1 with C2 (resp., C3). To restrict (3), for every disjunction C1 ≡C2 ∨C3, we systematically choose either C2 or C3 to replace the constraint C1. In particular, we choose C2 if x∗satisfies C2 (i.e., x∗∈F(C2)) and choose C3 otherwise. In our constraints, disjunctions are always mutually exclusive, so x∗never simultaneously satisfies both C2 and C3. We then take D(x∗) to be the conjunction of all our choices. The resulting constraints ˆCf(x, ℓ) contains only conjunctions of linear relations, so its feasible set is convex. In fact, it can be expressed as a linear program (LP) and can be solved using any standard LP solver. For example, consider a rectified linear layer (as before, max pooling layers are similar). The original constraint added for unit j of rectified linear layer f (i) is  x(i−1) j ≤0 ∧x(i) j = 0  ∨  x(i−1) j ≥0 ∧x(i) j = x(i−1) j  To restrict this constraint, we evaluate the neural network on the seed input x∗and look at the input to f (i), which equals x(i−1) ∗ = f (i−1)(...(f (1)(x∗))...). Then, for each 1 ≤j ≤ni: D(x∗) ←D(x∗) ∧ ( x(i−1) j ≤0 ∧x(i) j = x(i−1) j if (x(i−1) ∗ )j ≤0 x(i−1) j ≥0 ∧x(i) j = 0 if (x(i−1) ∗ )j > 0. Iterative constraint solving. We implement an optimization for solving LPs by lazily adding constraints as necessary. Given all constraints C, we start off solving the LP with the subset of equality constraints ˆC ⊆C, which yields a (possibly infeasible) solution z. If z is feasible, then z is also an optimal solution to the original LP; otherwise, we add to ˆC the constraints in C that are not satisfied by z and repeat the process. This process always yields the correct solution, since in the worst case ˆC becomes equal to C. In practice, this optimization is an order of magnitude faster than directly solving the LP with constraints C. Single target label. For simplicity, rather than minimize over ρ(f, x∗, ℓ) for each ℓ̸= ℓ∗, we fix ℓ to be the second most probable label ˜f(x∗); i.e., ˆρ(f, x∗) def = inf{ϵ ≥0 | ˆCf(x, ˜f(x∗)) ∧∥x −x∗∥∞≤ϵ satisfiable}. (5) Approximate robustness statistics. We can use ˆρ in our statistics ˆφ and ˆµ defined in §2. Because ˆρ is an overapproximation of ρ (i.e., ˆρ(f, x∗) ≥ρ(f, x∗)), the estimates ˆφ and ˆµ may not be unbiased (in particular, ˆφ(f, ϵ) ≤φ(f, ϵ)). In §6, we show empirically that our algorithm produces substantially less biased estimates than existing algorithms for finding adversarial examples. 5 Improving Neural Net Robustness Finding adversarial examples. We can use our algorithm for estimating ˆρ(f, x∗) to compute adversarial examples. Given x∗, the value of x computed by the optimization procedure used to solve (5) is an adversarial example for x∗with ∥x −x∗∥∞= ˆρ(f, x∗). Finetuning. We use fine-tuning to reduce a neural net’s susceptability to adversarial examples. First, we use an algorithm A to compute adversarial examples for each x∗∈Xtrain and add them to the training set. Then, we continue training the network on a the augmented training set at a reduced training rate. We can repeat this process multiple rounds (denoted T); at each round, we only consider x∗in the original training set (rather than the augmented training set). 6 Neural Net Accuracy (%) Adversarial Frequency (%) Adversarial Severity (pixels) Baseline Our Algo. Baseline Our Algo. LeNet (Original) 99.08 1.32 7.15 11.9 12.4 Baseline (T = 1) 99.14 1.02 6.89 11.0 12.3 Baseline (T = 2) 99.15 0.99 6.97 10.9 12.4 Our Algo. (T = 1) 99.17 1.18 5.40 12.8 12.2 Our Algo. (T = 2) 99.23 1.12 5.03 12.2 11.7 Table 1: Evaluation of fine-tuned networks. Our method discovers more adversarial examples than the baseline [21] for each neural net, hence producing better estimates. LeNet fine-tuned for T = 1, 2 rounds (bottom four rows) exhibit a notable increase in robustness compared to the original LeNet. (a) (b) (c) Figure 3: The cumulative number of test points x∗such that ρ(f, x∗) ≤ϵ as a function of ϵ. In (a) and (b), the neural nets are the original LeNet (black), LeNet fine-tuned with the baseline and T = 2 (red), and LeNet fine-tuned with our algorithm and T = 2 (blue); in (a), ˆρ is measured using the baseline, and in (b), ˆρ is measured using our algorithm. In (c), the neural nets are the original NiN (black) and NiN finetuned with our algorithm, and ˆρ is estimated using our algorithm. Rounding errors. MNIST images are represented as integers, so we must round the perturbation to obtain an image, which oftentimes results in non-adversarial examples. When fine-tuning, we add a constraint x(k) ℓ ≥x(k) ℓ′ + α for all ℓ′ ̸= ℓ, which eliminates this problem by ensuring that the neural net has high confidence on its adversarial examples. In our experiments, we fix α = 3.0. Similarly, we modified the L-BFGS-B baseline so that during the line search over c, we only count x∗+r as adversarial if x(k) ℓ ≥x(k) ℓ′ +α for all ℓ′ ̸= ℓ. We choose α = 0.15, since larger α causes the baseline to find significantly fewer adversarial examples, and small α results in smaller improvement in robustness. With this choice, rounding errors occur on 8.3% of the adversarial examples we find on the MNIST training set. 6 Experiments 6.1 Adversarial Images for CIFAR-10 and MNIST We find adversarial examples for the neural net LeNet [12] (modified to use ReLUs instead of sigmoids) trained to classify MNIST [11], and for the network-in-network (NiN) neural net [13] trained to classify CIFAR-10 [9]. Both neural nets are trained using Caffe [8]. For MNIST, Figure 2 (b) shows an adversarial example (labeled 1) we find for the image in Figure 2 (a) labeled 3, and Figure 2 (c) shows the corresponding adversarial perturbation scaled so the difference is visible (it has L∞norm 17). For CIFAR-10, Figure 2 (e) shows an adversarial example labeled “truck” for the image in Figure 2 (d) labeled “automobile”, and Figure 2 (f) shows the corresponding scaled adversarial perturbation (which has L∞norm 3). 6.2 Comparison to Other Algorithms on MNIST We compare our algorithm for estimating ρ to the baseline L-BFGS-B algorithm proposed by [21]. We use the tool provided by [22] to compute this baseline. For both algorithms, we use adversarial target label ℓ= ˜f(x∗). We use LeNet in our comparisons, since we find that it is substantially more robust than the neural nets considered in most previous work (including [21]). We also use versions 7 of LeNet fine-tuned using both our algorithm and the baseline with T = 1, 2. To focus on the most severe adversarial examples, we use a stricter threshold for robustness of ϵ = 20 pixels. We performed a similar comparison to the signed gradient algorithm proposed by [5] (with the signed gradient multiplied by ϵ = 20 pixels). For LeNet, this algorithm found only one adversarial example on the MNIST test set (out of 10,000) and four adversarial examples on the MNIST training set (out of 60,000), so we omit results 2. Results. In Figure 3, we plot the number of test points x∗for which ˆρ(f, x∗) ≤ϵ, as a function of ϵ, where ˆρ(f, x∗) is estimated using (a) the baseline and (b) our algorithm. These plots compare the robustness of each neural network as a function of ϵ. In Table 1, we show results evaluating the robustness of each neural net, including the adversarial frequency and the adversarial severity. The running time of our algorithm and the baseline algorithm are very similar; in both cases, computing ˆρ(f, x∗) for a single input x∗takes about 1.5 seconds. For comparison, without our iterative constraint solving optimization, our algorithm took more than two minutes to run. Discussion. For every neural net, our algorithm produces substantially higher estimates of the adversarial frequency. In other words, our algorithm estimates ˆρ(f, x∗) with substantially better accuracy compared to the baseline. According to the baseline metrics shown in Figure 3 (a), the baseline neural net (red) is similarly robust to our neural net (blue), and both are more robust than the original LeNet (black). Our neural net is actually more robust than the baseline neural net for smaller values of ϵ, whereas the baseline neural net eventually becomes slightly more robust (i.e., where the red line dips below the blue line). This behavior is captured by our robustness statistics—the baseline neural net has lower adversarial frequency (so it has fewer adversarial examples with ˆρ(f, x∗) ≤ϵ) but also has worse adversarial severity (since its adversarial examples are on average closer to the original points x∗). However, according to our metrics shown in Figure 3 (b), our neural net is substantially more robust than the baseline neural net. Again, this is reflected by our statistics—our neural net has substantially lower adversarial frequency compared to the baseline neural net, while maintaining similar adversarial severity. Taken together, our results suggest that the baseline neural net is overfitting to the adversarial examples found by the baseline algorithm. In particular, the baseline neural net does not learn the adversarial examples found by our algorithm. On the other hand, our neural net learns both the adversarial examples found by our algorithm and those found by the baseline algorithm. 6.3 Scaling to CIFAR-10 We also implemented our approach for the for the CIFAR-10 network-in-network (NiN) neural net [13], which obtains 91.31% test set accuracy. Computing ˆρ(f, x∗) for a single input on NiN takes about 10-15 seconds on an 8-core CPU. Unlike LeNet, NiN suffers severely from adversarial examples—we measure a 61.5% adversarial frequency and an adversarial severity of 2.82 pixels. Our neural net (NiN fine-tuned using our algorithm and T = 1) has test set accuracy 90.35%, which is similar to the test set accuracy of the original NiN. As can be seen in Figure 3 (c), our neural net improves slightly in terms of robustness, especially for smaller ϵ. As before, these improvements are reflected in our metrics—the adversarial frequency of our neural net drops slightly to 59.6%, and the adversarial severity improves to 3.88. Nevertheless, unlike LeNet, our fine-tuned version of NiN remains very prone to adversarial examples. In this case, we believe that new techniques are required to significantly improve robustness. 7 Conclusion We have shown how to formulate, efficiently estimate, and improve the robustness of neural nets using an encoding of the robustness property as a constraint system. Future work includes devising better approaches to improving robustness on large neural nets such as NiN and studying properties beyond robustness. 2Futhermore, the signed gradient algorithm cannot be used to estimate adversarial severity since all the adversarial examples it finds have L∞norm ϵ. 8 References [1] K. Chalupka, P. Perona, and F. Eberhardt. Visual causal feature learning. 2015. [2] A. Fawzi, O. Fawzi, and P. Frossard. Analysis of classifers’ robustness to adversarial perturbations. ArXiv e-prints, 2015. [3] Jiashi Feng, Tom Zahavy, Bingyi Kang, Huan Xu, and Shie Mannor. Ensemble robustness of deep learning algorithms. arXiv preprint arXiv:1602.02389, 2016. [4] Amir Globerson and Sam Roweis. Nightmare at test time: robust learning by feature deletion. In Proceedings of the 23rd international conference on Machine learning, pages 353–360. ACM, 2006. [5] Ian J. Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. 2015. [6] S. Gu and L. Rigazio. Towards deep neural network architectures robust to adversarial examples. 2014. [7] Ruitong Huang, Bing Xu, Dale Schuurmans, and Csaba Szepesvári. Learning with a strong adversary. CoRR, abs/1511.03034, 2015. [8] Yangqing Jia, Evan Shelhamer, Jeff Donahue, Sergey Karayev, Jonathan Long, Ross Girshick, Sergio Guadarrama, and Trevor Darrell. Caffe: Convolutional architecture for fast feature embedding. arXiv preprint arXiv:1408.5093, 2014. [9] Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images, 2009. [10] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E. Hinton. Imagenet classification with deep convolutional neural networks. 2012. [11] Yann LeCun, Léon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278–2324, 1998. [12] Yann LeCun, Léon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to document recognition. In S. Haykin and B. Kosko, editors, Intelligent Signal Processing, pages 306–351. IEEE Press, 2001. [13] Min Lin, Qiang Chen, and Shuicheng Yan. Network In Network. CoRR, abs/1312.4400, 2013. [14] Takeru Miyato, Shin-ichi Maeda, Masanori Koyama, Ken Nakae, and Shin Ishii. Distributional smoothing with virtual adversarial training. stat, 1050:25, 2015. [15] Guido F. Montúfar, Razvan Pascanu, KyungHyun Cho, and Yoshua Bengio. On the number of linear regions of deep neural networks. In Advances in Neural Information Processing Systems 27: Annual Conference on Neural Information Processing Systems 2014, December 8-13 2014, Montreal, Quebec, Canada, pages 2924–2932, 2014. [16] Seyed Mohsen Moosavi Dezfooli, Alhussein Fawzi, and Pascal Frossard. Deepfool: a simple and accurate method to fool deep neural networks. In Proceedings of 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), number EPFL-CONF-218057, 2016. [17] Anh Nguyen, Jason Yosinski, and Jeff Clune. Deep neural networks are easily fooled: High confidence predictions for unrecognizable images. In Computer Vision and Pattern Recognition (CVPR), 2015 IEEE Conference on, pages 427–436. IEEE, 2015. [18] Nicolas Papernot, Patrick McDaniel, Ian Goodfellow, Somesh Jha, Z Berkay Celik, and Ananthram Swami. Practical black-box attacks against deep learning systems using adversarial examples. arXiv preprint arXiv:1602.02697, 2016. [19] Sara Sabour, Yanshuai Cao, Fartash Faghri, and David J Fleet. Adversarial manipulation of deep representations. arXiv preprint arXiv:1511.05122, 2015. [20] Uri Shaham, Yutaro Yamada, and Sahand Negahban. Understanding adversarial training: Increasing local stability of neural nets through robust optimization. arXiv preprint arXiv:1511.05432, 2015. [21] Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, and Rob Fergus. Intriguing properties of neural networks. 2014. [22] Pedro Tabacof and Eduardo Valle. Exploring the space of adversarial images. CoRR, abs/1510.05328, 2015. [23] Huan Xu and Shie Mannor. Robustness and generalization. Machine learning, 86(3):391–423, 2012. 9
2016
345
6,267
The Power of Adaptivity in Identifying Statistical Alternatives Kevin Jamieson, Daniel Haas, Ben Recht University of California, Berkeley Berkeley, CA 94720 {kjamieson,dhaas,brecht}@eecs.berkeley.edu Abstract This paper studies the trade-off between two different kinds of pure exploration: breadth versus depth. We focus on the most biased coin problem, asking how many total coin flips are required to identify a “heavy” coin from an infinite bag containing both “heavy” coins with mean ✓1 2 (0, 1), and “light" coins with mean ✓0 2 (0, ✓1), where heavy coins are drawn from the bag with proportion ↵2 (0, 1/2). When ↵, ✓0, ✓1 are unknown, the key difficulty of this problem lies in distinguishing whether the two kinds of coins have very similar means, or whether heavy coins are just extremely rare. While existing solutions to this problem require some prior knowledge of the parameters ✓0, ✓1, ↵, we propose an adaptive algorithm that requires no such knowledge yet still obtains near-optimal sample complexity guarantees. In contrast, we provide a lower bound showing that non-adaptive strategies require at least quadratically more samples. In characterizing this gap between adaptive and nonadaptive strategies, we make connections to anomaly detection and prove lower bounds on the sample complexity of differentiating between a single parametric distribution and a mixture of two such distributions. 1 Introduction The trade-off between exploration and exploitation has been an ever-present trope in the online learning literature. In contrast, this paper studies the trade-off between two different kinds of pure exploration: breadth versus depth. Consider a bag that contains an infinite number of two kinds of biased coins: “heavy” coins with mean ✓1 2 (0, 1) and “light” coins with mean ✓0 2 (0, ✓1). When a player picks a coin from the bag, with probability ↵the coin is “heavy” and with probability (1 −↵) the coin is “light.” The player can flip any coin she picks from the bag as many times as she wants, and the goal is to identify a heavy coin using as few total flips as possible. When ↵, ✓0, ✓1 are unknown, the key difficulty of this problem lies in distinguishing whether the two kinds of coins have very similar means, or whether heavy coins are just extremely rare. That is, how does one balance flipping an individual coin many times to better estimate its mean against considering many new coins to maximize the probability of observing a heavy one. Previous work has only proposed solutions that rely on some or full knowledge ↵, ✓0, ✓1, limiting their applicability. In this work we propose the first algorithm that requires no knowledge of ↵, ✓0, ✓1, is guaranteed to return a heavy coin with probability at least 1 −δ, and flips a total number of coins, in expectation, that nearly matches known lower bounds. Moreover, our fully adaptive algorithm supports more general sub-Gaussian sources in addition to just coins, and only ever has one “coin” outside the bag at a given time, a constraint of practical importance to some applications. In addition, we connect the most biased coin problem to anomaly detection and prove novel lower bounds on the difficulty of detecting the presence of a mixture versus just a single component of a known family of distributions (e.g. X ⇠(1 −↵)g✓0 + ↵g✓1 versus X ⇠g✓for some ✓). We show that in detecting the presence of a mixture distribution, there is a stark difference of difficulty 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. between when the underlying distribution parameters are known (e.g. ↵, ✓0, ✓1) and when they are not. The most biased coin problem can be viewed as an online, adaptive mixture detection problem where source distributions arrive one at a time that are either g✓0 with probability (1 −↵) or g✓1 with probability ↵(e.g. null or anomolous) and the player adaptively chooses how many samples to take from each distribution (to increase the signal-to-noise ratio) with the goal of identifying an anomolous distribution f✓1 using as few total number of samples as possible. This work draws a contrast between the power of an adaptive versus non-adaptive (e.g. taking the same number of samples each time) approaches to this problem, specifically when ↵, ✓0, ✓1 are unknown. 1.1 Motivation and Related Work for the Most Biased Coin Problem The most biased coin problem characterizes the inherent difficulty of real-world problems including anomaly and intrusion detection and discovery of vacant frequencies in the radio spectrum. Our interest in the problem stemmed from automated hiring of crowd workers: data labeling for machine learning applications is often performed by humans, and recent work in the crowdsourcing literature accelerates labeling by organizing workers into pools of labelers and paying them to wait for incoming data [4, 12]. Workers hired on marketplaces such as Amazon’s Mechanical Turk [16] vary widely in skill, and identifying high-quality workers as quickly as possible is an important challenge. We can model each worker’s performance (e.g. accuracy or speed) as a random variable so that selecting a good worker is equivalent to identifying a worker with a high mean. Since we do not observe a worker’s expected performance directly, we must give them tasks from which we estimate it (like repeatedly flipping a biased coin). Arlotto et al. [3] proposed a strategy with some guarantees for a related problem but did not characterize the sample complexity of the problem, the focus of our work. The most biased coin problem was first proposed by Chandrasekaran and Karp [8]. In that work, it was shown that if ↵, ✓0, ✓1 were known then there exists an algorithm based on the sequential probability ratio test (SPRT) that is optimal in that it minimizes the expected number of total flips to find a “heavy” coin whose posterior probability of being heavy is at least 1 −δ, and the expected sample complexity of this algorithm was upper-bounded by 16 (✓1 −✓0)2 ✓1 −↵ ↵ + log ✓(1 −↵)(1 −δ) ↵δ ◆◆ . (1) However, the practicality of the proposed algorithm is severely limited as it relies critically on knowing ↵, ✓0, and ✓1 exactly. In addition, the algorithm returns to coins it has previously flipped and thus requires more than one coin to be outside the bag at a time, ruling out some applications. Malloy et al. [15] addressed some of the shortcomings of [9] (a preprint of [8]) by considering both an alternative SPRT procedure and a sequential thresholding procedure. Both of these proposed algorithms only ever have one coin out of the bag at a time. However, the former requires knowledge of all relevant parameters ↵, ✓0, ✓1, and the latter requires knowledge of ↵, ✓0. Moreover, these results are only presented for the asymptotic case where δ ! 0. The most biased coin problem can be viewed through the lens of multi-armed bandits. In the best-arm identification problem, the player has access to K distributions (arms) such that if arm i 2 [K] is sampled (pulled), an iid random variable with mean µi is observed; the objective is to identify the arm associated with the highest mean with probability at least 1 −δ using as few pulls as possible (see [14] for a short survey). In the infinite armed bandit problem, the player is not confined to K arms but an infinite reservoir of arms such that a draw from this reservoir results in an arm with a mean µ drawn from some distribution; the objective is to identify the highest mean possible after n total pulls for any n > 0 with probability 1 −δ (see [7]). The most biased coin problem is an instance of this latter game with the arm reservoir distribution of means µ defined as P(µ ≥✓1 −✏) = ↵1✏≥0 + (1 −↵)1✏≥✓1−✓0 for all ✏. Previous work has focused on an alternative arm distribution reservoir that satisfies E✏β P(µ ≥µ⇤−✏) E0✏β for some µ⇤2 [0, 1] where E, E0 are constants and β is known [5, 21, 6, 7]. Because neither arm distribution reservoir can be written in terms of the other, neither work subsumes the other. Note that one can always apply an algorithm designed for the infinite armed bandit problem to any finite K-armed bandit problem by defining the arm reservoir as placing a uniform distribution over the K arms. This is appealing when K is very large and one wishes to guarantee nontrivial performance when the number of pulls is much less than K1. The most biased problem is a special case of the K-armed reservoir distribution where one arm has mean ✓1 and K −1 arms have mean ✓0 with ↵= 1 K . 1All algorithms for K-armed bandit problem known to these authors begins by sampling each arm once so that until the number of pulls exceeds K, performance is no better than random selection. 2 Given that [8] and [15] are provably optimal algorithms for the most biased coin problem given knowledge of ↵, ✓0, ✓1, it is natural to consider a procedure that first estimates these unknown parameters first and then uses these estimates in the algorithms of [8] or [15]. Indeed, in the βparameterized arm reservoir setting discussed above, this is exactly what Carpentier and Valko [7] propose to do, suggesting a particular estimator for β given a lower bound bβ β. They show that this estimator is sufficient to obtain the same sample complexity result up to log factors as when β was known. Sadly, through upper and lower bounds we show that for the most biased coin problem this estimate-then-explore approach requires quadratically more flips than our proposed algorithm that adapts to these unknown parameters. Specifically, we show that when ✓1 −✓0 is sufficiently small one cannot use a static estimation step to determine whether ↵= 0 or ↵> 0 unless a number of samples quadratic in the optimal sample complexity are taken. Our contributions to the most biased coin problem include a novel algorithm that never has more than one coin outside the bag at a time, has no knowledge of the distribution parameters, supports distributions on [0, 1] rather than just “coins,” and comes within log factors of the known informationtheoretic lower bound and Equation 1 which is achieved by an algorithm that knows the parameters. See Table 1 for an overview of the upper and lower bounds proved in this work for this problem. We believe that our algorithm is the first solution to the most biased coin problem that does not require prior knowledge of the problem parameters and that the same approach can be reworked to solve more general instances of the infinite-armed bandit problem, including the β-parameterized and K-armed reservoir cases described of above. Finally, if an algorithm is desired for arbitrary arm reservoir distributions, this work rules out an estimate-then-explore approach. 1.2 Problem Statement Let ✓2 ⇥index a family of single-parameter probability density functions g✓and fix ✓0, ✓1 2 ⇥, ↵2 [0, 1/2]. For any ✓2 ⇥assume that g✓is known to the procedure. Note that in the most biased coin problem, g✓=Bernoulli(✓), but in general it is arbitrary (e.g. N(✓, 1)). Consider a sequence of iid Bernoulli random variables ⇠i 2 {0, 1} for i = 1, 2, . . . where each P(⇠i = 1) = 1 −P(⇠i = 0) = ↵. Let Xi,j for j = 1, 2, . . . be a sequence of random variables drawn from g✓1 if ⇠i = 1 and g✓0 otherwise, and let {{Xi,j}Mi j=1}N i=1 represent the sampling history generated by a procedure for some N 2 N and (M1, . . . , MN) 2 NN. Any valid procedure behaves accordingly: Algorithm 1 The most biased coin problem definition. Only the last distribution drawn may be sampled or declared heavy, enforcing the rule that only one coin may be outside the bag at a time. Initialize an empty history (N = 1, M = (0, 0, . . . )). Repeat until heavy distribution declared: Choose one of 1. draw a sample from distribution N, MN MN + 1 2. draw a sample from the (N + 1)st distribution, MN+1 = 1, N N + 1 3. declare distribution N as heavy Definition 1 We say a strategy for the most biased coin problem is δ-probably correct if for all (↵, ✓0, ✓1) it identifies a “heavy” g✓1 distribution with probability at least 1 −δ. Definition 2 (Strategies for the most biased coin problem) An estimate-then-explore strategy is a strategy that, for any fixed m 2 N, begins by sampling each successive coin exactly m times for a number of coins that is at least the minimum necessary for any test to determine that ↵6= 0 with probability at least 1 −δ, then optionally continues sampling with an arbitrary strategy that declares a heavy coin. An adaptive strategy is any strategy that is not an estimate-then-explore strategy. We study the estimate-then-explore strategy because there exist optimal algorithms [8, 15] for the most biased coin problem if ↵, ✓0, ✓1 are known, so it is natural to consider estimating these quantities then using one of these algorithms. Note that the algorithm of [7] for the β-parameterized infinite armed bandit problem discussed above can be considered an estimate-then-explore strategy since it first estimates β by sampling a fixed number of samples from a set of arms, and then uses this estimate to draw a fixed number of arms and applies a UCB-style algorithm to these arms. A contribution of this work is showing that such a strategy is infeasible for the most biased coin problem. 3 For all strategies that are δ-probably correct and follow the interface of Algorithm 1, our goal is to provide lower and upper bounds on the quantity E[T] := E[PN i=1 Mi] for any (↵, ✓0, ✓1) if N denotes the final number of coins considered. 2 From Identifying Coins to Detecting Mixture Distributions Addressing the most biased coin problem, [15] analyzes perhaps the most natural strategy: fix an m 2 N and flip each successive coin exactly m times. The relevant questions are how large does m have to be in order to guarantee correctness with probability 1 −δ, and for a given m how long must one wait to declare a “heavy” coin? The authors partially answer these questions and we improve upon them (see Section 3.2.1) which leads us to our study of the difficulty of detecting the presence of a mixture distribution. As an example of the kind of lower bounds shown in this work, if we observe a sequence of random variables X1, . . . , Xn, consider the following hypothesis test: H0 : 8i X1, . . . , Xn ⇠N(✓, σ2) for some ✓2 R, H1 : 8i X1, . . . , Xn ⇠(1 −↵)N(✓0, σ2) + ↵N(✓1, σ2) (P1) which will henceforth be referred to as Problem P1 or just (P1). We can show that if ✓0, ✓1, ↵are known and ✓= ✓0, then it is sufficient to observe just max{1/↵, σ2 ↵2(✓1−✓0)2 log(1/δ)} samples to determine the correct hypothesis with probability at least 1 −δ. However, if ✓0, ✓1, ↵are unknown then it is necessary to observe at least max % 1/↵, & σ2 ↵(✓1−✓0)2 '2 log(1/δ) samples in expectation whenever (✓1−✓0)2 σ2 1 and max{1/↵, σ2 ↵2(✓1−✓0)2 log(1/δ)} otherwise (see Appendix C). Recognizing (✓1−✓0)2 σ2 as the KL divergence between two Gaussians of H1, we observe startling consequences for anomaly detection when the parameters of the underlying distributions are unknown: if the anomalous distribution is well separated from the null distribution, then detecting an anomalous component is only about as hard as observing just one anomalous sample (i.e. 1/↵) multiplied by the inverse KL divergence between the null and anomalous distributions. However, when the two distributions are not well separated then the necessary sample complexity explodes to this latter quantity squared. In Section 4 we will investigate adaptive methods for dramatically decreasing this sample complexity. Our lower bounds are based on the detection of the presence of a mixture of two distributions of an exponential family versus just a single distribution of the same family. There has been extensive work in the estimation of mixture distributions [13, 11] but this literature often assumes that the mixture coefficient ↵is bounded away from 0 and 1 to ensure a sufficient number of samples from each distribution. In contrast, we highlight the regime when ↵is arbitrarily small, as is the case in statistical anomaly detection [10, 20, 2]. Property testing, e.g. unimodality, [1] is relevant but can lack interpetability or strength in favor of generality. Considering the exponential family allowing us to make interpretable statements about the relevant problem parameters in different regimes. Preliminaries Let P and Q be two probability distributions with densities p and q, respectively. For simplicity, assume p and q have the same support. Define the KL Divergence between P and Q as KL(P, Q) = R log ⇣ p(x) q(x) ⌘ dp(x). Define the χ2 Divergence between P and Q as χ2(P, Q) = R ⇣ p(x) q(x) −1 ⌘2 dq(x) = R (p(x)−q(x))2 q(x) dx. Note that by Jensen’s inequality KL(P, Q) = Ep ⇥ log & p q '⇤ log & Ep ⇥p q ⇤' = log & χ2(P, Q) + 1 ' χ2(P, Q). (2) Examples: If P = N(✓1, σ2) and Q = N(✓0, σ2) then KL(P, Q) = (✓1−✓0)2 2σ2 and χ2(P, Q) = e (✓1−✓0)2 σ2 −1. If P = Bernoulli(✓1) and Q = Bernoulli(✓0) then KL(P, Q) = ✓1 log( ✓1 ✓0 ) + (1 − ✓1) log( 1−✓1 1−✓0 )  (✓1−✓0)2/2 ✓0(1−✓0)−[(✓1−✓0)(2✓0−1)]+ and χ2(P, Q) = (✓1−✓0)2 ✓0(1−✓0). All proofs appear in the appendix. 3 Lower bounds We present lower bounds on the sample complexity of δ-probably correct strategies for the most biased coin problem that follow the interface of Algorithm 1. Lower bounds are stated for any 4 adaptive strategy in Section 3.1, non-adaptive strategies that may have knowledge of the parameters but sample each distribution the same number of times in Section 3.2.1, and estimate-then-explore strategies that do not have prior knowledge of the parameters in Section 3.2.2. Our lower bounds, with the exception of the adaptive strategy, are based on the difficulty of detecting the presence of a mixture distribution, and this reduction is explained in Section 3.2. 3.1 Adaptive strategies The following theorem, reproduced from [15], describes the sample complexity of any δ-probably correct algorithm for the most biased coin identification problem. Note that this lower bound holds for any procedure even if it returns to previously seen distributions to draw additional samples and even if it knows ↵, ✓0, ✓1. Theorem 1 [15, Theorem 2] Fix δ 2 (0, 1). Let T be the total number of samples taken of any procedure that is δ-probably correct in identifying a heavy distribution. Then E[T] ≥c1 max ⇢1 −δ ↵ , (1 −δ) ↵KL(g✓0|g✓1) / whenever ↵c2δ where c1, c2 2 (0, 1) are absolute constants. The above theorem is directly applicable to the special case where g✓is a Bernoulli distribution, implying a lower bound of max % 1−δ ↵, 2 min{✓0(1−✓0),✓1(1−✓1)} ↵(✓1−✓0)2 for the most biased coin problem. The upper bounds of our proposed procedures for the most biased coin problem presented later will be compared to this benchmark. 3.2 The detection of a mixture distribution and the most biased coin problem First observe that identifying a specific distribution i N as heavy (i.e. ⇠i = 1) or determining that ↵ is strictly greater than 0, is at least as hard as detecting that any of the distributions up to distribution N is heavy. Thus, a lower bound on the total expected number of samples of all considered distributions for this strictly easier detection problem is also a lower bound for the estimate-then-explore strategy for the most biased coin identification problem. The estimate-then-explore strategy fixes an m 2 N prior to starting the game and then samples each distribution exactly m times, i.e. Mi = m for all i N for some N. To simplify notation let f✓ denote the distribution of the sufficient statistics of these m samples. In general f✓is a product distribution, but when g✓is a Bernoulli distribution, as in the biased coin problem, we can take f✓to be a Binomial distribution with parameters (m, ✓). Now our problem is more succinctly described as: H0 : 8i Xi ⇠f✓ for some ✓2 e⇥✓⇥, H1 : 8i ⇠i ⇠Bernoulli(↵), 8i Xi ⇠ ⇢f✓0 if ⇠i = 0 f✓1 if ⇠i = 1 (P2) If ✓0 and ✓1 are close to each other, or if ↵is very small, it can be very difficult to decide between H0 and H1 even if ↵, ✓0, ✓1 are known a priori. Note that when the parameters are known, one can take e⇥= {✓0}. However, when the parameters are unknown, one takes e⇥= ⇥to prove a lower bound on the sample complexity of the estimate-then-explore algorithm, which is tasked with deciding whether or not samples are coming from a mixture of distributions or just a single distribution within the family. That is, lower bounds on the sample complexity when the parameters are known and unknown follow by analyzing a simple binary and composite hypothesis test, respectively. In what follows, for any event A, let Pi(A) and Ei[A] denote probability and expectation of A under hypothesis Hi for i 2 {0, 1} (the specific value of ✓in H0 will be clear from context). The next claim is instrumental in our ability to prove lower bounds on the difficulty of the hypothesis tests. Claim 1 Any procedure that is δ-probably correct also satisfies P0(N < 1) δ whenever ↵= 0. 3.2.1 Sample complexity when parameters are known Theorem 2 Fix δ 2 (0, 1). Consider the hypothesis test of Problem P2 for any fixed ✓2 e⇥✓ ⇥. Let N be the random number of distributions considered before stopping and declaring a 5 hypothesis. If a procedure satisfies P0(N < 1) δ and P1([N i=1{⇠i = 1}) ≥1 −δ, then E1[N] ≥max n 1−δ ↵, log(1/δ) KL(P1|P0) o ≥max n 1−δ ↵, log(1/δ) χ2(P1|P0) o . In particular, if e⇥= {✓0} then E1[N] ≥max n1 −δ ↵ , log(1/δ) ↵2χ2(f✓1|f✓0) o . The next corollary relates Theorem 2 to the most biased coin problem and is related to Malloy et al. [15, Theorem 4] that considers the limit as ↵! 0 and assumes m is sufficiently large (specifically, large enough for the Chernoff-Stein lemma to apply). In contrast, our result holds for all finite δ, ↵, m. Corollary 1 Fix δ 2 (0, 1). For any m 2 N consider a δ-probably correct strategy that flips each coin exactly m times. If Nm is the number of coins considered before declaring a coin as heavy then min m2N E[mNm] ≥ (1 −δ) log ⇣ log(1/δ) ↵ ⌘ ↵ ✓0(1 −✓0) (✓1 −✓0)2 . One can show the existence of such a strategy with a nearly matching upperbound when ↵, ✓0, ✓1 are known (see Appendix B.1). Note that this is at least log(1/↵) larger than the sample complexity of (1) that can be achieved by an adaptive algorithm when the parameters are known. 3.2.2 Sample complexity when parameters are unknown If ↵, ✓0, and ✓1 are unknown, we cannot test f✓0 against the mixture (1 −↵)f✓0 + ↵f✓1. Instead, we have the general composite test of any individual distribution against any mixture, which is at least as hard as the hypothesis test of Problem P2 with e⇥= {✓} for some particular worst-case setting of ✓. Without any specific form of f✓, it is difficult to pick a worst case ✓that will produce a tight bound. Consequently, in this section we consider single parameter exponential families (defined formally below) to provide us with a class of distributions in which we can reason about different possible values for ✓. Since exponential families include Bernoulli, Gaussian, exponential, and many other distributions, the following theorem is general enough to be useful in a wide variety of settings. The constant C referred to in the next theorem is an absolute constant under certain conditions that we outline in the following remark and corollary, its explicit form is given in the proof. Theorem 3 Suppose f✓for ✓2 ⇥⇢R is a single parameter exponential family so that f✓(x) = h(x) exp(⌘(✓)x −b(⌘(✓))) for some scalar functions h, b, ⌘where ⌘is strictly increasing. If e⇥= {✓⇤} where ✓⇤= ⌘−1& (1 −↵)⌘(✓0) + ↵⌘(✓1) ' and N is the stopping time of any procedure that satisfies P0(N < 1) δ and P1([N i=1{⇠i = 1}) ≥1 −δ, then E1[N] ≥max n 1−δ ↵, log( 1 δ ) C( 1 2 ↵(1−↵)(⌘(✓1)−⌘(✓0))2) 2 o . where C is a constant that may depend on ↵, ✓0, ✓1. The following remark and corollary apply Theorem 3 to the special cases of Gaussian mixture model detection and the most biased coin problem, respectively. Remark 1 When ↵, ✓0, ✓1 are unknown, any procedure has no knowledge of e⇥in Problem P2 and consequently it cannot rule out ✓= ✓⇤for H0 where ✓⇤is defined in Theorem 3. If f✓= N(✓, σ2) for known σ, then whenever (✓1−✓0)2 σ2 1 the constant C in Theorem 3 is an absolute constant and consequently, E1[N] = ⌦ && σ2 ↵(✓1−✓0)2 '2 log(1/δ) ' . Conversely, when ↵, ✓0, ✓1 are known, then we simply need to determine whether samples came from N(✓0, σ2) or (1 −↵)N(✓0, σ2) + ↵N(✓1, σ2), and we show that it is sufficient to take just O ⇣ σ2 ↵2(✓1−✓0)2 log(1/δ) ⌘ samples (see Appendix C). Corollary 2 Fix δ 2 [0, 1] and assume ✓0, ✓1 are bounded sufficiently far from {0, 1} such that 2(✓1 −✓0) min{✓0(1 −✓0), ✓1(1 −✓1)}. For any m let Nm be the number of coins a δ-probably correct estimate-then-explore strategy that flips each coin m times in the exploration step. Then mE[Nm] ≥c0 min{ 1 m, ✓⇤(1 −✓⇤)} ⇣ ↵(1 −↵) (✓1−✓0)2 ✓⇤(1−✓⇤) ⌘2 log( 1 δ ) whenever m ✓⇤(1 −✓⇤) (✓1 −✓0)2 . where c0 is an absolute constant and ✓⇤= ⌘−1 ((1 −↵)⌘(✓0) + ↵⌘(✓1)) 2 [✓0, ✓1]. 6 Remark 2 If ↵, ✓0, ✓1 are unknown, any estimate-then-explore strategy (or the strategy described in Corollary 1) would be unable to choose an m that depended on these parameters, so we can treat it as a constant. Thus, for the case when ✓0 and ✓1 are bounded away from {0, 1} (e.g. ✓0, ✓1 2 [1/8, 7/8]), the above corollary states that for any fixed m, whenever ✓1 −✓0 is sufficiently small the number of samples necessary for these strategies to identify a heavy coin scales like & 1 ↵(✓1−✓0)2 '2 log(1/δ). This is striking example of the difference when parameters are known versus when they are not and effectively rules out an estimate-then-explore strategy for practical purposes. Setting Upper Bound Lower Bound Fixed, known ↵, ✓0, ✓1 log(1/(δ↵)) ↵✏2 , Thm. 7 log(log(1/δ)/↵) ↵✏2 Cor. 1 Adaptive, known ↵, ✓0, ✓1 1 ✏2 & 1 ↵+ log( 1 δ ) ' [8, 15], Thm. 4 1 ↵✏2 [15] Est+Expl, unknown ↵, ✓0, ✓1 Unconsidered† & 1 ↵✏2 '2 log( 1 δ ) Cor. 2 Adaptive, unknown ↵, ✓0, ✓1 c log( 1 ↵✏2 ) log(log( 1 ↵✏2 )/δ) ↵✏2 Thm. 5 1 ↵✏2 [15] Table 1: Upper and lower bounds on the expected sample complexity of different δ-probably correct strategies. Fixed refers to the strategy of Corollary 1. For this table, we assume min{✓0(1 − ✓0), ✓1(1 −✓1)} is lower bounded by a constant (e.g. ✓0, ✓1 2 [1/8, 7/8]) and ✏= ✓1 −✓0 is sufficiently small. Also note that the upperbounds apply to distributions supported on [0, 1], not just coins. All results without bracketed citations were unknown prior to this work. † Due to our discouraging lower bound for any estimate-then-explore strategy, it is inadvisable to propose an algorithm. 4 Near optimal adaptive algorithm In this section we propose an algorithm that has no prior knowledge of the parameters ↵, ✓0, ✓1 yet yields an upper bound that matches the lower bound of Theorem 1 up to logarithmic factors. We assume that samples from heavy or light distributions are supported on [0, 1], and that drawn samples are independent and unbiased estimators of the mean, i.e., E[Xi,j] = µi for µi 2 {✓0, ✓1}. All results can be easily extended to sub-Gaussian distributions. Consider Algorithm 2, an SPRT-like procedure [18] for finding a heavy distribution given δ and lower bounds on ↵and ✏= ✓1 −✓0. It improves upon prior work by supporting arbitrary distributions on [0, 1] and requires only bounds ↵, ✏. Algorithm 2 Adaptive strategy for heavy distribution identification with inputs ↵0, ✏0, δ Given δ 2 (0, 1/4), ↵0 2 (0, 1/2), ✏0 2 (0, 1). Initialize n = d2 log(9)/↵0e, m = d64✏−2 0 log(14n/δ)e, A = −8✏−1 0 log(21), B = 8✏−1 0 log(14n/δ), k1 = 5, k2 = d8✏−2 0 log(2k1/ min{δ/8, m−1✏−2 0 })e. Draw k1 distributions and sample them each k2 times. Estimate b✓0 = mini=1,...,k1 bµi,k2, ˆγ = b✓0 + ✏0/2. Repeat for i = 1, . . . , n: Draw distribution i. Repeat for j = 1, . . . , m: Sample distribution i and observe Xi,j. If Pj k=1(Xi,k −ˆγ) > B: Declare distribution i to be heavy and Output distribution i. Else if Pj k=1(Xi,k −ˆγ) < A: break. Output null. Theorem 4 If Algorithm 2 is run with δ 2 (0, 1/4), ↵0 2 (0, 1/2), ✏0 2 (0, 1), then the expected number of total samples taken by the algorithm is no more than c0↵log(1/↵0) + c00 log & 1 δ ' ↵0✏2 0 (3) 7 for some absolute constants c0,c00, and all of the following hold: 1) with probability at least 1 −δ, a light distribution is not returned, 2) if ✏0 ✓1 −✓0 and ↵0 ↵, then with probability 4 5 a heavy distribution is returned, and 3) the procedure takes no more than c log(1/(↵0δ)) ↵0✏2 0 total samples. The second claim of the theorem holds only with constant probability (versus with probability 1 −δ) since the probability of observing a heavy distribution among the n = d2 log(4)/↵0e distributions only occurs with constant probability. One can show that if the outer loop of algorithm is allowed to run indefinitely (with m and n defined as is), ✏0 = ✓1 −✓0, ↵0 = ↵, and b✓0 = ✓0, then a heavy coin is returned with probability at least 1 −δ and the expected number of samples is bounded by (3). If a tight lower bound is known on either ✏= ✓1 −✓0 or ↵, there is only one parameter that is unknown and the “doubling trick”, along with Theorem 4, can be used to identify a heavy coin with just log(log(✏−2)/δ) ↵✏2 and log(log(↵−1)/δ) ↵✏2 samples, respectively (see Appendix B.3). Now consider Algorithm 3 that assumes no prior knowledge of ↵, ✓0, ✓1, the first result for this setting that we are aware of. We remark that while the placing of “landmarks” (↵k, ✏k) throughout the search space as is done in Algorithm 3 appears elementary in hindsight, it is surprising that so few can cover this two dimensional space since one has to balance the exploration of ↵and ✏. We believe similar a similar approach may be generalized for more generic infinite armed bandit problems. Algorithm 3 Adaptive strategy for heavy distribution identification with unknown parameters Given δ > 0. Initialize ` = 1, heavy distribution h = null. Repeat until h is not null: Set γ` = 2`, δ` = δ/(2`3) Repeat for k = 0, . . . , `: Set ↵k = 2k γ` , ✏k = q 1 2↵kγ` Run Algorithm 2 with ↵0 = ↵k, ✏0 = ✏k, δ = δ` and Set h to its output. If h is not null break Set ` = ` + 1 Output h Theorem 5 (Unknown ↵, ✓0, ✓1) Fix δ 2 (0, 1). If Algorithm 3 is run with δ then with probability at least 1 −δ a heavy distribution is returned and the expected number of total samples taken is bounded by clog2( 1 ↵✏2 ) ↵✏2 (↵log2( 1 ✏2 ) + log(log2( 1 ↵✏2 )) + log(1/δ)) for an absolute constant c. 5 Conclusion While all prior works have required at least partial knowledge of ↵, ✓0, ✓1 to solve the most biased coin problem, our algorithm requires no knowledge of these parameters yet obtain the near-optimal sample complexity. In addition, we have proved lower bounds on the sample complexity of detecting the presence of a mixture distribution when the parameters are known or unknown, with consequences for any estimate-then-explore strategy, an approach previously proposed for an infinite armed bandit problem. Extending our adaptive algorithm to arbitrary arm reservoir distributions is of significant interest. We believe a successful algorithm in this vein could have a significant impact on how researchers think about sequential decision processes in both finite and uncountable action spaces. Acknowledgments Kevin Jamieson is generously supported by ONR awards N00014-15-1-2620, and N0001413-1-0129. This research is supported in part by NSF CISE Expeditions Award CCF-1139158, DOE Award SN10040 DE-SC0012463, and DARPA XData Award FA8750-12-2-0331, and gifts from Amazon Web Services, Google, IBM, SAP, The Thomas and Stacey Siebel Foundation, Apple Inc., Arimo, Blue Goji, Bosch, Cisco, Cray, Cloudera, Ericsson, Facebook, Fujitsu, Guavus, HP, Huawei, Intel, Microsoft, Pivotal, Samsung, Schlumberger, Splunk, State Farm and VMware. 8 References [1] Jayadev Acharya, Constantinos Daskalakis, and Gautam C Kamath. Optimal testing for properties of distributions. In Advances in Neural Information Processing Systems, pages 3577–3598, 2015. [2] Deepak Agarwal. Detecting anomalies in cross-classified streams: a bayesian approach. Knowledge and Information Systems, 11(1):29–44, 2006. [3] Alessandro Arlotto, Stephen E Chick, and Noah Gans. Optimal hiring and retention policies for heterogeneous workers who learn. Management Science, 60(1):110–129, 2013. [4] Michael S Bernstein, Joel Brandt, Robert C Miller, and David R Karger. Crowds in two seconds: enabling realtime crowd-powered interfaces. UIST, 2011. [5] Donald A. Berry, Robert W. Chen, Alan Zame, David C. Heath, and Larry A. Shepp. Bandit problems with infinitely many arms. Ann. Statist., 25(5):2103–2116, 10 1997. [6] Thomas Bonald and Alexandre Proutiere. Two-target algorithms for infinite-armed bandits with bernoulli rewards. In C.J.C. Burges, L. Bottou, M. Welling, Z. Ghahramani, and K.Q. Weinberger, editors, Advances in Neural Information Processing Systems 26, pages 2184–2192. Curran Associates, Inc., 2013. [7] Alexandra Carpentier and Michal Valko. Simple regret for infinitely many armed bandits. arXiv preprint arXiv:1505.04627, 2015. [8] Karthekeyan Chandrasekaran and Richard Karp. Finding a most biased coin with fewest flips. In Proceedings of The 27th Conference on Learning Theory, pages 394–407, 2014. [9] Karthekeyan Chandrasekaran and Richard M. Karp. Finding the most biased coin with fewest flips. CoRR, abs/1202.3639, 2012. URL http://arxiv.org/abs/1202.3639. [10] Eleazar Eskin. Anomaly detection over noisy data using learned probability distributions. In Proceedings of the Seventeenth International Conference on Machine Learning, ICML ’00, pages 255–262, San Francisco, CA, USA, 2000. Morgan Kaufmann Publishers Inc. [11] Yoav Freund and Yishay Mansour. Estimating a mixture of two product distributions. In Proceedings of the twelfth annual conference on Computational learning theory, pages 53–62. ACM, 1999. [12] Daniel Haas, Jiannan Wang, Eugene Wu, and Michael J. Franklin. Clamshell: Speeding up crowds for low-latency data labeling. Proc. VLDB Endow., 9(4):372–383, December 2015. ISSN 2150-8097. [13] Moritz Hardt and Eric Price. Sharp bounds for learning a mixture of two gaussians. ArXiv e-prints, 1404, 2014. [14] Kevin Jamieson and Robert Nowak. Best-arm identification algorithms for multi-armed bandits in the fixed confidence setting. In Information Sciences and Systems (CISS), pages 1–6. IEEE, 2014. [15] Matthew L Malloy, Gongguo Tang, and Robert D Nowak. Quickest search for a rare distribution. In Information Sciences and Systems (CISS), pages 1–6. IEEE, 2012. [16] MTurk. Amazon Mechanical Turk. https://www.mturk.com/. [17] David Pollard. Asymptopia. Manuscript in progress. Available at http://www. stat.yale.edu/⇠pollard, 2000. [18] David Siegmund. Sequential analysis: tests and confidence intervals. Springer Science & Business Media, 2013. [19] Robert Spira. Calculation of the gamma function by stirling’s formula. mathematics of computation, pages 317–322, 1971. [20] Gautam Thatte, Urbashi Mitra, and John Heidemann. Parametric methods for anomaly detection in aggregate traffic. IEEE/ACM Trans. Netw., 19(2):512–525, April 2011. ISSN 1063-6692. [21] Yizao Wang, Jean yves Audibert, and Rémi Munos. Algorithms for infinitely many-armed bandits. In D. Koller, D. Schuurmans, Y. Bengio, and L. Bottou, editors, Advances in Neural Information Processing Systems 21, pages 1729–1736. Curran Associates, Inc., 2009. 9
2016
346
6,268
Adaptive Skills Adaptive Partitions (ASAP) Daniel J. Mankowitz, Timothy A. Mann∗and Shie Mannor The Technion - Israel Institute of Technology, Haifa, Israel danielm@tx.technion.ac.il, mann.timothy@acm.org, shie@ee.technion.ac.il ∗Timothy Mann now works at Google Deepmind. Abstract We introduce the Adaptive Skills, Adaptive Partitions (ASAP) framework that (1) learns skills (i.e., temporally extended actions or options) as well as (2) where to apply them. We believe that both (1) and (2) are necessary for a truly general skill learning framework, which is a key building block needed to scale up to lifelong learning agents. The ASAP framework can also solve related new tasks simply by adapting where it applies its existing learned skills. We prove that ASAP converges to a local optimum under natural conditions. Finally, our experimental results, which include a RoboCup domain, demonstrate the ability of ASAP to learn where to reuse skills as well as solve multiple tasks with considerably less experience than solving each task from scratch. 1 Introduction Human-decision making involves decomposing a task into a course of action. The course of action is typically composed of abstract, high-level actions that may execute over different timescales (e.g., walk to the door or make a cup of coffee). The decision-maker chooses actions to execute to solve the task. These actions may need to be reused at different points in the task. In addition, the actions may need to be used across multiple, related tasks. Consider, for example, the task of building a city. The course of action to building a city may involve building the foundations, laying down sewage pipes as well as building houses and shopping malls. Each action operates over multiple timescales and certain actions (such as building a house) may need to be reused if additional units are required. In addition, these actions can be reused if a neighboring city needs to be developed (multi-task scenario). Reinforcement Learning (RL) represents actions that last for multiple timescales as Temporally Extended Actions (TEAs) (Sutton et al., 1999), also referred to as options, skills (Konidaris & Barto, 2009) or macro-actions (Hauskrecht, 1998). It has been shown both experimentally (Precup & Sutton, 1997; Sutton et al., 1999; Silver & Ciosek, 2012; Mankowitz et al., 2014) and theoretically (Mann & Mannor, 2014) that TEAs speed up the convergence rates of RL planning algorithms. TEAs are seen as a potentially viable solution to making RL truly scalable. TEAs in RL have become popular in many domains including RoboCup soccer (Bai et al., 2012), video games (Mann et al., 2015) and Robotics (Fu et al., 2015). Here, decomposing the domains into temporally extended courses of action (strategies in RoboCup, move combinations in video games and skill controllers in Robotics for example) has generated impressive solutions. From here on in, we will refer to TEAs as skills. A course of action is defined by a policy. A policy is a solution to a Markov Decision Process (MDP) and is defined as a mapping from states to a probability distribution over actions. That is, it tells the RL agent which action to perform given the agent’s current state. We will refer to an inter-skill policy as being a policy that tells the agent which skill to execute, given the current state. A truly general skill learning framework must (1) learn skills as well as (2) automatically compose them together (as stated by Bacon & Precup (2015)) and determine where each skill should be executed (the inter-skill policy). This framework should also determine (3) where skills can be reused 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. Table 1: Comparison of Approaches to ASAP Automated Skill Automatic Continuous Learning Correcting Learning Skill State Reusable Model with Policy Composition Multitask Skills Misspecification Gradient Learning ASAP (this paper) ✓ ✓ ✓ ✓ ✓ da Silva et al. 2012 ✓ × ✓ × × Konidaris & Barto 2009 × ✓ × × × Bacon & Precup 2015 ✓ × × × × Eaton & Ruvolo 2013 × × ✓ × × in different parts of the state space and (4) adapt to changes in the task itself. Finally it should also be able to (5) correct model misspecification (Mankowitz et al., 2014). Whilst different forms of model misspecification exist in RL, we define it here as having an unsatisfactory set of skills and inter-skill policy that provide a sub-optimal solution to a given task. This skill learning framework should be able to correct this misspecification to obtain a near-optimal solution. A number of works have addressed some of these issues separately as shown in Table 1. However, no work, to the best of our knowledge, has combined all of these elements into a truly general skill-learning framework. Our framework entitled ‘Adaptive Skills, Adaptive Partitions (ASAP)’ is the first of its kind to incorporate all of the above-mentioned elements into a single framework, as shown in Table 1, and solve continuous state MDPs. It receives as input a misspecified model (a sub-optimal set of skills and inter-skill policy). The ASAP framework corrects the misspecification by simultaneously learning a near-optimal skill-set and inter-skill policy which are both stored, in a Bayesian-like manner, within the ASAP policy. In addition, ASAP automatically composes skills together, learns where to reuse them and learns skills across multiple tasks. Main Contributions: (1) The Adaptive Skills, Adaptive Partitions (ASAP) algorithm that automatically corrects a misspecified model. It learns a set of near-optimal skills, automatically composes skills together and learns an inter-skill policy to solve a given task. (2) Learning skills over multiple different tasks by automatically adapting both the inter-skill policy and the skill set. (3) ASAP can determine where skills should be reused in the state space. (4) Theoretical convergence guarantees. 2 Background Reinforcement Learning Problem: A Markov Decision Process is defined by a 5-tuple ⟨X, A, R, γ, P⟩where X is the state space, A is the action space, R ∈[−b, b] is a bounded reward function, γ ∈[0, 1] is the discount factor and P : X × A →[0, 1]X is the transition probability function for the MDP. The solution to an MDP is a policy π : X →∆A which is a function mapping states to a probability distribution over actions. An optimal policy π∗: X →∆A determines the best actions to take so as to maximize the expected reward. The value function V π(x) = Ea∼π(·|a)  R(x, a)  + γEx′∼P (·|x,a)  V π(x′)  defines the expected reward for following a policy π from state x. The optimal expected reward V π∗(x) is the expected value obtained for following the optimal policy from state x. Policy Gradient: Policy Gradient (PG) methods have enjoyed success in recent years especially in the fields of robotics (Peters & Schaal, 2006, 2008). The goal in PG is to learn a policy πθ that maximizes the expected return J(πθ) = R τ P(τ)R(τ)dτ, where τ is a set of trajectories, P(τ) is the probability of a trajectory and R(τ) is the reward obtained for a particular trajectory. P(τ) is defined as P(τ) = P(x0)ΠT k=0P(xk+1|xk, ak)πθ(ak|xk). Here, xk ∈X is the state at the kth timestep of the trajectory; ak ∈A is the action at the kth timestep; T is the trajectory length. Only the policy, in the general formulation of policy gradient, is parameterized with parameters θ. The idea is then to update the policy parameters using stochastic gradient descent leading to the update rule θt+1 = θt + η∇J(πθ), where θt are the policy parameters at timestep t, ∇J(πθ) is the gradient of the objective function with respect to the parameters and η is the step size. 3 Skills, Skill Partitions and Intra-Skill Policy Skills: A skill is a parameterized Temporally Extended Action (TEA) (Sutton et al., 1999). The power of a skill is that it incorporates both generalization (due to the parameterization) and temporal 2 abstraction. Skills are a special case of options and therefore inherit many of their useful theoretical properties (Sutton et al., 1999; Precup et al., 1998). Definition 1. A Skill ζ is a TEA that consists of the two-tuple ζ = ⟨σθ, p(x)⟩where σθ : X →∆A is a parameterized, intra-skill policy with parameters θ ∈Rd and p : X →[0, 1] is the termination probability distribution of the skill. Skill Partitions: A skill, by definition, performs a specialized task on a sub-region of a state space. We refer to these sub-regions as Skill Partitions (SPs) which are necessary for skills to specialize during the learning process. A given set of SPs covering a state space effectively define the inter-skill policy as they determine where each skill should be executed. These partitions are unknown a-priori and are generated using intersections of hyperplane half-spaces (described below). Hyperplanes provide a natural way to automatically compose skills together. In addition, once a skill is being executed, the agent needs to select actions from the skill’s intra-skill policy σθ. We next utilize SPs and the intra-skill policy for each skill to construct the ASAP policy, defined in Section 4. We first define a skill hyperplane. Definition 2. Skill Hyperplane (SH): Let ψx,m ∈Rd be a vector of features that depend on a state x ∈X and an MDP environment m. Let βi ∈Rd be a vector of hyperplane parameters. A skill hyperplane is defined as ψT x,mβi = L, where L is a constant. In this work, we interpret hyperplanes to mean that the intersection of skill hyperplane half spaces form sub-regions in the state space called Skill Partitions (SPs), defining where each skill is executed. Figure 1a contains two example skill hyperplanes h1, h2. Skill ζ1 is executed in the SP defined by the intersection of the positive half-space of h1 and the negative half-space of h2. The same argument applies for ζ0, ζ2, ζ3. From here on in, we will refer to skill ζi interchangeably with its index i. Skill hyperplanes have two functions: (1) They automatically compose skills together, creating chainable skills as desired by Bacon & Precup (2015). (2) They define SPs which enable us to derive the probability of executing a skill, given a state x and MDP m. First, we need to be able to uniquely identify a skill. We define a binary vector B = [b1, b2, · · · , bK] ∈{0, 1}K where bk is a Bernoulli random variable and K is the number of skill hyperplanes. We define the skill index i = PK k=1 2k−1bk as a sum of Bernoulli random variables bk. Note that this is but one approach to generate skills (and SPs). In principle this setup defines 2K skills, but in practice, far fewer skills are typically used (see experiments). Furthermore, the complexity of the SP is governed by the VC-dimension. We can now define the probability of executing skill i as a Bernoulli likelihood in Equation 1. P(i|x, m) = P " i = K X k=1 2k−1bk # = Y k pk(bk = ik|x, m) . (1) Here, ik ∈{0, 1} is the value of the kth bit of B, x is the current state and m is a description of the MDP. The probability pk(bk = 1|x, m) and pk(bk = 0|x, m) are defined in Equation 2. pk(bk = 1|x, m) = 1 1 + exp(−αψT (x,m)βk), pk(bk = 0|x, m) = 1 −pk(bk = 1|x, m) . (2) We have made use of the logistic sigmoid function to ensure valid probabilities where ψT x,mβk is a skill hyperplane and α > 0 is a temperature parameter. The intuition here is that the kth bit of a skill, bk = 1, if the skill hyperplane ψT x,mβk > 0 meaning that the skill’s partition is in the positive half-space of the hyperplane. Similarly, bk = 0 if ψT x,mβk < 0 corresponding to the negative half-space. Using skill 3 as an example with K = 2 hyperplanes in Figure 1a, we would define the Bernoulli likelihood of executing ζ3 as p(i = 3|x, m) = p1(b1 = 1|x, m) · p2(b2 = 1|x, m). Intra-Skill Policy: Now that we can define the probability of executing a skill based on its SP, we define the intra-skill policy σθ for each skill. The Gibb’s distribution is a commonly used function to define policies in RL (Sutton et al., 1999). Therefore we define the intra-skill policy for skill i, parameterized by θi ∈Rd as σθi(a|s) = exp (αφT x,aθi) P b∈A exp (αφT x,bθi) . (3) 3 Here, α > 0 is the temperature, φx,a ∈Rd is a feature vector that depends on the current state x ∈X and action a ∈A. Now that we have a definition of both the probability of executing a skill and an intra-skill policy, we need to incorporate these distributions into the policy gradient setting using a generalized trajectory. Generalized Trajectory: A generalized trajectory is necessary to derive policy gradient update rules with respect to the parameters Θ, β as will be shown in Section 4. A typical trajectory is usually defined as τ = (xt, at, rt, xt+1)T t=0 where T is the length of the trajectory. For a generalized trajectory, our algorithm emits a class it at each timestep t ≥1, which denotes the skill that was executed. The generalized trajectory is defined as g = (xt, at, it, rt, xt+1)T t=0. The probability of a generalized trajectory, as an extension to the PG trajectory in Section 2, is now, PΘ,β(g) = P(x0) QT t=0 P(xt+1|xt, at)Pβ(it|xt, m)σθi(at|xt), where Pβ(it|xt, m) is the probability of a skill being executed, given the state xt ∈X and environment m at time t ≥1; σθi(at|xt) is the probability of executing action at ∈A at time t ≥1 given that we are executing skill i. The generalized trajectory is now a function of two parameter vectors θ and β. 4 Adaptive Skills, Adaptive Partitions (ASAP) Framework The Adaptive Skills, Adaptive Partitions (ASAP) framework simultaneously learns a near-optimal set of skills and SPs (inter-skill policy), given an initially misspecified model. ASAP also automatically composes skills together and allows for a multi-task setting as it incorporates the environment m into its hyperplane feature set. We have previously defined two important distributions Pβ(it|xt, m) and σθi(at|xt) respectively. These distributions are used to collectively define the ASAP policy which is presented below. Using the notion of a generalized trajectory, the ASAP policy can be learned in a policy gradient setting. ASAP Policy: Assume that we are given a probability distribution µ over MDPs with a d-dimensional state-action space and a z-dimensional vector describing each MDP. We define β as a (d + z) × K matrix where each column βi represents a skill hyperplane, and Θ is a (d × 2K) matrix where each column θj parameterizes an intra-skill policy. Using the previously defined distributions, we now define the ASAP policy. Definition 3. (ASAP Policy). Given K skill hyperplanes, a set of 2K skills Σ = {ζi|i = 1, · · · 2K}, a state space x ∈X, a set of actions a ∈A and an MDP m from a hypothesis space of MDPs, the ASAP policy is defined as, πΘ,β(a|x, m) = 2K X i=1 Pβ(i|x, m)σθi(a|x) , (4) where Pβ(i|x, m) and σθi(a|s) are the distributions as defined in Equations 1 and 3 respectively. This is a powerful description for a policy, which resembles a Bayesian approach, as the policy takes into account the uncertainty of the skills that are executing as well as the actions that each skill’s intra-skill policy chooses. We now define the ASAP objective with respect to the ASAP policy. ASAP Objective: We defined the policy with respect to a hypothesis space of m MDPs. We now need to define an objective function which takes this hypothesis space into account. Since we assume that we are provided with a distribution µ : M →[0, 1] over possible MDP models m ∈M, with a d-dimensional state-action space, we can incorporate this into the ASAP objective function: ρ(πΘ,β) = Z µ(m)J(m)(πΘ,β)dm , (5) where πΘ,β is the ASAP policy and J(m)(πΘ,β) is the expected return for MDP m with respect to the ASAP policy. To simplify the notation, we group all of the parameters into a single parameter vector Ω= [vec(Θ), vec(β)]. We define the expected reward for generalized trajectories g as J(πΩ) = R g PΩ(g)R(g)dg, where R(g) is reward obtained for a particular trajectory g. This is a slight variation of the original policy gradient objective defined in Section 2. We then insert J(πΩ) into Equation 5 and we get the ASAP objective function ρ(πΩ) = Z µ(m)J(m)(πΩ)dm , (6) 4 where J(m)(πΩ) is the expected return for policy πΩin MDP m. Next, we need to derive gradient update rules to learn the parameters of the optimal policy π∗ Ωthat maximizes this objective. ASAP Gradients: To learn both intra-skill policy parameters matrix Θ as well as the hyperplane parameters matrix β (and therefore implicitly the SPs), we derive an update rule for the policy gradient framework with generalized trajectories. The full derivation is in the supplementary material. The first step involves calculating the gradient of the ASAP objective function yielding the ASAP gradient (Theorem 1). Theorem 1. (ASAP Gradient Theorem). Suppose that the ASAP objective function is ρ(πΩ) = R µ(m)J(m)(πΩ)dm where µ(m) is a distribution over MDPs m and J(m)(πΩ) is the expected return for MDP m whilst following policy πΩ, then the gradient of this objective is: ∇Ωρ(πΩ) = Eµ(m)  EP (m) Ω (g) H(m) X i=0 ∇ΩZ(m) Ω (xt, it, at)R(m)  , where Z(m) Ω (xt, it, at) = log Pβ(it|xt, m)σθi(at|xt), H(m) is the length of a trajectory for MDP m; R(m) = PH(m) i=0 γiri is the discounted cumulative reward for trajectory H(m) 1. If we are able to derive ∇ΩZ(m) Ω (xt, it, at), then we can estimate the gradient ∇Ωρ(πΩ). We will refer to Z(m) Ω = Z(m) Ω (xt, it, at) where it is clear from context. It turns out that it is possible to derive this term as a result of the generalized trajectory. This yields the gradients ∇ΘZ(m) Ω and ∇βZ(m) Ω in Theorems 2 and 3 respectively. The derivations can be found the supplementary material. Theorem 2. (Θ Gradient Theorem). Suppose that Θ is a (d × 2K) matrix where each column θj parameterizes an intra-skill policy. Then the gradient ∇θit Z(m) Ω corresponding to the intra-skill parameters of the ith skill at time t is: ∇θit Z(m) Ω = αφxt,at − α P b∈A φxt,bt exp(αφT xt,btΘit)  P b∈A exp(αφT xt,btΘit)  , where α > 0 is the temperature parameter and φxt,at ∈Rd×2K is a feature vector of the current state xt ∈Xt and the current action at ∈At. Theorem 3. (β Gradient Theorem). Suppose that β is a (d + z) × K matrix where each column βk represents a skill hyperplane. Then the gradient ∇βkZ(m) Ω corresponding to parameters of the kth hyperplane is: ∇βk,1Z(m) Ω = αψ(xt,m) exp(−αψT xt,mβk) 1 + exp(−αψTxt,mβk)  , ∇βk,0Z(m) Ω = −αψxt,m + αψxt,m exp(−αψT xt,mβk) 1 + exp(−αψTxt,mβk)  (7) where α > 0 is the hyperplane temperature parameter, ψT (xt,m)βk is the kth skill hyperplane for MDP m, βk,1 corresponds to locations in the binary vector equal to 1 (bk = 1) and βk,0 corresponds to locations in the binary vector equal to 0 (bk = 0). Using these gradient updates, we can then order all of the gradients into a vector ∇ΩZ(m) Ω = ⟨∇θ1Z(m) Ω . . . ∇θ2k Z(m) Ω , ∇β1Z(m) Ω . . . ∇βkZ(m) Ω ⟩and update both the intra-skill policy parameters and hyperplane parameters for the given task (learning a skill set and SPs). Note that the updates occur on a single time scale. This is formally stated in the ASAP Algorithm. 5 ASAP Algorithm We present the ASAP algorithm (Algorithm 1) that dynamically and simultaneously learns skills, the inter-skill policy and automatically composes skills together by learning SPs. The skills (Θ matrix) and SPs (β matrix) are initially arbitrary and therefore form a misspecified model. Line 2 combines 1These expectations can easily be sampled (see supplementary material). 5 the skill and hyperplane parameters into a single parameter vector Ω. Lines 3 −7 learns the skill and hyperplane parameters (and therefore implicitly the skill partitions). In line 4 a generalized trajectory is generated using the current ASAP policy. The gradient ∇Ωρ(πΩ) is then estimated in line 5 from this trajectory and updates the parameters in line 6. This is repeated until the skill and hyperplane parameters have converged, thus correcting the misspecified model. Theorem 4 provides a convergence guarantee of ASAP to a local optimum (see supplementary material for the proof). Algorithm 1 ASAP Require: φs,a ∈Rd {state-action feature vector}, ψx,m ∈R(d+z) {skill hyperplane feature vector}, K {The number of hyperplanes}, Θ ∈Rd×2K {An arbitrary skill matrix}, β ∈R(d+z)×K {An arbitrary skill hyperplane matrix}, µ(m) {A distribution over MDP tasks} 1: Z = (|d||2K| + |(d + z)K|) {Define the number of parameters} 2: Ω= [vec(Θ), vec(β)] ∈RZ 3: repeat 4: Perform a trial (which may consist of multiple MDP tasks) and obtain x0:H, i0:H, a0:H, r0:H, m0:H {states, skills, actions, rewards, task-specific information} 5: ∇Ωρ(πΩ) = P m PT (m) i=0 ∇ΩZ(m)(Ω)R(m)  {T is the task episode length} 6: Ω→Ω+ η∇Ωρ(πΩ) 7: until parameters Ωhave converged 8: return Ω Theorem 4. Convergence of ASAP: Given an ASAP policy π(Ω), an ASAP objective over MDP models ρ(πΩ) as well as the ASAP gradient update rules. If (1) the step-size ηk satisfies lim k→∞ηk = 0 and P k ηk = ∞; (2) The second derivative of the policy is bounded and we have bounded rewards; Then, the sequence {ρ(πΩ,k)}∞ k=0 converges such that lim k→∞ ∂ρ(πΩ,k) ∂Ω = 0 almost surely. 6 Experiments The experiments have been performed on four different continuous domains: the Two Rooms (2R) domain (Figure 1b), the Flipped 2R domain (Figure 1c), the Three rooms (3R) domain (Figure 1d) and RoboCup domains (Figure 1e) that include a one-on-one scenario between a striker and a goalkeeper (R1), a two-on-one scenario of a striker against a goalkeeper and a defender (R2), and a striker against two defenders and a goalkeeper (R3) (see supplementary material). In each experiment, ASAP is provided with a misspecified model; that is, a set of skills and SPs (the inter-skill policy) that achieve degenerate, sub-optimal performance. ASAP corrects this misspecified model in each case to learn a set of near-optimal skills and SPs. For each experiment we implement ASAP using Actor-Critic Policy Gradient (AC-PG) as the learning algorithm 2. The Two-Room and Flipped Room Domains (2R): In both domains, the agent (red ball) needs to reach the goal location (blue square) in the shortest amount of time. The agent receives constant negatives rewards and upon reaching the goal, receives a large positive reward. There is a wall dividing the environment which creates two rooms. The state space is a 4-tuple consisting of the continuous ⟨xagent, yagent⟩location of the agent and the ⟨xgoal, ygoal⟩location of the center of the goal. The agent can move in each of the four cardinal directions. For each experiment involving the two room domains, a single hyperplane is learned (resulting in two SPs) with a linear feature vector representation ψx,m = [1, xagent, yagent]. In addition, a skill is learned in each of the two SPs. The intra-skill policies are represented as a probability distribution over actions. Automated Hyperplane and Skill Learning: Using ASAP, the agent learned intuitive SPs and skills as seen in Figure 1f and g. Each colored region corresponds to a SP. The white arrows have been superimposed onto the figures to indicate the skills learned for each SP. Since each intra-skill policy is a probability distribution over actions, each skill is unable to solve the entire task on its own. ASAP has taken this into account and has positioned the hyperplane accordingly such that the given skill representation can solve the task. Figure 2a shows that ASAP improves upon the initial misspecified partitioning to attain near-optimal performance compared to executing ASAP on the fixed initial misspecified partitioning and on a fixed approximately optimal partitioning. 2AC-PG works well in practice and can be trivially incorporated into ASAP with convergence guarantees 6 Figure 1: (a) The intersection of skill hyperplanes {h1, h2} form four partitions, each of which defines a skill’s execution region (the inter-skill policy). The (b) 2R, (c) Flipped 2R, (d) 3R and (e) RoboCup domains (with a varying number of defenders for R1,R2,R3). The learned skills and Skill Partitions (SPs) for the (f) 2R, (g) Flipped 2R, (h) 3R and (i) across multiple tasks. Figure 2: Average reward of the learned ASAP policy compared to (1) the approximately optimal SPs and skill set as well as (2) the initial misspecified model. This is for the (a) 2R, (b) 3R, (c) 2R learning across multiple tasks and the (d) 2R without learning by flipping the hyperplane. (e) The average reward of the learned ASAP policy for a varying number of K hyperplanes. (f) The learned SPs and skill set for the R1 domain. (g) The learned SPs using a polynomial hyperplane (1),(2) and linear hyperplane (3) representation. (h) The learned SPs using a polynomial hyperplane representation without the defender’s location as a feature (1) and with the defender’s x location (2), y location (3), and ⟨x, y⟩location as a feature (4). (i) The dribbling behavior of the striker when taking the defender’s y location into account. (j) The average reward for the R1 domain. Multiple Hyperplanes: We analyzed the ASAP framework when learning multiple hyperplanes in the two room domain. As seen in Figure 2e, increasing the number of hyperplanes K, does not have an impact on the final solution in terms of average reward. However, it does increase the computational complexity of the algorithm since 2K skills need to be learned. The approximate points of convergence are marked in the figure as K1, K2 and K3, respectively. In addition, two skills dominate in each case producing similar partitions to those seen in Figure 1a (see supplementary material) indicating that ASAP learns that not all skills are necessary to solve the task. Multitask Learning: We first applied ASAP to the 2R domain (Task 1) and attained a near optimal average reward (Figure 2c). It took approximately 35000 episodes to get near-optimal performance and resulted in the SPs and skill set shown in Figure 1i (top). Using the learned SPs and skills, ASAP was then able to adapt and learn a new set of SPs and skills to solve a different task (Flipped 2R Task 2) in only 5000 episodes (Figure 2c) indicating that the parameters learned from the old task provided a good initialization for the new task. The knowledge transfer is seen in Figure 1i (bottom) as the SPs do not significantly change between tasks, yet the skills are completely relearned. We also wanted to see whether we could flip the SPs; that is, switch the sign of the hyperplane parameters learned in the 2R domain and see whether ASAP can solve the Flipped 2R domain (Task 2) without any additional learning. Due to the symmetry of the domains, ASAP was indeed able to solve the new domain and attained near-optimal performance (Figure 2d). This is an exciting result as many problems, especially navigation tasks, possess symmetrical characteristics. This insight could dramatically reduce the sample complexity of these problems. The Three-Room Domain (3R): The 3R domain (Figure 1d), is similar to the 2R domain regarding the goal, state-space, available actions and rewards. However, in this case, there are two walls, dividing the state space into three rooms. The hyperplane feature vector ψx,m consists of a single 7 fourier feature. The intra-skill policy is a probability distribution over actions. The resulting learned hyperplane partitioning and skill set are shown in Figure 1h. Using this partitioning ASAP achieved near optimal performance (Figure 2b). This experiment shows an insightful and unexpected result. Reusable Skills: Using this hyperplane representation, ASAP was able to not only learn the intra-skill policies and SPs, but also that skill ‘A’ needed to be reused in two different parts of the state space (Figure 1h). ASAP therefore shows the potential to automatically create reusable skills. RoboCup Domain: The RoboCup 2D soccer simulation domain (Akiyama & Nakashima, 2014) is a 2D soccer field (Figure 1e) with two opposing teams. We utilized three RoboCup sub-domains 3 R1, R2 and R3 as mentioned previously. In these sub-domains, a striker (the agent) needs to learn to dribble the ball and try and score goals past the goalkeeper. State space: R1 domain the continuous locations of the striker ⟨xstriker, ystriker⟩, the ball ⟨xball, yball⟩, the goalkeeper ⟨xgoalkeeper, ygoalkeeper⟩and the constant goal location ⟨xgoal, ygoal⟩. R2 domain - we have the addition of the defender’s location ⟨xdefender, ydefender⟩to the state space. R3 domain - we add the locations of two defenders. Features: For the R1 domain, we tested both a linear and degree two polynomial feature representation for the hyperplanes. For the R2 and R3 domains, we also utilized a degree two polynomial hyperplane feature representation. Actions: The striker has three actions which are (1) move to the ball (M), (2) move to the ball and dribble towards the goal (D) (3) move to the ball and shoot towards the goal (S). Rewards: The reward setup is consistent with logical football strategies (Hausknecht & Stone, 2015; Bai et al., 2012). Small negative (positive) rewards for shooting from outside (inside) the box and dribbling when inside (outside) the box. Large negative rewards for losing possession and kicking the ball out of bounds. Large positive reward for scoring. Different SP Optimas: Since ASAP attains a locally optimal solution, it may sometimes learn different SPs. For the polynomial hyperplane feature representation, ASAP attained two different solutions as shown in Figure 2g(1) as well as Figure 2g(2), respectively. Both achieve near optimal performance compared to the approximately optimal scoring controller (see supplementary material). For the linear feature representation, the SPs and skill set in Figure 2g(3) is obtained and achieved near-optimal performance (Figure 2j), outperforming the polynomial representation. SP Sensitivity: In the R2 domain, an additional player (the defender) is added to the game. It is expected that the presence of the defender will affect the shape of the learned SPs. ASAP again learns intuitive SPs. However, the shape of the learned SPs change based on the pre-defined hyperplane feature vector ψm,x. Figure 2h(1) shows the learned SPs when the location of the defender is not used as a hyperplane feature. When the x location of the defender is utilized, the ‘flatter’ SPs are learned in Figure 2h(2). Using the y location of the defender as a hyperplane feature causes the hyperplane offset shown in Figure 2h(3). This is due to the striker learning to dribble around the defender in order to score a goal as seen in Figure 2i. Finally, taking the ⟨x, y⟩location of the defender into account results in the ‘squashed’ SPs shown in Figure 2h(4) clearly showing the sensitivity and adaptability of ASAP to dynamic factors in the environment. 7 Discussion We have presented the Adaptive Skills, Adaptive Partitions (ASAP) framework that is able to automatically compose skills together and learns a near-optimal skill set and skill partitions (the inter-skill policy) simultaneously to correct an initially misspecified model. We derived the gradient update rules for both skill and skill hyperplane parameters and incorporated them into a policy gradient framework. This is possible due to our definition of a generalized trajectory. In addition, ASAP has shown the potential to learn across multiple tasks as well as automatically reuse skills. These are the necessary requirements for a truly general skill learning framework and can be applied to lifelong learning problems (Ammar et al., 2015; Thrun & Mitchell, 1995). An exciting extension of this work is to incorporate it into a Deep Reinforcement Learning framework, where both the skills and ASAP policy can be represented as deep networks. Acknowledgements The research leading to these results has received funding from the European Research Council under the European Union’s Seventh Framework Program (FP/2007-2013) / ERC Grant Agreement n. 306638. 3https://github.com/mhauskn/HFO.git 8 References Akiyama, Hidehisa and Nakashima, Tomoharu. Helios base: An open source package for the robocup soccer 2d simulation. In RoboCup 2013: Robot World Cup XVII, pp. 528–535. Springer, 2014. Ammar, Haitham Bou, Tutunov, Rasul, and Eaton, Eric. Safe policy search for lifelong reinforcement learning with sublinear regret. arXiv preprint arXiv:1505.05798, 2015. Bacon, Pierre-Luc and Precup, Doina. The option-critic architecture. In NIPS Deep Reinforcement Learning Workshop, 2015. Bai, Aijun, Wu, Feng, and Chen, Xiaoping. Online planning for large mdps with maxq decomposition. In AAMAS, 2012. da Silva, B.C., Konidaris, G.D., and Barto, A.G. Learning parameterized skills. In ICML, 2012. Eaton, Eric and Ruvolo, Paul L. Ella: An efficient lifelong learning algorithm. In Proceedings of the 30th international conference on machine learning (ICML-13), pp. 507–515, 2013. Fu, Justin, Levine, Sergey, and Abbeel, Pieter. One-shot learning of manipulation skills with online dynamics adaptation and neural network priors. arXiv preprint arXiv:1509.06841, 2015. Hausknecht, Matthew and Stone, Peter. Deep reinforcement learning in parameterized action space. arXiv preprint arXiv:1511.04143, 2015. Hauskrecht, Milos, Meuleau Nicolas et. al. Hierarchical solution of markov decision processes using macro-actions. In UAI, pp. 220–229, 1998. Konidaris, George and Barto, Andrew G. Skill discovery in continuous reinforcement learning domains using skill chaining. In NIPS, 2009. Mankowitz, Daniel J, Mann, Timothy A, and Mannor, Shie. Time regularized interrupting options. Internation Conference on Machine Learning, 2014. Mann, Timothy A and Mannor, Shie. Scaling up approximate value iteration with options: Better policies with fewer iterations. In Proceedings of the 31 st International Conference on Machine Learning, 2014. Mann, Timothy Arthur, Mankowitz, Daniel J, and Mannor, Shie. Learning when to switch between skills in a high dimensional domain. In AAAI Workshop, 2015. Masson, Warwick and Konidaris, George. Reinforcement learning with parameterized actions. arXiv preprint arXiv:1509.01644, 2015. Peters, Jan and Schaal, Stefan. Policy gradient methods for robotics. In Intelligent Robots and Systems, 2006 IEEE/RSJ International Conference on, pp. 2219–2225. IEEE, 2006. Peters, Jan and Schaal, Stefan. Reinforcement learning of motor skills with policy gradients. Neural Networks, 21:682–691, 2008. Precup, Doina and Sutton, Richard S. Multi-time models for temporally abstract planning. In Advances in Neural Information Processing Systems 10 (Proceedings of NIPS’97), 1997. Precup, Doina, Sutton, Richard S, and Singh, Satinder. Theoretical results on reinforcement learning with temporally abstract options. In Machine Learning: ECML-98, pp. 382–393. Springer, 1998. Silver, David and Ciosek, Kamil. Compositional Planning Using Optimal Option Models. In Proceedings of the 29th International Conference on Machine Learning, Edinburgh, 2012. Sutton, Richard S, Precup, Doina, and Singh, Satinder. Between MDPs and semi-MDPs: A framework for temporal abstraction in reinforcement learning. Artificial Intelligence, 1999. Sutton, Richard S, McAllester, David, Singh, Satindar, and Mansour, Yishay. Policy gradient methods for reinforcement learning with function approximation. In NIPS, pp. 1057–1063, 2000. Thrun, Sebastian and Mitchell, Tom M. Lifelong robot learning. Springer, 1995. 9
2016
347
6,269
Riemannian SVRG: Fast Stochastic Optimization on Riemannian Manifolds Hongyi Zhang MIT Sashank J. Reddi Carnegie Mellon University Suvrit Sra MIT Abstract We study optimization of finite sums of geodesically smooth functions on Riemannian manifolds. Although variance reduction techniques for optimizing finite-sums have witnessed tremendous attention in the recent years, existing work is limited to vector space problems. We introduce Riemannian SVRG (RSVRG), a new variance reduced Riemannian optimization method. We analyze RSVRG for both geodesically convex and nonconvex (smooth) functions. Our analysis reveals that RSVRG inherits advantages of the usual SVRG method, but with factors depending on curvature of the manifold that influence its convergence. To our knowledge, RSVRG is the first provably fast stochastic Riemannian method. Moreover, our paper presents the first non-asymptotic complexity analysis (novel even for the batch setting) for nonconvex Riemannian optimization. Our results have several implications; for instance, they offer a Riemannian perspective on variance reduced PCA, which promises a short, transparent convergence analysis. 1 Introduction We study the following rich class of (possibly nonconvex) finite-sum optimization problems: min x2X⇢M f(x) , 1 n n X i=1 fi(x), (1) where (M, g) is a Riemannian manifold with the Riemannian metric g, and X ⇢M is a geodesically convex set. We assume that each fi : M ! R is geodesically L-smooth (see §2). Problem (1) generalizes the fundamental machine learning problem of empirical risk minimization, which is usually cast in vector spaces, to a Riemannian setting. It also includes as special cases important problems such as principal component analysis (PCA), independent component analysis (ICA), dictionary learning, mixture modeling, among others (see e.g., the related work section). The Euclidean version of (1) where M = Rd and g is the Euclidean inner-product has been the subject of intense algorithmic development in machine learning and optimization, starting with the classical work of Robbins and Monro [26] to the recent spate of work on variance reduction [10; 18; 20; 25; 28]. However, when (M, g) is a nonlinear Riemannian manifold, much less is known beyond [7; 38]. When solving problems with manifold constraints, one common approach is to alternate between optimizing in the ambient Euclidean space and “projecting” onto the manifold. For example, two well-known methods to compute the leading eigenvector of symmetric matrices, power iteration and Oja’s algorithm [23], are in essence projected gradient and projected stochastic gradient algorithms. For certain manifolds (e.g., positive definite matrices), projections can be quite expensive to compute. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. An effective alternative is to use Riemannian optimization1, which directly operates on the manifold in question. This mode of operation allows Riemannian optimization to view the constrained optimization problem (1) as an unconstrained problem on a manifold, and thus, to be “projection-free.” More important is its conceptual value: viewing a problem through the Riemannian lens, one can discover insights into problem geometry, which can translate into better optimization algorithms. Although the Riemannian approach is appealing, our knowledge of it is fairly limited. In particular, there is little analysis about its global complexity (a.k.a. non-asymptotic convergence rate), in part due to the difficulty posed by the nonlinear metric. Only very recently Zhang and Sra [38] developed the first global complexity analysis of batch and stochastic gradient methods for geodesically convex functions. However, the batch and stochastic gradient methods in [38] suffer from problems similar to their vector space counterparts. For solving finite sum problems with n components, the full-gradient method requires n derivatives at each step; the stochastic method requires only one derivative but at the expense of slower O(1/✏2) convergence to an ✏-accurate solution. These issues have motivated much of the recent progress on faster stochastic optimization in vector spaces by using variance reduction [10; 18; 28] techniques. However, all ensuing methods critically rely on properties of vector spaces, whereby, adapting them to work in the context of Riemannian manifolds poses major challenges. Given the richness of Riemannian optimization (it includes vector space optimization as a special case) and its growing number of applications, developing fast stochastic Riemannian optimization is important. It will help us apply Riemannian optimization to large-scale problems, while offering a new set of algorithmic tools for the practitioner’s repertoire. Contributions. We summarize the key contributions of this paper below. • We introduce Riemannian SVRG (RSVRG), a variance reduced Riemannian stochastic gradient method based on SVRG [18]. We analyze RSVRG for geodesically strongly convex functions through a novel theoretical analysis that accounts for the nonlinear (curved) geometry of the manifold to yield linear convergence rates. • Building on recent advances in variance reduction for nonconvex optimization [3; 25], we generalize the convergence analysis of RSVRG to (geodesically) nonconvex functions and also to gradient dominated functions (see §2 for the definition). Our analysis provides the first stochastic Riemannian method that is provably superior to both batch and stochastic (Riemannian) gradient methods for nonconvex finite-sum problems. • Using a Riemannian formulation and applying our result for (geodesically) gradient-dominated functions, we provide new insights, and a short transparent analysis explaining fast convergence of variance reduced PCA for computing the leading eigenvector of a symmetric matrix. To our knowledge, this paper provides the first stochastic gradient method with global linear convergence rates for geodesically strongly convex functions, as well as the first non-asymptotic convergence rates for geodesically nonconvex optimization (even in the batch case). Our analysis reveals how manifold geometry, in particular curvature, impacts convergence rates. We illustrate the benefits of RSVRG by showing an application to computing leading eigenvectors of a symmetric matrix and to the task of computing the Riemannian centroid of covariance matrices, a problem that has received great attention in the literature [5; 16; 38]. Related Work. Variance reduction techniques, such as control variates, are widely used in Monte Carlo simulations [27]. In linear spaces, variance reduced methods for solving finite-sum problems have recently witnessed a huge surge of interest [e.g. 4; 10; 14; 18; 20; 28; 36]. They have been shown to accelerate stochastic optimization for strongly convex objectives, convex objectives, nonconvex fi (i 2 [n]), and even when both f and fi (i 2 [n]) are nonconvex [3; 25]. Reddi et al. [25] further proved global linear convergence for gradient dominated nonconvex problems. Our analysis is inspired by [18; 25], but applies to the substantially more general Riemannian optimization setting. References of Riemannian optimization can be found in [1; 33], where analysis is limited to asymptotic convergence (except [33, Theorem 4.2] which proved linear rate convergence for first-order line search method with bounded and positive definite hessian). Stochastic Riemannian optimization has 1Riemannian optimization is optimization on a known manifold structure. Note the distinction from manifold learning, which attempts to learn a manifold structure from data. We briefly review some Riemannian optimization applications in the related work. 2 been previously considered in [7; 21], though with only asymptotic convergence analysis, and without any rates. Many applications of Riemannian optimization are known, including matrix factorization on fixed-rank manifold [32; 34], dictionary learning [8; 31], optimization under orthogonality constraints [11; 22], covariance estimation [35], learning elliptical distributions [30; 39], and Gaussian mixture models [15]. Notably, some nonconvex Euclidean problems are geodesically convex, for which Riemannian optimization can provide similar guarantees to convex optimization. Zhang and Sra [38] provide the first global complexity analysis for first-order Riemannian algorithms, but their analysis is restricted to geodesically convex problems with full or stochastic gradients. In contrast, we propose RSVRG, a variance reduced Riemannian stochastic gradient algorithm, and analyze its global complexity for both geodesically convex and nonconvex problems. In parallel with our work, [19] also proposed and analyzed RSVRG specifically for the Grassmann manifold. Their complexity analysis is restricted to local convergence to strict local minima, which essentially corresponds to our analysis of (locally) geodesically strongly convex functions. 2 Preliminaries Before formally discussing Riemannian optimization, let us recall some foundational concepts of Riemannian geometry. For a thorough review one can refer to any classic text, e.g.,[24]. A Riemannian manifold (M, g) is a real smooth manifold M equipped with a Riemannain metric g. The metric g induces an inner product structure in each tangent space TxM associated with every x 2 M. We denote the inner product of u, v 2 TxM as hu, vi , gx(u, v); and the norm of u 2 TxM is defined as kuk , p gx(u, u). The angle between u, v is defined as arccos hu,vi kukkvk. A geodesic is a constant speed curve γ : [0, 1] ! M that is locally distance minimizing. An exponential map Expx : TxM ! M maps v in TxM to y on M, such that there is a geodesic γ with γ(0) = x, γ(1) = y and ˙γ(0) , d dtγ(0) = v. If between any two points in X ⇢M there is a unique geodesic, the exponential map has an inverse Exp−1 x : X ! TxM and the geodesic is the unique shortest path with kExp−1 x (y)k = kExp−1 y (x)k the geodesic distance between x, y 2 X. Parallel transport Γy x : TxM ! TyM maps a vector v 2 TxM to Γy xv 2 TyM, while preserving norm, and roughly speaking, “direction,” analogous to translation in Rd. A tangent vector of a geodesic γ remains tangent if parallel transported along γ. Parallel transport preserves inner products. x v Expx(v) x v y Γy xv Figure 1: Illustration of manifold operations. (Left) A vector v in TxM is mapped to Expx(v); (right) A vector v in TxM is parallel transported to TyM as Γy xv. The geometry of a Riemannian manifold is determined by its Riemannian metric tensor through various characterization of curvatures. Let u, v 2 TxM be linearly independent, so that they span a two dimensional subspace of TxM. Under the exponential map, this subspace is mapped to a two dimensional submanifold of U ⇢M. The sectional curvature (x, U) is defined as the Gauss curvature of U at x. As we will mainly analyze manifold trigonometry, for worst-case analysis, it is sufficient to consider sectional curvature. Function Classes. We now define some key terms. A set X is called geodesically convex if for any x, y 2 X, there is a geodesic γ with γ(0) = x, γ(1) = y and γ(t) 2 X for t 2 [0, 1]. Throughout the paper, we assume that the function f in (1) is defined on a geodesically convex set X on a Riemannian manifold M. We call a function f : X ! R geodesically convex (g-convex) if for any x, y 2 X and any geodesic γ such that γ(0) = x, γ(1) = y and γ(t) 2 X for t 2 [0, 1], it holds that f(γ(t)) (1 −t)f(x) + tf(y). 3 It can be shown that if the inverse exponential map is well-defined, an equivalent definition is that for any x, y 2 X, f(y) ≥f(x) + hgx, Exp−1 x (y)i, where gx is a subgradient of f at x (or the gradient if f is differentiable). A function f : X ! R is called geodesically µ-strongly convex (µ-strongly g-convex) if for any x, y 2 X and subgradient gx, it holds that f(y) ≥f(x) + hgx, Exp−1 x (y)i + µ 2 kExp−1 x (y)k2. We call a vector field g : X ! Rd geodesically L-Lipschitz (L-g-Lipschitz) if for any x, y 2 X, kg(x) −Γx yg(y)k LkExp−1 x (y)k, where Γx y is the parallel transport from y to x. We call a differentiable function f : X ! R geodesically L-smooth (L-g-smooth) if its gradient is L-g-Lipschitz, in which case we have f(y) f(x) + hgx, Exp−1 x (y)i + L 2 kExp−1 x (y)k2. We say f : X ! R is ⌧-gradient dominated if x⇤is a global minimizer of f and for every x 2 X f(x) −f(x⇤) ⌧krf(x)k2. (2) We recall the following trigonometric distance bound that is essential for our analysis: Lemma 1 ([7; 38]). If a, b, c are the side lengths of a geodesic triangle in a Riemannian manifold with sectional curvature lower bounded by min, and A is the angle between sides b and c (defined through inverse exponential map and inner product in tangent space), then a2  p |min|c tanh( p |min|c) b2 + c2 −2bc cos(A). (3) An Incremental First-order Oracle (IFO) [2] in (1) takes an i 2 [n] and a point x 2 X, and returns a pair (fi(x), rfi(x)) 2 R ⇥TxM. We measure non-asymptotic complexity in terms of IFO calls. 3 Riemannian SVRG In this section we introduce RSVRG formally. We make the following standing assumptions: (a) f attains its optimum at x⇤2 X; (b) X is compact, and the diameter of X is bounded by D, that is, maxx,y2X d(x, y) D; (c) the sectional curvature in X is upper bounded by max, and within X the exponential map is invertible; and (d) the sectional curvature in X is lower bounded by min. We define the following key geometric constant that capture the impact of manifold curvature: ⇣= ( p |min|D tanh(p |min|D), if min < 0, 1, if min ≥0, (4) We note that most (if not all) practical manifold optimization problems can satisfy these assumptions. Our proposed RSVRG algorithm is shown in Algorithm 1. Compared with the Euclidean SVRG, it differs in two key aspects: the variance reduction step uses parallel transport to combine gradients from different tangent spaces; and the exponential map is used (instead of the update xs+1 t −⌘vs+1 t ). 3.1 Convergence analysis for strongly g-convex functions In this section, we analyze global complexity of RSVRG for solving (1), where each fi (i 2 [n]) is g-smooth and f is strongly g-convex. In this case, we show that RSVRG has linear convergence rate. This is in contrast with the O(1/t) rate of Riemannian stochastic gradient algorithm for strongly g-convex functions [38]. Theorem 1. Assume in (1) each fi is L-g-smooth, and f is µ-strongly g-convex, then if we run Algorithm 1 with Option I and parameters that satisfy ↵= 3⇣⌘L2 µ −2⇣⌘L2 + (1 + 4⇣⌘2 −2⌘µ)m(µ −5⇣⌘L2) µ −2⇣⌘L2 < 1 then with S outer loops, the Riemannian SVRG algorithm produces an iterate xa that satisfies Ed2(xa, x⇤) ↵Sd2(x0, x⇤). 4 Algorithm 1: RSVRG (x0, m, ⌘, S) Parameters: update frequency m, learning rate ⌘, number of epochs S initialize ˜x0 = x0; for s = 0, 1, . . . , S −1 do xs+1 0 = ˜xs; gs+1 = 1 n Pn i=1 rfi(˜xs); for t = 0, 1, . . . , m −1 do Randomly pick it 2 {1, . . . , n}; vs+1 t = rfit(xs+1 t ) −Γ xs+1 t ˜xs " rfit(˜xs) −gs+1# ; xs+1 t+1 = Expxs+1 t " −⌘vs+1 t # ; end Set ˜xs+1 = xs+1 m ; end Option I: output xa = ˜xS; Option II: output xa chosen uniformly randomly from {{xs+1 t }m−1 t=0 }S−1 s=0 . The proof of Theorem 1 is in the appendix, and takes a different route compared with the original SVRG proof [18]. Specifically, due to the nonlinear Riemannian metric, we are not able to bound the squared norm of the variance reduced gradient by f(x) −f(x⇤). Instead, we bound this quantity by the squared distances to the minimizer, and show linear convergence of the iterates. A bound on E[f(x) −f(x⇤)] is then implied by L-g-smoothness, albeit with a stronger dependence on the condition number. Theorem 1 leads to the following more digestible corollary on the global complexity of the algorithm: Corollary 1. With assumptions as in Theorem 1 and properly chosen parameters, after O ⇣ (n + ⇣L2 µ2 ) log( 1 ✏) ⌘ IFO calls, the output xa satisfies E[f(xa) −f(x⇤)] ✏. We give a proof with specific parameter choices in the appendix. Observe the dependence on ⇣in our result: for min < 0, we have ⇣> 1, which implies that negative space curvature adversarially affects convergence rate; while for min ≥0, we have ⇣= 1, which implies that for nonnegatively curved manifolds, the impact of curvature is not explicit. In the rest of our analysis we will see a similar effect of sectional curvature; this phenomenon seems innate to manifold optimization (also see [38]). In the analysis we do not assume each fi to be g-convex, which resulted in a worse dependence on the condition number. We note that a similar result was obtained in linear space [12]. However, we will see in the next section that by generalizing the analysis for gradient dominated functions in [25], we are able to greatly improve this dependence. 3.2 Convergence analysis for geodesically nonconvex functions In this section, we analyze global complexity of RSVRG for solving (1), where each fi is only required to be L-g-smooth, and neither fi nor f need be g-convex. We measure convergence to a stationary point using krf(x)k2 following [13]. Note, however, that here rf(x) 2 TxM and krf(x)k is defined via the inner product in TxM. We first note that Riemannian-SGD on nonconvex L-g-smooth problems attains O(1/✏2) convergence as SGD [13] holds; we relegate the details to the appendix. Recently, two groups independently proved that variance reduction also benefits stochastic gradient methods for nonconvex smooth finite-sum optimization problems, with different analysis [3; 25]. Our analysis for nonconvex RSVRG is inspired by [25]. Our main result for this section is Theorem 2. Theorem 2. Assume in (1) each fi is L-g-smooth, the sectional curvature in X is lower bounded by min, and we run Algorithm 1 with Option II. Then there exist universal constants µ0 2 (0, 1), ⌫> 0 such that if we set ⌘= µ0/(Ln↵1⇣↵2) (0 < ↵1 1 and 0 ↵2 2), m = bn3↵1/2/(3µ0⇣1−2↵2)c and T = mS, we have E[krf(xa)k2] Ln↵1⇣↵2[f(x0)−f(x⇤)] T ⌫ , where x⇤is an optimal solution to (1). 5 Algorithm 2: GD-SVRG(x0, m, ⌘, S, K) Parameters: update frequency m, learning rate ⌘, number of epochs S, K, x0 for k = 0, . . . , K −1 do xk+1 = RSVRG(xk, m, ⌘, S) with Option II; end Output: xK The key challenge in proving Theorem 2 in the Riemannian setting is to incorporate the impact of using a nonlinear metric. Similar to the g-convex case, the nonlienar metric impacts the convergence, notably through the constant ⇣that depends on a lower-bound on sectional curvature. Reddi et al. [25] suggested setting ↵1 = 2/3, in which case we obtain the following corollary. Corollary 2. With assumptions and parameters in Theorem 2, choosing ↵1 = 2/3, the IFO complexity for achieving an ✏-accurate solution is: IFO calls = ⇢ O ' n + (n2/3⇣1−↵2/✏) ( , if ↵2 1/2, O ' n⇣2↵2−1 + (n2/3⇣↵2/✏) ( , if ↵2 > 1/2. Setting ↵2 = 1/2 in Corollary 2 immediately leads to Corollary 3: Corollary 3. With assumptions in Theorem 2 and ↵1 = 2/3, ↵2 = 1/2, the IFO complexity for achieving an ✏-accurate solution is O ' n + (n2/3⇣1/2/✏) ( . The same reasoning allows us to also capture the class of gradient dominated functions (2), for which Reddi et al. [25] proved that SVRG converges linearly to a global optimum. We have the following corresponding theorem for RSVRG: Theorem 3. Suppose that in addition to the assumptions in Theorem 2, f is ⌧-gradient dominated. Then there exist universal constants µ0 2 (0, 1), ⌫> 0 such that if we run Algorithm 2 with ⌘= µ0/(Ln2/3⇣1/2), m = bn/(3µ0)c, S = d(6 + 18µ0 n−3 )L⌧⇣1/2µ0/(⌫n1/3)e, we have E[krf(xK)k2] 2−Kkrf(x0)k2, E[f(xK) −f(x⇤)] 2−K[f(x0) −f(x⇤)]. We summarize the implication of Theorem 3 as follows (note the dependence on curvature): Corollary 4. With Algorithm 2 and the parameters in Theorem 3, the IFO complexity to compute an ✏-accurate solution for a gradient dominated function f is O((n + L⌧⇣1/2n2/3) log(1/✏)). A typical example of gradient dominated function is a strongly g-convex function (see appendix). Specifically, we have the following corollary, which prove linear convergence rate of RSVRG with the same assumptions as in Theorem 1, improving the dependence on the condition number. Corollary 5. With Algorithm 2 and the parameters in Theorem 3, the IFO complexity to compute an ✏-accurate solution for a µ-strongly g-convex function f is O((n + µ−1L⇣1/2n2/3) log(1/✏)). 4 Applications 4.1 Computing the leading eigenvector In this section, we apply our analysis of RSVRG for gradient dominated functions (Theorem 3) to fast eigenvector computation, a fundamental problem that is still being actively researched in the big-data setting [12; 17; 29]. For the problem of computing the leading eigenvector, i.e., min x>x=1 −x> ⇣Xn i=1 ziz> i ⌘ x , −x>Ax = f(x), (5) existing analyses for state-of-the-art algorithms typically result in O(1/δ2) dependence on the eigengap δ of A, as opposed to the conjectured O(1/δ) dependence [29], as well as the O(1/δ) dependence of power iteration. Here we give new support for the O(1/δ) conjecture. Note that Problem (5) seen as one in Rd is nonconvex, with negative semidefinite Hessian everywhere, and has nonlinear constraints. However, we show that on the hypersphere Sd−1 Problem (5) is unconstrained, and has gradient dominated objective. In particular we have the following result: 6 Theorem 4. Suppose A has eigenvalues λ1 > λ2 ≥· · · ≥λd and δ = λ1 −λ2, and x0 is drawn uniformly randomly on the hypersphere. Then with probability 1 −p, x0 falls in a Riemannian ball of a global optimum of the objective function, within which the objective function is O( d p2δ)-gradient dominated. We provide the proof of Theorem 4 in appendix. Theorem 4 gives new insights for why the conjecture might be true – once it is shown that with a constant stepsize and with high probability (both independent of δ) the iterates remain in such a Riemannian ball, applying Corollary 4 one can immediately prove the O(1/δ) dependence conjecture. We leave this analysis as future work. Next we show that variance reduced PCA (VR-PCA) [29] is closely related to RSVRG. We implement Riemannian SVRG for PCA, and use the code for VR-PCA in [29]. Analytic forms for exponential map and parallel transport on hypersphere can be found in [1, Example 5.4.1; Example 8.1.1]. We conduct well-controlled experiments comparing the performance of two algorithms. Specifically, to investigate the dependence of convergence on δ, for each δ = 10−3/k where k = 1, . . . , 25, we generate a d ⇥n matrix Z = (z1, . . . , zn) where d = 103, n = 104 using the method Z = UDV > where U, V are orthonormal matrices and D is a diagonal matrix, as described in [29]. Note that A has the same eigenvalues as D2. All the data matrices share the same U, V and only differ in δ (thus also in D). We also fix the same random initialization x0 and random seed. We run both algorithms on each matrix for 50 epochs. For every five epochs, we estimate the number of epochs required to double its accuracy 2. This number can serve as an indicator of the global complexity of the algorithm. We plot this number for different epochs against 1/δ, shown in Figure 2. Note that the performance of RSVRG and VR-PCA with the same stepsize is very similar, which implies a close connection of the two. Indeed, the update x+v kx+vk used in [29] and others is a well-known approximation to the exponential map Expx(v) with small stepsize (a.k.a. retraction). Also note the complexity of both algorithms seems to have an asymptotically linear dependence on 1/δ. 0 2 4 6 #IFO calls#105 10-8 10-6 10-4 10-2 accuracy / = 1e-3 RSVRG VR-PCA 0 1 2 3 1// #104 0 50 100 #epochs required RSVRG 1-5 11-15 21-25 31-35 41-45 0 1 2 3 1// #104 0 50 100 #epochs required VR-PCA 1-5 11-15 21-25 31-35 41-45 Figure 2: Computing the leading eigenvector. Left: RSVRG and VR-PCA are indistinguishable in terms of IFO complexity. Middle and right: Complexity appears to depend on 1/δ. x-axis shows the inverse of eigengap δ, y-axis shows the estimated number of epochs required to double the accuracy. Lines represent different epoch index. All variables are controlled except for δ. 4.2 Computing the Riemannian centroid In this subsection we validate that RSVRG converges linearly for averaging PSD matrices under the Riemannian metric. The problem for finding the Riemannian centroid of a set of PSD matrices {Ai}n i=1 is X⇤= arg minX⌫0 n f(X; {Ai}n i=1) , Pn i=1 k log(X−1/2AiX−1/2)k2 F o where X is also a PSD matrix. This is a geodesically strongly convex problem, yet nonconvex in Euclidean space. It has been studied both in matrix computation and in various applications [5; 16]. We use the same experiment setting as described in [38] 3, and compare RSVRG against Riemannian full gradient (RGD) and stochastic gradient (RSGD) algorithms (Figure 3). Other methods for this problem include the relaxed Richardson iteration algorithm [6], the approximated joint diagonalization algorithm [9], and Riemannian Newton and quasi-Newton type methods, notably the limited-memory Riemannian 2Accuracy is measured by f(x)−f(x⇤) |f(x⇤)| , i.e. the relative error between the objective value and the optimum. We measure how much the error has been reduced after each five epochs, which is a multiplicative factor c < 1 on the error at the start of each five epochs. Then we use log(2)/ log(1/c) ⇤5 as the estimate, assuming c stays constant. 3We generate 100 ⇥100 random PSD matrices using the Matrix Mean Toolbox [6] with normalization so that the norm of each matrix equals 1. 7 BFGS [37]. However, none of these methods were shown to greatly outperform RGD, especially in data science applications where n is large and extremely small optimization error is not required. Note that the objective is sum of squared Riemannian distances in a nonpositively curved space, thus is (2n)-strongly g-convex and (2n⇣)-g-smooth. According to the proof of Corollary 1 (see appendix) the optimal stepsize for RSVRG is O(1/(⇣3n)). For all the experiments, we initialize all the algorithms using the arithmetic mean of the matrices. We set ⌘= 1 100n, and choose m = n in Algorithm 1 for RSVRG, and use suggested parameters from [38] for other algorithms. The results suggest RSVRG has clear advantage in the large scale setting. 0 1000 2000 #IFO calls 10-5 100 105 accuracy N=100,Q=1e2 RGD RSGD RSVRG 0 1000 2000 #IFO calls 10-5 100 105 accuracy N=100,Q=1e8 RGD RSGD RSVRG 0 5000 10000 #IFO calls 10-5 100 105 accuracy N=1000,Q=1e2 RGD RSGD RSVRG 0 5000 10000 #IFO calls 10-5 100 105 accuracy N=1000,Q=1e8 RGD RSGD RSVRG Figure 3: Riemannian mean of PSD matrices. N: number of matrices, Q: conditional number of each matrix. x-axis shows the actual number of IFO calls, y-axis show f(X) −f(X⇤) in log scale. Lines show the performance of different algorithms in colors. Note that RSVRG achieves linear convergence and is especially advantageous for large dataset. 5 Discussion We introduce Riemannian SVRG, the first variance reduced stochastic gradient algorithm for Riemannian optimization. In addition, we analyze its global complexity for optimizing geodesically strongly convex, convex, and nonconvex functions, explicitly showing their dependence on sectional curvature. Our experiments validate our analysis that Riemannian SVRG is much faster than full gradient and stochastic gradient methods for solving finite-sum optimization problems on Riemannian manifolds. Our analysis of computing the leading eigenvector as a Riemannian optimization problem is also worth noting: a nonconvex problem with nonpositive Hessian and nonlinear constraints in the ambient space turns out to be gradient dominated on the manifold. We believe this shows the promise of theoretical study of Riemannian optimization, and geometric optimization in general, and we hope it encourages other researchers in the community to join this endeavor. Our work also has limitations – most practical Riemannian optimization algorithms use retraction and vector transport to efficiently approximate the exponential map and parallel transport, which we do not analyze in this work. A systematic study of retraction and vector transport is an important topic for future research. For other applications of Riemannian optimization such as low-rank matrix completion [34], covariance matrix estimation [35] and subspace tracking [11], we believe it would also be promising to apply fast incremental gradient algorithms in the large scale setting. Acknowledgment: SS acknowledges support of NSF grant: IIS-1409802. HZ acknowledges support from the Leventhal Fellowship. References [1] P.-A. Absil, R. Mahony, and R. Sepulchre. Optimization algorithms on matrix manifolds. Princeton University Press, 2009. [2] A. Agarwal and L. Bottou. A lower bound for the optimization of finite sums. In Proceedings of the 32nd International Conference on Machine Learning (ICML-15), pages 78–86, 2015. [3] Z. Allen-Zhu and E. Hazan. Variance reduction for faster non-convex optimization. arXiv:1603.05643, 2016. [4] F. Bach and E. Moulines. Non-strongly-convex smooth stochastic approximation with convergence rate o (1/n). In Advances in Neural Information Processing Systems, pages 773–781, 2013. [5] R. Bhatia. Positive Definite Matrices. Princeton University Press, 2007. [6] D. A. Bini and B. Iannazzo. Computing the karcher mean of symmetric positive definite matrices. Linear Algebra and its Applications, 438(4):1700–1710, 2013. [7] S. Bonnabel. Stochastic gradient descent on Riemannian manifolds. Automatic Control, IEEE Transactions on, 58(9):2217–2229, 2013. 8 [8] A. Cherian and S. Sra. Riemannian dictionary learning and sparse coding for positive definite matrices. arXiv:1507.02772, 2015. [9] M. Congedo, B. Afsari, A. Barachant, and M. Moakher. Approximate joint diagonalization and geometric mean of symmetric positive definite matrices. PloS one, 10(4):e0121423, 2015. [10] A. Defazio, F. Bach, and S. Lacoste-Julien. Saga: A fast incremental gradient method with support for non-strongly convex composite objectives. In NIPS, pages 1646–1654, 2014. [11] A. Edelman, T. A. Arias, and S. T. Smith. The geometry of algorithms with orthogonality constraints. SIAM journal on Matrix Analysis and Applications, 20(2):303–353, 1998. [12] D. Garber and E. Hazan. Fast and simple pca via convex optimization. arXiv preprint arXiv:1509.05647, 2015. [13] S. Ghadimi and G. Lan. Stochastic first-and zeroth-order methods for nonconvex stochastic programming. SIAM Journal on Optimization, 23(4):2341–2368, 2013. [14] P. Gong and J. Ye. Linear convergence of variance-reduced stochastic gradient without strong convexity. arXiv preprint arXiv:1406.1102, 2014. [15] R. Hosseini and S. Sra. Matrix manifold optimization for Gaussian mixtures. In NIPS, 2015. [16] B. Jeuris, R. Vandebril, and B. Vandereycken. A survey and comparison of contemporary algorithms for computing the matrix geometric mean. Electronic Transactions on Numerical Analysis, 39:379–402, 2012. [17] C. Jin, S. M. Kakade, C. Musco, P. Netrapalli, and A. Sidford. Robust shift-and-invert preconditioning: Faster and more sample efficient algorithms for eigenvector computation. arXiv:1510.08896, 2015. [18] R. Johnson and T. Zhang. Accelerating stochastic gradient descent using predictive variance reduction. In Advances in Neural Information Processing Systems, pages 315–323, 2013. [19] H. Kasai, H. Sato, and B. Mishra. Riemannian stochastic variance reduced gradient on grassmann manifold. arXiv preprint arXiv:1605.07367, 2016. [20] J. Koneˇcn`y and P. Richtárik. Semi-stochastic gradient descent methods. arXiv:1312.1666, 2013. [21] X. Liu, A. Srivastava, and K. Gallivan. Optimal linear representations of images for object recognition. IEEE TPAMI, 26(5):662–666, 2004. [22] M. Moakher. Means and averaging in the group of rotations. SIAM journal on matrix analysis and applications, 24(1):1–16, 2002. [23] E. Oja. Principal components, minor components, and linear neural networks. Neural Networks, 5(6): 927–935, 1992. [24] P. Petersen. Riemannian geometry, volume 171. Springer Science & Business Media, 2006. [25] S. J. Reddi, A. Hefny, S. Sra, B. Póczós, and A. Smola. Stochastic variance reduction for nonconvex optimization. arXiv:1603.06160, 2016. [26] H. Robbins and S. Monro. A stochastic approximation method. Annals of Mathematical Statistics, 22: 400–407, 1951. [27] R. Y. Rubinstein and D. P. Kroese. Simulation and the Monte Carlo method, volume 707. John Wiley & Sons, 2011. [28] M. Schmidt, N. L. Roux, and F. Bach. Minimizing finite sums with the stochastic average gradient. arXiv:1309.2388, 2013. [29] O. Shamir. A Stochastic PCA and SVD Algorithm with an Exponential Convergence Rate. In International Conference on Machine Learning (ICML-15), pages 144–152, 2015. [30] S. Sra and R. Hosseini. Geometric optimisation on positive definite matrices for elliptically contoured distributions. In Advances in Neural Information Processing Systems, pages 2562–2570, 2013. [31] J. Sun, Q. Qu, and J. Wright. Complete dictionary recovery over the sphere ii: Recovery by riemannian trust-region method. arXiv:1511.04777, 2015. [32] M. Tan, I. W. Tsang, L. Wang, B. Vandereycken, and S. J. Pan. Riemannian pursuit for big matrix recovery. In International Conference on Machine Learning (ICML-14), pages 1539–1547, 2014. [33] C. Udriste. Convex functions and optimization methods on Riemannian manifolds, volume 297. Springer Science & Business Media, 1994. [34] B. Vandereycken. Low-rank matrix completion by Riemannian optimization. SIAM Journal on Optimization, 23(2):1214–1236, 2013. [35] A. Wiesel. Geodesic convexity and covariance estimation. IEEE Transactions on Signal Processing, 60 (12):6182–6189, 2012. [36] L. Xiao and T. Zhang. A proximal stochastic gradient method with progressive variance reduction. SIAM Journal on Optimization, 24(4):2057–2075, 2014. [37] X. Yuan, W. Huang, P.-A. Absil, and K. Gallivan. A riemannian limited-memory bfgs algorithm for computing the matrix geometric mean. Procedia Computer Science, 80:2147–2157, 2016. [38] H. Zhang and S. Sra. First-order methods for geodesically convex optimization. arXiv:1602.06053, 2016. [39] T. Zhang, A. Wiesel, and M. S. Greco. Multivariate generalized Gaussian distribution: Convexity and graphical models. Signal Processing, IEEE Transactions on, 61(16):4141–4148, 2013. 9
2016
348
6,270
Hypothesis Testing in Unsupervised Domain Adaptation with Applications in Alzheimer’s Disease Hao Henry Zhou† Sathya N. Ravi† Vamsi K. Ithapu† Sterling C. Johnson§,† Grace Wahba† Vikas Singh† §William S. Middleton Memorial VA Hospital †University of Wisconsin–Madison Abstract Consider samples from two different data sources {xi s} ∼Psource and {xi t} ∼ Ptarget. We only observe their transformed versions h(xi s) and g(xi t), for some known function class h(·) and g(·). Our goal is to perform a statistical test checking if Psource = Ptarget while removing the distortions induced by the transformations. This problem is closely related to domain adaptation, and in our case, is motivated by the need to combine clinical and imaging based biomarkers from multiple sites and/or batches – a fairly common impediment in conducting analyses with much larger sample sizes. We address this problem using ideas from hypothesis testing on the transformed measurements, wherein the distortions need to be estimated in tandem with the testing. We derive a simple algorithm and study its convergence and consistency properties in detail, and provide lower-bound strategies based on recent work in continuous optimization. On a dataset of individuals at risk for Alzheimer’s disease, our framework is competitive with alternative procedures that are twice as expensive and in some cases operationally infeasible to implement. 1 Introduction A first order requirement in many estimation tasks is that the training and testing samples are from the same underlying distribution and the associated features are directly comparable. But in many real world datasets, training/testing (or source/target) samples may come from different “domains”: they may be variously represented and involve different marginal distributions [8, 32]. “Domain adaptation” (DA) algorithms [24, 27] are often used to address such problems. For example, in vision, not accounting for systematic source/target variations in images due to commodity versus professional camera equipment yields poor accuracy for visual recognition; here, these schemes can be used to match the source/target distributions or identify intermediate latent representations [12, 1, 9], often yielding superior performance [29, 12, 1, 9]. Such success has lead to specialized formulations, for instance, when target annotations are absent (unsupervised) [11, 13] or minimally available (semi-supervised) [7, 22]. With a mapping to compensate for this domain shift, we know that the normalized (or transformed) features are sufficiently invariant and reliable in practice. In numerous DA applications, the interest is in seamlessly translating a classifier across domains — consequently, the model’s test/target predictive performance serves the intended goals. However, in many areas of science, issues concerning the statistical power of the experiment, the sample sizes needed to achieve this power and whether we can derive p-values for the estimated domain adaptation model are equally, if not, more important. For instance, the differences in instrument calibration and reagents in wet lab experiments are potential DA applications except that the downstream analysis may involve little to no discrimination performance measures per se. Separately, in multi-site population studies [17, 18, 21], where due to operational reasons, recruitment and data acquisition is distributed over multiple sites (even countries) — site-specific shifts in measurements and missing covariates are common [17, 18, 21]. The need to harmonize such data requires some form of DA. While good 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. predictive performance is useful, the ability to perform hypothesis tests and obtain interpretable statistical quantities remain central to the conduct of experiments or analyses across a majority of scientific disciplines. We remark that constructs such as H∆H distance have been widely used to analyze non-conservative DA and obtain probabilistic bounds on the performance of a classifier from certain hypotheses classes, but the statistical considerations identified above are not well studied and do not follow straightforwardly from the learning theoretic results derived in [2, 5]. A Motivating Example from Neuroscience. The social and financial burden (of health-care) is projected to grow considerably since elderly are the fastest growing populace [28, 6], and age is the strongest risk factor for neurological disorders such as Alzheimer’s disease (AD). Although numerous large scale projects study the aging brain to identify early biomarkers for various types of dementia, when younger cohorts are analyzed (farther away from disease onset), the effect sizes become worse. This has led to multi-center research collaborations and clinical trials in an effort to increase sample sizes. Despite the promise, combining data across sites pose significant statistical challenges – for AD in particular, the need for harmonization or standardization (i.e., domain adaptation) was found to be essential [20, 34] in the analysis of multi-site Cerebrospinal fluid (CSF) assays and brain volumetric measurements. These analyses refer to the use of AD related pathological biomarkers (β-amyloid peptide in CSF), but there is variability in absolute concentrations due to CSF collection and storage procedures [34]. Similar variability issues exist for amyloid and structural brain imaging studies, and are impediments before multi-site data can be pooled and analyzed in totality. The temporary solution emerging from [20] is to use an “normalization/anchor” cohort of individuals which will then be validated using test/retest variation. The goal of this paper is to provide a rigorous statistical framework for addressing these challenges that will make domain adaptation an analysis tool in neuroimaging as well as other experimental areas. This paper makes the following key contributions. a) On the formulation side, we generalize existing models which assume an identical transformation applied to both the source/target domains to compensate for the domain shift. Our proposal permits domain-specific transformations to align both the marginal (and the conditional) data distributions; b) On the statistical side, we derive a provably consistent hypothesis test to check whether the transformation model can indeed correct the ‘shift’, directly yielding p-values. We also show consistency of the model in that we can provably estimate the actual transformation parameters in an asymptotic sense; c) We identify some interesting links of our estimation with recent developments in continuous optimization and show how our model permits an analysis based on obtaining successively tighter lower bounds; d) Finally, we present experiments on an AD study showing how CSF data from different batches (source/target) can be harmonized enabling the application of standard statistical analysis schemes. 2 Background Consider the unsupervised domain adaptation setting where the inputs/features/covariates in the source and target domains are denoted by xs and xt respectively. The source and target feature spaces are related via some unknown mapping, which is recovered by applying some appropriate transformations on the inputs. We denote these transformed inputs as ˜xs and ˜xt. Within this setting, our goal is two-fold: first, to estimate the source-to-target mapping, followed by performing some statistical test about the ‘goodness’ of the estimate. Specifically, the problem is to first estimate suitable transformations h ∈G, g ∈G′, parameterized by some λ and β respectively, such that the transformed data ˜xs := h(xs, λ) and ˜xt := g(xt, β) have similar distributions. G and G′ restrict the allowable mappings (e.g., affine) between source and target. Clearly the goodness of domain adaptation depends on the nature and size of G, and the similarity measure used to compare the distributions. The distance/similarity measure used in our model defines a statistic for comparing distributions. Hence, using the estimated transformations, we then provide a hypothesis test for the existence of λ and β such that Pr(˜xs) = Pr(˜xt), and finally assign p-values for the significance. To setup this framework, we start with a statistic that measures the distance between two distributions. As motivated in Section 1, we do not impose any parametric assumptions. Since we are interested in the mismatch of Pr(˜xs) and Pr(˜xt), we use maximum mean discrepancy (MMD) which measures the mean distance between {xs} and {xt} in a Hilbert space induced by a characteristic kernel K, MMD(xs, xt) = sup f∈F 1 m m X i=1 f(xi s) −1 n n X i=1 f(xi t) ! = ∥1 m m X i=1 K(xi t, ·) −1 n n X i=1 K(xi s, ·)∥H (1) 2 where F = {f ∈HK, ||f||HK ≤1} and HK denotes the universal RKHS. The advantage of MMD over other nonparametric distance measures is discussed in [30, 15, 16, 31]. Specifically, MMD statistic defines a metric, and whenever MMD is large, the samples are “likely” from different distributions. The simplicity of MMD and the statistical and asymptotic guarantees it provides [15, 16], largely drive our estimation and testing approach. In fact, our framework will operate on ‘transformed’ data ˜xs and ˜xt while estimating the appropriate transformations. 2.1 Related Work The body of work on domain adaptation is fairly extensive, even when restricted to the unsupervised version. Below, we describe algorithms that are more closely related to our work and identify the similarities/differences. A common feature of many unsupervised methods is to match the feature/covariate distributions between the source and the target domains, and broadly, these fall into two different categories. The first set of methods deal with feature distributions that may be different but not due to the distortion of the inputs/features. Denoting the labels/outputs for the source and target domains as ys and yt respectively, here we have, Pr(ys|xs) ≈Pr(yt|xt) but Pr(xs) ̸= Pr(xt) – this is sampling bias. The ideas in [19, 25, 2, 5] address this by ‘re-weighting’ the source instances so as to minimize feature distribution differences between the source and the target. Such re-weighting schemes do not necessarily correspond to transforming the source and target inputs, and may simply scale or shift the appropriate loss functions. The central difference among these approaches is the distance metric used to measure the discrepancy of the feature distributions. The second set of methods correspond to the case where distributional differences are mainly caused by feature distortion such as change in pose, lighting, blur and resolution in visual recognition. Under this scenario, Pr(ys|xs) ̸= Pr(yt|xt) but Pr(˜xs) ≈Pr(˜xt) and the transformed conditional distributions are close. [26, 1, 10, 14, 12] address this problem by learning the same feature transformation on source and target domains to minimize the difference of Pr(˜xs) and Pr(˜xt) directly. Our proposed model fits better under this umbrella — where the distributional differences are mainly caused by feature distortion due to site specific acquisition and other experimental issues. While some methods are purely data-driven such as those using geodesic flow [14, 12], backpropagation [10]) and so on, other approaches estimate the transformation that minimizes distance metrics such as the Maximum Mean Discrepancy (MMD) [26, 1]. To our knowledge, no statistical consistency results are known for any of the methods that fall in the second set. Overview: The idea in [1] is perhaps the most closely related to our proposal, but with a few important differences. First, we relax the condition that the same transformation must be applied to each domain; instead, we permit domain-specific transformations. Second, we derive a provably consistent hypothesis test to check whether the transformation model can indeed correct the shift. We then prove that the model is consistent when it is correct. These theoretical results apply directly to [1], which turns out to be a special case of our framework. We find that the extension of our results to [26] is problematic since that method violates the requirement that the mean differences should be measured in a valid Reproducing Kernel Hilbert space (RKHS). 3 Model We first present the objective function of our estimation problem and provide a simple algorithm to compute the unknown parameters λ and β. Recall the definition of MMD from (1). Given the kernel K and the source and target inputs xs and xt, we are interested in the MMD between the “transformed” inputs ˜xs and ˜xt. We are only provided the class of the transformations; m and n denote the sample sizes of source and target inputs. So our objective function is simply min λ∈Ωλ min β∈Ωβ ∥ExtK(g(xt, β), ·) −ExsK(h(xs, λ), ·)∥H (2) where λ ∈Ωλ and β ∈Ωβ are the constraint sets of the unknowns. Assume that the parameters are bounded is reasonable (discussed in Section 4.3), and their approximations can be easily computed using certain data statistics. The empirical estimate of the above objective would simply be min λ∈Ωλ min β∈Ωβ ∥1 m m X i=1 K(g(xi t, β), ·) −1 n n X i=1 K(h(xi s, λ), ·)||H (3) 3 Remarks: We note a few important observations about (3) to draw the contrast from (1). The power of MMD lies in differentiating feature distributions, and the correction factor is entirely dependant on the choice of the kernel class – a richer one does a better job. Instead, our objective in (3) is showing that complex distortions can be corrected before applying the kernel in an intra-domain manner (as we show in Section 4). From the perspective of the complexity of distortions, this strategy may correspond to a larger hypotheses space compared to the classical MMD setup. This is clearly beneficial in settings where source and target are related by complex feature distortions. It may be seen from the structure of the objective in (3) that designing an algorithm for any given K and G may not be straightforward. We present the estimation procedure for certain widely-used classes of K and G in Section 4.3. For the remainder of the section, where we present our testing procedure and describe technical results, we will assume that we can solve the above objective and the corresponding estimates are denoted by ˆλ and ˆβ. 3.1 Minimal MMD test statistic Observe that the objective in (3) is based on the assumption that the transformations h(·) ∈G and g(·) ∈G′ (G and G′ may be different if desired) are sufficient in some sense for ‘correcting’ the discrepancy between the source and target inputs. Hence, we need to specify a model checking task on the recoverability of these transforms, while also concurrently checking the goodness of the estimates of λ and β. This task will correspond to a hypothesis test where the two hypotheses being compared are as follows. H0 : There exists a λ and β such that Pr(g(xt, β)) = Pr(h(xs, λ)). HA : There does not exist any such λ and β such that Pr(g(xt, β)) = Pr(h(xs, λ)). Since the statistic for testing H0 here needs to measure the discrepancy of Pr(g(xt, β)) and Pr(h(xs, λ)), one can simply use the objective from (3). Hence our test statistic is given by the minimal MMD estimate for a given h ∈G, g ∈G′, xs, xt and computed at the estimates ˆλ, ˆβ (ˆλ, ˆβ) := arg min λ∈Ωλ min β∈Ωβ M(λ, β) := ∥1 m m X i=1 K(g(xi t, β), ·) −1 n n X i=1 K(h(xi s, λ), ·)||H (4) We denote the population estimates of the parameters under the null and alternate hypothesis as (λ0, β0) and (λA, βA). Recall that the MMD corresponds to a statistic, and it has been used for testing the equality of distributions in earlier works [15]. It is straightforward to see that the true minimal MMD M∗(λ0, β0) = 0 if and only if H0 is true. Observe that (4) is the empirical (and hence biased) ‘approximation’ of the true minimal MMD statistic M∗(·) from the objective in (2). This will be used while presenting our technical results (in Section 4) on the consistency and the corresponding statistical power guaranteed by this minimal MMD statistic based testing. Relationship to existing approaches. Hypothesis testing involves transforming the inputs before comparing their distributions in some RKHS (while we solve for the transformation parameters). The approach in [15, 16] applies the kernel to the input data directly and asks whether or not the distributions are the same based on the MMD measure. Our approach derives from the intuition that allowing for the two-step procedure of transforming the inputs first, followed by computing their distance in some RKHS is flexible, and in some sense is more general compared to directly using MMD (or other distance measures) on the inputs. To see this, consider the simple example where xs ∼N(0, 1) and xt = xs + 1. A simple application of MMD (from (1)) on the inputs xs and xt directly will reject the null hypothesis (where the H0 states that the source and target are the same distributions). Our algorithm allows for a transformation on the source/target and will correct this discrepancy and accept H0. Further, our proposed model generalizes the approach taken in [1]. Specifically, their approach is a special case of (3) with h(xs) = WT xs, g(xt) = WT xt (λ and β correspond to W here) with the constraint that W is orthogonal. Summary: Overall, our estimation followed by testing procedure will be two-fold. Given xs and xt, the kernel K and the function spaces G, G′, we first estimate the unknowns λ and β (described in Section 4.3). The corresponding statistic M(ˆλ, ˆβ) at the estimates is then compared to a given significance threshold γ. Whenever M(ˆλ, ˆβ) > γ the null H0 is rejected. This rejection simply indicates that G and/or G′ are not sufficient in recovering the mismatch of source to target at 4 the Type I error of α. Clearly, the richness of these function classes is central to the power of the testing procedure. We will further argue in Section 4 that even allowing h(·) and g(·) to be linear transformations greatly enhances the ability to remove the distorted feature distributions and reliably test their difference or equivalence. Also the test is non-parametric and handles missing (systematic/noisy) features among the two distributions of interest (see appendix for more details). 4 Consistency Building upon the two-fold estimating and testing procedure presented in the previous sections, we provide several guarantees about the estimation consistency and the power of minimal MMD based hypothesis testing, both in the asymptotic and finite sample regimes. The technical results presented here are applicable for large classes of transformation functions G with fairly weak and reasonable assumptions on K. Specifically we consider Holder-continuous h(·) and g(·) functions on compact sets Ωλ and Ωβ. Like [15], we have K to be a bounded non-negative characteristic kernel i.e., 0 ≤K(x, x′) ≤K ∀x, x′, and we assume ∂K to be bounded in a neighborhood of 0. We note that technical results for an even more general class of kernels are fairly involved and so in this paper we restrict ourselves to radial basis kernels. Nevertheless, even under the above assumptions our null hypothesis space is more general than the one considered in [15] because of the extra transformations that we allow on the inputs. With these assumptions, and the Holder-continuity of h(xs, ·) and g(xt, ·), we assume (A1) ∥K(h(xs, λ1), ·) −K(h(xs, λ2), ·)∥≤Lhd(λ1, λ2)rh ∀xs; λ1, λ2 ∈Ωλ (A2) ∥K(g(xt, β1), ·) −K(g(xt, β2), ·)∥≤Lgd(β1, β2)rg ∀xt; β1, β2 ∈Ωβ 4.1 Estimation Consistency Observe that the minimization of (3) assumes that the null is true i.e., the parameter estimates correspond to H0. Therefore, we discuss consistency in the context of existence of a unique set of parameters (λ0, β0) that match the distributions of ˜xs and ˜xt perfectly. By inspecting the structure of the objective in (2) and (3), we see that the estimates will be asymptotically unbiased. Our first set of results summarized here provide consistency of the estimation whenever the assumptions (A1) and (A2) hold. This consistency result follows from the convergence of objective. All the proofs are included in the appendix. Theorem 4.1 (MMD Convergence). Under H0, ∥ExsK(h(xs, ˆλ), ·) −ExtK(g(xt, ˆβ), ·)∥H →0 at the rate, max  √log n √n , √log m √m  . Theorem 4.2 (Consistency). Under H0, the estimators ˆλ and ˆβ are consistent. Remarks: Theorem 4.1 shows the convergence rate of MMD distance between the source and the target after the transformations are applied. Recall that m and n are the sample sizes of source and target respectively, and h(xs, ˆλ) and g(xt, ˆβ) are the recovered transformations. 4.2 Power of the Hypothesis Test We now discuss the statistical power of minimal MMD based testing. The next set of results establish that the testing setup from Section 3.1 is asymptotically consistent. Recall that M∗(·) denotes the (unknown) expected statistic from (2) while M(·) is its empirical estimate from (4). Theorem 4.3 (Hypothesis Testing). (a) Whenever H0 is true, with probability at least 1 −α, 0 ≤M(ˆλ, ˆβ) ≤ r 2K(m + n) log α−1 mn + 2 √ K √n + 2 √ K √m (5) (b) Whenever HA is true, with probability at least 1 −ϵ, M(ˆλ, ˆβ) ≤M∗(λA, βA) + r 2K(m + n) log ϵ−1 mn + 2 √ K √n + 2 √ K √m M(ˆλ, ˆβ) ≥M∗(λA, βA) − √ K √n 4 + r C(h,ϵ) + dλ 2rh log n ! − √ K √m 4 + s C(g,ϵ) + dβ 2rg log m ! (6) 5 where C(h,ϵ) = log(2|Ωλ|)+log ϵ−1+ dλ rh log Lh √ K , and C(g,ϵ) = log(2|Ωβ|)+log ϵ−1+ dβ rg log Lg √ K Remarks: We make a few comments about the theorem. Recall that the constant K is the kernel bound, and Lh, Lg, rh and rg are defined in (A1)(A2). dλ and dβ are the dimensions of λ and β spaces respectively. Observe that whenever H0 is true, (5) shows that M(ˆλ, ˆβ) approaches 0 as the sample size increases. Similarly, under HA the statistic converges to some positive (unknown) value M∗(λA, βA). Following these observations, Theorem 4.3 basically implies that the statistical power of our test (described in Section 3.1) increases to 1 as the sample size m, n increases. Except constants, the upper bounds under both H0 and HA have a rate of max( 1 √n, 1 √m), while the lower bound under HA has the rate max( √log n √n , √log m √m ). In the appendix we show that (see Lemma 4.5) as m, n →∞, the constants |Ωλ|, |Ωβ| converge to a small positive number, thus removing the dependence of consistency on these constants. The dependence on the sizes of search spaces Ωλ and Ωβ may nevertheless make the bounds for HA loose. In practice, one can choose ‘good’ bound constraints based on some pre-processing on the source and target inputs (e.g., comparison of median and modes). The loss in power due to overestimated Ωλ and Ωβ will be compensated by ‘large enough’ sample sizes. Observe that this trade-off of sample size versus complexity of hypothesis space is fundamental in statistical testing and is not specific to our model. We further investigate this trade-off for certain special cases of transformations h(·) and g(·) that may be of interest in practice. For instance, consider the scenario where one of the transformations is identity and the other one is linear in the unknowns. Specifically, ˜xt = xt and h0(xs, λ0) = φ(xs)T λ0 where φ(·) is some known transformation. Although restrictive, this scenario is very common in medical data acquisition (refer to Section 1) where the source and target inputs are assumed to have linear/affine distortions. Within this setting, the assumptions for our technical results will be satisfied whenever φ(xs) is bounded with high probability and with rh = 1 2. We have the following result for this scenario (Var(·) denotes empirical variance). Theorem 4.4 (Linear transformation). Under H0, identity g(·) with h = φ(xs)T λ, we have Ωλ := {λ; | 1 n Pn i=1 ∥xi t −φ(xi s)T λ)∥2 ≤3 Pp k=1 Var(xt,k) + ϵ}. For any ϵ, α > 0 and sufficiently large sample size, a neighborhood of λ0 is contained in Ωλ with probability at least 1 −α. Observe that subscript k in xt,k above denotes the kth dimensional feature of xt. The above result implies that the search space for λ reduces to a quadratic constraint in the above described example scenario. Clearly, this refined search region would enhance the statistical power for the test even when the sample sizes are small (which is almost always the case in population studies). Note that such refined sets may be computed using ‘extra’ information about the structure of the transformations and/or input data statistics, there by allowing for better estimation and higher power. Lastly, we point out that the ideas presented in [16] for a finite sample testing setting translate to our model as well but we do not present explicit details in this work. 4.3 Optimization Lower Bounds We see that it is valid to assume that the feasible set is compact and convex for our purposes (Theorem 4.4). This immediately allows us to use algorithms that exploit feasible set compactness to estimate model parameters, for instance, conditional gradient algorithms which have low per iteration complexity [23]. Even though these algorithms offer practical benefits, with non-convex objective, it is nontrivial to analyze their theoretical/convergence aspects, and as was noted earlier in Section 3, except for simplistic G, G′ and K, the minimization in (3) might involve a non-convex objective. We turn to some recent results which have shown that specific classes of non-convex problems or NP-Hard problems can be solved to any desired accuracy using a sequence of convex optimization problems [33]. This strategy is currently an active area of research and has already shown to provide impressive performance in practice [3]. Very recently,[4] showed that one such class of problems called signomial programming can be solved using successive relative entropy relaxations. Interestingly, we show that for the widely-used class of Gaussian kernels, our objective can be optimized using these ideas. For notational simplicity, we do not transform the targets i.e, ˜xt = xt or g(·) is identity and only allow for linear transformations h(·). Observe that, with respect to the estimation problem (refer to (3)) this is the same as transforming both source and target inputs. When K is Gaussian, the objective in (3) with identity g(·) and linear 6 h(·) (λ corresponds to slope and intercept here) can be equivalently written as, min λ∈Ωλ 1 n2 n X i=1 n X j=1 K(h(xi s, λ), h(xj s, λ)) − 2 mn m X i=1 n X j=1 K(xi t, h(xj s, λ)) ! := min λ∈Ωλ X j 1 n2 exp  −  aT j λλT ai)  − X i,j 2 mn exp  −  bT ijλλT bij + 2cbT ijλ + c2 (7) for appropriate aj, bij and c. Denoting γ = λλT , the above objective can be made linear in the decision variables γ and λ thus putting it in the standard form of signomial optimization. The convex relaxation of the quadratic equality constraint is γ −λλT ⪰0, hence we seek to solve, min γ,λ X j 1 n2 exp (tr(Ajγ)) − X i,j 2 mn exp  tr(Bijγ) + CT ijλ + c  s.t. γ −λλT ⪰0 (8) Clearly the objective is exactly in the form that [4] solves, albeit we also have a convex constraint. Nevertheless, using their procedure for the unconstrained signomial optimization we can write a sequence of convex relaxations for this objective. This sequence is hierarchical, in the sense that, as we go down the sequence, each problem gives tighter bounds to the original nonconvex objective [4]. For our applications, we see that since confidence interval procedure (mentioned earlier) naturally suggests a good initial point in addition, any generic (local) numerical optimization schemes like trust region, gradient projection etc. can be used to solve (7) whereas the hierarchy of (8) can be used in general when one does not have access to a good starting point. 5 Experiments Design and Overall Goals. We performed evaluations on both synthetic data as well as data from an AD study. (A) We first evaluate the goodness of our estimation procedure and the power of the minimal MMD based test when the source and target inputs are known transformations of samples from different distribution families (e.g., Normal, Laplace). Here, we seek to clearly identify the influence of the sample size as well as the effect of the transformations on recoverability. (B) After these checks, we then apply our proposed model for matching CSF protein levels of 600 subjects. These biomarkers were collected in two different batches; it is known that the measures for the same participant (across batches) have high variability [20]. In our data, fortunately, a subset of individuals have both batch data (the “real” measurement must be similar in both batches) whereas a fraction of individuals’ CSF is only available in one batch. If we find a linear standardization between the Sample Size (Log2 scale) 4 6 8 10 Acceptance Rate 0 0.2 0.4 0.6 0.8 1 1.2 Normal target vs. different sources Normal(0,1) Laplace(0,1) Exponential(1) (a) Sample Size (Log2 scale) 4 6 8 10 Acceptance Rate 0 0.2 0.4 0.6 0.8 1 1.2 Models linear in parameters a*x 2+b*x+c a*log(|x|)+b (b) Sample Size (Log2 scale) 2 4 6 8 10 12 L1 Error 0 0.2 0.4 0.6 0.8 1 1.2 Estimation Errors normal vs. normal Slope Intercept (c) Sample Size (Log2 scale) 4 5 6 7 8 9 Quartic Mean of estimation error 0.5 1 1.5 2 2.5 Estimation error for 2D simulation Model 1, first row Model 1, second row Model 2, first row Model 2, second row (d) mMMD value 0 0.005 0.01 0.015 0.02 0.025 histogram 0 0.2 0.4 0.6 0.8 1Minimal MMD histogram (128 samples) Nor vs Nor Nor vs Exp Nor vs Lap (e) mMMD value 0 0.005 0.01 0.015 histogram 0 0.2 0.4 0.6 0.8 1 Minimal MMD histogram (1024 samples) Nor vs Nor Nor vs Exp Nor vs Lap (f) Figure 1: (a,b) Acceptance Ratios, (c,d) Estimation errors, (e,f) Histograms of minimal MMD statistic. 7 two batches it serves as a gold standard, against which we compare our algorithm which does not use information about corresponding samples. Note that the standardization trick is unavailable in multi-center studies; we use this data in this paper simply to make the description of our evaluation design simpler which, for multi-site data pooling, must be addressed using secondary analyses. Synthetic data. Fig 1 summarizes our results on synthetic data where the source are Normal samples and targets comes from different families. p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12 Relative Error 0 0.05 0.1 0.15 0.2 0.25 Relative error on comparsion to baseline Linear Model Minimal MMD (S 1) Minimal MMD (S 2) Figure 2: Relative error in transformation estimation between CSF batches. First, observe that our testing procedure efficiently rejects H0 whenever the targets are not Normal (blue and black curves in Fig. 1(a)). If the transformation class is beyond linear (e.g., log), the null is efficiently rejected as samples increase (see Fig. 1(b)). Beyond the testing power, Figs. 1(c,d) shows the error in the actual estimates, which decrease as the sample size increases (with tighter confidence intervals). The appendix includes additional model details. To get a better idea about the minimal MMD statistic, we show its histogram (over multiple bootstrap simulations) for different targets in Fig 1(e,f). The green line here denotes the bootstrap significance threshold (0.05). In Fig. 1(e,f), the red curve is always to the left of the threshold, as desired. However, the samples are not enough to reject the null the black and blue curves; and we will need larger sample sizes (Fig. 1(f)). If needed, the minimal MMD value can be used to obtain a better threshold. Overall, these plots show that the minimal MMD based estimation and testing setup robustly removes the feature distortions and facilitates the statistical test. AD study. Fig 2 shows the relative errors after correcting the feature distortions between the two batches in the 12 CSF proteins. The bars correspond to simple linear “standardization” transformation where we assume we have corresponding sample information (blue) and our minimal MMD based domain adaptation procedure on sets S1 and S2 (S1: participants available in both batches, S2: all participants). Our models perform as well as the gold standard (where some subjects have volunteered CSF sampling for both batches). Specifically, the trends in Fig 2 indicate that our minimal MMD based testing procedure is a powerful procedure for conducting analyses on such pooled datasets. Table 1: Performance of transformed (our vs. gold standard) CSF on a regression task. Model Left Right None 0.46± 0.15 0.37±0.16 Linear 0.46± 0.15 0.37±0.16 M (S1) 0.48± 0.15 0.39± 0.15 M (S2) 0.48± 0.15 0.40± 0.15 To further validate these observations, we used the ‘transformed’ CSF data from the two batches (our algorithm and gold standard) and performed a multiple regression to predict Left and Right Hippocampal Volume (which are known to be AD markers). Table 1 shows that the correlations (predicted vs. actual) resulting from the minimal MMD corrected data are comparable or offer improvements to the alternatives. We point out that the best correlations are achieved when all the data is used with minimal MMD (which the gold standard cannot benefit from). Any downstream prediction tasks we wish to conduct are independent of the model presented here. 6 Conclusions We presented a framework for kernelized statistical testing on data from multiple sources when the observed measurements/features have been systematically distorted/transformed. While there is a rich body of work on kernel test statistics based on the maximum mean discrepancy and other measures, the flexibility to account for a given class of transformations offers improvements in statistical power. We analyze the statistical properties of the estimation and demonstrate how such a formulation may enable pooling datasets from multiple participating sites, and facilitate the conduct of neuroscience studies with substantially higher sample sizes which may be otherwise infeasible. Acknowledgments: This work is supported by NIH AG040396, NIH U54AI117924, NSF DMS1308847, NSF CAREER 1252725, NSF CCF 1320755 and UW CPCP AI117924. The authors are grateful for partial support from UW ADRC AG033514 and UW ICTR 1UL1RR025011. We thank Marilyn S. Albert (Johns Hopkins) and Anne Fagan (Washington University at St. Louis) for discussions at a preclinical Alzheimer’s disease meeting in 2015 (supported by Stay Sharp fund). 8 References [1] M Baktashmotlagh, M Harandi, B Lovell, and M Salzmann. Unsupervised domain adaptation by domain invariant projection. In Proceedings of the IEEE ICCV, 2013. [2] S Ben-David, J Blitzer, K Crammer, et al. A theory of learning from different domains. Machine learning, 2010. [3] B Chalise, Y Zhang, and M Amin. Successive convex approximation for system performance optimization in a multiuser network with multiple mimo relays. In IEEE CAMSAP, 2011. [4] V Chandrasekaran and P Shah. Relative entropy relaxations for signomial optimization. arXiv:1409.7640, 2014. [5] C Cortes and M Mohri. Domain adaptation in regression. In Algorithmic Learning Theory, 2011. [6] T Dall, P Gallo, R Chakrabarti, T West, A Semilla, and M Storm. An aging population and growing disease burden will require alarge and specialized health care workforce by 2025. Health Affairs, 2013. [7] H Daumé III, A Kumar, and A Saha. Frustratingly easy semi-supervised domain adaptation. In Proceedings of the 2010 Workshop on Domain Adaptation for Natural Language Processing, 2010. [8] P Dollár, C Wojek, B Schiele, and P Perona. Pedestrian detection: A benchmark. In CVPR, 2009. [9] B Fernando, A Habrard, M Sebban, and T Tuytelaars. Unsupervised visual domain adaptation using subspace alignment. In Proceedings of the IEEE ICCV, 2013. [10] Y Ganin and V Lempitsky. Unsupervised domain adaptation by backpropagation. arXiv:1409.7495, 2014. [11] B Gong, K Grauman, and F Sha. Connecting the dots with landmarks: Discriminatively learning domaininvariant features for unsupervised domain adaptation. In ICML, 2013. [12] B Gong, Y Shi, F Sha, and K Grauman. Geodesic flow kernel for unsupervised domain adaptation. In CVPR, 2012. [13] Boqing Gong. Kernel Methods for Unsupervised Domain Adaptation. PhD thesis, Citeseer, 2015. [14] R Gopalan, R Li, and R Chellappa. Domain adaptation for object recognition: An unsupervised approach. In Proceedings of the IEEE ICCV, 2011. [15] A Gretton, K Borgwardt, M Rasch, B Schölkopf, and A Smola. A kernel two-sample test. JMLR, 2012. [16] A Gretton, K Fukumizu, Z Harchaoui, and B Sriperumbudur. A fast, consistent kernel two-sample test. In NIPS, 2009. [17] Glioma Meta-analysis Trialists GMT Group. Chemotherapy in adult high-grade glioma: a systematic review and meta-analysis of individual patient data from 12 randomised trials. The Lancet, 2002. [18] M Haase, R Bellomo, P Devarajan, P Schlattmann, et al. Accuracy of neutrophil gelatinase-associated lipocalin (ngal) in diagnosis and prognosis in acute kidney injury: a systematic review and meta-analysis. American Journal of Kidney Diseases, 2009. [19] J Huang, A Gretton, K Borgwardt, B Schölkopf, and A Smola. Correcting sample selection bias by unlabeled data. In NIPS, 2006. [20] W Klunk, R Koeppe, J Price, T Benzinger, M Devous, et al. The centiloid project: standardizing quantitative amyloid plaque estimation by pet. Alzheimer’s & Dementia, 2015. [21] W Klunk, R Koeppe, J Price, T Benzinger, et al. The centiloid project: standardizing quantitative amyloid plaque estimation by pet. Alzheimer’s & Dementia, 2015. [22] A Kumar, A Saha, and H Daume. Co-regularization based semi-supervised domain adaptation. In NIPS, 2010. [23] S Lacoste-Julien, M Jaggi, M Schmidt, and P Pletscher. Block-coordinate frank-wolfe optimization for structural svms. arXiv:1207.4747, 2012. [24] Qi Li. Literature survey: domain adaptation algorithms for natural language processing. Department of CS The Graduate Center, The City University of New York, 2012. [25] X Nguyen, M Wainwright, and M Jordan. Estimating divergence functionals and the likelihood ratio by convex risk minimization. Information Theory, IEEE Transactions on, 2010. [26] S Pan, I Tsang, J Kwok, and Q Yang. Domain adaptation via transfer component analysis. Neural Networks, IEEE Transactions on, 2011. [27] V Patel, R Gopalan, R Li, and R Chellappa. Visual domain adaptation: A survey of recent advances. Signal Processing Magazine, IEEE, 2015. [28] B Plassman, K Langa, G Fisher, S Heeringa, et al. Prevalence of dementia in the united states: the aging, demographics, and memory study. Neuroepidemiology, 2007. [29] K Saenko, B Kulis, M Fritz, and T Darrell. Adapting visual category models to new domains. In ECCV. 2010. [30] D Sejdinovic, B Sriperumbudur, A Gretton, K Fukumizu, et al. Equivalence of distance-based and rkhs-based statistics in hypothesis testing. The Annals of Statistics, 2013. [31] B Sriperumbudur, K Fukumizu, A Gretton, G Lanckriet, and B Schölkopf. Kernel choice and classifiability for rkhs embeddings of probability distributions. In NIPS, 2009. [32] A Torralba and A Efros. Unbiased look at dataset bias. In CVPR, 2011. [33] L Tunçel. Polyhedral and semidefinite programming methods in combinatorial optimization. AMS, 2010. [34] H Vanderstichele, M Bibl, S Engelborghs, N Le Bastard, et al. Standardization of preanalytical aspects of cerebrospinal fluid biomarker testing for alzheimer’s disease diagnosis: a consensus paper from the alzheimer’s biomarkers standardization initiative. Alzheimer’s & Dementia, 2012. 9
2016
349
6,271
Single Pass PCA of Matrix Products Shanshan Wu The University of Texas at Austin shanshan@utexas.edu Srinadh Bhojanapalli Toyota Technological Institute at Chicago srinadh@ttic.edu Sujay Sanghavi The University of Texas at Austin sanghavi@mail.utexas.edu Alexandros G. Dimakis The University of Texas at Austin dimakis@austin.utexas.edu Abstract In this paper we present a new algorithm for computing a low rank approximation of the product AT B by taking only a single pass of the two matrices A and B. The straightforward way to do this is to (a) first sketch A and B individually, and then (b) find the top components using PCA on the sketch. Our algorithm in contrast retains additional summary information about A, B (e.g. row and column norms etc.) and uses this additional information to obtain an improved approximation from the sketches. Our main analytical result establishes a comparable spectral norm guarantee to existing two-pass methods; in addition we also provide results from an Apache Spark implementation1 that shows better computational and statistical performance on real-world and synthetic evaluation datasets. 1 Introduction Given two large matrices A and B we study the problem of finding a low rank approximation of their product AT B, using only one pass over the matrix elements. This problem has many applications in machine learning and statistics. For example, if A = B, then this general problem reduces to Principal Component Analysis (PCA). Another example is a low rank approximation of a co-occurrence matrix from large logs, e.g., A may be a user-by-query matrix and B may be a user-by-ad matrix, so AT B computes the joint counts for each query-ad pair. The matrices A and B can also be two large bag-ofword matrices. For this case, each entry of AT B is the number of times a pair of words co-occurred together. As a fourth example, AT B can be a cross-covariance matrix between two sets of variables, e.g., A and B may be genotype and phenotype data collected on the same set of observations. A low rank approximation of the product matrix is useful for Canonical Correlation Analysis (CCA) [3]. For all these examples, AT B captures pairwise variable interactions and a low rank approximation is a way to efficiently represent the significant pairwise interactions in sub-quadratic space. Let A and B be matrices of size d ⇥n (d ≫n) assumed too large to fit in main memory. To obtain a rank-r approximation of AT B, a naive way is to compute AT B first, and then perform truncated singular value decomposition (SVD) of AT B. This algorithm needs O(n2d) time and O(n2) memory to compute the product, followed by an SVD of the n ⇥n matrix. An alternative option is to directly run power method on AT B without explicitly computing the product. Such an algorithm will need to access the data matrices A and B multiple times and the disk IO overhead for loading the matrices to memory multiple times will be the major performance bottleneck. For this reason, a number of recent papers introduce randomized algorithms that require only a few passes over the data, approximately linear memory, and also provide spectral norm guarantees. The 1The code can be found at https://github.com/wushanshan/MatrixProductPCA 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. key step in these algorithms is to compute a smaller representation of data. This can be achieved by two different methods: (1) dimensionality reduction, i.e., matrix sketching [15, 5, 14, 6]; (2) random sampling [7, 1]. The recent results of Cohen et al. [6] provide the strongest spectral norm guarantee of the former. They show that a sketch size of O(˜r/✏2) suffices for the sketched matrices eAT eB to achieve a spectral error of ✏, where ˜r is the maximum stable rank of A and B. Note that eAT eB is not the desired rank-r approximation of AT B. On the other hand, [1] is a recent sampling method with very good performance guarantees. The authors consider entrywise sampling based on column norms, followed by a matrix completion step to compute low rank approximations. There is also a lot of interesting work on streaming PCA, but none can be directly applied to the general case when A is different from B (see Figure 4(c)). Please refer to Appendix D for more discussions on related work. Despite the significant volume of prior work, there is no method that computes a rank-r approximation of AT B when the entries of A and B are streaming in a single pass 2. Bhojanapalli et al. [1] consider a two-pass algorithm which computes column norms in the first pass and uses them to sample in a second pass over the matrix elements. In this paper, we combine ideas from the sketching and sampling literature to obtain the first algorithm that requires only a single pass over the data. Contributions: We propose a one-pass algorithm SMP-PCA (which stands for Streaming Matrix Product PCA) that computes a rank-r approximation of AT B in time O((nnz(A) + nnz(B)) ⇢2r3˜r ⌘2 + nr6⇢4˜r3 ⌘4 ). Here nnz(·) is the number of non-zero entries, ⇢is the condition number, ˜r is the maximum stable rank, and ⌘measures the spectral norm error. Existing two-pass algorithms such as [1] typically have longer runtime than our algorithm (see Figure 3(a)). We also compare our algorithm with the simple idea that first sketches A and B separately and then performs SVD on the product of their sketches. We show that our algorithm always achieves better accuracy and can perform arbitrarily better if the column vectors of A and B come from a cone (see Figures 2, 4(b), 3(b)). The central idea of our algorithm is a novel rescaled JL embedding that combines information from matrix sketches and vector norms. This allows us to get better estimates of dot products of high dimensional vectors compared to previous sketching approaches. We explain the benefit compared to a naive JL embedding in Figure 2 and the related discussion; we believe it may be of more general interest beyond low rank matrix approximations. We prove that our algorithm recovers a low rank approximation of AT B up to an error that depends on kAT B −(AT B)rk and kAT Bk, decaying with increasing sketch size and number of samples (Theorem 3.1). The first term is a consequence of low rank approximation and vanishes if AT B is exactly rank-r. The second term results from matrix sketching and subsampling; the bounds have similar dependencies as in [6]. We implement SMP-PCA in Apache Spark and perform several distributed experiments on synthetic and real datasets. Our distributed implementation uses several design innovations described in Section 4 and Appendix C.5 and it is the only Spark implementation that we are aware of that can handle matrices that are large in both dimensions. Our experiments show that we improve by approximately a factor of 2⇥in running time compared to the previous state of the art and scale gracefully as the cluster size increases. The source code is available at [18]. In addition to better performance, our algorithm offers another advantage: It is possible to compute low-rank approximations to AT B even when the entries of the two matrices arrive in some arbitrary order (as would be the case in streaming logs). We can therefore discover significant correlations even when the original datasets cannot be stored, for example due to storage or privacy limitations. 2 Problem setting and algorithms Consider the following problem: given two matrices A 2 Rd⇥n1 and B 2 Rd⇥n2 that are stored in disk, find a rank-r approximation of their product AT B. In particular, we are interested in the setting where both A, B and AT B are too large to fit into memory. This is common for modern large scale machine learning applications. For this setting, we develop a single-pass algorithm SMP-PCA that computes the rank-r approximation without explicitly forming the entire matrix AT B. 2One straightforward idea is to sketch each matrix individually and perform SVD on the product of the sketches. We compare against that scheme and show that we can perform arbitrarily better using our rescaled JL embedding. 2 Notations. Throughout the paper, we use A(i, j) or Aij to denote (i, j) entry for any matrix A. Let Ai and Aj be the i-th column vector and j-th row vector. We use kAkF for Frobenius norm, and kAk for spectral (or operator) norm. The optimal rank-r approximation of matrix A is Ar, which can be found by SVD. For any positive integer n, let [n] denote the set {1, 2, · · · , n}. Given a set ⌦⇢[n1] ⇥[n2] and a matrix A 2 Rn1⇥n2, we define P⌦(A) 2 Rn1⇥n2 as the projection of A on ⌦, i.e., P⌦(A)(i, j) = A(i, j) if (i, j) 2 ⌦and 0 otherwise. 2.1 SMP-PCA Our algorithm SMP-PCA (Streaming Matrix Product PCA) takes four parameters as input: the desired rank r, number of samples m, sketch size k, and the number of iterations T. Performance guarantee involving these parameters is provided in Theorem 3.1. As illustrated in Figure 1, our algorithm has three main steps: 1) compute sketches and side information in one pass over A and B; 2) given partial information of A and B, estimate important entries of AT B; 3) compute low rank approximation given estimates of a few entries of AT B. Now we explain each step in detail. Figure 1: An overview of our algorithm. A single pass is performed over the data to produce the sketched matrices eA, eB and the column norms kAik, kBjk, for i 2 [n1] and j 2 [n2]. We then compute the sampled matrix P⌦(f M) through a biased sampling process, where P⌦(f M) = f M(i, j) if (i, j) 2 ⌦and zero otherwise. Here ⌦represents the set of sampled entries. The (i, j)-th entry of f M is given in Eq. (2). Performing matrix completion on P⌦(f M) gives the desired rank-r approximation. Algorithm 1 SMP-PCA: Streaming Matrix Product PCA 1: Input: A 2 Rd⇥n1, B 2 Rd⇥n2, desired rank: r, sketch size: k, number of samples: m, number of iterations: T 2: Construct a random matrix ⇧2 Rk⇥d, where ⇧(i, j) ⇠N(0, 1/k), 8(i, j) 2 [k] ⇥[d]. Perform a single pass over A and B to obtain: eA = ⇧A, eB = ⇧B, and kAik, kBjk, for i 2 [n1] and j 2 [n2]. 3: Sample each entry (i, j) 2 [n1] ⇥[n2] independently with probability ˆqij = min{1, qij}, where qij is defined in Eq.(1); maintain a set ⌦⇢[n1] ⇥[n2] which stores all the sampled pairs (i, j). 4: Define f M 2 Rn1⇥n2, where f M(i, j) is given in Eq. (2). Calculate P⌦(f M) 2 Rn1⇥n2, where P⌦(f M) = f M(i, j) if (i, j) 2 ⌦and zero otherwise. 5: Run WAltMin(P⌦(f M), ⌦, r, ˆq, T ), see Appendix A for more details. 6: Output: bU 2 Rn1⇥r and bV 2 Rn2⇥r. Step 1: Compute sketches and side information in one pass over A and B. In this step we compute sketches eA := ⇧A and eB := ⇧B, where ⇧2 Rk⇥d is a random matrix with entries being i.i.d. N(0, 1/k) random variables. It is known that ⇧satisfies an "oblivious Johnson-Lindenstrauss (JL) guarantee" [15][17] and it helps preserving the top row spaces of A and B [5]. Note that any sketching matrix ⇧that is an oblivious subspace embedding can be considered here, e.g., sparse JL transform and randomized Hadamard transform (see [6] for more discussion). Besides eA and eB, we also compute the L2 norms for all column vectors, i.e., kAik and kBjk, for i 2 [n1] and j 2 [n2]. We use this additional information to design better estimates of AT B in the 3 next step, and also to determine important entries of eAT eB to sample. Note that this is the only step that needs one pass over data. Step 2: Estimate important entries of AT B by rescaled JL embedding. In this step we use partial information obtained from the previous step to compute a few important entries of eAT eB. We first determine what entries of eAT eB to sample, and then propose a novel rescaled JL embedding for estimating those entries. We sample entry (i, j) of AT B independently with probability ˆqij = min{1, qij}, where qij = m · ( kAik2 2n2kAk2 F + kBjk2 2n1kBk2 F ). (1) Let ⌦⇢[n1]⇥[n2] be the set of sampled entries (i, j). Since E(P i,j qij) = m, the expected number of sampled entries is roughly m. The special form of qij ensures that we can draw m samples in O(n1 + m log(n2)) time; we show how to do this in Appendix C.5. Note that qij intuitively captures important entries of AT B by giving higher weight to heavy rows and columns. We show in Section 3 that this sampling actually generates good approximation to the matrix AT B. The biased sampling distribution of Eq. (1) is first proposed by Bhojanapalli et al. [1]. However, their algorithm [1] needs a second pass to compute the sampled entries, while we propose a novel way of estimating dot products, using information obtained in the first step. Define f M 2 Rn1⇥n2 as f M(i, j) = kAik · kBjk · eAT i eBj k eAik · k eBjk . (2) Note that we will not compute and store f M, instead, we only calculate f M(i, j) for (i, j) 2 ⌦. This matrix is denoted as P⌦(f M), where P⌦(f M)(i, j) = f M(i, j) if (i, j) 2 ⌦and 0 otherwise. -1 -0.5 0 0.5 1 True dot product -2 -1 0 1 2 Estimated dot product JL embedding Rescaled JL embedding (a) (b) Figure 2: (a) Rescaled JL embedding (red dots) captures the dot products with smaller variance compared to JL embedding (blue triangles). Mean squared error: 0.053 versus 0.129. (b) Lower figure illustrates how to construct unit-norm vectors from a cone with angle ✓. Let x be a fixed unit-norm vector, and let t be a random Gaussian vector with expected norm tan(✓/2), we set y as either x + t or −(x + t) with probability half, and then normalize it. Upper figure plots the ratio of spectral norm errors kAT B −eAT eBk/kAT B −f Mk, when the column vectors of A and B are unit vectors drawn from a cone with angle ✓. Clearly, f M has better accuracy than eAT eB for all possible values of ✓, especially when ✓is small. We now explain the intuition of Eq. (2), and why f M is a better estimator than eAT eB. To estimate the (i, j) entry of AT B, a straightforward way is to use eAT i eBj = k eAik · k eBjk · cos e✓ij, where e✓ij is the 4 angle between vectors eAi and eBj. Since we already know the actual column norms, a potentially better estimator would be kAik · kBjk · cos e✓ij. This removes the uncertainty that comes from distorted column norms3. Figure 2(a) compares the two estimators eAT i eBj (JL embedding) and f M(i, j) (rescaled JL embedding) for dot products. We plot simulation results on pairs of unit-norm vectors with different angles. The vectors have dimension 1,000 and the sketching matrix has dimension 10-by-1,000. Clearly rescaling by the actual norms help reduce the estimation uncertainty. This phenomenon is more prominent when the true dot products are close to ±1, which makes sense because cos ✓has a small slope when cos ✓approaches ±1, and hence the uncertainty from angles may produce smaller distortion compared to that from norms. In the extreme case when cos ✓= ±1, rescaled JL embedding can perfectly recover the true dot product4. In the lower part of Figure 2(b) we illustrate how to construct unit-norm vectors from a cone with angle ✓. Given a fixed unit-norm vector x, and a random Gaussian vector t with expected norm tan(✓/2), we construct new vector y by randomly picking one from the two possible choices x+t and −(x + t), and then renormalize it. Suppose the columns of A and B are unit vectors randomly drawn from a cone with angle ✓, we plot the ratio of spectral norm errors kAT B −eAT eBk/kAT B −f Mk in Figure 2(b). We observe that f M always outperforms eAT eB and can be much better when ✓approaches zero, which agrees with the trend indicated in Figure 2(a). Step 3: Compute low rank approximation given estimates of few entries of AT B. Finally we compute the low rank approximation of AT B from the samples using alternating least squares: min U,V 2Rn⇥r X (i,j)2⌦ wij(eT i UV T ej −f M(i, j))2, (3) where wij = 1/ˆqij denotes the weights, and ei, ej are standard base vectors. This is a popular technique for low rank recovery and matrix completion (see [1] and the references therein). After T iterations, we will get a rank-r approximation of f M presented in the convenient factored form. This subroutine is quite standard, so we defer the details to Appendix A. 3 Analysis Now we present the main theoretical result. Theorem 3.1 characterizes the interaction between the sketch size k, the sampling complexity m, the number of iterations T, and the spectral error k(AT B)r −[ AT Brk, where [ AT Br is the output of SMP-PCA, and (AT B)r is the optimal rank-r approximation of AT B. Note that the following theorem assumes that A and B have the same size. For the general case of n1 6= n2, Theorem 3.1 is still valid by setting n = max{n1, n2}. Theorem 3.1. Given matrices A 2 Rd⇥n and B 2 Rd⇥n, let (AT B)r be the optimal rank-r approximation of AT B. Define ˜r = max{ kAk2 F kAk2 , kBk2 F kBk2 } as the maximum stable rank, and ⇢= σ⇤ 1 σ⇤r as the condition number of (AT B)r, where σ⇤ i is the i-th singular values of AT B. Let [ AT Br be the output of Algorithm SMP-PCA. If the input parameters k, m, and T satisfy k ≥C1kAk2kBk2⇢2r3 kAT Bk2 F · max{˜r, 2 log(n)} + log (3/γ) ⌘2 , (4) m ≥C2˜r2 γ · ✓kAk2 F + kBk2 F kAT BkF ◆2 · nr3⇢2 log(n)T 2 ⌘2 , (5) T ≥log(kAkF + kBkF ⇣ ), (6) where C1 and C2 are some global constants independent of A and B. Then with probability at least 1 −γ, we have k(AT B)r −[ AT Brk ⌘kAT B −(AT B)rkF + ⇣+ ⌘σ⇤ r. (7) 3We also tried using the cosine rule for computing the dot product, and another sketching method specifically designed for preserving angles [2], but empirically those methods perform worse than our current estimator. 4See http://wushanshan.github.io/files/RescaledJL_project.pdf for more results. 5 Remark 1. Compared to the two-pass algorithm proposed by [1], we notice that Eq. (7) contains an additional error term ⌘σ⇤ r. This extra term captures the cost incurred when we are approximating entries of AT B by Eq. (2) instead of using the actual values. The exact tradeoff between ⌘and k is given by Eq. (4). On one hand, we want to have a small k so that the sketched matrices can fit into memory. On the other hand, the parameter k controls how much information is lost during sketching, and a larger k gives a more accurate estimation of the inner products. Remark 2. The dependence on kAk2 F +kBk2 F kAT BkF captures one difficult situation for our algorithm. If kAT BkF is much smaller than kAkF or kBkF , which could happen, e.g., when many column vectors of A are orthogonal to those of B, then SMP-PCA requires many samples to work. This is reasonable. Imagine that AT B is close to an identity matrix, then it may be hard to tell it from an all-zero matrix without enough samples. Nevertheless, removing this dependence is an interesting direction for future research. Remark 3. For the special case of A = B, SMP-PCA computes a rank-r approximation of matrix AT A in a single pass. Theorem 3.1 provides an error bound in spectral norm for the residual matrix (AT A)r −[ AT Ar. Most results in the online PCA literature use Frobenius norm as performance measure. Recently, [10] provides an online PCA algorithm with spectral norm guarantee. They achieves a spectral norm bound of ✏σ⇤ 1 + σ⇤ r+1, which is stronger than ours. However, their algorithm requires a target dimension of O(r log n/✏2), i.e., the output is a matrix of size n-by-O(r log n/✏2), while the output of SMP-PCA is simply n-by-r. Remark 4. We defer our proofs to Appendix C. The proof proceeds in three steps. In Appendix C.2, we show that the sampled matrix provides a good approximation of the actual matrix AT B. In Appendix C.3, we show that there is a geometric decrease in the distance between the computed subspaces bU, bV and the optimal ones U ⇤, V ⇤at each iteration of WAltMin algorithm. The spectral norm bound in Theorem 3.1 is then proved using results from the previous two steps. Computation Complexity. We now analyze the computation complexity of SMP-PCA. In Step 1, we compute the sketched matrices of A and B, which requires O(nnz(A)k + nnz(B)k) flops. Here nnz(·) denotes the number of non-zero entries. The main job of Step 2 is to sample a set ⌦ and calculate the corresponding inner products, which takes O(m log(n) + mk) flops. Here we define n as max{n1, n2} for simplicity. According to Eq. (4), we have log(n) = O(k), so Step 2 takes O(mk) flops. In Step 3, we run alternating least squares on the sampled matrix, which can be completed in O((mr2 + nr3)T) flops. Since Eq. (5) indicates nr = O(m), the computation complexity of Step 3 is O(mr2T). Therefore, SMP-PCA has a total computation complexity O(nnz(A)k + nnz(B)k + mk + mr2T). 4 Numerical Experiments Spark implementation. We implement our SMP-PCA in Apache Spark 1.6.2 [19]. For the purpose of comparison, we also implement a two-pass algorithm LELA [1] in Spark5. The matrices A and B are stored as a resilient distributed dataset (RDD) in disk (by setting its StorageLevel as DISK_ONLY). We implement the two passes of LELA using the treeAggregate method. For SMP-PCA, we choose the subsampled randomized Hadamard transform (SRHT) [16] as the sketching matrix. The biased sampling procedure is performed using binary search (see Appendix C.5 for how to sample m elements in O(m log n) time). After obtaining the sampled matrix, we run ALS (alternating least squares) to get the desired low-rank matrices. More details can be found at [18]. Description of datasets. We test our algorithm on synthetic datasets and three real datasets: SIFT10K [9], NIPS-BW [11], and URL-reputation [12]. For synthetic data, we generate matrices A and B as GD, where G has entries independently drawn from standard Gaussian distribution, and D is a diagonal matrix with Dii = 1/i. SIFT10K is a dataset of 10,000 images. Each image is represented by 128 features. We set A as the image-by-feature matrix. The task here is to compute a low rank approximation of AT A, which is a standard PCA task. The NIPS-BW dataset contains bag-of-words features extracted from 1,500 NIPS papers. We divide the papers into two subsets, and let A and B be the corresponding word-by-paper matrices, so AT B computes the counts of co-occurred words between two sets of papers. The original URL-reputation dataset has 2.4 million 5To our best knowledge, this the first distributed implementation of LELA. 6 2 5 10 0 1000 2000 3000 Runtime (sec) vs Cluster size LELA SMC-PCA (a) 1000 2000 Sketch size (k) 0.05 0.1 0.15 0.2 Spectral norm error SVD( !AT !B) SMP-PCA LELA Optimal 1000 2000 Sketch size (k) 0.05 0.1 0.15 0.2 0.25 0.3 SVD( !AT !B) SMP-PCA LELA Optimal (b) Figure 3: (a) Spark-1.6.2 running time on a 150GB dataset. All nodes are m3.2xlarge EC2 instances. See [18] for more details. (b) Spectral norm error achieved by three algorithms over two datasets: SIFT10K (left) and NIPS-BW (right). SMP-PCA outperforms SVD( eAT eB) by a factor of 1.8 for SIFT10K and 1.1 for NIPS-BW. The error of SMP-PCA keeps decreasing as the sketch size k grows. URLs. Each URL is represented by 3.2 million features, and is indicated as malicious or benign. This dataset has been used previously for CCA [13]. Here we extract two subsets of features, and let A and B be the corresponding URL-by-feature matrices. The goal is to compute a low rank approximation of AT B, the cross-covariance matrix between two subsets of features. Sample complexity. In Figure 4(a) we present simulation results on a small synthetic data with n = d = 5, 000 and r = 5. We observe that a phase transition occurs when the sample complexity m = ⇥(nr log n). This agrees with the experimental results shown in previous papers, see, e.g., [4, 1]. For all rest experiments, unless otherwise specified, we set r = 5, T = 10, and m as 4nr log n. Table 1: A comparison of spectral norm error over three datasets Dataset d n Algorithm Sketch size k Error Synthetic 100,000 100,000 Optimal 0.0271 LELA 0.0274 SMP-PCA 2,000 0.0280 URLmalicious 792,145 10,000 Optimal 0.0163 LELA 0.0182 SMP-PCA 2,000 0.0188 URLbenign 1,603,985 10,000 Optimal 0.0103 LELA 0.0105 SMP-PCA 2,000 0.0117 Comparison of SMP-PCA and LELA. We now compare the statistical performance of SMP-PCA and LELA [1] on three real datasets and one synthetic dataset. As shown in Figure 3(b) and Table 1, LELA always achieves a smaller spectral norm error than SMP-PCA, which makes sense because LELA takes two passes and hence has more chances exploring the data. Besides, we observe that as the sketch size increases, the error of SMP-PCA keeps decreasing and gets closer to that of LELA. In Figure 3(a) we compare the runtime of SMP-PCA and LELA using a 150GB synthetic dataset on m3.2xlarge Amazon EC2 instances6. The matrices A and B have dimension n = d = 100, 000. The sketch dimension is set as k = 2, 000. We observe that the speedup achieved by SMP-PCA is more prominent for small clusters (e.g., 56 mins versus 34 mins on a cluster of size two). This is possibly due to the increasing spark overheads at larger clusters, see [8] for more related discussion. Comparison of SMP-PCA and SVD( eAT eB). In Figure 4(b) we repeat the experiment in Section 2 by generating column vectors of A and B from a cone with angle ✓. Here SVD( eAT eB) refers to 6Each machine has 8 cores, 30GB memory, and 2⇥80GB SSD. 7 1 2 3 4 # Samples / nrlogn 0.2 0.3 0.4 0.5 Spectral norm error k = 400 k = 800 (a) 0 π/4 π/2 3π/4 π 100 105 Ratio of errors vs theta (b) 200 400 600 800 1000 Sketch size (k) 0.2 0.4 0.6 0.8 1 Spectral norm error AT r Br SMP-PCA (c) Figure 4: (a) A phase transition occurs when the sample complexity m = ⇥(nr log n). (b) This figure plots the ratio of spectral norm error of SVD( eAT eB) over that of SMP-PCA. The columns of A and B are unit vectors drawn from a cone with angle ✓. We see that the ratio of errors scales to infinity as the cone angle shrinks. (c) If the top r left singular vectors of A are orthogonal to those of B, the product AT r Br is a very poor low rank approximation of AT B. computing SVD on the sketched matrices7. We plot the ratio of the spectral norm error of SVD( eAT eB) over that of SMP-PCA, as a function of ✓. Note that this is different from Figure 2(b), as now we take the effect of random sampling and SVD into account. However, the trend in both figures are the same: SMP-PCA always outperforms SVD( eAT eB) and can be arbitrarily better as ✓goes to zero. In Figure 3(b) we compare SMP-PCA and SVD( eAT eB) on two real datasets SIFK10K and NIPS-BW. The y-axis represents spectral norm error, defined as ||AT B −[ AT Br||/||AT B||, where [ AT Br is the rank-r approximation found by a specific algorithm. We observe that SMP-PCA outperforms SVD( eAT eB) by a factor of 1.8 for SIFT10K and 1.1 for NIPS-BW. Now we explain why SMP-PCA produces a more accurate result than SVD( eAT eB). The reasons are twofold. First, our rescaled JL embedding f M is a better estimator for AT B than eAT eB (Figure 2). Second, the noise due to sampling is relatively small compared to the benefit obtained from f M, and hence the final result computed using P⌦(f M) still outperforms SVD( eAT eB). Comparison of SMP-PCA and AT r Br. Let Ar and Br be the optimal rank-r approximation of A and B, we show that even if one could use existing methods (e.g., algorithms for streaming PCA) to estimate Ar and Br, their product AT r Br can be a very poor low rank approximation of AT B. This is demonstrated in Figure 4(c), where we intentionally make the top r left singular vectors of A orthogonal to those of B. 5 Conclusion We develop a novel one-pass algorithm SMP-PCA that directly computes a low rank approximation of matrix product, using ideas of matrix sketching and entrywise sampling. As a subroutine of our algorithm, we propose rescaled JL for estimating entries of AT B, which has smaller error compared to the standard estimator ˜AT ˜B. This we believe can be extended to other applications. Moreover, SMP-PCA allows the non-zero entries of A and B to be presented in any arbitrary order, and hence can be used for steaming applications. We design a distributed implementation for SMP-PCA. Our experimental results show that SMP-PCA can perform arbitrarily better than SVD( eAT eB), and is significantly faster compared to algorithms that require two or more passes over the data. Acknowledgements We thank the anonymous reviewers for their valuable comments. This research has been supported by NSF Grants CCF 1344179, 1344364, 1407278, 1422549, 1302435, 1564000, and ARO YIP W911NF-14-1-0258. 7This can be done by standard power iteration based method, without explicitly forming the product matrix e AT eB, whose size is too big to fit into memory according to our assumption. 8 References [1] S. Bhojanapalli, P. Jain, and S. Sanghavi. Tighter low-rank approximation via sampling the leveraged element. In Proceedings of the Twenty-Sixth Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 902–920. SIAM, 2015. [2] P. T. Boufounos. Angle-preserving quantized phase embeddings. In SPIE Optical Engineering+ Applications. International Society for Optics and Photonics, 2013. [3] X. Chen, H. Liu, and J. G. Carbonell. Structured sparse canonical correlation analysis. In International Conference on Artificial Intelligence and Statistics, pages 199–207, 2012. [4] Y. Chen, S. Bhojanapalli, S. Sanghavi, and R. Ward. Completing any low-rank matrix, provably. arXiv preprint arXiv:1306.2979, 2013. [5] K. L. Clarkson and D. P. Woodruff. Low rank approximation and regression in input sparsity time. In Proceedings of the 45th annual ACM symposium on Symposium on theory of computing, pages 81–90. ACM, 2013. [6] M. B. Cohen, J. Nelson, and D. P. Woodruff. Optimal approximate matrix product in terms of stable rank. arXiv preprint arXiv:1507.02268, 2015. [7] P. Drineas, R. Kannan, and M. W. Mahoney. Fast monte carlo algorithms for matrices ii: Computing a low-rank approximation to a matrix. SIAM Journal on Computing, 36(1):158–183, 2006. [8] A. Gittens, A. Devarakonda, E. Racah, M. F. Ringenburg, L. Gerhardt, J. Kottalam, J. Liu, K. J. Maschhoff, S. Canon, J. Chhugani, P. Sharma, J. Yang, J. Demmel, J. Harrell, V. Krishnamurthy, M. W. Mahoney, and Prabhat. Matrix factorization at scale: a comparison of scientific data analytics in spark and C+MPI using three case studies. arXiv preprint arXiv:1607.01335, 2016. [9] H. Jegou, M. Douze, and C. Schmid. Product quantization for nearest neighbor search. Pattern Analysis and Machine Intelligence, IEEE Transactions on, 33(1):117–128, 2011. [10] Z. Karnin and E. Liberty. Online pca with spectral bounds. In Proceedings of The 28th Conference on Learning Theory (COLT), volume 40, pages 1129–1140, 2015. [11] M. Lichman. UCI machine learning repository. http://archive.ics.uci.edu/ml, 2013. [12] J. Ma, L. K. Saul, S. Savage, and G. M. Voelker. Identifying suspicious urls: an application of large-scale online learning. In Proceedings of the 26th annual international conference on machine learning, pages 681–688. ACM, 2009. [13] Z. Ma, Y. Lu, and D. Foster. Finding linear structure in large datasets with scalable canonical correlation analysis. arXiv preprint arXiv:1506.08170, 2015. [14] A. Magen and A. Zouzias. Low rank matrix-valued chernoff bounds and approximate matrix multiplication. In Proceedings of the twenty-second annual ACM-SIAM symposium on Discrete Algorithms, pages 1422– 1436. SIAM, 2011. [15] T. Sarlos. Improved approximation algorithms for large matrices via random projections. In Foundations of Computer Science, 2006. FOCS’06. 47th Annual IEEE Symposium on, pages 143–152. IEEE, 2006. [16] J. A. Tropp. Improved analysis of the subsampled randomized hadamard transform. Advances in Adaptive Data Analysis, pages 115–126, 2011. [17] D. P. Woodruff. Sketching as a tool for numerical linear algebra. arXiv preprint arXiv:1411.4357, 2014. [18] S. Wu, S. Bhojanapalli, S. Sanghavi, and A. Dimakis. Github repository for "single-pass pca of matrix products". https://github.com/wushanshan/MatrixProductPCA, 2016. [19] M. Zaharia, M. Chowdhury, T. Das, A. Dave, J. Ma, M. McCauley, M. J. Franklin, S. Shenker, and I. Stoica. Resilient distributed datasets: A fault-tolerant abstraction for in-memory cluster computing. In Proceedings of the 9th USENIX conference on Networked Systems Design and Implementation, 2012. 9
2016
35
6,272
Review Networks for Caption Generation Zhilin Yang, Ye Yuan, Yuexin Wu, Ruslan Salakhutdinov, William W. Cohen School of Computer Science Carnegie Mellon University {zhiliny,yey1,yuexinw,rsalakhu,wcohen}@cs.cmu.edu Abstract We propose a novel extension of the encoder-decoder framework, called a review network. The review network is generic and can enhance any existing encoderdecoder model: in this paper, we consider RNN decoders with both CNN and RNN encoders. The review network performs a number of review steps with attention mechanism on the encoder hidden states, and outputs a thought vector after each review step; the thought vectors are used as the input of the attention mechanism in the decoder. We show that conventional encoder-decoders are a special case of our framework. Empirically, we show that our framework improves over state-ofthe-art encoder-decoder systems on the tasks of image captioning and source code captioning.1 1 Introduction Encoder-decoder is a framework for learning a transformation from one representation to another. In this framework, an encoder network first encodes the input into a context vector, and then a decoder network decodes the context vector to generate the output. The encoder-decoder framework was recently introduced for sequence-to-sequence learning based on recurrent neural networks (RNNs) with applications to machine translation [3, 15], where the input is a text sequence in one language and the output is a text sequence in the other language. More generally, the encoder-decoder framework is not restricted to RNNs and text; e.g., encoders based on convolutional neural networks (CNNs) are used for image captioning [18]. Since it is often difficult to encode all the necessary information in a single context vector, an attentive encoder-decoder introduces an attention mechanism to the encoder-decoder framework. An attention mechanism modifies the encoder-decoder bottleneck by conditioning the generative process in the decoder on the encoder hidden states, rather than on one single context vector only. Improvements due to an attention mechanism have been shown on various tasks, including machine translation [1], image captioning [20], and text summarization [12]. However, there remain two important issues to address for attentive encoder-decoder models. First, the attention mechanism proceeds in a sequential manner and thus lacks global modeling abilities. More specifically, at the generation step t, the decoded token is conditioned on the attention results at the current time step ˜ht, but has no information about future attention results ˜ht′ with t′ > t. For example, when there are multiple objects in the image, the caption tokens generated at the beginning focuses on the first one or two objects and is unaware of the other objects, which is potentially suboptimal. Second, previous works show that discriminative supervision (e.g., predicting word occurrences in the caption) is beneficial for generative models [5], but it is not clear how to integrate discriminative supervision into the encoder-decoder framework in an end-to-end manner. To address the above questions, we propose a novel architecture, the review network, which extends existing (attentive) encoder-decoder models. The review network performs a given number of review steps with attention on the encoder hidden states and outputs a thought vector after each step, where 1Code and data available at https://github.com/kimiyoung/review_net. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. the thought vectors are introduced to capture the global properties in a compact vector representation and are usable by the attention mechanism in the decoder. The intuition behind the review network is to review all the information encoded by the encoder and produce vectors that are a more compact, abstractive, and global representation than the original encoder hidden states. Another role for the thought vectors is as a focus for multitask learning. For instance, one can use the thought vectors as inputs for a secondary prediction task, such as predicting discriminative signals (e.g., the words that occur in an image caption), in addition to the objective as a generative model. In this paper we explore this multitask review network, and also explore variants with weight tying. We show that conventional attentive encoder-decoders are a special case of the review networks, which indicates that our model is strictly more expressive than the attentive encoder-decoders. We experiment with two different tasks, image captioning and source code captioning, using CNNs and RNNs as the encoders respectively. Our results show that the review network can consistently improve the performance over attentive encoder-decoders on both datasets, and obtain state-of-the-art performance. 2 Related Work The encoder-decoder framework in the context of sequence-to-sequence learning was recently introduced for learning transformation between text sequences [3, 15], where RNNs were used for both encoding and decoding. Encoder-decoders, in general, can refer to models that learn a representation transformation using two network components, an encoder and a decoder. Besides RNNs, convolutional encoders have been developed to address multi-modal tasks such as image captioning [18]. Attention mechanisms were later introduced to the encoder-decoder framework for machine translation, with attention providing an explanation of explicit token-level alignment between input and output sequences [1]. In contrast to vanilla encoder-decoders, attentive encoder-decoders condition the decoder on the encoder’s hidden states. At each generation step, the decoder pays attention to a specific part of the encoder, and generates the next token based on both the current hidden state in the decoder and the attended hidden states in the encoder. Attention mechanisms have had considerable success in other applications as well, including image captioning [20] and text summarization [12]. Our work is also related to memory networks [19, 14]. Memory networks take a question embedding as input, and perform multiple computational steps with attention on the memory, which is usually formed by the embeddings of a group of sentences. Dynamic memory networks extend memory networks to model sequential memories [8]. Memory networks are mainly used in the context of question answering; the review network, on the other hand, is a generic architecture that can be integrated into existing encoder-decoder models. Moreover, the review network learns thought vectors using multiple review steps, while (embedded) facts are provided as input to the memory networks. Another difference is that the review network outputs a sequence of thought vectors, while memory networks only use the last hidden state to generate the answer. [17] presented a processor unit that runs over the encoder multiple times, but their model mainly focuses on handling non-sequential data and their approach differs from ours in many ways (e.g., the encoder consists of small neural networks operating on each input element, and the process module is not directly connected to the encoder, etc). The model proposed in [6] performs a number of sub-steps inside a standard recurrent step, while our decoder generates the output with attention to the thought vectors. 3 Model Given the input representation x and the output representation y, the goal is to learn a function mapping from x to y. For example, image captioning aims to learn a mapping from an image x to a caption y. For notation simplicity, we use x and y to denote both a tensor and a sequence of tensors. For example, x can be a 3d-tensor that represents an image with RGB channels in image captioning, or can be a sequence of 1d-tensors (i.e., vectors) x = (x1, · · · , xTx) in machine translation, where xt denotes the one-of-K embedding of the t-th word in the input sequence of length Tx. In contrast to conventional (attentive) encoder-decoder models, our model consists of three components, encoder, reviewer, and decoder. The comparison of architectures is shown in Figure 1. Now we describe the three components in detail. 2 (a) Attentive Encoder-Decoder Model. (b) Review Network. Blue components denote optional discriminative supervision. Tr is set to 3 in this example. Figure 1: Model Architectures. (a) Attentive Input Reviewer. (b) Attentive Output Reviewer. (c) Decoder. Figure 2: Illustrations of modules in the review network. f ′ · and f ′′ · denote LSTM units. 3.1 Encoder The encoder encodes the input x into a context vector c and a set of hidden states H = {ht}t. We discuss two types of encoders, RNN encoders and CNN encoders. RNN Encoder: Let Tx = |H| be the length of the input sequence. An RNN encoder processes the input sequence x = (x1, · · · , xTx) sequentially. At time step t, the RNN encoder updates the hidden state by ht = f(xt, ht−1). In this work, we implement f using an LSTM unit. The context vector is defined as the final hidden state c = hTx. The cell state and hidden state h0 of the first LSTM unit are initialized as zero. CNN Encoder: We take a widely-used CNN architecture—VGGNet [13]—as an example to describe how we use CNNs as encoders. Given a VGGNet, we use the output of the last fully connected layer fc7 as the context vector c = fc7(x), and use 14 × 14 = 196 columns of 512d convolutional output conv5 as hidden states H = conv5(x). In this case Tx = |H| = 196. 3.2 Reviewer Let Tr be a hyperparameter that specifies the number of review steps. The intuition behind the reviewer module is to review all the information encoded by the encoder and learn thought vectors that are a more compact, abstractive, and global representation than the original encoder hidden states. The reviewer performs Tr review steps on the encoder hidden states H and outputs a thought vector ft after each step. More specifically, ft = gt(H, ft−1), where gt is a modified LSTM unit with attention mechanism at review step t. We study two variants of gt, attentive input reviewers and attentive output reviewers. The attentive input reviewer is inspired by visual attention [20], which is more commonly used for images; the attentive output reviewer is inspired by attention on text [1], which is more commonly used for sequential tokens. Attentive Input Reviewer At each review step t, the attentive input reviewer first applies an attention mechanism on H and use the attention result as the input to an LSTM unit (Cf. Figure 2a). Let 3 ˜ft = att(H, ft−1) be the attention result at step t. The attentive input reviewer is formulated as ˜ft = att(H, ft−1) = |H| X i=1 α(hi, ft−1) P|H| i′=1 α(hi′, ft−1) hi, gt(H, ft−1) = f ′ t(˜ft, ft−1), (1) where α(hi, ft−1) is a function that determines the weight for the i-th hidden state. α(x1, x2) can be implemented as a dot product between x1 and x2 or a multi-layer perceptron (MLP) that takes the concatenation of x1 and x2 as input [9]. f ′ t is an LSTM unit at step t. Attentive Output Reviewer In contrast to the attentive input reviewer, the attentive output reviewer uses a zero vector as input to the LSTM unit, and the thought vector is computed as the weighted sum of the attention results and the output of the LSTM unit (Cf. Figure 2b). More specifically, the attentive output reviewer is formulated as ˜ft = att(H, ft−1), gt(H, ft−1) = f ′ t(0, ft−1) + W˜ft, where the attention mechanism att follows the definition in Eq. (1), 0 denotes a zero vector, W is a model parameter matrix, and f ′ t is an LSTM unit at step t. We note that performing attention on top of an RNN unit is commonly used in sequence-to-sequence learning [1, 9, 12]. We apply a linear transformation with a matrix W since the dimensions of f ′ t(·, ·) and ˜ft can be different. Weight Tying We study two variants of weight tying for the reviewer module. Let wt denote the parameters for the unit f ′ t. The first variant follows the common setting in RNNs, where weights are shared among all the units; i.e., w1 = · · · = wTr. We also observe that the reviewer unit does not have sequential input, so we experiment with the second variant where weights are untied; i.e. wi ̸= wj, ∀i ̸= j. The cell state and hidden state of the first unit f ′ 1 are initialized as the context vector c. The cell states and hidden states are passed through all the reviewer units in both cases of weight tying. 3.3 Decoder Let F = {ft}t be the set of thought vectors output by the reviewer. The decoder is formulated as an LSTM network with attention on the thought vectors F (Cf. Figure 2c). Let st be the hidden state of the t-th LSTM unit in the decoder. The decoder is formulated as follows: ˜st = att(F, st−1), st = f ′′([˜st; yt−1], st−1), yt = arg max y softmaxy(st), (2) where [·; ·] denotes the concatenation of two vectors, f ′′ denotes the decoder LSTM, softmaxy is the probability of word y given by a softmax layer, yt is the t-th decoded token, and yt is the word embedding of yt. The attention mechanism att follows the definition in Eq. (1). The initial cell state and hidden state s0 of the decoder LSTM are both set to the review vector r = W′[fTr; c], where W′ is a model parameter matrix. 3.4 Discriminative Supervision In conventional encoder-decoders, supervision is provided in a generative manner; i.e., the model aims to maximize the conditional probability of generating the sequential output p(y|x). However, discriminative supervision has been shown to be useful in [5], where the model is guided to predict discriminative objectives, such as the word occurrences in the output y. We argue that the review network provides a natural way of incorporating discriminative supervision into the model. Here we take word occurrence prediction for example to describe how to incorporate discriminative supervision. As shown in the blue components in Figure 1b, we first apply a linear layer on top of the thought vector to compute a score for each word at each review step. We then apply a max-pooling layer over all the review units to extract the most salient signal for each word, and add a multi-label margin loss as discriminative supervision. Let si be the score of word i after the max pooling layer, and W be the set of all words that occur in y. The discriminative loss can be written as Ld = 1 Z X j∈W X i̸=j max(0, 1 −(sj −si)), (3) where Z is a normalizer that counts all the valid i, j pairs. We note that when the discriminative supervision is derived from the given data (i.e., predicting word occurrences in captions), we are not using extra information. 4 3.5 Training The training loss for a single training instance (x, y) is defined as a weighted sum of the negative conditional log likelihood and the discriminative loss. Let Ty be the length of the output sequence y. The loss can be written as L(x, y) = 1 Ty Ty X t=1 −log softmaxyt(st) + λLd, where the definition of softmaxy and st follows Eq. (2), and the formulation of Ld follows Eq. (3). λ is a constant weighting factor. We adopt adaptive stochastic gradient descent (AdaGrad) [4] to train the model in an end-to-end manner. The loss of a training batch is averaged over all instances in the batch. 3.6 Connection to Encoder-Decoders We now show that our model can be reduced to the conventional (attentive) encoder-decoders in a special case. In attentive encoder-decoders, the decoder takes the context vector c and the set of encoder hidden states H = {ht}t as input, while in our review network, the input of the decoder is instead the review vector r and the set of thought vectors F = {ft}t. To show that our model can be reduced to attentive encoder-decoders, we only need to construct a case where H = F and c = r. Since r = W′[fTr; c], it can be reduced to r = c with a specific setting of W′. We further set Tr = Tx, and define each reviewer unit as an identity mapping gt(H, ft−1) = ht, which satisfies the definition of both the attentive input reviewer and the attentive output reviewer with untied weights. With the above setting, we have ht = ft, ∀t = 1, · · · , Tx; i.e., H = F. Thus our model can be reduced to attentive encoder-decoders in a special case. Similarly we can show that our model can be reduced to vanilla encoder-decoders (without attention) by constructing a case where r = c and ft = 0. Therefore, our model is more expressive than (attentive) encoder-decoders. Though we set Tr = Tx in the above construction, in practice, we set the number of review steps Tr to be much smaller compared to Tx, since we find that the review network can learn a more compact and effective representation. 4 Experiments We experiment with two datasets of different tasks, image captioning and source code captioning. Since these two tasks are quite different, we can use them to test the robustness and generalizability of our model. 4.1 Image Captioning 4.1.1 Offline Evaluation We evaluate our model on the MSCOCO benchmark dataset [2] for image captioning. The dataset contains 123,000 images with at least 5 captions for each image. For offline evaluation, we use the same data split as in [7, 20, 21], where we reserve 5,000 images for development and test respectively and use the rest for training. The models are evaluated using the official MSCOCO evaluation scripts. We report three widely used automatic evaluation metrics, BLEU-4, METEOR, and CIDEr. We remove all the non-alphabetic characters in the captions, transform all letters to lowercase, and tokenize the captions using white space. We replace all words occurring less than 5 times with an unknown token <UNK> and obtain a vocabulary of 9,520 words. We truncate all the captions longer than 30 tokens. We set the number of review steps Tr = 8, the weighting factor λ = 10.0, the dimension of word embeddings to be 100, the learning rate to be 1e−2, and the dimension of LSTM hidden states to be 1, 024. These hyperparameters are tuned on the development set. We also use early stopping strategies to prevent overfitting. More specifically, we stop the training procedure when the BLEU-4 score on the development set reaches the maximum. We use an MLP with one hidden layer of size 512 to define the function α(·, ·) in the attention mechanism, and use an attentive input reviewer in 5 Table 1: Comparison of model variants on MSCOCO dataset. Results are obtained with a single model using VGGNet. Scores in the brackets are without beam search. We use RNN-like tied weights for the review network unless otherwise indicated. “Disc Sup” means discriminative supervision. Model BLEU-4 METEOR CIDEr Attentive Encoder-Decoder 0.278 (0.255) 0.229 (0.223) 0.840 (0.793) Review Net 0.282 (0.259) 0.233 (0.227) 0.852 (0.816) Review Net + Disc Sup 0.287 (0.264) 0.238 (0.232) 0.879 (0.833) Review Net + Disc Sup + Untied Weights 0.290 (0.268) 0.237 (0.232) 0.886 (0.852) Table 2: Comparison with state-of-the-art systems on the MSCOCO evaluation server. † indicates ensemble models. Feat. means using task-specific features or attributes. Fine. means using CNN fine-tuning. Model BLEU-4 METEOR ROUGE-L CIDEr Fine. Feat. Attention [20] 0.537 0.322 0.654 0.893 No No MS Research [5] 0.567 0.331 0.662 0.925 No Yes Google NIC [18]† 0.587 0.346 0.682 0.946 Yes No Semantic Attention [21]† 0.599 0.335 0.682 0.958 No Yes Review Net (this paper)† 0.597 0.347 0.686 0.969 No No our experiments to be consistent with visual attention models [20]. We use beam search with beam size 3 for decoding. We guide the model to predict the words occurring in the caption through the discriminative supervision Ld without introducing extra information. We fix the parameters of the CNN encoders during training. We compare our model with encoder-decoders to study the effectiveness of the review network. We also compare different variants of our model to evaluate the effects of different weight tying strategies and discriminative supervision. Results are reported in Table 1. All the results in Table 1 are obtained using VGGNet [13] as encoders as described in Section 3.1. From Table 1, we can see that the review network can improve the performance over conventional attentive encoder-decoders consistently on all the three metrics. We also observe that adding discriminative supervision can boost the performance, which demonstrates the effectiveness of incorporating discriminative supervision in an end-to-end manner. Untying the weights between the reviewer units can further improve the performance. Our conjecture is that the models with untied weights are more expressive than shared-weight models since each unit can have its own parametric function to compute the thought vector. In addition to Table 1, our experiment shows that applying discriminative supervision on attentive encoder-decoders can improve the CIDEr score from 0.793 to 0.811 without beam search. We did experiments on the development set with Tr = 0, 4, 8, and 16. The performances when Tr = 4 and Tr = 16 are slightly worse then Tr = 8 (−0.003 in Bleu-4 and −0.01 in CIDEr). We also experimented on the development set with λ = 0, 5, 10, and 20, and λ = 10 gives the best performance. 4.1.2 Online Evaluation on MSCOCO Server We also compare our model with state-of-the-art systems on the MSCOCO evaluation server in Table 2. Our submission uses Inception-v3 [16] as the encoder and is an ensemble of three identical models with different random initialization. We take the output of the last convolutional layer (before pooling) as the encoder states. From Table 2, we can see that among state-of-the-art published systems, the review network achieves the best performance for three out of four metrics (i.e., METEOR, ROUGE-L, and CIDEr), and has very close performance to Semantic Attention [21] on BLEU-4 score. The Google NIC system [18] employs several tricks such as CNN fine-tuning and scheduled sampling and takes more than two weeks to train; the semantic attention system requires hand-engineering task-specific features/attributes. Unlike these methods, our approach with the review network is a generic end-to-end encoder-decoder model and can be trained within six hours on a Titan X GPU. 6 Figure 3: Each row corresponds to a test image: the first is the original image with the caption output by our model, and the following three images are the visualized attention weights of the first three reviewer units. We also list the top-5 words with highest scores for each unit. Colors indicate semantically similar words. 4.1.3 Case Study and Visualization To better understand the review network, we visualize the attention weights α in the review network in Figure 3. The visualization is based on the review network with untied weights and discriminative supervision. We also list the top-5 words with highest scores (computed based on the thought vectors) at each reviewer unit. We find that the top words with highest scores can uncover the reasoning procedure underlying the review network. For example, in the first image (a giraffe in a zoo), the first reviewer focuses on the motion of the giraffe and the tree near it, the second reviewer analyzes the relative position between the giraffe and the tree, and the third reviewer looks at the big picture and infers that the scene is in a zoo based on recognizing the fences and enclosures. All the above information is stored in the thought vectors and decoded as natural language by the decoder. Different from attentive encoder-decoders [20] that attend to a single object at a time during generation, it can be clearly seen from Figure 3 that the review network captures more global signals, usually combining multiple objects into one thought, including objects not finally shown in the caption (e.g., “traffic light” and “motorcycles”). The thoughts are sometimes abstractive, such as motion (“standing”), relative position (“near”, “by”, “up”), quantity (“bunch”, “group”), and scene (“city”, “zoo”). Also, the order of review is not restricted by the order in natural language. 4.2 Source Code Captioning 4.2.1 Data and Settings The task of source code captioning is to predict the code comment given the source code, which can be framed under the problem of sequence-to-sequence learning. We experiment with a benchmark 7 Table 3: Comparison of model variants on HabeasCorpus code captioning dataset. “Bidir” indicates using bidirectional RNN encoders, “LLH” refers to log-likelihood, “CS-k” refers to top-k character savings. Model LLH CS-1 CS-2 CS-3 CS-4 CS-5 Language Model -5.34 0.2340 0.2763 0.3000 0.3153 0.3290 Encoder-Decoder -5.25 0.2535 0.2976 0.3201 0.3367 0.3507 Encoder-Decoder (Bidir) -5.19 0.2632 0.3068 0.3290 0.3442 0.3570 Attentive Encoder-Decoder (Bidir) -5.14 0.2716 0.3152 0.3364 0.3523 0.3651 Review Net -5.06 0.2889 0.3361 0.3579 0.3731 0.3840 dataset for source code captioning, HabeasCorpus [11]. HabeasCorpus collects nine popular opensource Java code repositories, such as Apache Ant and Lucene. The dataset contains 6, 734 Java source code files with 7, 903, 872 source code tokens and 251, 565 comment word tokens. We randomly sample 10% of the files as the test set, 10% as the development set, and use the rest for training. We use the development set for early stopping and hyperparameter tuning. Our evaluation follows previous works on source code language modeling [10] and captioning [11]. We report the log-likelihood of generating the actual code captions based on the learned models. We also evaluate the approaches from the perspective of code comment completion, where we compute the percentage of characters that can be saved by applying the models to predict the next token. More specifically, we use a metric of top-k character savings [11] (CS-k). Let n be the minimum number of prefix characters needed to be filtered such that the actual word ranks among the top-k based on the given model. Let L be the length of the actual word. The number of saved characters is then L −n. We compute the average percentage of saved characters per comment to obtain the metric CS-k. We follow the tokenization used in [11], where we transform camel case identifiers into multiple separate words (e.g., “binaryClassifierEnsemble” to “binary classifier ensemble”), and remove all non-alphabetic characters. We truncate code sequences and comment sequences longer than 300 tokens. We use an RNN encoder and an attentive output reviewer with tied weights. We set the number of review steps Tr = 8, the dimension of word embeddings to be 50, and the dimension of the LSTM hidden states to be 256. 4.2.2 Results We report the log-likelihood and top-k character savings of different model variants in Table 3. The baseline model “Language Model” is an LSTM decoder whose output is not sensitive to the input code sequence. A preliminary experiment showed that the LSTM decoder significantly outperforms the Ngram models used in [11] (+3% in CS-2), so we use the LSTM decoder as a baseline for comparison. We also compare with different variants of encoder-decoders, including incorporating bidirectional RNN encoders and attention mechanism. It can be seen from Table 3 that both bidirectional encoders and attention mechanism can improve over vanilla encoder-decoders. The review network outperforms attentive encoder-decoders consistently in all the metrics, which indicates that the review network is effective at learning useful representation. 5 Conclusion We present a novel architecture, the review network, to improve the encoder-decoder learning framework. The review network performs multiple review steps with attention on the encoder hidden states, and computes a set of thought vectors that summarize the global information in the input. We empirically show consistent improvement over conventional encoder-decoders on the tasks of image captioning and source code captioning. In the future, it will be interesting to apply our model to more tasks that can be modeled under the encoder-decoder framework, such as machine translation and text summarization. Acknowledgements This work was funded by the NSF under grants CCF-1414030 and IIS-1250956, Google, Disney Research, the ONR grant N000141512791, and the ADeLAIDE grant FA8750-16C0130-001. 8 References [1] Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. In ICLR, 2015. [2] Xinlei Chen, Hao Fang, Tsung-Yi Lin, Ramakrishna Vedantam, Saurabh Gupta, Piotr Dollár, and C Lawrence Zitnick. Microsoft coco captions: Data collection and evaluation server. arXiv preprint arXiv:1504.00325, 2015. [3] Kyunghyun Cho, Bart Van Merriënboer, Caglar Gulcehre, Dzmitry Bahdanau, Fethi Bougares, Holger Schwenk, and Yoshua Bengio. Learning phrase representations using rnn encoderdecoder for statistical machine translation. In ACL, 2014. [4] John Duchi, Elad Hazan, and Yoram Singer. Adaptive subgradient methods for online learning and stochastic optimization. JMLR, 12:2121–2159, 2011. [5] Hao Fang, Saurabh Gupta, Forrest Iandola, Rupesh K Srivastava, Li Deng, Piotr Dollár, Jianfeng Gao, Xiaodong He, Margaret Mitchell, John C Platt, et al. From captions to visual concepts and back. In CVPR, pages 1473–1482, 2015. [6] Alex Graves. Adaptive computation time for recurrent neural networks. arXiv preprint arXiv:1603.08983, 2016. [7] Andrej Karpathy and Li Fei-Fei. Deep visual-semantic alignments for generating image descriptions. In CVPR, pages 3128–3137, 2015. [8] Ankit Kumar, Ozan Irsoy, Jonathan Su, James Bradbury, Robert English, Brian Pierce, Peter Ondruska, Ishaan Gulrajani, and Richard Socher. Ask me anything: Dynamic memory networks for natural language processing. In ICML, 2016. [9] Minh-Thang Luong, Hieu Pham, and Christopher D Manning. Effective approaches to attentionbased neural machine translation. In ACL, 2015. [10] Chris J Maddison and Daniel Tarlow. Structured generative models of natural source code. In ICML, 2014. [11] Dana Movshovitz-Attias and William W Cohen. Natural language models for predicting programming comments. In ACL, 2013. [12] Alexander M Rush, Sumit Chopra, and Jason Weston. A neural attention model for abstractive sentence summarization. In EMNLP, 2015. [13] Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. In ICLR, 2015. [14] Sainbayar Sukhbaatar, Jason Weston, Rob Fergus, et al. End-to-end memory networks. In NIPS, pages 2431–2439, 2015. [15] Ilya Sutskever, Oriol Vinyals, and Quoc V Le. Sequence to sequence learning with neural networks. In NIPS, pages 3104–3112, 2014. [16] Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jonathon Shlens, and Zbigniew Wojna. Rethinking the inception architecture for computer vision. arXiv preprint arXiv:1512.00567, 2015. [17] Oriol Vinyals, Samy Bengio, and Manjunath Kudlur. Order matters: Sequence to sequence for sets. In ICLR, 2016. [18] Oriol Vinyals, Alexander Toshev, Samy Bengio, and Dumitru Erhan. Show and tell: A neural image caption generator. In CVPR, pages 3156–3164, 2015. [19] Jason Weston, Sumit Chopra, and Antoine Bordes. Memory networks. In ICLR, 2015. [20] Kelvin Xu, Jimmy Ba, Ryan Kiros, Aaron Courville, Ruslan Salakhutdinov, Richard Zemel, and Yoshua Bengio. Show, attend and tell: Neural image caption generation with visual attention. In ICML, 2015. [21] Quanzeng You, Hailin Jin, Zhaowen Wang, Chen Fang, and Jiebo Luo. Image captioning with semantic attention. In CVPR, 2016. 9
2016
350
6,273
Distributed Flexible Nonlinear Tensor Factorization Shandian Zhe§, Kai Zhang†, Pengyuan Wang‡, Kuang-chih Lee♯, Zenglin Xu♮, Yuan Qi♭, Zoubin Gharamani⋆ §Dept. Computer Science, Purdue University, †NEC Laboratories America, Princeton NJ, ‡Dept. Marketing, University of Georgia at Athens, ♯Yahoo! Research, ♮Big Data Res. Center, School Comp. Sci. Eng., Univ. of Electr. Sci. & Tech. of China, ♭Ant Financial Service Group, Alibaba, ⋆University of Cambridge §szhe@purdue.edu, †kzhang@nec-labs.com, ‡pengyuan@uga.edu, ♯kclee@yahoo-inc.com, ♮zlxu@uestc.edu.cn, ♭alanqi0@outlook.com, ⋆zoubin@cam.ac.uk Abstract Tensor factorization is a powerful tool to analyse multi-way data. Recently proposed nonlinear factorization methods, although capable of capturing complex relationships, are computationally quite expensive and may suffer a severe learning bias in case of extreme data sparsity. Therefore, we propose a distributed, flexible nonlinear tensor factorization model, which avoids the expensive computations and structural restrictions of the Kronecker-product in the existing TGP formulations, allowing an arbitrary subset of tensorial entries to be selected for training. Meanwhile, we derive a tractable and tight variational evidence lower bound (ELBO) that enables highly decoupled, parallel computations and high-quality inference. Based on the new bound, we develop a distributed, key-value-free inference algorithm in the MAPREDUCE framework, which can fully exploit the memory cache mechanism in fast MAPREDUCE systems such as SPARK. Experiments demonstrate the advantages of our method over several state-of-the-art approaches, in terms of both predictive performance and computational efficiency. 1 Introduction Tensors, or multidimensional arrays, are generalizations of matrices (from binary interactions) to high-order interactions between multiple entities. For example, we can extract a three-mode tensor (user, advertisement, context) from online advertising logs. To analyze tensor data, people usually turn to factorization approaches, which use a set of latent factors to represent each entity and model how the latent factors interact with each other to generate tensor elements. Classical tensor factorization models, including Tucker [18] and CANDECOMP/PARAFAC (CP) [5], assume multilinear interactions and hence are unable to capture more complex, nonlinear relationships. Recently, Xu et al. [19] proposed Infinite Tucker decomposition (InfTucker), which generalizes the Tucker model to infinite feature space using a Tensor-variate Gaussian process (TGP) and is hence more powerful in modeling intricate nonlinear interactions. However, InfTucker and its variants [22, 23] are computationally expensive, because the Kronecker product between the covariances of all the modes requires the TGP to model the entire tensor structure. In addition, they may suffer from the extreme sparsity of real-world tensor data, i.e., when the proportion of the nonzero entries is extremely low. As is often the case, most of the zero elements in real tensors are meaningless: they simply indicate missing or unobserved entries. Incorporating all of them in the training process may affect the factorization quality and lead to biased predictions. To address these issues, we propose a distributed, flexible nonlinear tensor factorization model, which has several important advantages. First, it can capture highly nonlinear interactions in the tensor, and is flexible enough to incorporate arbitrary subset of (meaningful) tensor entries for the training. This is achieved by placing a Gaussian process prior over tensor entries, where the input is constructed by concatenating the latent factors from each mode and the intricate relationships 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. are captured by using the kernel function. By using such a construction, the covariance function is then free of the Kronecker-product structure, and as a result users can freely choose any subset of tensor elements for the training process and incorporate prior domain knowledge. For example, one can choose a combination of balanced zero and nonzero elements to overcome the learning bias. Second, the tight variational evidence lower bound (ELBO) we derived using functional derivatives and convex conjugates subsumes optimal variational posteriors, thus evades inefficient, sequential E-M updates and enables highly efficient, parallel computations as well as improved inference quality. Moreover, the new bound allows us to develop a distributed, gradient-based optimization algorithm. Finally, we develop a simple yet very efficient procedure to avoid the data shuffling operation, a major performance bottleneck in the (key-value) sorting procedure in MAPREDUCE. That is, rather than sending out key-value pairs, each mapper simply calculates and sends a global gradient vector without keys. This key-value-free procedure is general and can effectively prevent massive disk IOs and fully exploit the memory cache mechanism in fast MAPREDUCE systems, such as SPARK. Evaluation using small real-world tensor data have fully demonstrated the superior prediction accuracy of our model in comparison with InfTucker and other state-of-the-art; on large tensors with millions of nonzero elements, our approach is significantly better than, or at least as good as two popular large-scale nonlinear factorization methods based on TGP: one uses hierarchical modeling to perform distributed infinite Tucker decomposition [22]; the other further enhances InfTucker by using Dirichlet process mixture prior over the latent factors and employs an online learning scheme [23]. Our method also outperforms GigaTensor [8], a typical large-scale CP factorization algorithm, by a large margin. In addition, our method achieves a faster training speed and enjoys almost linear speedup with respect to the number of computational nodes. We apply our model to CTR prediction for online advertising and achieves a significant, 20% improvement over the popular logistic regression and linear SVM approaches (Section 4 of the supplementary material). 2 Background We first introduce the background knowledge. For convenience, we will use the same notations in [19]. Specifically, we denote a K-mode tensor by M ∈Rd1×...×dK, where the k-th mode is of dimension dk. The tensor entry at location i (i = (i1, . . . , iK)) is denoted by mi. To introduce Tucker decomposition, we need to generalize matrix-matrix products to tensor-matrix products. Specifically, a tensor W ∈Rr1×...×rK can multiply with a matrix U ∈Rs×t at mode k when its dimension at mode-k is consistent with the number of columns in U, i.e., rk = t. The product is a new tensor, with size r1 × . . . × rk−1 × s × rk+1 × . . . × rK. Each element is calculated by (W ×k U)i1...ik−1jik+1...iK = Prk ik=1 wi1...iKujik. The Tucker decomposition model uses a latent factor matrix Uk ∈Rdk×rk in each mode k and a core tensor W ∈Rr1×...×rK and assumes the whole tensor M is generated by M = W ×1 U(1) ×2 . . . ×K U(K). Note that this is a multilinear function of W and {U1, . . . , UK}. It can be further simplified by restricting r1 = r2 = . . . = rK and the off-diagonal elements of W to be 0. In this case, the Tucker model becomes CANDECOMP/PARAFAC (CP). The infinite Tucker decomposition (InfTucker) generalizes the Tucker model to infinite feature space via a tensor-variate Gaussian process (TGP) [19]. Specifically, in a probabilistic framework, we assign a standard normal prior over each element of the core tensor W, and then marginalize out W to obtain the probability of the tensor given the latent factors: p(M|U(1), . . . , U(K)) = N(vec(M); 0, Σ(1) ⊗. . . ⊗Σ(K)) (1) where vec(M) is the vectorized whole tensor, Σ(k) = U(k)U(k)⊤and ⊗is the Kronecker-product. Next, we apply the kernel trick to model nonlinear interactions between the latent factors: Each row uk t of the latent factors U(k) is replaced by a nonlinear feature transformation φ(uk t ) and thus an equivalent nonlinear covariance matrix Σ(k) = k(U(k), U(k)) is used to replace U(k)U(k)⊤, where k(·, ·) is the covariance function. After the nonlinear feature mapping, the original Tucker decomposition is performed in an (unknown) infinite feature space. Further, since the covariance of vec(M) is a function of the latent factors U = {U(1), . . . , U(K)}, Equation (1) actually defines a Gaussian process (GP) on tensors, namely tensor-variate GP (TGP) [19], where the input are based on U. Finally, we can use different noisy models p(Y|M) to sample the observed tensor Y. For example, we can use Gaussian models and Probit models for continuous and binary observations, respectively. 2 3 Model Despite being able to capture nonlinear interactions, InfTucker may suffer from the extreme sparsity issue in real-world tensor data sets. The reason is that its full covariance is a Kronecker-product between the covariances over all the modes—{Σ(1), . . . , Σ(K)} (see Equation (1)). Each Σ(k) is of size dk × dk and the full covariance is of size Q k dk × Q k dk. Thus TGP is projected onto the entire tensor with respect to the latent factors U, including all zero and nonzero elements, rather than a (meaningful) subset of them. However, the real-world tensor data are usually extremely sparse, with a huge number of zero entries and a tiny portion of nonzero entries. On one hand, because most zero entries are meaningless—they are either missing or unobserved, using them can adversely affect the tensor factorization quality and lead to biased predictions; on the other hand, incorporating numerous zero entries into GP models will result in large covariance matrices and high computational costs. Zhe et al. [22, 23] proposed to improve the scalability by modeling subtensors instead, but the sampled subtensors can still be very sparse. Even worse, because they are typically of small dimensions (for efficiency considerations), it is often possible to encounter subtensors full of zeros. This may further incur numerical instabilities in model estimation. To address these issues, we propose a flexible Gaussian process tensor factorization model. While inheriting the nonlinear modeling power, our model disposes of the Kronecker-product structure in the full covariance and can therefore select an arbitrary subset of tensor entries for training. Specifically, given a tensor M ∈Rd1×...×dK, for each tensor entry mi (i = (i1, . . . , iK)), we construct an input xi by concatenating the corresponding latent factors from all the modes: xi = [u(1) i1 , . . . , u(K) iK ], where u(k) ik is the ik-th row in the latent factor matrix U(k) for mode k. We assume that there is an underlying function f : R PK j=1 dj →R such that mi = f(xi) = f([u(1) i1 , . . . , u(K) iK ]). This function is unknown and can be complex and nonlinear. To learn the function, we assign a Gaussian process prior over f: for any set of tensor entries S = {i1, . . . , iN}, the function values fS = {f(xi1), . . . , f(xiN )} are distributed according to a multivariate Gaussian distribution with mean 0 and covariance determined by XS = {xi1, . . . , xiN }: p(fS|U) = N(fS|0, k(XS, XS)) where k(·, ·) is a (nonlinear) covariance function. Because k(xi, xj) = k([u(1) i1 , . . . , u(K) iK ], [u(1) j1 , . . . , u(K) jK ]), there is no Kronecker-product structure constraint and so any subset of tensor entries can be selected for training. To prevent the learning process to be biased toward zero, we can use a set of entries with balanced zeros and nonzeros; furthermore, useful domain knowledge can also be incorporated to select meaningful entries for training. Note, however, that if we still use all the tensor entries and intensionally impose the Kronecker-product structure in the full covariance, our model is reduced to InfTucker. Therefore, from the modeling perspective, the proposed model is more general. We further assign a standard normal prior over the latent factors U. Given the selected tensor entries m = [mi1, . . . , miN ], the observed entries y = [yi1, . . . , yiN ] are sampled from a noise model p(y|m). In this paper, we deal with both continuous and binary observations. For continuous data, we use the Gaussian model, p(y|m) = N(y|m, β−1I) and the joint probability is p(y, m, U) = YK t=1 N(vec(U(t))|0, I)N(m|0, k(XS, XS))N(y|m, β−1I) (2) where S = [i1, . . . , iN]. For binary data, we use the Probit model in the following manner. We first introduce augmented variables z = [z1, . . . , zN] and then decompose the Probit model into p(zj|mij) = N(zj|mij, 1) and p(yij|zj) = 1(yij = 0)1(zj ≤0) + 1(yij = 1)1(zj > 0) where 1(·) is the indicator function. Then the joint probability is p(y, z, m, U) = YK t=1 N(vec(U(t))|0, I)N(m|0, k(XS, XS))N(z|m, I) · Y j 1(yij = 0)1(zj ≤0) + 1(yij = 1)1(zj > 0). (3) 4 Distributed Variational Inference Real-world tensors often comprise a large number of entries, say, millions of non-zeros and billions of zeros, making exact inference of the proposed model totally intractable. This motives us to develop a distributed variational inference algorithm, presented as follows. 3 4.1 Tractable Variational Evidence Lower Bound Since the GP covariance term — k(XS, XS) (see Equations (2) and (3)) intertwines all the latent factors, exact inference in parallel is quite difficult. Therefore, we first derive a tractable variational evidence lower bound (ELBO), following the sparse Gaussian process framework by Titsias [17]. The key idea is to introduce a small set of inducing points B = {b1, . . . , bp} and latent targets v = {v1, . . . , vp} (p ≪N). Then we augment the original model with a joint multivariate Gaussian distribution of the latent tensor entries m and targets v, p(m, v|U, B) = N([m, v]⊤|[0, 0]⊤, [KSS, KSB; KBS, KBB]) where KSS = k(XS, XS), KBB = k(B, B), KSB = k(XS, B) and KBS = k(B, XS). We use Jensen’s inequality and conditional Gaussian distributions to construct the ELBO. Using a very similar derivation to [17], we can obtain a tractable ELBO for our model on continuous data, log p(y, U|B)  ≥L1 U, B, q(v)  , where L1 U, B, q(v)  = log(p(U)) + Z q(v) log p(v|B) q(v) dv + X j Z q(v)Fv(yij, β)dv. (4) Here p(v|B) = N(v|0, KBB), q(v) is the variational posterior for the latent targets v and Fv(·j, ∗) = R log N(·j|mij, ∗)  N(mij|µj, σ2 j )dmij, where µj = k(xij, B)K−1 BBv and σ2 j = Σ(j, j) = k(xij, xij) −k(xij, B)K−1 BBk(B, xij). Note that L1 is decomposed into a summation of terms involving individual tensor entries ij(1 ≤j ≤N). The additive form enables us to distribute the computation across multiple computers. For binary data, we introduce a variational posterior q(z) and make the mean-field assumption that q(z) = Q j q(zj). Following a similar derivation to the continuous case, we can obtain a tractable ELBO for binary data, log p(y, U|B)  ≥L2 U, B, q(v), q(z)  , where L2 U, B, q(v), q(z)  = log(p(U)) + Z q(v) log(p(v|B) q(v) )dv + X j q(zj) log(p(yij|zj) q(zj) ) + X j Z q(v) Z q(zj)Fv(zj, 1)dzjdv. (5) One can simply use the standard Expectation-maximization (EM) framework to optimize (4) and (5) for model inference, i.e., the E step updates the variational posteriors {q(v), q(z)} and the M step updates the latent factors U, the inducing points B and the kernel parameters. However, the sequential E-M updates can not fully exploit the paralleling computing resources. Due to the strong dependencies between the E step and the M step, the sequential E-M updates may take a large number of iterations to converge. Things become worse for binary case: in the E step, the updates of q(v) and q(z) are also dependent on each other, making a parallel inference even less efficient. 4.2 Tight and Parallelizable Variational Evidence Lower Bound In this section, we further derive tight(er) ELBOs that subsume the optimal variational posteriors for q(v) and q(z). Thereby we can avoid the sequential E-M updates to perform decoupled, highly efficient parallel inference. Moreover, the inference quality is very likely to be improved using tighter bounds. Due to the space limit, we only present key ideas and results here; detailed discussions are given in Section 1 and 2 of the supplementary material. Tight ELBO for continuous tensors. We take functional derivative of L1 with respect to q(v) in (4). By setting the derivative to zero, we obtain the optimal q(v) (which is a Gaussian distribution) and then substitute it into L1, manipulating the terms, we achieve the following tighter ELBO. Theorem 4.1. For continuous data, we have log p(y, U|B)  ≥L∗ 1(U, B) = 1 2 log |KBB| −1 2 log |KBB + βA1| −1 2βa2 −1 2βa3 + β 2 tr(K−1 BBA1) −1 2 K X k=1 ∥U(k)∥2 F + 1 2β2a⊤ 4 (KBB + βA1)−1a4 + N 2 log( β 2π ), (6) where ∥· ∥F is Frobenius norm, and A1 = X j k(B, xij)k(xij, B), a2 = X j y2 ij, a3 = X j k(xij, xij), a4 = X j k(B, xij)yij. 4 Tight ELBO for binary tensors. The binary case is more difficult because q(v) and q(z) are coupled together (see (5)). We use the following steps: we first fix q(z) and plug the optimal q(v) in the same way as the continuous case. Then we obtain an intermediate ELBO ˆL2 that only contains q(z). However, a quadratic term in ˆL2 , 1 2(KBS⟨z⟩)⊤(KBB + A1)−1(KBS⟨z⟩), intertwines all {q(zj)}j in ˆL2, making it infeasible to analytically derive or parallelly compute the optimal {q(zj)}j. To overcome this difficulty, we use the convex conjugate of the quadratic term, and introduce a variational parameter λ to decouple the dependences between {q(zj)}j. After that, we are able to derive the optimal {q(zj)}j using functional derivatives and to obtain the following tight ELBO. Theorem 4.2. For binary data, we have log p(y, U|B)  ≥L∗ 2(U, B, λ) = 1 2 log |KBB| −1 2 log |KBB + A1| −1 2a3 + X j log Φ((2yij −1)λ⊤k(B, xij))  −1 2λ⊤KBBλ + 1 2tr(K−1 BBA1) −1 2 K X k=1 ∥U(k)∥2 F (7) where Φ(·) is the cumulative distribution function of the standard Gaussian. As we can see, due to the additive forms of the terms in L∗ 1 and L∗ 2, such as A1, a2, a3 and a4, the computation of the tight ELBOs and their gradients can be efficiently performed in parallel. 4.3 Distributed Inference on Tight Bound 4.3.1 Distributed Gradient-based Optimization Given the tighter ELBOs in (6) and (7), we develop a distributed algorithm to optimize the latent factors U, the inducing points B, the variational parameters λ (for binary data) and the kernel parameters. We distribute the computations over multiple computational nodes (MAP step) and then collect the results to calculate the ELBO and its gradient (REDUCE step). A standard routine, such as gradient descent and L-BFGS, is then used to solve the optimization problem. For binary data, we further find that λ can be updated with a simple fixed point iteration: λ(t+1) = (KBB + A1)−1(A1λ(t) + a5) (8) where a5 = P j k(B, xij)(2yij −1) N k(B,xij )⊤λ(t)|0,1  Φ (2yij −1)k(B,xij )⊤λ(t). Apparently, the updating can be efficiently performed in parallel (due to the additive structure of A1 and a5). Moreover, the convergence is guaranteed by the following lemma. The proof is given in Section 3 of the supplementary material. Lemma 4.3. Given U and B, we have L∗ 2(U, B, λt+1) ≥L∗ 2(U, B, λt) and the fixed point iteration (8) always converges. To use the fixed point iteration, before we calculate the gradients with respect to U and B, we first optimize λ via (8) in an inner loop. In the outer control, we then employ gradient descent or L-BFGS to optimize U and B. This will lead to an even tighter bound for our model: L∗∗ 2 (U, B) = maxλ L∗ 2(U, B, λ) = maxq(v),q(z) L2(U, B, q(v), q(z)). Empirically, this converges must faster than feeding the optimization algorithms with ∂λ, ∂U and ∂B altogether, especially for large data. 4.3.2 Key-Value-Free MAPREDUCE We now present the detailed design of MAPREDUCE procedures to fulfill our distributed inference. Basically, we first allocate a set of tensor entries St on each MAPPER t such that the corresponding components of the ELBO and the gradients are calculated; then the REDUCER aggregates local results from each MAPPER to obtain the integrated, global ELBO and gradient. We first consider the standard (key-value) design. For brevity, we take the gradient computation for the latent factors as an example. For each tensor entry i on a MAPPER, we calculate the corresponding gradients {∂u(1) i1 , . . . ∂u(K) iK } and then send out the key-value pairs {(k, ik) →∂u(k) ik }k, where the key indicates the mode and the index of the latent factors. The REDUCER aggregates gradients with the same key to recover the full gradient with respect to each latent factor. 5 Although the (key-value) MAPREDUCE has been successfully applied in numerous applications, it relies on an expensive data shuffling operation: the REDUCE step has to sort the MAPPERS’ output by the keys before aggregation. Since the sorting is usually performed on disk due to significant data size, intensive disk I/Os and network communications will become serious computational overheads. To overcome this deficiency, we devise a key-value-free MAP-REDUCE scheme to avoid on-disk data shuffling operations. Specifically, on each MAPPER, a complete gradient vector is maintained for all the parameters, including U, B and the kernel parameters; however, only relevant components of the gradient, as specified by the tensor entries allocated to this MAPPER, will be updated. After updates, each MAPPER will then send out the full gradient vector, and the REDUCER will simply sum them up together to obtain a global gradient vector without having to perform any extra data sorting. Note that a similar procedure can also be used to perform the fixed point iteration for λ (in binary tensors). Efficient MAPREDUCE systems, such as SPARK [21], can fully optimize the non-shuffling MAP and REDUCE, where most of the data are buffered in memory and disk I/Os are circumvented to the utmost; by contrast, the performance with data shuffling degrades severely [3]. This is verified in our evaluations: on a small tensor of size 100 × 100 × 100, our key-value-free MAPREDUCE gains 30 times speed acceleration over the traditional key-value process. Therefore, our algorithm can fully exploit the memory-cache mechanism to achieve fast inference. 4.4 Algorithm Complexity Suppose we use N tensor entries for training, with p inducing points and T MAPPER, the time complexity for each MAPPER node is O( 1 T p2N). Since p ≪N is a fixed constant (p = 100 in our experiments), the time complexity is linear in the number of tensor entries. The space complexity for each MAPPER node is O(PK j=1 mjrj + p2 + N T K), in order to store the latent factors, their gradients, the covariance matrix on inducing points, and the indices of the latent factors for each tensor entry. Again, the space complexity is linear in the number of tensor entries. In comparison, InfTucker utilizes the Kronecker-product properties to calculate the gradients and has to perform eigenvalue decomposition of the covariance matrices in each tensor mode. Therefor it has a higher time and space complexity (see [19] for details) and is not scalable to large dimensions. 5 Related work Classical tensor factorization models include Tucker [18] and CP [5], based on which there are many excellent works [2, 16, 6, 20, 14, 7, 13, 8, 1]. Despite the wide-spread success, their underlying multilinear factorization structures prevent them from capturing more complex, nonlinear relationship in real-world applications. Infinite Tucker decomposition [19], and its distributed or online extensions [22, 23] overcome this limitation by modeling tensors or subtensors via tensor-variate Gaussian processes (TGP). However, these methods may suffer from the extreme sparsity in real-world tensors due to the Kronecker-product structure in TGP formulations. Our model further address this issue by eliminating the Kronecker-product restriction, and can model an arbitrary subset of tensor entries. In theory, all such nonlinear factorization models belong to the family of random function prior models [11] for exchangeable multidimensional arrays. Our distributed variational inference algorithm is based on sparse GP [12], an efficient approximation framework to scale up GP models. Sparse GP uses a small set of inducing points to break the dependency between random function values. Recently, Titsias [17] proposed a variational learning framework for sparse GP, based on which Gal et al. [4] derived a tight variational lower bound for distributed inference of GP regression and GPLVM [10]. The derivation of the tight ELBO in our model for continuous tensors is similar to [4]; however, the gradient calculation is substantially different, because the input to our GP factorization model is the concatenation of the latent factors. Many tensor entries may partly share the same latent factors, causing a large amount of key-value pair to be sent during the distributed gradient calculation. This will incur an expensive data shuffling procedure that takes place on disk. To improve the computational efficiency, we develop a nonkey-value MAP-REDUCE to avoid data shuffling and fully exploit the memory-cache mechanism in efficient MAPREDUCE systems. This strategy is also applicable to other MAP-REDUCE based learning algorithms. In addition to continuous data, we also develop a tight ELBO for binary data on optimal variational posteriors. By introducing p extra variational parameters with convex conjugates (p is the number of inducing points), our inference can be performed efficiently in a distributed manner, which avoids explicit optimization on a large number of variational posteriors for the latent tensor entries and inducing targets. Our method can also be useful for GP classification problem. 6 6 Experiments 6.1 Evaluation on Small Tensor Data For evaluation, we first compared our method with various existing tensor factorization methods. To this end, we used four small real datasets where all methods are computationally feasible: (1) Alog, a real-valued tensor of size 200 × 100 × 200, representing a three-way interaction (user, action, resource) in a file access log. It contains 0.33% nonzero entries.(2) AdClick, a real-valued tensor of size 80 × 100 × 100, describing (user, publisher, advertisement) clicks for online advertising. It contains 2.39% nonzero entries. (3) Enron, a binary tensor depicting the three-way relationship (sender, receiver, time) in emails. It contains 203 × 203 × 200 elements, of which 0.01% are nonzero. (4) NellSmall, a binary tensor of size 295 × 170 × 94, depicting the knowledge predicates (entity, relationship, entity). The data set contains 0.05% nonzero elements. We compared with CP, nonnegative CP (NN-CP) [15], high order SVD (HOSVD) [9], Tucker, infinite Tucker (InfTucker) [19] and its extension (InfTuckerEx) which uses the Dirichlet process mixture (DPM) prior to model latent clusters and local TGP to perform scalable, online factorization [23]. Note that InfTucker and InfTuckerEx are nonlinear factorization approaches. For testing, we used the same setting as in [23]. All the methods were evaluated via a 5-fold cross validation. The nonzero entries were randomly split into 5 folds; 4 folds were used for training and the remaining non-zero entries and 0.1% zero entries were used for testing so that the number of non-zero entries is comparable to the number of zero entries. In doing so, zero and nonzero entries are treated equally important in testing, and the evaluation will not be dominated by large portion of zeros. For InfTucker and InfTuckerEx, we performed extra cross-validations to select the kernel form (e.g., RBF, ARD and Matern kernels) and the kernel parameters. For InfTuckerEx, we randomly sampled subtensors and tuned the learning rate following [23]. For our model, the number of inducing points was set to 100, and we used a balanced training set generated as follows: in addition to nonzero entries, we randomly sampled the same number of zero entries and made sure that they would not overlap with the testing zero elements. Our model used ARD kernel and the kernel parameters were estimated jointly with the latent factors. We implemented our distributed inference algorithm with two optimization frameworks, gradient descent and L-BFGS (denoted by Ours-GD and Ours-LBFGS respectively). For a comprehensive evaluation, we also examined CP on balanced training entries generated in the same way as our model, denoted by CP-2. The mean squared error (MSE) is used to evaluate predictive performance on Alog and Click and area-under-curve (AUC) on Enron and NellSmall. The averaged results from the 5-fold cross validation are reported. Our model achieves a higher prediction accuracy than InfTucker, and a better or comparable accuracy than InfTuckerEx (see Figure 1). A t-test shows that our model outperforms InfTucker significantly (p < 0.05) in almost all situations. Although InfTuckerEx uses the DPM prior to improve factorization, our model still obtains significantly better predictions on Alog and AdClick and comparable or better performance on Enron and NellSmall. This might be attributed to the flexibility of our model in using balanced training entries to prevent the learning bias (toward numerous zeros). Similar improvements can be observed from CP to CP-2. Finally, our model outperforms all the remaining methods, demonstrating the advantage of our nonlinear factorization approach. 6.2 Scalability Analysis To examine the scalability of the proposed distributed inference algorithm, we used the following large real-world datasets: (1) ACC, A real-valued tensor describing three-way interactions (user, action, resource) in a code repository management system [23]. The tensor is of size 3K × 150 × 30K, where 0.009% are nonzero. (2) DBLP: a binary tensor depicting a three-way bibliography relationship (author, conference, keyword) [23]. The tensor was extracted from DBLP database and contains 10K × 200 × 10K elements, where 0.001% are nonzero entries. (3) NELL: a binary tensor representing the knowledge predicates, in the form of (entity, entity, relationship) [22]. The tensor size is 20K × 12.3K × 280 and 0.0001% are nonzero. The scalability of our distributed inference algorithm was examined with regard to the number of machines on ACC dataset. The number of latent factors was set to 3. We ran our algorithm using the gradient descent. The results are shown in Figure 2(a). The Y-axis shows the reciprocal of the running time multiplied by a constant—which corresponds to the running speed. As we can see, the speed of our algorithm scales up linearly to the number of machines. 7 CP NNCP HOSVD Tucker InfTucker InfTuckerEx CP-2 Ours-GD Ours-LBFGS Number of Factors 3 5 8 10 Mean Squared Error (MSE) 0.65 1.5 2 2.5 3 (a) Alog Number of Factors 3 5 8 10 Mean Squared Error (MSE) 0.3 0.8 1.2 1.9 (b) AdClick Number of Factors 3 5 8 10 AUC 0.7 0.8 0.9 1 (c) Enron Number of Factors 3 5 8 10 AUC 0.7 0.8 0.9 1 (d) NellSmall Figure 1: The prediction results on small datasets. The results are averaged over 5 runs. Number of Machines 5 10 15 20 1 / RunningTime X Const 1 3 5 (a) Scalability Mean Squared Error (MSE) 0.1 0.5 0.7 0.9 GigaTensor DinTucker InfTuckerEx Ours-GD Ours-LBFGS (b) ACC AUC 0.82 0.9 0.95 (c) DBLP AUC 0.82 0.9 0.95 1 (d) NELL Figure 2: Prediction accuracy (averaged on 50 test datasets) on large tensor data and the scalability. 6.3 Evaluation on Large Tensor Data We then compared our approach with three state-of-the-art large-scale tensor factorization methods: GigaTensor [8], Distributed infinite Tucker decomposition (DinTucker) [22], and InfTuckerEx [23]. Both GigaTensor and DinTucker are developed on HADOOP, while InfTuckerEx uses online inference. Our model was implemented on SPARK. We ran Gigatensor, DinTucker and our approach on a large YARN cluster and InfTuckerEx on a single computer. We set the number of latent factors to 3 for ACC and DBLP data set, and 5 for NELL data set. Following the settings in [23, 22], we randomly chose 80% of nonzero entries for training, and then sampled 50 test data sets from the remaining entries. For ACC and DBLP, each test data set comprises 200 nonzero elements and 1, 800 zero elements; for NELL, each test data set contains 200 nonzero elements and 2, 000 zero elements. The running of GigaTensor was based on the default settings of the software package. For DinTucker and InfTuckerEx, we randomly sampled subtensors for distributed or online inference. The parameters, including the number and size of the subtensors and the learning rate, were selected in the same way as [23]. The kernel form and parameters were chosen by a cross-validation on the training tensor. For our model, we used the same setting as in the small data. We set 50 MAPPERS for GigaTensor, DinTucker and our model. Figure 2(b)-(d) shows the predictive performance of all the methods. We observe that our approach consistently outperforms GigaTensor and DinTucker on all the three datasets; our approach outperforms InfTuckerEx on ACC and DBLP and is slightly worse than InfTuckerEx on NELL. Note again that InfTuckerEx uses DPM prior to enhance the factorization while our model doesn’t; finally, all the nonlinear factorization methods outperform GigaTensor, a distributed CP factorization algorithm by a large margin, confirming the advantages of nonlinear factorizations on large data. In terms of speed, our algorithm is much faster than GigaTensor and DinTucker. For example, on DBLP dataset, the average per-iteration running time were 1.45, 15.4 and 20.5 minutes for our model, GigaTensor and DinTucker, respectively. This is not surprising, because (1) our model uses the data sparsity and can exclude numerous, meaningless zero elements from training; (2) our algorithm is based on SPARK, a more efficient MAPREDUCE system than HADOOP; (3) our algorithm gets rid of data shuffling and can fully exploit the memory-cache mechanism of SPARK. 7 Conclusion In this paper, we have proposed a novel flexible GP tensor factorization model. In addition, we have derived a tight ELBO for both continuous and binary problems, based on which we further developed an efficient distributed variational inference algorithm in MAPREDUCE framework. Acknowledgement Dr. Zenglin Xu was supported by a grant from NSF China under No. 61572111. We thank IBM T.J. Watson Research Center for providing one dataset. We also thank Jiasen Yang for proofreading this paper. 8 References [1] Choi, J. H. & Vishwanathan, S. (2014). Dfacto: Distributed factorization of tensors. In NIPS. [2] Chu, W. & Ghahramani, Z. (2009). Probabilistic models for incomplete multi-dimensional arrays. In AISTATS. [3] Davidson, A. & Or, A. (2013). Optimizing shuffle performance in Spark. University of California, Berkeley-Department of Electrical Engineering and Computer Sciences, Tech. Rep. [4] Gal, Y., van der Wilk, M., & Rasmussen, C. (2014). Distributed variational inference in sparse Gaussian process regression and latent variable models. In NIPS. [5] Harshman, R. A. (1970). Foundations of the PARAFAC procedure: Model and conditions for an "explanatory" multi-mode factor analysis. UCLA Working Papers in Phonetics, 16, 1–84. [6] Hoff, P. (2011). Hierarchical multilinear models for multiway data. Computational Statistics & Data Analysis. [7] Hu, C., Rai, P., & Carin, L. (2015). Zero-truncated poisson tensor factorization for massive binary tensors. In UAI. [8] Kang, U., Papalexakis, E., Harpale, A., & Faloutsos, C. (2012). Gigatensor: scaling tensor analysis up by 100 times-algorithms and discoveries. In KDD. [9] Lathauwer, L. D., Moor, B. D., & Vandewalle, J. (2000). A multilinear singular value decomposition. SIAM J. Matrix Anal. Appl, 21, 1253–1278. [10] Lawrence, N. D. (2004). Gaussian process latent variable models for visualisation of high dimensional data. In NIPS. [11] Lloyd, J. R., Orbanz, P., Ghahramani, Z., & Roy, D. M. (2012). Random function priors for exchangeable arrays with applications to graphs and relational data. In NIPS. [12] Quiñonero-Candela, J. & Rasmussen, C. E. (2005). A unifying view of sparse approximate Gaussian process regression. The Journal of Machine Learning Research, 6, 1939–1959. [13] Rai, P., Hu, C., Harding, M., & Carin, L. (2015). Scalable probabilistic tensor factorization for binary and count data. In IJCAI. [14] Rai, P., Wang, Y., Guo, S., Chen, G., Dunson, D., & Carin, L. (2014). Scalable Bayesian low-rank decomposition of incomplete multiway tensors. In ICML. [15] Shashua, A. & Hazan, T. (2005). Non-negative tensor factorization with applications to statistics and computer vision. In ICML. [16] Sutskever, I., Tenenbaum, J. B., & Salakhutdinov, R. R. (2009). Modelling relational data using Bayesian clustered tensor factorization. In NIPS. [17] Titsias, M. K. (2009). Variational learning of inducing variables in sparse Gaussian processes. In AISTATS. [18] Tucker, L. (1966). Some mathematical notes on three-mode factor analysis. Psychometrika, 31, 279–311. [19] Xu, Z., Yan, F., & Qi, Y. (2012). Infinite Tucker decomposition: Nonparametric Bayesian models for multiway data analysis. In ICML. [20] Yang, Y. & Dunson, D. B. (2016). Bayesian conditional tensor factorizations for high-dimensional classification. Journal of the American Statistical Association, 656–669. [21] Zaharia, M., Chowdhury, M., Das, T., Dave, A., Ma, J., McCauley, M., Franklin, M. J., Shenker, S., & Stoica, I. (2012). Resilient distributed datasets: A fault-tolerant abstraction for in-memory cluster computing. In NSDI. [22] Zhe, S., Qi, Y., Park, Y., Xu, Z., Molloy, I., & Chari, S. (2016). Dintucker: Scaling up Gaussian process models on large multidimensional arrays. In AAAI. [23] Zhe, S., Xu, Z., Chu, X., Qi, Y., & Park, Y. (2015). Scalable nonparametric multiway data analysis. In AISTATS. 9
2016
351
6,274
Safe Policy Improvement by Minimizing Robust Baseline Regret Marek Petrik University of New Hampshire mpetrik@cs.unh.edu Mohammad Ghavamzadeh Adobe Research & INRIA Lille ghavamza@adobe.com Yinlam Chow Stanford University ychow@stanford.edu Abstract An important problem in sequential decision-making under uncertainty is to use limited data to compute a safe policy, which is guaranteed to outperform a given baseline strategy. In this paper, we develop and analyze a new model-based approach that computes a safe policy, given an inaccurate model of the system’s dynamics and guarantees on the accuracy of this model. The new robust method uses this model to directly minimize the (negative) regret w.r.t. the baseline policy. Contrary to existing approaches, minimizing the regret allows one to improve the baseline policy in states with accurate dynamics and to seamlessly fall back to the baseline policy, otherwise. We show that our formulation is NP-hard and propose a simple approximate algorithm. Our empirical results on several domains further show that even the simple approximate algorithm can outperform standard approaches. 1 Introduction Many problems in science and engineering can be formulated as a sequential decision-making problem under uncertainty. A common scenario in such problems that occurs in many different fields, such as online marketing, inventory control, health informatics, and computational finance, is to find a good or an optimal strategy/policy, given a batch of data generated by the current strategy of the company (hospital, investor). Although there are many techniques to find a good policy given a batch of data, only a few of them guarantee that the obtained policy will perform well, when it is deployed. Since deploying an untested policy can be risky for the business, the product (hospital, investment) manager does not usually allow it to happen, unless we provide her/him with some performance guarantees of the obtained strategy, in comparison to the baseline policy (for example the policy that is currently in use). In this paper, we focus on the model-based approach to this fundamental problem in the context of infinite-horizon discounted Markov decision processes (MDPs). In this approach, we use the batch of data and build a model or a simulator that approximates the true behavior of the dynamical system, together with an error function that captures the accuracy of the model at each state of the system. Our goal is to compute a safe policy, i.e., a policy that is guaranteed to perform at least as well as the baseline strategy, using the simulator and error function. Most of the work on this topic has been in the model-free setting, where safe policies are computed directly from the batch of data, without building an explicit model of the system [Thomas et al., 2015b,a]. Another class of model-free algorithms are those that use a batch of data generated by the current policy and return a policy that is guaranteed to perform better. They optimize for the policy by repeating this process until convergence [Kakade and Langford, 2002; Pirotta et al., 2013]. A major limitation of the existing methods for computing safe policies is that they either adopt a newly learned policy with provable improvements or do not make any improvement at all by returning the baseline policy. These approaches may be quite limiting when model uncertainties are not uniform 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. across the state space. In such cases, it is desirable to guarantee an improvement over the baseline policy by combining it with a learned policy on a state-by-state basis. In other words, we want to use the learned policy at the states in which either the improvement is significant or the model uncertainty (error function) is small, and to use the baseline policy everywhere else. However, computing a learned policy that can be effectively combined with a baseline policy is non-trivial due to the complex effects of policy changes in an MDP. Our key insight is that this goal can be achieved by minimizing the (negative) robust regret w.r.t. the baseline policy. This unifies the sources of uncertainties in the learned and baseline policies and allows a more systematic performance comparison. Note that our approach differs significantly from the standard one, which compares a pessimistic performance estimate of the learned policy with an optimistic estimate of the baseline strategy. That may result in rejecting a learned policy with a performance (slightly) better than the baseline, simply due to the discrepancy between the pessimistic and optimistic evaluations. The model-based approach of this paper builds on robust Markov decision processes [Iyengar, 2005; Wiesemann et al., 2013; Ahmed and Varakantham, 2013]. The main difference is the availability of the baseline policy that creates unique challenges for sequential optimization. To the best of our knowledge, such challenges have not yet been fully investigated in the literature. A possible solution is to solve the robust formulation of the problem and then accept the resulted policy only if its conservative performance estimate is better than the baseline. While a similar idea has been investigated in the model-free setting (e.g., [Thomas et al., 2015a]), we show in this paper that it can be overly conservative. As the main contribution of the paper, we propose and analyze a new robust optimization formulation that captures the above intuition of minimizing robust regret w.r.t. the baseline policy. After a preliminary discussion in Section 2, we formally describe our model and analyze its main properties in Section 3. We show that in solving this optimization problem, we may have to go beyond the standard space of deterministic policies and search in the space of randomized policies; we derive a bound on the performance loss of its solutions; and we prove that solving this problem is NP-hard. We also propose a simple and practical approximate algorithm. Then, in Section 4, we show that the standard model-based approach is really a tractable approximation of robust baseline regret minimization. Finally, our experimental results in Section 5 indicate that even the simple approximate algorithm significantly outperforms the standard model-based approach when the model is uncertain. 2 Preliminaries We consider problems in which the agent’s interaction with the environment is modeled as an infinitehorizon γ-discounted MDP. A γ-discounted MDP is a tuple M = ⟨X, A, r, P, p0, γ⟩, where X and A are the state and action spaces, r(x, a) ∈[−Rmax, Rmax] is the bounded reward function, P(·|x, a) is the transition probability function, p0(·) is the initial state distribution, and γ ∈(0, 1] is a discount factor. We use ΠR = {π : X →∆A} and ΠD = {π : X →A} to denote the sets of randomized and deterministic stationary Markovian policies, respectively, where ∆A is the set of probability distributions over the action space A. Throughout the paper, we assume that the true reward r of the MDP is known, but the true transition probability is not given. The generalization to include reward estimation is straightforward and is omitted for the sake of brevity. We use historical data to build a MDP model with the transition probability denoted by bP. Due to limited number of samples and other modeling issues, it is unlikely that bP matches the true transition probability of the system P ⋆. We also require that the estimated model bP deviates from the true transition probability P ⋆as stated in the following assumption: Assumption 1. For each (x, a) ∈X ×A, the error function e(x, a) bounds the ℓ1 difference between the estimated transition probability and true transition probability, i.e., ∥P ⋆(·|x, a) −bP(·|x, a)∥1 ≤e(x, a). (1) The error function e can be derived either directly from samples using high probability concentration bounds, as we briefly outline in Appendix A, or based on specific domain properties. To model the uncertainty in the transition probability, we adopt the notion of robust MDP (RMDP) [Iyengar, 2005; Nilim and El Ghaoui, 2005; Wiesemann et al., 2013], i.e., an extension of 2 MDP in which nature adversarially chooses the transitions from a given uncertainty set Ξ( bP, e) = n ξ : X × A →∆X : ∥ξ(·|x, a) −bP(·|x, a)∥1 ≤e(x, a), ∀x, a ∈X × A o . From Assumption 1, we notice that the true transition probability is in the set of uncertain transition probabilities, i.e., P ⋆∈Ξ( bP, e). The above ℓ1 constraint is common in the RMDP literature (e.g., [Iyengar, 2005; Wiesemann et al., 2013; Petrik and Subramanian, 2014]). The uncertainty set Ξ in RMDP is (x, a)-rectangular and randomized [Le Tallec, 2007; Wiesemann et al., 2013]. One of the motivations for considering (x, a)-rectangular sets in RMDP is that they lead to tractable solutions in the conventional reward maximization setting. However, in the robust regret minimization problem that we propose in this paper, even if we assume that the uncertainty set is (x, a)-rectangular, it does not guarantee tractability of the solution. While it is of great interest to investigate the structure of uncertainty sets that lead to tractable algorithms in robust regret minimization, it is beyond the main scope of this paper and we leave it as future work. For each policy π ∈ΠR and nature’s choice ξ ∈Ξ, the discounted return is defined as ρ(π, ξ) = lim T →∞Eξ "T −1 X t=0 γtr Xt, At  | X0 ∼p0, At ∼π(Xt) # = p⊤ 0 vξ π, where Xt and At are the state and action random variables at time t, and vξ π is the corresponding value function. An optimal policy for a given ξ is defined as π⋆ ξ ∈arg maxπ∈ΠR ρ(π, ξ). Similarly, under the true transition probability P ⋆, the true return of a policy π and a truly optimal policy are defined as ρ(π, P ⋆) and π⋆∈arg maxπ∈ΠR ρ(π, P ⋆), respectively. Although we define the optimal policy using arg maxπ∈ΠR, it is known that every reward maximization problem in MDPs has at least one optimal policy in ΠD. Finally, given a deterministic baseline policy πB, we call a policy π safe, if its "true" performance is guaranteed to be no worse than that of the baseline policy, i.e., ρ(π, P ⋆) ≥ρ(πB, P ⋆). 3 Robust Policy Improvement Model In this section, we introduce and analyze an optimization procedure that robustly improves over a given baseline policy πB. As described above, the main idea is to find a policy that is guaranteed to be an improvement for any realization of the uncertain model parameters. The following definition formalizes this intuition. Definition 2 (The Robust Policy Improvement Problem). Given a model uncertainty set Ξ( bP, e) and a baseline policy πB, find a maximal ζ ≥0 such that there exists a policy π ∈ΠR for which ρ(π, ξ) ≥ρ(πB, ξ) + ζ, for every ξ ∈Ξ( bP, e).1 The problem posed in Definition 2 readily translates to the following optimization problem: πS ∈arg max π∈ΠR min ξ∈Ξ  ρ(π, ξ) −ρ(πB, ξ)  . (2) Note that since the baseline policy πB achieves value 0 in (2), ζ in Definition 2 is always non-negative. Therefore, any solution πS of (2) is safe, because under the true transition probability P ⋆∈Ξ( bP, e), we have the guarantee that ρ(π, P ⋆) −ρ(πB, P ⋆) ≥min ξ∈Ξ  ρ(π, ξ) −ρ(πB, ξ)  ≥0 . It is important to highlight how Definition 2 differs from the standard approach (e.g., [Thomas et al., 2015a]) on determining whether a policy π is an improvement over the baseline policy πB. The standard approach considers a statistical error bound that translates to the test: minξ∈Ξ ρ(π, ξ) ≥ maxξ∈Ξ ρ(πB, ξ). The uncertainty parameters ξ on both sides of (2) are not necessarily the same. Therefore, any optimization procedure derived based on this test is more conservative than the problem in (2). Indeed when the error function in Ξ is large, even the baseline policy (π = πB) 1From now on, for brevity, we omit the parameters bP and e, and use Ξ to denote the model uncertainty set. 3 x1 a1 a2 2 x11 1 ξ1 ξ2 2 3 a11 a12 x0 start a1 a2 x1 a1 +10/γ −10/γ πB 0 ξ⋆ ξ1 π⋆ 1 π⋆ πB Figure 1: (left) A robust/uncertain MDP used in Example 4 that illustrates the sub-optimality of deterministic policies in solving the optimization problem (2). (right) A Markov decision process with significant uncertainty in the baseline policy. may not pass this test. In Section 5.1, we show the conditions under which this approach fails. Our approach also differs from other related work in that we consider regret with respect to the baseline policy, and not the optimal policy, as considered in [Xu and Mannor, 2009]. In the remainder of this section, we highlight some major properties of the optimization problem (2). Specifically, we show that its solution policy may be purely randomized, we compute a bound on the performance loss of its solution policy w.r.t. π⋆, and we finally prove that it is a NP-hard problem. 3.1 Policy Class The following theorem shows that we should search for the solutions of the optimization problem (2) in the space of randomized policies ΠR. Theorem 3. The optimal solution to the optimization problem (2) may not be attained by a deterministic policy. Moreover, the loss due to considering deterministic policies cannot be bounded, i.e., there exists no constant c ∈R such that max π∈ΠR min ξ∈Ξ  ρ(π, ξ) −ρ(πB, ξ)  ≤c · max π∈ΠD min ξ∈Ξ  ρ(π, ξ) −ρ(πB, ξ)  . Proof. The proof follows directly from Example 4. The optimal policy in this example is randomized and achieves a guaranteed improvement ζ = 1/2. There is no deterministic policy that guarantees a positive improvement over the baseline policy, which proves the second part of the theorem. Example 4. Consider the robust/uncertain MDP on the left panel of Figure 1 with states {x1, x11} ⊂ X, actions A = {a1, a2, a11, a12}, and discount factor γ = 1. Actions a1 and a2 are shown as solid black nodes. A number with no state represents a terminal state with the corresponding reward. The robust outcomes {ξ1, ξ2} correspond to the uncertainty set of transition probabilities Ξ. The baseline policy πB is deterministic and is denoted by double edges. It can be readily seen from the monotonicity of the Bellman operator that any improved policy π will satisfy π(a12|x11) = 1. Therefore, we will only focus on the policy at state x1. The robust improvement as a function of π(·|x1) and the uncertainties {ξ1, ξ2} is given as follows: min ξ∈Ξ ρ(π, ξ) −ρ(πB, ξ)  = min ξ∈Ξ " π \ ξ ξ1 ξ2 a1 3 1 a2 2 2 # −  π \ ξ ξ1 ξ2 a1 2 1 ! = 0. This shows that no deterministic policy can achieve a positive improvement in this problem. However, a randomized policy π(a1|x1) = π(a2|x1) = 1/2 returns the maximum improvement ζ = 1/2. Randomized policies can do better than their deterministic counterparts, because they allow for hedging among various realizations of the MDP parameters. Example 4 shows a problem such that there exists a realization of the parameters with improvement over the baseline when any deterministic policy is executed. However in this example, there is no single realization of parameters that provides an improvement for all the deterministic policies simultaneously. Therefore, randomizing the policy guarantees an improvement independent of the parameters’ choice. 4 3.2 Performance Bound Generally, one cannot compute the truly optimal policy π⋆using an imprecise model. Nevertheless, it is still crucial to understand how errors in the model translates to a performance loss w.r.t. an optimal policy. The following theorem (proved in Appendix C) provides a bound on the performance loss of any solution πS to the optimization problem (2). Theorem 5. A solution πS to the optimization problem (2) is safe and its performance loss is bounded by the following inequality: Φ(πS) ∆= ρ(π⋆, P ⋆) −ρ(πS, P ⋆) ≤min 2γRmax (1 −γ)2  ∥eπ⋆∥1,u⋆ π⋆+∥eπB∥1,u⋆πB  , Φ(πB)  , where u⋆ π⋆and u⋆ πB are the state occupancy distributions of the optimal and baseline policies in the true MDP P ⋆. Furthermore, the above bound is tight. 3.3 Computational Complexity In this section, we analyze the computational complexity of solving the optimization problem (2) and prove that the problem is NP-hard. In particular, we proceed by showing that the following sub-problem of (2): arg min ξ∈Ξ  ρ(π, ξ) −ρ(πB, ξ)  , (3) for a fixed π ∈ΠR, is NP-hard. The optimization problem (3) can be interpreted as computing a policy that simultaneously minimizes the returns of two MDPs, whose transitions induced by policies π and πB. The proof of Theorem 6 is given in Appendix D. Theorem 6. Both optimization problems (2) and (3) are NP-hard. Although the optimization problem (2) is NP-hard in general, but it can be tractable in certain settings. One such setting is when the Markov chain induced by the baseline policy is known precisely, as the following proposition states. See Appendix E for the proof. Proposition 7. Assume that for each x ∈X, the error function induced by the baseline policy is zero, i.e., e x, πB(x)  = 0.2 Then, the optimization problem (2) is equivalent to the following robust MDP (RMDP) problem and can be solved in polynomial time: arg max π∈ΠR min ξ∈Ξ ρ(π, ξ). (4) 3.4 Approximate Algorithm Solving for the optimal solution of (2) may not be possible in practice, since the problem is NP hard. In this section, we propose a simple and practical approximate algorithm. The empirical results of Section 5 indicate that this algorithm holds promise and also suggest that the approach may be a good starting point for building better approximate algorithms in the future. Algorithm 1: Approximate Robust Baseline Regret Minimization Algorithm input :Empirical transition probabilities: bP, baseline policy πB, and the error function e output :Policy ˜πS 1 foreach x ∈X, a ∈A do 2 ˜e(x, a) ← e(x, a) when πB(x) ̸= a 0 otherwise ; 3 end 4 ˜πS ←arg maxπ∈ΠR minξ∈Ξ( b P ,˜e) ρ π, ξ  −ρ πB, ξ  ; 5 return ˜πS Algorithm 1 contains the pseudocode of the proposed approximate method. The main idea is to use a modified uncertainty model by assuming no error in transition probabilities of the baseline 2Note that this is equivalent to precisely knowing the Markov chain induced by the baseline policy P ⋆ πB. 5 policy. Then it is possible to minimize the robust baseline regret in polynomial time as suggested by Theorem 7. Assuming no error in baseline transition probabilities is reasonable because of two main reasons. First, in practice, data is often generated by executing the baseline policy, and thus, we may have enough data for a good approximation of the baseline’s transition probabilities: ∀x ∈X, bP · |x, πB(x)  ≈P ⋆· |x, πB(x)  . Second, transition probabilities often affect baseline and improved policies similarly, and as a result, have little effect on the difference between their returns (i.e., the regret). See Section 5.1 for an example of such behavior. 4 Standard Policy Improvement Methods In Section 3, we showed that finding an exact solution to the optimization problem (2) is computationally expensive and proposed an approximate algorithm. In this section, we describe and analyze two standard methods for computing safe policies and show how they can be interpreted as an approximation of our proposed baseline regret minimization. Due to space limitations, we describe another method, called reward-adjusted MDP, in Appendix H, but report its performance in Section 5. 4.1 Solving the Simulator The simplest solution to (2) is to assume that our simulator is accurate and to solve the reward maximization problem of an MDP with the transition probability bP, i.e., πsim ∈arg maxπ∈ΠR ρ(π, bP). Theorem 8 quantifies the performance loss of the resulted policy πsim. Theorem 8. Let πsim be an optimal policy of the reward maximization problem of an MDP with transition probability bP. Then under Assumption 1, the performance loss of πsim is bounded by Φ(πsim) ∆= ρ(π⋆, P ⋆) −ρ(πsim, P ⋆) ≤2γRmax (1 −γ)2 ∥e∥∞. The proof is available in Appendix F. Note that there is no guarantee that πsim is safe, and thus, deploying it may lead to undesirable outcomes due to model uncertainties. Moreover, the performance guarantee of πsim, reported in Theorem 8, is weaker than that in Theorem 5 due to the L∞norm. 4.2 Solving Robust MDP Another standard solution to the problem in (2) is based on solving the RMDP problem (4). We prove that the policy returned by this algorithm is safe and has better (sharper) worst-case guarantees than the simulator-based policy πsim. Details of this algorithm are summarized in Algorithm 2. The algorithm first constructs and solves an RMDP. It then returns the solution policy if its worst-case performance over the uncertainty set is better than the robust performance maxξ∈Ξ ρ(πB, ξ), and it returns the baseline policy πB, otherwise. Algorithm 2: RMDP-based Algorithm input :Simulated MDP bP, baseline policy πB, and the error function e output :Policy πR 1 π0 ←arg maxπ∈ΠR minξ∈Ξ( b P ,e) ρ π, ξ  ; 2 if minξ∈Ξ( b P ,e) ρ π0, ξ  > maxξ∈Ξ ρ(πB, ξ) then return π0 else return πB ; Algorithm 2 makes use of the following approximation to the solution of (2): max π∈ΠR min ξ∈Ξ  ρ(π, ξ) −ρ(πB, ξ)  ≥max π∈ΠR min ξ∈Ξ ρ(π, ξ) −max ξ∈Ξ ρ(πB, ξ), and guarantees safety by designing π such that the RHS of this inequality is always non-negative. The performance bound of πR is identical to that in Theorem 5 and is stated and proved in Theorem 12 in Appendix G. Although the worst-case bounds are the same, we show in Section 5.1 that the performance loss of πR may be worse than that of πS by an arbitrarily large margin. 6 It is important to discuss the difference between Algorithms 1 and 2. Although both solve an RMDP, they use different uncertainty sets Ξ. The uncertainty set used in Algorithm 2 is the true error function in building the simulator, while the uncertainty set used in Algorithm 1 assumes that the error function is zero for all the actions suggested by the baseline policy. As a result, both algorithms approximately solve (2) but approximate the problem in different ways. 5 Experimental Evaluation In this section, we experimentally evaluate the benefits of minimizing the robust baseline regret. First, we demonstrate that solving the problem in (2) may outperform the regular robust formulation by an arbitrarily large margin. Then, in the remainder of the section, we compare the solution quality of Algorithm 1 with simpler methods in more complex and realistic experimental domains. The purpose of our experiments is to show how solution quality depends on the degree of model uncertainties. 5.1 An Illustrative Example Consider the example depicted on the right panel of Figure 1. White nodes represent states and black nodes represent state-action pairs. Labels on the edges originated from states indicate the policy according to which the action is taken; labels on the edges originated from actions denote the rewards and, if necessary, the name of the uncertainty realization. The baseline policy is πB, the optimal policy is π⋆, and the discount factor is γ ∈(0, 1). This example represents a setting in which the level of uncertainty varies significantly across the individual states: the transition model is precise in state x0 and uncertain in state x1. The baseline policy πB takes a suboptimal action in state x0 and the optimal action in the uncertain state x1. To prevent being overly conservative in computing a safe policy, one needs to consider that the realization of uncertainty in x1 influences both the baseline and improved policies. Using the plain robust optimization formulation in Algorithm 2, even the optimal policy π⋆is not considered safe in this example. In particular, the robust return of π⋆is minξ ρ(π⋆, ξ) = −9, while the optimistic return of πB is maxξ ρ(πB, ξ) = +10. On the other hand, solving (2) will return the optimal policy since: minξ ρ(π⋆, ξ) −ρ(πB, ξ) = 11 −10 = −9 −(−10) = 1. Even the heuristic method of Section 3.4 will return the optimal policy. Note that since the reward-adjusted formulation (see its description in Appendix H) is even more conservative than the robust formulation, it will also fail to improve on the baseline policy. 5.2 Grid Problem In this section, we use a simple grid problem to compare the solution quality of Algorithm 1 with simpler methods. The grid problem is motivated by modeling customer interactions with an online system. States in the problem represent a two dimensional grid. Columns capture states of interaction with the website and rows capture customer states such as overall satisfaction. Actions can move customers along either dimension with some probability of failure. A more detailed description of this domain is provided in Section I.1. Our goal is to evaluate how the solution quality of various methods depends on the magnitude of the model error e. The model is constructed from samples, and thus, its magnitude of error depends on the number of samples used to build it. We use a uniform random policy to gather samples. Model error function e is then constructed from this simulated data using bounds in Section B. The baseline policy is constructed to be optimal when ignoring the row part of state; see Section I.1 for more details. All methods are compared in terms of the improvement percentage in total return over the baseline policy. Figure 2 depicts the results as a function of the number of transition samples used in constructing the uncertain model and represents the mean of 40 runs. Methods used in the comparison are as follows: 1) EXP represents solving the nominal model as described in Section 4.1, 2) RWA represent the reward-adjusted formulation in Algorithm 3 of Appendix H, 3) ROB represents the robust method in Algorithm 2, and 4) RBC represents our approximate solution of Algorithm 1. Figure 2 shows that Algorithm 1 not only reliably computes policies that are safe, but also significantly improves on the quality of the baseline policy when the model error is large. When the number of 7 0 500 1000 1500 2000 2500 3000 Number of Samples −20 −10 0 10 20 30 40 Improvement over Baseline (%) EXP RWA ROB RBC 1000 1500 2000 2500 3000 3500 4000 4500 5000 5500 Number of samples −0.20 −0.15 −0.10 −0.05 0.00 0.05 0.10 0.15 Improvement over baseline (%) EXP ROB RBC Figure 2: Improvement in return over the baseline policy in: (left) the grid problem and (right) the energy arbitrage problem. The dashed line shows the return of the optimal policy. samples is small, Algorithm 1 is significantly better than other methods by relying on the baseline policy in states with a large model error and only taking improving actions when the model error is small. Note that EXP can be significantly worse than the baseline policy, especially when the number of samples is small. 5.3 Energy Arbitrage In this section, we compare model-based policy improvement methods using a more complex domain. The problem is to determine an energy arbitrage policy in given limited energy storage (a battery) and stochastic prices. At each time period, the decision-maker observes the available battery charge and a Markov state of energy price, and decides on the amount of energy to purchase or to sell. The set of states in the energy arbitrage problem consists of three components: current state of charge, current capacity, and a Markov state representing price; the actions represent the amount of energy purchased or sold; the rewards indicate profit/loss in the transactions. We discretize the state of charge and action sets to 10 separate levels. The problem is based on the domain from [Petrik and Wu, 2015], whose description is detailed in Appendix I.2. Energy arbitrage is a good fit for model-based approaches because it combines known and unknown dynamics. Physics of battery charging and discharging can be modeled with high confidence, while the evolution of energy prices is uncertain. As a result, using an explicit battery model, the only uncertainty is in transition probabilities between the 10 states of the price process instead of the entire 1000 state-action pairs. This significantly reduces the number of samples needed. As in the previous experiments, we estimate the uncertainty model in a data-driven manner. Notice that the inherent uncertainty is only in price transitions and is independent of the policy used (which controls the storage dynamics). Here the uncertainty set of transition probabilities is estimated using the method in Appendix A, but the uncertainty set is only a non-singleton w.r.t. price states. Figure 2 shows the percentage improvement on the baseline policy averaged over 5 runs. We clearly observe that the heuristic RBC method, described in Section 3.4, effectively interleaves the baseline policy (in states with high level of uncertainty) and an improved policy (in states with low level of uncertainty), and results in the best performance in most cases. Solving a robust MDP with no baseline policy performed similarly to directly solving the simulator. 6 Conclusion In this paper, we study the model-based approach to the fundamental problem of learning safe policies given a batch of data. A policy is considered safe, if it is guaranteed to have an improved performance over a baseline policy. Solving the problem of safety in sequential decision-making can immensely increase the applicability of the existing technology to real-world problems. We show that the standard robust formulation may be overly conservative and formulate a better approach that interleaves an improved policy with the baseline policy, based on the error at each state. We propose and analyze an optimization problem based on this idea (see (2)) and prove that solving it is NP-hard. Furthermore, we propose several approximate solutions and experimentally evaluated their performance. 8 References A. Ahmed and P Varakantham. Regret based Robust Solutions for Uncertain Markov Decision Processes. Advances in neural information processing systems, pages 1–9, 2013. T. Hansen, P. Miltersen, and U. Zwick. Strategy iteration is strongly polynomial for 2-player turn-based stochastic games with a constant discount factor. Journal of the ACM, 60(1):1–16, 2013. G. Iyengar. Robust dynamic programming. Mathematics of Operations Research, 30(2):257–280, 2005. S. Kakade and J. Langford. Approximately optimal approximate reinforcement learning. In Proceedings of the 19th International Conference on Machine Learning, pages 267–274, 2002. Y. Le Tallec. Robust, Risk-Sensitive, and Data-driven Control of Markov Decision Processes. PhD thesis, MIT, 2007. A. Nilim and L. El Ghaoui. Robust control of Markov decision processes with uncertain transition matrices. Operations Research, 53(5):780–798, 2005. M. Petrik and D. Subramanian. RAAM : The benefits of robustness in approximating aggregated MDPs in reinforcement learning. In Neural Information Processing Systems, 2014. M. Petrik and X. Wu. Optimal Threshold Control for Energy Arbitrage with Degradable Battery Storage. In Uncertainty in Artificial Intelligence, pages 692–701, 2015. M. Pirotta, M. Restelli, and D. Calandriello. Safe Policy Iteration. In Proceedings of the 30th International Conference on Machine Learning, 2013. P. Thomas, G. Teocharous, and M. Ghavamzadeh. High Confidence Policy Improvement. In International Conference on Machine Learning, pages 2380–2388, 2015. P. Thomas, G. Theocharous, and M. Ghavamzadeh. High confidence off-policy evaluation. In Proceedings of the Twenty-Ninth Conference on Artificial Intelligence, 2015. T. Weissman, E. Ordentlich, G. Seroussi, S. Verdu, and M. Weinberger. Inequalities for the L1 deviation of the empirical distribution. Hewlett-Packard Labs, Tech. Rep, 2003. W. Wiesemann, D. Kuhn, and B. Rustem. Robust Markov decision processes. Mathematics of Operations Research, 38(1):153–183, 2013. H. Xu and S. Mannor. Parametric regret in uncertain Markov decision processes. Proceedings of the IEEE Conference on Decision and Control, pages 3606–3613, 2009. 9
2016
352
6,275
Safe Exploration in Finite Markov Decision Processes with Gaussian Processes Matteo Turchetta ETH Zurich matteotu@ethz.ch Felix Berkenkamp ETH Zurich befelix@ethz.ch Andreas Krause ETH Zurich krausea@ethz.ch Abstract In classical reinforcement learning agents accept arbitrary short term loss for long term gain when exploring their environment. This is infeasible for safety critical applications such as robotics, where even a single unsafe action may cause system failure or harm the environment. In this paper, we address the problem of safely exploring finite Markov decision processes (MDP). We define safety in terms of an a priori unknown safety constraint that depends on states and actions and satisfies certain regularity conditions expressed via a Gaussian process prior. We develop a novel algorithm, SAFEMDP, for this task and prove that it completely explores the safely reachable part of the MDP without violating the safety constraint. To achieve this, it cautiously explores safe states and actions in order to gain statistical confidence about the safety of unvisited state-action pairs from noisy observations collected while navigating the environment. Moreover, the algorithm explicitly considers reachability when exploring the MDP, ensuring that it does not get stuck in any state with no safe way out. We demonstrate our method on digital terrain models for the task of exploring an unknown map with a rover. 1 Introduction Today’s robots are required to operate in variable and often unknown environments. The traditional solution is to specify all potential scenarios that a robot may encounter during operation a priori. This is time consuming or even infeasible. As a consequence, robots need to be able to learn and adapt to unknown environments autonomously [10, 2]. While exploration algorithms are known, safety is still an open problem in the development of such systems [18]. In fact, most learning algorithms allow robots to make unsafe decisions during exploration. This can damage the platform or its environment. In this paper, we provide a solution to this problem and develop an algorithm that enables agents to safely and autonomously explore unknown environments. Specifically, we consider the problem of exploring a Markov decision process (MDP), where it is a priori unknown which state-action pairs are safe. Our algorithm cautiously explores this environment without taking actions that are unsafe or may render the exploring agent stuck. Related Work. Safe exploration is an open problem in the reinforcement learning community and several definitions of safety have been proposed [16]. In risk-sensitive reinforcement learning, the goal is to maximize the expected return for the worst case scenario [5]. However, these approaches only minimize risk and do not treat safety as a hard constraint. For example, Geibel and Wysotzki [7] define risk as the probability of driving the system to a previously known set of undesirable states. The main difference to our approach is that we do not assume the undesirable states to be known a priori. Garcia and Fernández [6] propose to ensure safety by means of a backup policy; that is, a policy that is known to be safe in advance. Our approach is different, since it does not require a backup policy but only a set of initially safe states from which the agent starts to explore. Another approach that makes use of a backup policy is shown by Hans et al. [9], where safety is defined in terms of a minimum reward, which is learned from data. 29th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. Moldovan and Abbeel [14] provide probabilistic safety guarantees at every time step by optimizing over ergodic policies; that is, policies that let the agent recover from any visited state. This approach needs to solve a large linear program at every time step, which is computationally demanding even for small state spaces. Nevertheless, the idea of ergodicity also plays an important role in our method. In the control community, safety is mostly considered in terms of stability or constraint satisfaction of controlled systems. Akametalu et al. [1] use reachability analysis to ensure stability under the assumption of bounded disturbances. The work in [3] uses robust control techniques in order to ensure robust stability for model uncertainties, while the uncertain model is improved. Another field that has recently considered safety is Bayesian optimization [13]. There, in order to find the global optimum of an a priori unknown function [21], regularity assumptions in form of a Gaussian process (GP) [17] prior are made. The corresponding GP posterior distribution over the unknown function is used to guide evaluations to informative locations. In this setting, safety centered approaches include the work of Sui et al. [22] and Schreiter et al. [20], where the goal is to find the safely reachable optimum without violating an a priori unknown safety constraint at any evaluation. To achieve this, the function is cautiously explored, starting from a set of points that is known to be safe initially. The method in [22] was applied to the field of robotics to safely optimize the controller parameters of a quadrotor vehicle [4]. However, they considered a bandit setting, where at each iteration any arm can be played. In contrast, we consider exploring an MDP, which introduces restrictions in terms of reachability that have not been considered in Bayesian optimization before. Contribution. We introduce SAFEMDP, a novel algorithm for safe exploration in MDPs. We model safety via an a priori unknown constraint that depends on state-action pairs. Starting from an initial set of states and actions that are known to satisfy the safety constraint, the algorithm exploits the regularity assumptions on the constraint function in order to determine if nearby, unvisited states are safe. This leads to safe exploration, where only state-actions pairs that are known to fulfil the safety constraint are evaluated. The main contribution consists of extending the work on safe Bayesian optimization in [22] from the bandit setting to deterministic, finite MDPs. In order to achieve this, we explicitly consider not only the safety constraint, but also the reachability properties induced by the MDP dynamics. We provide a full theoretical analysis of the algorithm. It provably enjoys similar safety guarantees in terms of ergodicity as discussed in [14], but at a reduced computational cost. The reason for this is that our method separates safety from the reachability properties of the MDP. Beyond this, we prove that SAFEMDP is able to fully explore the safely reachable region of the MDP, without getting stuck or violating the safety constraint with high probability. To the best of our knokwledge, this is the first full exploration result in MDPs subject to a safety constraint. We validate our method on an exploration task, where a rover has to explore an a priori unknown map. 2 Problem Statement In this section, we define our problem and assumptions. The unknown environment is modeled as a finite, deterministic MDP [23]. Such a MDP is a tuple hS, A(·), f(s, a), r(s, a)i with a finite set of states S, a set of state-dependent actions A(·), a known, deterministic transition model f(s, a), and reward function r(s, a). In the typical reinforcement learning framework, the goal is to maximize the cumulative reward. In this paper, we consider the problem of safely exploring the MDP. Thus, instead of aiming to maximize the cumulative rewards, we define r(s, a) as an a priori unknown safety feature. Although r(s, a) is unknown, we make regularity assumptions about it to make the problem tractable. When traversing the MDP, at each discrete time step, k, the agent has to decide which action and thereby state to visit next. We assume that the underlying system is safety-critical and that for any visited state-action pair, (sk, ak), the unknown, associated safety feature, r(sk, ak), must be above a safety threshold, h. While the assumption of deterministic dynamics does not hold for general MDPs, in our framework, uncertainty about the environment is captured by the safety feature. If requested, the agent can obtain noisy measurements of the safety feature, r(sk, ak), by taking action ak in state sk. The index t is used to index measurements, while k denotes movement steps. Typically k ≫t. It is hopeless to achieve the goal of safe exploration unless the agent starts in a safe location. Hence, we assume that the agent stays in an initial set of state action pairs, S0, that is known to be safe a priori. The goal is to identify the maximum safely reachable region starting from S0, without visiting any unsafe states. For clarity of exposition, we assume that safety depends on states only; that is, r(s, a) = r(s). We provide an extension to safety features that also depend on actions in Sec. 3. 2 Figure 1: Illustration of the set operators with S = {¯s1,¯s2}. The set S = {s} can be reached from s2 in one step and from s1 in two steps, while only the state s1 can be reached from s. Visiting s1 is safe; that is, it is above the safety threshold, is reachable, and there exists a safe return path through s2. Assumptions on the reward function Ensuring that all visited states are safe without any prior knowledge about the safety feature is an impossible task (e.g., if the safety feature is discontinuous). However, many practical safety features exhibit some regularity, where similar states will lead to similar values of r. In the following, we assume that S is endowed with a positive definite kernel function k(·, ·) and that the function r(·) has bounded norm in the associated Reproducing Kernel Hilbert Space (RKHS) [19]. The norm induced by the inner product of the RKHS indicates the smoothness of functions with respect to the kernel. This assumption allows us to model r as a GP [21], r(s) ⇠GP(µ(s), k(s, s0)). A GP is a probability distribution over functions that is fully specified by its mean function µ(s) and its covariance function k(s, s0). The randomness expressed by this distribution captures our uncertainty about the environment. We assume µ(s) = 0 for all s 2 S, without loss of generality. The posterior distribution over r(·) can be computed analytically, based on t measurements at states Dt = {s1, . . . , st} ✓S with measurements, yt = [r(s1) + !1 . . . r(st) + !t]T, that are corrupted by zero-mean Gaussian noise, !t ⇠N(0, σ2). The posterior is a GP distribution with mean µt(s) = kt(s)T(Kt + σ2I)−1yt, variance σt(s) = kt(s, s), and covariance kt(s, s0) = k(s, s0) −kt(s)T(Kt + σ2I)−1kt(s0), where kt(s) = [k(s1, s), . . . , k(st, s)]T and Kt is the positive definite kernel matrix, [k(s, s0)]s,s02Dt. The identity matrix is denoted by I 2 Rt⇥t. We also assume L-Lipschitz continuity of the safety function with respect to some metric d(·, ·) on S. This is guaranteed by many commonly used kernels with high probability [21, 8]. Goal In this section, we define the goal of safe exploration. In particular, we ask what the best that any algorithm may hope to achieve is. Since we only observe noisy measurements, it is impossible to know the underlying safety function r(·) exactly after a finite number of measurements. Instead, we consider algorithms that only have knowledge of r(·) up to some statistical confidence ✏. Based on this confidence within some safe set S, states with small distance to S can be classified to satisfy the safety constraint using the Lipschitz continuity of r(·). The resulting set of safe states is Rsafe ✏ (S) = S [ {s 2 S | 9s0 2 S : r(s0) −✏−Ld(s, s0) ≥h}, (1) which contains states that can be classified as safe given the information about the states in S. While (1) considers the safety constraint, it does not consider any restrictions put in place by the structure of the MDP. In particular, we may not be able to visit every state in Rsafe ✏ (S) without visiting an unsafe state first. As a result, the agent is further restricted to Rreach(S) = S [ {s 2 S | 9s0 2 S, a 2 A(s0): s = f(s0, a)}, (2) the set of all states that can be reached starting from the safe set in one step. These states are called the one-step safely reachable states. However, even restricted to this set, the agent may still get stuck in a state without any safe actions. We define Rret(S, S) = S [ {s 2 S | 9a 2 A(s): f(s, a) 2 S} (3) as the set of states that are able to return to a set S through some other set of states, S, in one step. In particular, we care about the ability to return to a certain set through a set of safe states S. Therefore, these are called the one-step safely returnable states. In general, the return routes may require taking more than one action, see Fig. 1. The n-step returnability operator Rret n (S, S) = Rret(S, Rret n−1(S, S)) with Rret 1 (S, S) = Rret(S, S) considers these longer return routes by repeatedly applying the return operator, Rret in (3), n times. The limit R ret(S, S) = limn!1 Rret n (S, S) contains all the states that can reach the set S through an arbitrarily long path in S. 3 Algorithm 1 Safe exploration in MDPs (SafeMDP) Inputs: states S, actions A, transition function f(s, a), kernel k(s, s0), Safety threshold h, Lipschitz constant L, Safe seed S0. C0(s) [h, 1) for all s 2 S0 for t = 1, 2, . . . do St {s 2 S | 9s0 2 ˆSt−1 : lt(s0) −Ld(s, s0) ≥h} ˆSt {s 2 St | s 2 Rreach( ˆSt−1), s 2 R ret(St, ˆSt−1)} Gt {s 2 ˆSt | gt(s) > 0} st argmaxs2Gt wt(s) Safe Dijkstra in St from st−1 to st Update GP with st and yt r(st) + !t if Gt = ; or max s2Gt wt(s) ✏then Break For safe exploration of MDPs, all of the above are requirements; that is, any state that we may want to visit needs to be safe (satisfy the safety constraint), reachable, and we must be able to return to safe states from this new state. Thus, any algorithm that aims to safely explore an MDP is only allowed to visit states in R✏(S) = Rsafe ✏ (S) \ Rreach(S) \ R ret(Rsafe ✏ (S), S), (4) which is the intersection of the three safety-relevant sets. Given a safe set S that fulfills the safety requirements, R ret(Rsafe ✏ (S), S) is the set of states from which we can return to S by only visiting states that can be classified as above the safety threshold. By including it in the definition of R✏(S), we avoid the agent getting stuck in a state without an action that leads to another safe state to take. Given knowledge about the safety feature in S up to ✏accuracy thus allows us to expand the set of safe ergodic states to R✏(S). Any algorithm that has the goal of exploring the state space should consequently explore these newly available safe states and gain new knowledge about the safety feature to potentially further enlargen the safe set. The safe set after n such expansions can be found by repeatedly applying the operator in (4): Rn ✏(S) = R✏(Rn−1 ✏ (S)) with R1 ✏= R✏(S). Ultimately, the size of the safe set is bounded by surrounding unsafe states or the number of states in S. As a result, the biggest set that any algorithm may classify as safe without visiting unsafe states is given by taking the limit, R✏(S) = limn!1 Rn ✏(S). Thus, given a tolerance level ✏and an initial safe seed set S0, R✏(S0) is the set of states that any algorithm may hope to classify as safe. Let St denote the set of states that an algorithm determines to be safe at iteration t. In the following, we will refer to complete, safe exploration whenever an algorithm fulfills R✏(S0) ✓limt!1 St ✓R0(S0); that is, the algorithm classifies every safely reachable state up to ✏accuracy as safe, without misclassification or visiting unsafe states. 3 SAFEMDP Algorithm We start by giving a high level overview of the method. The SAFEMDP algorithm relies on a GP model of r to make predictions about the safety feature and uses the predictive uncertainty to guide the safe exploration. In order to guarantee safety, it maintains two sets. The first set, St, contains all states that can be classified as satisfying the safety constraint using the GP posterior, while the second one, ˆSt, additionally considers the ability to reach points in St and the ability to safely return to the previous safe set, ˆSt−1. The algorithm ensures safety and ergodicity by only visiting states in ˆSt. In order to expand the safe region, the algorithm visits states in Gt ✓ˆSt, a set of candidate states that, if visited, could expand the safe set. Specifically, the algorithm selects the most uncertain state in Gt, which is the safe state that we can gain the most information about. We move to this state via the shortest safe path, which is guaranteed to exist (Lemma 2). The algorithm is summarized in Algorithm 1. Initialization. The algorithm relies on an initial safe set S0 as a starting point to explore the MDP. These states must be safe; that is, r(s) ≥h, for all s 2 S0. They must also fulfill the reachability and returnability requirements from Sec. 2. Consequently, for any two states, s, s0 2 S0, there must exist a path in S0 that connects them: s0 2 R ret(S0, {s}). While this may seem restrictive, the requirement is, for example, fulfilled by a single state with an action that leads back to the same state. 4 s0 s2 s4 s6 s8 s10 s12 s14 s16 s18 Safety r(s) (a) States are classified as safe (above the safety constraint, dashed line) according to the confidence intervals of the GP model (red bar). States in the green bar can expand the safe set if sampled, Gt. (b) Modified MDP model that is used to encode safety features that depend on actions. In this model, actions lead to abstract action-states sa, which only have one available action that leads to f(s, a). Classification. In order to safely explore the MDP, the algorithm must determine which states are safe without visiting them. The regularity assumptions introduced in Sec. 2 allow us to model the safety feature as a GP, so that we can use the uncertainty estimate of the GP model in order to determine a confidence interval within which the true safety function lies with high probability. For every state s, this confidence interval has the form Qt(s) = ⇥ µt−1(s) ± pβtσt−1(s) ⇤ , where βt is a positive scalar that determines the amplitude of the interval. We discuss how to select βt in Sec. 4. Rather than defining high probability bounds on the values of r(s) directly in terms of Qt, we consider the intersection of the sets Qt up to iteration t, Ct(s) = Qt(s) \ Ct−1(s) with C0(s) = [h, 1] for safe states s 2 S0 and C0(s) = R otherwise. This choice ensures that set of states that we classify as safe does not shrink over iterations and is justified by the selection of βt in Sec. 4. Based on these confidence intervals, we define a lower bound, lt(s) = min Ct(s), and upper bound, ut(s) = max Ct(s), on the values that the safety features r(s) are likely to take based on the data obtained up to iteration t. Based on these lower bounds, we define St = # s 2 S | 9s0 2 ˆSt−1 : lt(s0) −Ld(s, s0) ≥h (5) as the set of states that fulfill the safety constraint on r with high probability by using the Lipschitz constant to generalize beyond the current safe set. Based on this classification, the set of ergodic safe states is the set of states that achieve the safety threshold and, additionally, fulfill the reachability and returnability properties discussed in Sec. 2: ˆSt = # s 2 St | s 2 Rreach( ˆSt−1) \ R ret(St, ˆSt−1) . (6) Expanders. With the set of safe states defined, the task of the algorithm is to identify and explore states that might expand the set of states that can be classified as safe. We use the uncertainty estimate in the GP in order to define an optimistic set of expanders, Gt = {s 2 ˆSt | gt(s) > 0}, (7) where gt(s) = %%{s0 2 S \ St | ut(s) −Ld(s, s0) ≥h} %%. The function gt(s) is positive whenever an optimistic measurement at s, equal to the upper confidence bound, ut(s), would allow us to determine that a previously unsafe state indeed has value r(s0) above the safety threshold. Intuitively, sampling s might lead to the expansion of St and thereby ˆSt. The set Gt explicitly considers the expansion of the safe set as exploration goal, see Fig. 2a for a graphical illustration of the set. Sampling and shortest safe path. The remaining part of the algorithm is concerned with selecting safe states to evaluate and finding a safe path in the MDP that leads towards them. The goal is to visit states that allow the safe set to expand as quickly as possible, so that we do not waste resources when exploring the MDP. We use the GP posterior uncertainty about the states in Gt in order to make this choice. At each iteration t, we select as next target sample the state with the highest variance in Gt, st = argmaxs2Gt wt(s), where wt(s) = ut(s) −lt(s). This choice is justified, because while all points in Gt are safe and can potentially enlarge the safe set, based on one noisy sample we can gain the most information from the state that we are the most uncertain about. This design choice maximizes the knowledge acquired with every sample but can lead to long paths between measurements within the safe region. Given st, we use Dijkstra’s algorithm within the set ˆSt in order to find the shortest safe path to the target from the current state, st−1. Since we require reachability and returnability for all safe states, such a path is guaranteed to exist. We terminate the algorithm when we reach the desired accuracy; that is, argmaxs2Gt wt(s) ✏. Action-dependent safety. So far, we have considered safety features that only depend on the states, r(s). In general, safety can also depend on the actions, r(s, a). In this section, we introduce a 5 modified MDP that captures these dependencies without modifying the algorithm. The modified MDP is equivalent to the original one in terms of dynamics, f(s, a). However, we introduce additional action-states sa for each action in the original MDP. When we start in a state s and take action a, we first transition to the corresponding action-state and from there transition to f(s, a) deterministically. This model is illustrated in Fig. 2b. Safety features that depend on action-states, sa, are equivalent to action-dependent safety features. The SAFEMDP algorithm can be used on this modified MDP without modification. See the experiments in Sec. 5 for an example. 4 Theoretical Results The safety and exploration aspects of the algorithm that we presented in the previous section rely on the correctness of the confidence intervals Ct(s). In particular, they require that the true value of the safety feature, r(s), lies within Ct(s) with high probability for all s 2 S and all iterations t > 0. Furthermore, these confidence intervals have to shrink sufficiently fast over time. The probability of r taking values within the confidence intervals depends on the scaling factor βt. This scaling factor trades off conservativeness in the exploration for the probability of unsafe states being visited. Appropriate selection of βt has been studied by Srinivas et al. [21] in the multi-armed bandit setting. Even though our framework is different, their setting can be applied to our case. We choose, βt = 2B + 300γt log3(t/δ), (8) where B is the bound on the RKHS norm of the function r(·), δ is the probability of visiting unsafe states, and γt is the maximum mutual information that can be gained about r(·) from t noisy observations; that is, γt = max|A|t I(r, yA). The information capacity γt has a sublinear dependence on t for many commonly used kernels [21]. The choice of βt in (8) is justified by the following Lemma, which follows from [21, Theorem 6]: Lemma 1. Assume that krk2 k B, and that the noise !t is zero-mean conditioned on the history, as well as uniformly bounded by σ for all t > 0. If βt is chosen as in (8), then, for all t > 0 and all s 2 S, it holds with probability at least 1 −δ that r(s) 2 Ct(s). This Lemma states that, for βt as in (8), the safety function r(s) takes values within the confidence intervals C(s) with high probability. Now we show that the the safe shortest path problem has always a solution: Lemma 2. Assume that S0 6= ; and that for all states, s, s0 2 S0, s 2 R ret(S0, {s0}). Then, when using Algorithm 1 under the assumptions in Theorem 1, for all t > 0 and for all states, s, s0 2 ˆSt, s 2 R ret(St, {s0}). This lemma states that, given an initial safe set that fulfills the initialization requirements, we can always find a policy that drives us from any state in ˆSt to any other state in ˆSt without leaving the set of safe states, St. Lemmas 1 and 2 have a key role in ensuring safety during exploration and, thus, in our main theoretical result: Theorem 1. Assume that r(·) is L-Lipschitz continuous and that the assumptions of Lemma 1 hold. Also, assume that S0 6= ;, r(s) ≥h for all s 2 S0, and that for any two states, s, s0 2 S0, s0 2 R ret(S0, {s}). Choose βt as in (8). Then, with probability at least 1 −δ, we have r(s) ≥h for any s along any state trajectory induced by Algorithm 1 on an MDP with transition function f(s, a). Moreover, let t⇤be the smallest integer such that t⇤ βt⇤γt⇤≥C |R0(S0)| ✏2 , with C = 8/ log(1 + σ−2). Then there exists a t0 t⇤such that, with probability at least 1 −δ, R✏(S0) ✓ˆSt0 ✓R0(S0). Theorem 1 states that Algorithm 1 performs safe and complete exploration of the state space; that is, it explores the maximum reachable safe set without visiting unsafe states. Moreover, for any desired accuracy ✏and probability of failure δ, the safely reachable region can be found within a finite number of observations. This bound depends on the information capacity γt, which in turn depends on the kernel. If the safety feature is allowed to change rapidly across states, the information capacity will be larger than if the safety feature was smooth. Intuitively, the less prior knowledge the kernel encodes, the more careful we have to be when exploring the MDP, which requires more measurements. 6 5 Experiments In this section, we demonstrate Algorithm 1 on an exploration task. We consider the setting in [14], the exploration of the surface of Mars with a rover. The code for the experiments is available at http://github.com/befelix/SafeMDP. For space exploration, communication delays between the rover and the operator on Earth can be prohibitive. Thus, it is important that the robot can act autonomously and explore the environment without risking unsafe behavior. For the experiment, we consider the Mars Science Laboratory (MSL) [11], a rover deployed on Mars. Due to communication delays, the MSL can travel 20 meters before it can obtain new instructions from an operator. It can climb a maximum slope of 30◦[15, Sec. 2.1.3]. In our experiments we use digital terrain models of the surface of Mars from the High Resolution Imaging Science Experiment (HiRISE), which have a resolution of one meter [12]. As opposed to the experiments considered in [14], we do not have to subsample or smoothen the data in order to achieve good exploration results. This is due to the flexibility of the GP framework that considers noisy measurements. Therefore, every state in the MDP represents a d ⇥d square area with d = 1 m, as opposed to d = 20 m in [14]. At every state, the agent can take one of four actions: up, down, left, and right. If the rover attempts to climb a slope that is steeper than 30◦, it fails and may be damaged. Otherwise it moves deterministically to the desired neighboring state. In this setting, we define safety over state transitions by using the extension introduced in Sec. 3. The safety feature over the transition from s to s0 is defined in terms of height difference between the two states, H(s) −H(s0). Given the maximum slope of ↵= 30◦that the rover can climb, the safety threshold is set at a conservative h = −d tan(25◦). This encodes that it is unsafe for the robot to climb hills that are too steep. In particular, while the MDP dynamics assume that Mars is flat and every state can be reached, the safety constraint depends on the a priori unknown heights. Therefore, under the prior belief, it is unknown which transitions are safe. We model the height distribution, H(s), as a GP with a Matérn kernel with ⌫= 5/2. Due to the limitation on the grid resolution, tuning of the hyperparameters is necessary to achieve both safety and satisfactory exploration results. With a finer resolution, more cautious hyperparameters would also be able to generalize to neighbouring states. The lengthscales are set to 14.5 m and the prior standard deviation of heights is 10 m. We assume a noise standard deviation of 0.075 m. Since the safety feature of each state transition is a linear combination of heights, the GP model of the heights induces a GP model over the differences of heights, which we use to classify whether state transitions fulfill the safety constraint. In particular, the safety depends on the direction of travel, that is, going downhill is possible, while going uphill might be unsafe. Following the recommendations in [22], in our experiments we use the GP confidence intervals Qt(s) directly to determine the safe set St. As a result, the Lipschitz constant is only used to determine expanders in G. Guaranteeing safe exploration with high probability over multiple steps leads to conservative behavior, as every step beyond the set that is known to be safe decreases the ‘probability budget’ for failure. In order to demonstrate that safety can be achieved empirically using less conservative parameters than those suggested by Theorem 1, we fix βt to a constant value, βt = 2, 8t ≥0. This choice aims to guarantee safety per iteration rather than jointly over all the iterations. The same assumption is used in [14]. We compare our algorithm to several baselines. The first one considers both the safety threshold and the ergodicity requirements but neglects the expanders. In this setting, the agent samples the most uncertain safe state transaction, which corresponds to the safe Bayesian optimization framework in [20]. We expect the exploration to be safe, but less efficient than our approach. The second baseline considers the safety threshold, but does not consider ergodicity requirements. In this setting, we expect the rover’s behavior to fulfill the safety constraint and to never attempt to climb steep slopes, but it may get stuck in states without safe actions. The third method uses the unconstrained Bayesian optimization framework in order to explore new states, without safety requirements. In this setting, the agent tries to obtain measurements from the most uncertain state transition over the entire space, rather than restricting itself to the safe set. In this case, the rover can easily get stuck and may also incur failures by attempting to climb steep slopes. Last, we consider a random exploration strategy, which is similar to the ✏-greedy exploration strategies that are widely used in reinforcement learning. 7 0 30 60 90 120 distance [m] 70 35 0 distance [m] (a) Non-ergodic 0 30 60 90 120 distance [m] (b) Unsafe 0 30 60 90 120 distance [m] (c) Random 0 30 60 90 120 distance [m] (d) No Expanders 0 30 60 90 distance [m] 70 35 distance [m] 0 10 20 30 altitude [m] (e) SafeMDP R.15(S0) [%] k at failure SafeMDP 80.28 % No Expanders 30.44 % Non-ergodic 0.86 % 2 Unsafe 0.23 % 1 Random 0.98 % 219 (f) Performance metrics. Figure 2: Comparison of different exploration schemes. The background color shows the real altitude of the terrain. All algorithms are run for 525 iterations, or until the first unsafe action is attempted. The saturated color indicates the region that each strategy is able to explore. The baselines get stuck in the crater in the bottom-right corner or fail to explore, while Algorithm 1 manages to safely explore the unknown environment. See the statistics in Fig. 2f. We compare these baselines over an 120 by 70 meters area at −30.6◦latitude and 202.2◦longitude. We set the accuracy ✏= σnβ. The resulting exploration behaviors can be seen in Fig. 2. The rover starts in the center-top part of the plot, a relatively planar area. In the top-right corner there is a hill that the rover cannot climb, while in the bottom-right corner there is a crater that, once entered, the rover cannot leave. The safe behavior that we expect is to explore the planar area, without moving into the crater or attempting to climb the hill. We run all algorithms for 525 iterations or until the first unsafe action is attempted. It can be seen in Fig. 2e that our method explores the safe area that surrounds the crater, without attempting to move inside. While some state-action pairs closer to the crater are also safe, the GP model would require more data to classify them as safe with the necessary confidence. In contrast, the baselines perform significantly worse. The baseline that does not ensure the ability to return to the safe set (non-ergodic) can be seen in Fig. 2a. It does not explore the area, because it quickly reaches a state without a safe path to the next target sample. Our approach avoids these situations explicitly. The unsafe exploration baseline in Fig. 2b considers ergodicity, but concludes that every state is reachable according to the MDP model. Consequently, it follows a path that crosses the boundary of the crater and eventually evaluates an unsafe action. Overall, it is not enough to consider only ergodicity or only safety, in order to solve the safe exploration problem. The random exploration in Fig. 2c attempts an unsafe action after some exploration. In contrast, Algorithm 1 manages to safely explore a large part of the unknown environment. Running the algorithm without considering expanders leads to the behavior in Fig. 2d, which is safe, but only manages to explore a small subset of the safely reachable area within the same number of iterations in which Algorithm 1 explores over 80% of it. The results are summarized in Table 2f. 6 Conclusion We presented SAFEMDP, an algorithm to safely explore a priori unknown environments. We used a Gaussian process to model the safety constraints, which allows the algorithm to reason about the safety of state-action pairs before visiting them. An important aspect of the algorithm is that it considers the transition dynamics of the MDP in order to ensure that there is a safe return route before visiting states. We proved that the algorithm is capable of exploring the full safely reachable region with few measurements, and demonstrated its practicality and performance in experiments. Acknowledgement. This research was partially supported by the Max Planck ETH Center for Learning Systems and SNSF grant 200020_159557. 8 References [1] Anayo K. Akametalu, Shahab Kaynama, Jaime F. Fisac, Melanie N. Zeilinger, Jeremy H. Gillula, and Claire J. Tomlin. Reachability-based safe learning with Gaussian processes. In Proc. of the IEEE Conference on Decision and Control (CDC), pages 1424–1431, 2014. [2] Brenna D. Argall, Sonia Chernova, Manuela Veloso, and Brett Browning. A survey of robot learning from demonstration. Robotics and Autonomous Systems, 57(5):469–483, 2009. [3] Felix Berkenkamp and Angela P. Schoellig. Safe and robust learning control with Gaussian processes. In Proc. of the European Control Conference (ECC), pages 2501–2506, 2015. [4] Felix Berkenkamp, Angela P. Schoellig, and Andreas Krause. Safe controller optimization for quadrotors with Gaussian processes. In Proc. of the IEEE International Conference on Robotics and Automation (ICRA), 2016. [5] Stefano P. Coraluppi and Steven I. Marcus. Risk-sensitive and minimax control of discrete-time, finite-state Markov decision processes. Automatica, 35(2):301–309, 1999. [6] Javier Garcia and Fernando Fernández. Safe exploration of state and action spaces in reinforcement learning. Journal of Artificial Intelligence Research, pages 515–564, 2012. [7] Peter Geibel and Fritz Wysotzki. Risk-sensitive reinforcement learning applied to control under constraints. Journal of Artificial Intelligence Research (JAIR), 24:81–108, 2005. [8] Subhashis Ghosal and Anindya Roy. Posterior consistency of Gaussian process prior for nonparametric binary regression. The Annals of Statistics, 34(5):2413–2429, 2006. [9] Alexander Hans, Daniel Schneegaß, Anton Maximilian Schäfer, and Steffen Udluft. Safe exploration for reinforcement learning. In Proc. of the European Symposium on Artificial Neural Networks (ESANN), pages 143–148, 2008. [10] Jens Kober, J. Andrew Bagnell, and Jan Peters. Reinforcement learning in robotics: a survey. The International Journal of Robotics Research, 32(11):1238–1274, 2013. [11] Mary Kae Lockwood. Introduction: Mars Science Laboratory: The Next Generation of Mars Landers. Journal of Spacecraft and Rockets, 43(2):257–257, 2006. [12] Alfred S. McEwen, Eric M. Eliason, James W. Bergstrom, Nathan T. Bridges, Candice J. Hansen, W. Alan Delamere, John A. Grant, Virginia C. Gulick, Kenneth E. Herkenhoff, Laszlo Keszthelyi, Randolph L. Kirk, Michael T. Mellon, Steven W. Squyres, Nicolas Thomas, and Catherine M. Weitz. Mars Reconnaissance Orbiter’s High Resolution Imaging Science Experiment (HiRISE). Journal of Geophysical Research: Planets, 112(E5):E05S02, 2007. [13] Jonas Mockus. Bayesian Approach to Global Optimization, volume 37 of Mathematics and Its Applications. Springer Netherlands, 1989. [14] Teodor Mihai Moldovan and Pieter Abbeel. Safe exploration in Markov decision processes. In Proc. of the International Conference on Machine Learning (ICML), pages 1711–1718, 2012. [15] MSL. MSL Landing Site Selection User’s Guide to Engineering Constraints, 2007. URL http://marsoweb. nas.nasa.gov/landingsites/msl/memoranda/MSL_Eng_User_Guide_v4.5.1.pdf. [16] Martin Pecka and Tomas Svoboda. Safe exploration techniques for reinforcement learning – an overview. In Modelling and Simulation for Autonomous Systems, pages 357–375. Springer, 2014. [17] Carl Edward Rasmussen and Christopher K. I. Williams. Gaussian processes for machine learning. Adaptive computation and machine learning. MIT Press, 2006. [18] Stefan Schaal and Christopher Atkeson. Learning Control in Robotics. IEEE Robotics & Automation Magazine, 17(2):20–29, 2010. [19] Bernhard Schölkopf and Alexander J. Smola. Learning with Kernels: Support Vector Machines, Regularization, Optimization, and Beyond. MIT Press, 2002. [20] Jens Schreiter, Duy Nguyen-Tuong, Mona Eberts, Bastian Bischoff, Heiner Markert, and Marc Toussaint. Safe exploration for active learning with Gaussian processes. In Proc. of the European Conference on Machine Learning (ECML), volume 9284, pages 133–149, 2015. [21] Niranjan Srinivas, Andreas Krause, Sham M. Kakade, and Matthias Seeger. Gaussian process optimization in the bandit setting: no regret and experimental design. In Proc. of the International Conference on Machine Learning (ICML), 2010. [22] Yanan Sui, Alkis Gotovos, Joel Burdick, and Andreas Krause. Safe exploration for optimization with Gaussian processes. In Proc. of the International Conference on Machine Learning (ICML), pages 997–1005, 2015. [23] Richard S. Sutton and Andrew G. Barto. Reinforcement learning: an introduction. Adaptive computation and machine learning. MIT Press, 1998. 9
2016
353
6,276
Multimodal Residual Learning for Visual QA Jin-Hwa Kim Sang-Woo Lee Donghyun Kwak Min-Oh Heo Seoul National University {jhkim,slee,dhkwak,moheo}@bi.snu.ac.kr Jeonghee Kim Jung-Woo Ha Naver Labs, Naver Corp. {jeonghee.kim,jungwoo.ha}@navercorp.com Byoung-Tak Zhang Seoul National University & Surromind Robotics btzhang@bi.snu.ac.kr Abstract Deep neural networks continue to advance the state-of-the-art of image recognition tasks with various methods. However, applications of these methods to multimodality remain limited. We present Multimodal Residual Networks (MRN) for the multimodal residual learning of visual question-answering, which extends the idea of the deep residual learning. Unlike the deep residual learning, MRN effectively learns the joint representation from vision and language information. The main idea is to use element-wise multiplication for the joint residual mappings exploiting the residual learning of the attentional models in recent studies. Various alternative models introduced by multimodality are explored based on our study. We achieve the state-of-the-art results on the Visual QA dataset for both Open-Ended and Multiple-Choice tasks. Moreover, we introduce a novel method to visualize the attention effect of the joint representations for each learning block using back-propagation algorithm, even though the visual features are collapsed without spatial information. 1 Introduction Visual question-answering tasks provide a testbed to cultivate the synergistic proposals which handle multidisciplinary problems of vision, language and integrated reasoning. So, the visual questionanswering tasks let the studies in artificial intelligence go beyond narrow tasks. Furthermore, it may help to solve the real world problems which need the integrated reasoning of vision and language. Deep residual learning [6] not only advances the studies in object recognition problems, but also gives a general framework for deep neural networks. The existing non-linear layers of neural networks serve to fit another mapping of F(x), which is the residual of identity mapping x. So, with the shortcut connection of identity mapping x, the whole module of layers fit F(x) + x for the desired underlying mapping H(x). In other words, the only residual mapping F(x), defined by H(x) −x, is learned with non-linear layers. In this way, very deep neural networks effectively learn representations in an efficient manner. Many attentional models utilize the residual learning to deal with various tasks, including textual reasoning [25, 21] and visual question-answering [29]. They use an attentional mechanism to handle two different information sources, a query and the context of the query (e.g. contextual sentences 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. Q V A RNN CNN softmax Multimodal Residual Networks What kind of animals are these ? sheep word embedding Figure 1: Inference flow of Multimodal Residual Networks (MRN). Using our visualization method, the attention effects are shown as a sequence of three images. More examples are shown in Figure 4. A Linear Tanh Linear Tanh Linear Tanh Linear Q V H1 Linear Tanh Linear Tanh Linear Tanh Linear H2 V Linear Tanh Linear Tanh Linear Tanh Linear H3 V Linear Softmax ⊙ ⊕ ⊙ ⊕ ⊙ ⊕ Softmax Figure 2: A schematic diagram of Multimodal Residual Networks with three-block layers. or an image). The query is added to the output of the attentional module, that makes the attentional module learn the residual of query mapping as in deep residual learning. In this paper, we propose Multimodal Residual Networks (MRN) to learn multimodality of visual question-answering tasks exploiting the excellence of deep residual learning [6]. MRN inherently uses shortcuts and residual mappings for multimodality. We explore various models upon the choice of the shortcuts for each modality, and the joint residual mappings based on element-wise multiplication, which effectively learn the multimodal representations not using explicit attention parameters. Figure 1 shows inference flow of the proposed MRN. Additionally, we propose a novel method to visualize the attention effects of each joint residual mapping. The visualization method uses back-propagation algorithm [22] for the difference between the visual input and the output of the joint residual mapping. The difference is back-propagated up to an input image. Since we use the pretrained visual features, the pretrained CNN is augmented for visualization. Based on this, we argue that MRN is an implicit attention model without explicit attention parameters. Our contribution is three-fold: 1) extending the deep residual learning for visual question-answering tasks. This method utilizes multimodal inputs, and allows a deeper network structure, 2) achieving the state-of-the-art results on the Visual QA dataset for both Open-Ended and Multiple-Choice tasks, and finally, 3) introducing a novel method to visualize spatial attention effect of joint residual mappings from the collapsed visual feature using back-propagation. 2 Related Works 2.1 Deep Residual Learning Deep residual learning [6] allows neural networks to have a deeper structure of over-100 layers. The very deep neural networks are usually hard to be optimized even though the well-known activation functions and regularization techniques are applied [17, 7, 9]. This method consistently shows state-of-the-art results across multiple visual tasks including image classification, object detection, localization and segmentation. This idea assumes that a block of deep neural networks forming a non-linear mapping F(x) may paradoxically fail to fit into an identity mapping. To resolve this, the deep residual learning adds x to F(x) as a shortcut connection. With this idea, the non-linear mapping F(x) can focus on the 2 residual of the shortcut mapping x. Therefore, a learning block is defined as: y = F(x) + x (1) where x and y are the input and output of the learning block, respectively. 2.2 Stacked Attention Networks Stacked Attention Networks (SAN) [29] explicitly learns the weights of visual feature vectors to select a small portion of visual information for a given question vector. Furthermore, this model stacks the attention networks for multi-step reasoning narrowing down the selection of visual information. For example, if the attention networks are asked to find a pink handbag in a scene, they try to find pink objects first, and then, narrow down to the pink handbag. For the attention networks, the weights are learned by a question vector and the corresponding visual feature vectors. These weights are used for the linear combination of multiple visual feature vectors indexing spatial information. Through this, SAN successfully selects a portion of visual information. Finally, an addition of the combined visual feature vector and the previous question vector is transferred as a new input question vector to next learning block. qk = F(qk−1, V) + qk−1 (2) Here, ql is a question vector for l-th learning block and V is a visual feature matrix, whose columns indicate the specific spatial indexes. F(q, V) is the attention networks of SAN. 3 Multimodal Residual Networks Deep residual learning emphasizes the importance of identity (or linear) shortcuts to have the nonlinear mappings efficiently learn only residuals [6]. In multimodal learning, this idea may not be readily applied. Since the modalities may have correlations, we need to carefully define joint residual functions as the non-linear mappings. Moreover, the shortcuts are undetermined due to its multimodality. Therefore, the characteristics of a given task ought to be considered to determine the model structure. 3.1 Background We infer a residual learning in the attention networks of SAN. Since Equation 18 in [29] shows a question vector transferred directly through successive layers of the attention networks. In the case of SAN, the shortcut mapping is for the question vector, and the non-linear mapping is the attention networks. In the attention networks, Yang et al. [29] assume that an appropriate choice of weights on visual feature vectors for a given question vector sufficiently captures the joint representation for answering. However, question information weakly contributes to the joint representation only through coefficients p, which may cause a bottleneck to learn the joint representation. F(q, V) = X i piVi (3) The coefficients p are the output of a nonlinear function of a question vector q and a visual feature matrix V (see Equation 15-16 in Yang et al. [29]). The Vi is a visual feature vector of spatial index i in 14 × 14 grids. Lu et al. [15] propose an element-wise multiplication of a question vector and a visual feature vector after appropriate embeddings for a joint model. This makes a strong baseline outperforming some of the recent works [19, 2]. We firstly take this approach as a candidate for the joint residual function, since it is simple yet successful for visual question-answering. In this context, we take the global visual feature approach for the element-wise multiplication, instead of the multiple (spatial) visual features approach for the explicit attention mechanism of SAN. (We present a visualization technique exploiting the element-wise multiplication in Section 5.2.) Based on these observations, we follow the shortcut mapping and the stacking architecture of SAN [29]; however, the element-wise multiplication is used for the joint residual function F. These updates effectively learn the joint representation of given vision and language information addressing the bottleneck issue of the attention networks of SAN. 3 Tanh Linear Linear Tanh Linear Q V Hl V ⊙ ⊕ (a) Linear Tanh Linear Tanh Linear Tanh Linear Q V Hl V ⊙ ⊕ (c) Linear Tanh Linear Tanh Linear Tanh Linear Tanh Linear Q V Hl V ⊙ ⊕ (b) Linear Tanh Linear Tanh Linear Tanh Linear Q V Hl V ⊙ ⊕ (e) Linear Tanh Linear Tanh Linear Tanh Linear Q V Hl V ⊙ ⊕ (d) if l=1 else Identity if l=1 Linear else none Figure 3: Alternative models are explored to justify our proposed model. The base model (a) has a shortcut for a question vector as SAN does [29], and the joint residual function takes the form of the Deep Q+I model’s joint function [15]. (b) extra embedding for visual modality. (c) extra embeddings for both modalities. (d) identity mappings for shortcuts. In the first learning block, use a linear mapping for matching a dimension with the joint dimension. (e) two shortcuts for both modalities. For simplicity, the linear mapping of visual shortcut only appears in the first learning block. Notice that (d) and (e) are compared to (b) after the model selection of (b) among (a)-(c) on test-dev results. Eventually, we chose (b) as the best performance and relative simplicity. 3.2 Multimodal Residual Networks MRN consists of multiple learning blocks, which are stacked for deep residual learning. Denoting an optimal mapping by H(q, v), we approximate it using H1(q, v) = W (1) q′ q + F(1)(q, v). (4) The first (linear) approximation term is W (1) q′ q and the first joint residual function is given by F(1)(q, v). The linear mapping Wq′ is used for matching a feature dimension. We define the joint residual function as F(k)(q, v) = σ(W (k) q q) ⊙σ(W (k) 2 σ(W (k) 1 v)) (5) where σ is tanh, and ⊙is element-wise multiplication. The question vector and the visual feature vector directly contribute to the joint representation. We justify this choice in Sections 4 and 5. For a deeper residual learning, we replace q with H1(q, v) in the next layer. In more general terms, Equations 4 and 5 can be rewritten as HL(q, v) = Wq′q + L X l=1 WF(l)F(l)(Hl−1, v) (6) where L is the number of learning blocks, H0 = q, Wq′ = ΠL l=1W (l) q′ , and WF(l) = ΠL m=l+1W (m) q′ . The cascading in Equation 6 can intuitively be represented as shown in Figure 2. Notice that the shortcuts for a visual part are identity mappings to transfer the input visual feature vector to each layer (dashed line). At the end of each block, we denote Hl as the output of the l-th learning block, and ⊕is element-wise addition. 4 Experiments 4.1 Visual QA Dataset We choose the Visual QA (VQA) dataset [1] for the evaluation of our models. Other datasets may not be ideal, since they have limited number of examples to train and test [16], or have synthesized questions from the image captions [14, 20]. 4 Table 1: The results of alternative models (a)(e) on the test-dev. Open-Ended All Y/N Num. Other (a) 60.17 81.83 38.32 46.61 (b) 60.53 82.53 38.34 46.78 (c) 60.19 81.91 37.87 46.70 (d) 59.69 81.67 37.23 46.00 (e) 60.20 81.98 38.25 46.57 Table 2: The effect of the visual features and # of target answers on the test-dev results. Vgg for VGG-19, and Res for ResNet-152 features described in Section 4. Open-Ended All Y/N Num. Other Vgg, 1k 60.53 82.53 38.34 46.78 Vgg, 2k 60.77 82.10 39.11 47.46 Vgg, 3k 60.68 82.40 38.69 47.10 Res, 1k 61.45 82.36 38.40 48.81 Res, 2k 61.68 82.28 38.82 49.25 Res, 3k 61.47 82.28 39.09 48.76 The questions and answers of the VQA dataset are collected via Amazon Mechanical Turk from human subjects, who satisfy the experimental requirement. The dataset includes 614,163 questions and 7,984,119 answers, since ten answers are gathered for each question from unique human subjects. Therefore, Agrawal et al. [1] proposed a new accuracy metric as follows: min # of humans that provided that answer 3 , 1  . (7) The questions are answered in two ways: Open-Ended and Multiple-Choice. Unlike Open-Ended, Multiple-Choice allows additional information of eighteen candidate answers for each question. There are three types of answers: yes/no (Y/N), numbers (Num.) and others (Other). Table 3 shows that Other type has the most benefit from Multiple-Choice. The images come from the MS-COCO dataset, 123,287 of them for training and validation, and 81,434 for test. The images are carefully collected to contain multiple objects and natural situations, which is also valid for visual question-answering tasks. 4.2 Implementation Torch framework and rnn package [13] are used to build our models. For efficient computation of variable-length questions, TrimZero is used to trim out zero vectors [11]. TrimZero eliminates zero computations at every time-step in mini-batch learning. Its efficiency is affected by a batch size, RNN model size, and the number of zeros in inputs. We found out that TrimZero was suitable for VQA tasks. Approximately, 37.5% of training time is reduced in our experiments using this technique. Preprocessing We follow the same preprocessing procedure of DeeperLSTM+NormalizedCNN [15] (Deep Q+I) by default. The number of answers is 1k, 2k, or 3k using the most frequent answers, which covers 86.52%, 90.45% and 92.42% of questions, respectively. The questions are tokenized using Python Natural Language Toolkit (nltk) [3]. Subsequently, the vocabulary sizes are 14,770, 15,031 and 15,169, respectively. Pretrained Models A question vector q ∈R2,400 is the last output vector of GRU [4], initialized with the parameters of Skip-Thought Vectors [12]. Based on the study of Noh et al. [19], this method shows effectiveness of question embedding in visual question-answering tasks. A visual feature vector v is an output of the first fully-connected layer of VGG-19 networks [23], whose dimension is 4,096. Alternatively, ResNet-152 [6] is used, whose dimension is of 2,048. The error is back-propagated to the input question for fine-tuning, yet, not for the visual part v due to the heavy computational cost of training. Postprocessing Image captioning model [10] is used to improve the accuracy of Other type. Let the intermediate representation v ∈R|Ω| which is right before applying softmax. |Ω| is the vocabulary size of answers, and vi is corresponding to answer ai. If ai is not a number or yes or no, and appeared at least once in the generated caption, then update vi ←vi + 1. Notice that the pretrained image captioning model is not part of training. This simple procedure improves around 0.1% of the test-dev 5 Table 3: The VQA test-standard results. The precision of some accuracies [29, 2] are one less than others, so, zero-filled to match others. Open-Ended Multiple-Choice All Y/N Num. Other All Y/N Num. Other DPPnet [19] 57.36 80.28 36.92 42.24 62.69 80.35 38.79 52.79 D-NMN [2] 58.00 Deep Q+I [15] 58.16 80.56 36.53 43.73 63.09 80.59 37.70 53.64 SAN [29] 58.90 ACK [27] 59.44 81.07 37.12 45.83 FDA [8] 59.54 81.34 35.67 46.10 64.18 81.25 38.30 55.20 DMN+ [28] 60.36 80.43 36.82 48.33 MRN 61.84 82.39 38.23 49.41 66.33 82.41 39.57 58.40 Human [1] 83.30 95.77 83.39 72.67 overall accuracy (0.3% for Other type). We attribute this improvement to “tie break” in Other type. For the Multiple-Choice task, we mask the output of softmax layer with the given candidate answers. Hyperparameters By default, we follow Deep Q+I. The common embedding size of the joint representation is 1,200. The learnable parameters are initialized using a uniform distribution from −0.08 to 0.08 except for the pretrained models. The batch size is 200, and the number of iterations is fixed to 250k. The RMSProp [26] is used for optimization, and dropouts [7, 5] are used for regularization. The hyperparameters are fixed using test-dev results. We compare our method to state-of-the-arts using test-standard results. 4.3 Exploring Alternative Models Figure 3 shows alternative models we explored, based on the observations in Section 3. We carefully select alternative models (a)-(c) for the importance of embeddings in multimodal learning [18, 24], (d) for the effectiveness of identity mapping as reported by [6], and (e) for the confirmation of using question-only shortcuts in the multiple blocks as in [29]. For comparison, all models have three-block layers (selected after a pilot test), using VGG-19 features and 1k answers, then, the number of learning blocks is explored to confirm the pilot test. The effect of the pretrained visual feature models and the number of answers are also explored. All validation is performed on the test-dev split. 5 Results 5.1 Quantitative Analysis The VQA Challenge, which released the VQA dataset, provides evaluation servers for test-dev and test-standard test splits. For the test-dev, the evaluation server permits unlimited submissions for validation, while the test-standard permits limited submissions for the competition. We report accuracies in percentage. Alternative Models The test-dev results of the alternative models for the Open-Ended task are shown in Table 1. (a) shows a significant improvement over SAN. However, (b) is marginally better than (a). As compared to (b), (c) deteriorates the performance. An extra embedding for a question vector may easily cause overfitting leading to the overall degradation. And, the identity shortcuts in (d) cause the degradation problem, too. Extra parameters of the linear mappings may effectively support to do the task. (e) shows a reasonable performance, however, the extra shortcut is not essential. The empirical results seem to support this idea. Since the question-only model (50.39%) achieves a competitive result to the joint model (57.75%), while the image-only model gets a poor accuracy (28.13%) (see Table 2 in [1]). Eventually, we chose model (b) as the best performance and relative simplicity. 6 examples examples What kind of animals are these ? sheep What animal is the picture ? elephant What is this animal ? zebra What game is this person playing ? tennis How many cats are here ? 2 What color is the bird ? yellow What sport is this ? surfing Is the horse jumping ? yes (a) (b) (c) (d) (e) (f) (g) (h) Figure 4: Examples for visualization of the three-block layered MRN. The original images are shown in the first of each group. The next three images show the input gradients of the attention effect for each learning block as described in Section 5.2. The gradients of color channels for each pixel are summed up after taking absolute values of these gradients. Then, these summed absolute values which are greater than the summation of the mean and the standard deviation of these values are visualized as the attention effect (bright color) on the images. The answers (blue) are predicted by MRN. The effects of other various options, Skip-Thought Vectors [12] for parameter initialization, Bayesian Dropout [5] for regularization, image captioning model [10] for postprocessing, and the usage of shortcut connections, are explored in Appendix A.1. Number of Learning Blocks To confirm the effectiveness of the number of learning blocks selected via a pilot test (L = 3), we explore this on the chosen model (b), again. As the depth increases, the overall accuracies are 58.85% (L = 1), 59.44% (L = 2), 60.53% (L = 3) and 60.42% (L = 4). Visual Features The ResNet-152 visual features are significantly better than VGG-19 features for Other type in Table 2, even if the dimension of the ResNet features (2,048) is a half of VGG features’ (4,096). The ResNet visual features are also used in the previous work [8]; however, our model achieves a remarkably better performance with a large margin (see Table 3). Number of Target Answers The number of target answers slightly affects the overall accuracies with the trade-off among answer types. So, the decision on the number of target answers is difficult to be made. We chose Res, 2k in Table 2 based on the overall accuracy (for Multiple-Choice task, see Appendix A.1). Comparisons with State-of-the-arts Our chosen model significantly outperforms other state-ofthe-art methods for both Open-Ended and Multiple-Choice tasks in Table 3. However, the performance of Number and Other types are still not satisfactory compared to Human performance, though the advances in the recent works were mainly for Other-type answers. This fact motivates to study on a counting mechanism in future work. The model comparison is performed on the test-standard results. 7 5.2 Qualitative Analysis In Equation 5, the left term σ(Wqq) can be seen as a masking (attention) vector to select a part of visual information. We assume that the difference between the right term V := σ(W2σ(W1v)) and the masked vector F(q, v) indicates an attention effect caused by the masking vector. Then, the attention effect Latt = 1 2∥V −F∥2 is visualized on the image by calculating the gradient of Latt with respect to a given image I, while treating F as a constant. ∂Latt ∂I = ∂V ∂I (V −F) (8) This technique can be applied to each learning block in a similar way. Since we use the preprocessed visual features, the pretrained CNN is augmented only for this visualization. Note that model (b) in Table 1 is used for this visualization, and the pretrained VGG-19 is used for preprocessing and augmentation. The model is trained using the training set of the VQA dataset, and visualized using the validation set. Examples are shown in Figure 4 (more examples in Appendix A.2-4). Unlike the other works [29, 28] that use explicit attention parameters, MRN does not use any explicit attentional mechanism. However, we observe the interpretability of element-wise multiplication as an information masking, which yields a novel method for visualizing the attention effect from this operation. Since MRN does not depend on a few attention parameters (e.g. 14×14), our visualization method shows a higher resolution than others [29, 28]. Based on this, we argue that MRN is an implicit attention model without explicit attention mechanism. 6 Conclusions The idea of deep residual learning is applied to visual question-answering tasks. Based on the two observations of the previous works, various alternative models are suggested and validated to propose the three-block layered MRN. Our model achieves the state-of-the-art results on the VQA dataset for both Open-Ended and Multiple-Choice tasks. Moreover, we have introduced a novel method to visualize the spatial attention from the collapsed visual features using back-propagation. We believe our visualization method brings implicit attention mechanism to research of attentional models. Using back-propagation of attention effect, extensive research in object detection, segmentation and tracking are worth further investigations. Acknowledgments The authors would like to thank Patrick Emaase for helpful comments and editing. This work was supported by Naver Corp. and partly by the Korea government (IITP-R0126-16-1072-SW.StarLab, KEIT-10044009-HRI.MESSI, KEIT-10060086-RISF, ADD-UD130070ID-BMRR). References [1] Aishwarya Agrawal, Jiasen Lu, Stanislaw Antol, Margaret Mitchell, C. Lawrence Zitnick, Dhruv Batra, and Devi Parikh. VQA: Visual Question Answering. In International Conference on Computer Vision, 2015. [2] Jacob Andreas, Marcus Rohrbach, Trevor Darrell, and Dan Klein. Learning to Compose Neural Networks for Question Answering. arXiv preprint arXiv:1601.01705, 2016. [3] Steven Bird, Ewan Klein, and Edward Loper. Natural language processing with Python. O’Reilly Media, Inc., 2009. [4] Kyunghyun Cho, Bart van Merrienboer, Dzmitry Bahdanau, and Yoshua Bengio. On the Properties of Neural Machine Translation: Encoder-Decoder Approaches. arXiv preprint arXiv:1409.1259, 2014. [5] Yarin Gal. A Theoretically Grounded Application of Dropout in Recurrent Neural Networks. arXiv preprint arXiv:1512.05287, 2015. [6] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep Residual Learning for Image Recognition. arXiv preprint arXiv:1512.03385, 2015. 8 [7] Geoffrey E Hinton, Nitish Srivastava, Alex Krizhevsky, Ilya Sutskever, and Ruslan R Salakhutdinov. Improving neural networks by preventing co-adaptation of feature detectors. arXiv preprint arXiv:1207.0580, 2012. [8] Ilija Ilievski, Shuicheng Yan, and Jiashi Feng. A Focused Dynamic Attention Model for Visual Question Answering. arXiv preprint arXiv:1604.01485, 2016. [9] Sergey Ioffe and Christian Szegedy. Batch Normalization : Accelerating Deep Network Training by Reducing Internal Covariate Shift. In Proceedings of the 32nd International Conference on Machine Learning, 2015. [10] Andrej Karpathy and Li Fei-Fei. Deep Visual-Semantic Alignments for Generating Image Descriptions. In 28th IEEE Conference on Computer Vision and Pattern Recognition, 2015. [11] Jin-Hwa Kim, Jeonghee Kim, Jung-Woo Ha, and Byoung-Tak Zhang. TrimZero: A Torch Recurrent Module for Efficient Natural Language Processing. In Proceedings of KIIS Spring Conference, volume 26, pages 165–166, 2016. [12] Ryan Kiros, Yukun Zhu, Ruslan Salakhutdinov, Richard S. Zemel, Antonio Torralba, Raquel Urtasun, and Sanja Fidler. Skip-Thought Vectors. arXiv preprint arXiv:1506.06726, 2015. [13] Nicholas Léonard, Sagar Waghmare, Yang Wang, and Jin-Hwa Kim. rnn : Recurrent Library for Torch. arXiv preprint arXiv:1511.07889, 2015. [14] Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dollár, and C Lawrence Zitnick. Microsoft COCO: Common objects in context. In European Conference on Computer Vision, pages 740–755. Springer, 2014. [15] Jiasen Lu, Xiao Lin, Dhruv Batra, and Devi Parikh. Deeper LSTM and normalized CNN Visual Question Answering model. https://github.com/VT-vision-lab/VQA_LSTM_CNN, 2015. [16] Mateusz Malinowski, Marcus Rohrbach, and Mario Fritz. Ask Your Neurons: A Neural-based Approach to Answering Questions about Images. arXiv preprint arXiv:1505.01121, 2015. [17] Vinod Nair and Geoffrey E Hinton. Rectified Linear Units Improve Restricted Boltzmann Machines. Proceedings of the 27th International Conference on Machine Learning, 2010. [18] Jiquan Ngiam, Aditya Khosla, Mingyu Kim, Juhan Nam, Honglak Lee, and Andrew Y Ng. Multimodal Deep Learning. In Proceedings of The 28th International Conference on Machine Learning, pages 689–696, 2011. ISBN 9781450306195. [19] Hyeonwoo Noh, Paul Hongsuck Seo, and Bohyung Han. Image Question Answering using Convolutional Neural Network with Dynamic Parameter Prediction. arXiv preprint arXiv:1511.05756, 2015. [20] Mengye Ren, Ryan Kiros, and Richard Zemel. Exploring Models and Data for Image Question Answering. In Advances in Neural Information Processing Systems 28, 2015. [21] Tim Rocktäschel, Edward Grefenstette, Karl Moritz Hermann, Tomáš Koˇciský, and Phil Blunsom. Reasoning about Entailment with Neural Attention. In International Conference on Learning Representations, pages 1–9, 2016. [22] David E Rumelhart, Geoffrey E Hinton, and Ronald J Williams. Learning representations by back-propagating errors. Nature, 323(6088):533–536, 1986. [23] Karen Simonyan and Andrew Zisserman. Very Deep Convolutional Networks for Large-Scale Image Recognition. In International Conference on Learning Representations, 2015. [24] Nitish Srivastava and Ruslan R Salakhutdinov. Multimodal Learning with Deep Boltzmann Machines. In Advances in Neural Information Processing Systems 25, pages 2222–2230. 2012. [25] Sainbayar Sukhbaatar, Arthur Szlam, Jason Weston, and Rob Fergus. End-To-End Memory Networks. In Advances in Neural Information Processing Systems 28, pages 2440–2448, 2015. [26] Tijmen Tieleman and Geoffrey Hinton. Lecture 6.5-rmsprop: Divide the gradient by a running average of its recent magnitude. COURSERA: Neural Networks for Machine Learning, 4, 2012. [27] Qi Wu, Peng Wang, Chunhua Shen, Anthony Dick, and Anton van den Hengel. Ask Me Anything: Free-form Visual Question Answering Based on Knowledge from External Sources. In IEEE Conference on Computer Vision and Pattern Recognition, 2016. [28] Caiming Xiong, Stephen Merity, and Richard Socher. Dynamic Memory Networks for Visual and Textual Question Answering. arXiv preprint arXiv:1603.01417, 2016. [29] Zichao Yang, Xiaodong He, Jianfeng Gao, Li Deng, and Alex Smola. Stacked Attention Networks for Image Question Answering. arXiv preprint arXiv:1511.02274, 2015. 9
2016
354
6,277
Variance Reduction in Stochastic Gradient Langevin Dynamics Avinava Dubey∗, Sashank J. Reddi∗, Barnab´as P´oczos, Alexander J. Smola, Eric P. Xing Department of Machine Learning Carnegie-Mellon University Pittsburgh, PA 15213 {akdubey, sjakkamr, bapoczos, alex, epxing}@cs.cmu.edu Sinead A. Williamson IROM/Statistics and Data Science University of Texas at Austin Austin, TX 78712 sinead.williamson@mccombs.utexas.edu Abstract Stochastic gradient-based Monte Carlo methods such as stochastic gradient Langevin dynamics are useful tools for posterior inference on large scale datasets in many machine learning applications. These methods scale to large datasets by using noisy gradients calculated using a mini-batch or subset of the dataset. However, the high variance inherent in these noisy gradients degrades performance and leads to slower mixing. In this paper, we present techniques for reducing variance in stochastic gradient Langevin dynamics, yielding novel stochastic Monte Carlo methods that improve performance by reducing the variance in the stochastic gradient. We show that our proposed method has better theoretical guarantees on convergence rate than stochastic Langevin dynamics. This is complemented by impressive empirical results obtained on a variety of real world datasets, and on four different machine learning tasks (regression, classification, independent component analysis and mixture modeling). These theoretical and empirical contributions combine to make a compelling case for using variance reduction in stochastic Monte Carlo methods. 1 Introduction Monte Carlo methods are the gold standard in Bayesian posterior inference due to their asymptotic convergence properties; however convergence can be slow in large models due to poor mixing. Gradient-based Monte Carlo methods such as Langevin Dynamics and Hamiltonian Monte Carlo [10] allow us to use gradient information to more efficiently explore posterior distributions over continuous-valued parameters. By traversing contours of a potential energy function based on the posterior distribution, these methods allow us to make large moves in the sample space. Although gradient-based methods are efficient in exploring the posterior distribution, they are limited by the computational cost of computing the gradient and evaluating the likelihood on large datasets. As a result, stochastic variants are a popular choice when working with large data sets [15]. Stochastic gradient methods [13] have long been used in the optimization community to decrease the computational cost of gradient-based optimization algorithms such as gradient descent. These methods replace the (expensive, but accurate) gradient evaluation with a noisy (but computationally ∗denotes equal contribution 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. cheap) gradient evaluation on a random subset of the data. With appropriate scaling, this gradient evaluated on a random subset of the data acts as a proxy for the true gradient. A carefully designed schedule of step sizes ensures convergence of the stochastic algorithm. A similar idea has been employed to design stochastic versions of gradient-based Monte Carlo methods [15, 1, 2, 9]. By evaluating the derivative of the log likelihood on only a small subset of data points, we can drastically reduce computational costs. However, using stochastic gradients comes at a cost: While the resulting estimates are unbiased, they do have very high variance. This leads to an increased probability of selecting paths with high deviation from the true gradient, leading to slower convergence. There have been a number of variations proposed on the basic stochastic gradient Langevin dynamics (SGLD) model of [15]: [4] incorporates a momentum term to improve posterior exploration; [6] proposes using additional variables to stabilize fluctuations; [12] proposes modifications to facilitate exploration of simplex; [7] provides sampling solutions for correlated data. However, none of these methods directly tries to reduce the variance in the computed stochastic gradient. As was the case with the original SGLD algorithm, we look to the optimization community for inspiration, since high variance is also detrimental in stochastic gradient based optimization. A plethora of variance reduction techniques have recently been proposed to alleviate this issue for the stochastic gradient descent (SGD) algorithm [8, 5, 14]. By incorporating a carefully designed (usually unbiased) term into the update sequence of SGD, these methods reduce the variance that arises due to the stochastic gradients in SGD, thereby providing strong theoretical and empirical performance. Inspired by these successes in the optimization community, we propose methods for reducing the variance in stochastic gradient Langevin dynamics. Our approach bridges the gap between the faster (in terms of iterations) convergence of non-stochastic Langevin dynamics, and the faster per-iteration speed of SGLD. While our approach draws its motivation from the stochastic optimization literature, it is to our knowledge the first approach that aims to directly reduce variance in a gradient-based Monte Carlo method. While our focus is on Langevin dynamics, our approach is easily applicable to other gradient-based Monte Carlo methods. Main Contributions: We propose a new Langevin algorithm designed to reduce variance in the stochastic gradient, with minimal additional computational overhead. We also provide a memory efficient variant of our algorithm. We demonstrate theoretical conversion to the true posterior under reasonable assumptions, and show that the rate of convergence has a tighter bound than one previously shown for SGLD. We complement these theoretical results with empirical evaluation showing impressive speed-ups versus a standard SGLD algorithm, on a variety of machine learning tasks such as regression, classification, independent component analysis and mixture modeling. 2 Preliminaries Let X = {xi}N i=1 be a set of data items modeled using a likelihood function p(X|θ) = N i=1 p(xi|θ) where the parameter θ has prior distribution p(θ). We are interested in sampling from the posterior distribution p(θ|X) ∝p(θ) N i=1 p(xi|θ). If N is large, standard Langevin Dynamics is not feasible due to the high cost of repeated gradient evaluations; a more scalable approach is to use a stochastic variant [15], which we will refer to as stochastic gradient Langevin dynamics, or SGLD. SGLD uses a classical Robbins-Monro stochastic approximation to the true gradient [13]. At each iteration t of the algorithm, a subset Xt = {xt1, . . . , xtn} of the data is sampled and the parameters are updated by using only this subset of data, according to Δθt = ht 2  ∇log p(θt) + N n n i=1 ∇log p(xti|θt)  + ηt (1) where ηt ∼N(0, ht), and ht is the learning rate. ht is set in such a fashion that ∞ t=1 ht = ∞and ∞ t=1 h2 t < ∞. This provides an approximation to a first order Langevin diffusion, with dynamics dθ = −1 2∇θUdt + dW, (2) where U is the unnormalized negative log posterior. Equation 2 has stationary distribution ρ(θ) ∝ exp{−U(θ)}. Let ¯φ =  φ(θ)ρ(θ)dθ where φ represents a test function of interest. For a numerical 2 method that generates samples {θt}T −1 i=0 , let ˆφ denote the empirical average 1 T T −1 t=0 φ(θt). Furthermore, let ψ denote the solution to the Poisson equation Lψ = φ −¯φ, where L is the generator of the diffusion, given by Lψ = ⟨∇θψ, ∇θU⟩+ 1 2  i ∇2 i ψ. (3) The decreasing step size ht in our approximation (Equation 1) means we do not have to incorporate a Metropolis-Hastings step to correct for the discretization error relative to Equation 2; however it comes at the cost of slowing the mixing rate of the algorithm. We note that, while the discretized Langevin diffusion is Markovian, its convergence guarantees rely on the quality of the approximation, rather than from standard Markov chain Monte Carlo analyses that rely on this Markovian property. A second source of error comes from the use of stochastic approximations to the true gradients. This is equivalent to using an approximate generator ˜Lt = L + ΔVt, where ΔVt = (∇Ut −∇U) · ∇ and ∇Ut is the current stochastic approximation to ∇U. The key contribution of this paper will be replacing the Robbins-Monro approximation to U with a lower-variance approximation, thus reducing the error. To see more clearly the effect of the variance of our stochastic approximation on the estimator error, we present a result derived for SGLD by [3]: Theorem 1. [3] Let Ut be an unbiased estimate of U and ht = h for all t ∈{1, . . . , T}. Then under certain reasonable assumptions (concretely, assumption [A1] in Section 4), for a smooth test function φ, the MSE of SGLD at time K = hT is bounded, for some C > 0 independent of (T, h) in the following manner: E(ˆφ −¯φ)2 ≤C ⎛ ⎜ ⎜ ⎝ 1 T  t E[∥ΔVt∥2] T T1 + 1 Th + h2 ⎞ ⎟ ⎟ ⎠. (4) Here ∥.∥represents the operator norm. We clearly see that the MSE depends on the variance term E[∥ΔVt∥2], which in turn depends on the variance of the noisy stochastic gradients. Since, for consistency, we require h →0 as T →∞,1 provided E[∥ΔVt∥2] is bounded by a constant τ, the term T1 ceases to dominate as T →∞, meaning that the effect of noise in the stochastic gradient becomes negligible. However outside this asymptotic regime, the effect of the variance term in Equation 4 remains significant. This motivates our efforts in this paper to decrease the variance of the approximate gradient, while maintaining an unbiased estimator. An easy to decrease the variance is by using larger minibatches. However, this comes at a considerable computational cost, undermining the whole benefit of using SGLD. Inspired by the recent success of variance reduction techniques in stochastic optimization [14, 8, 5], we take a rather different approach to reduce the effect of noisy gradients. 3 Variance Reduction for Langevin Dynamics As we have seen in Section 2, reducing the variance of our stochastic approximation can reduce our estimation error. In this section, we introduce two approaches for variance reduction, based on recent variance reduction algorithms for gradient descent [5, 8]. The first algorithm, SAGA-LD, is appropriate when our bottleneck is computation; it yields improved convergence with minimal additional computational costs over SGLD. The second algorithm, SVRG-LD, is appropriate when our bottleneck is memory; while the computational cost is generally higher than SAGA-LD, the memory requirement is lower, with the memory overhead beyond that of stochastic Langevin dynamics scales as O(d). In practice, we found that computation was a greater bottleneck in the examples considered, so our experimental section only focuses on SAGA-LD; however on larger datasets with easily computable gradients, SVRG-LD may be the optimal choice. 1In particular, if h ∝T −1/3, we obtain the optimal convergence rate for the above upper bound. 3 Algorithm 1: SAGA-LD 1: Input: αi 0 = θ0 ∈Rd for i ∈{1, . . . , N}, step sizes {ht > 0}T −1 i=0 2: gα = N i=1 ∇log p(xi|αi 0) 3: for t = 0 to T −1 do 4: Uniformly randomly pick a set It from {1, . . . , N} (with replacement) such that |It| = b 5: Randomly draw ηt ∼N(0, ht) 6: θt+1 = θt + ht 2  ∇log p(θt) + N n  i∈It  ∇log p(xi|θt) −∇log p(xi|αi t)  + gα  + ηt 7: αi t+1 = θt for i ∈It and αi t+1 = αi t for i /∈It 8: gα = gα +  i∈It  ∇log p(xi|αi t+1) −∇log p(xi|αi t)  9: end for 10: Output: Iterates {θt}T −1 t=0 3.1 SAGA-LD The increased variance in SGLD is due to the fact that we only have information from n ≪N data points at each iteration. However, inspired by a minibatch version of the SAGA algorithm [5], we can include information from the remaining data points via an approximate gradient, and partially update the average gradient in each operation. We call this approach SAGA-LD. Under SAGA-LD, we explicitly store N approximate gradients {gαi}N i=1, corresponding to the N data points. Concretely, let αt = (αi t)N i=1 be a set of vectors, initialized as αi 0 = θ0 for all i ∈ [N], and initialize gαi = ∇log p(xi|αi 0) and gα = N i=1 gαi. As we iterate through the data, if a data point is not selected in the current minibatch, we approximate its gradient with gαi. If It = {i1t, . . . int} is the minibatch selected at iteration t, this means we approximate the gradient as N i=1 ∇log p(xi|θt) ≈N n  i∈It (∇log p(xi|θt) −gαi) + gα (5) When Equation (5) is used for MAP estimation it corresponds to SAGA[5]. However by injecting noise into the parameter update in the following manner Δθt = ht 2  ∇log p(θt) + N n  i∈It (∇log p(xi|θt) −gαi) + gα  + ηt, where ηt ∼N(0, ht) (6) we can adapt it for sampling from the posterior. After updating θt+1 = θt + Δθt, we let αi t+1 = θt for i ∈It. Note that we do not need to explicitly store the αi t; instead we just update the corresponding gradients gαi and overall approximate gradient gα. The SAGA-LD algorithm is summarized in Algorithm 1. The approximation in Equation (6) gives an unbiased estimate of the true gradient, since the minibatch It is sampled uniformly at random from [N], and the αt i are independent of It. SAGA-LD offers two key properties: (i) As shown in Section 4, SAGA-LD has better convergence properties than SGLD; (ii) The computational overhead is minimal, since SAGA-LD does not require explicit calculation of the full gradient. Instead, it simply makes use of gradients that are already being calculated in the current minibatch. Combined, we end up with a similar computational complexity to SGLD, with a much better convergence rate. The only downside of SAGA-LD, when compared with SGLD, is in terms of memory storage. Since we need to store N individual gradients gαi, we typically have a storage overhead of O(Nd) relative to SGLD. Fortunately, in many applications of interest to machine learning, the cost can be reduced to O(N) (please refer to [5] for more details), and in practice the cost of the higher memory requirements is typically outweighed by the improved convergence and low computational cost. 3.2 SVRG-LD If the memory overhead of SAGA-LD is not acceptable, we can use a variant that reduces storage requirements, at the cost of higher computational demands. The memory complexity for SAGA-LD is high because the approximate gradient gα is updated at each step. This can be avoided by updating the approximate gradient every m iterations in a single evaluation, and never storing the individual gradients gαi. Concretely, after every m passes through the data, we evaluate the gradient on the 4 Algorithm 2: SVRG-LD 1: Input: ˜θ = θ0 ∈Rd, epoch length m, step sizes {ht > 0}T −1 i=0 2: for t = 0 to T −1 do 3: if (t mod m = 0) then 4: ˜θ = θt 5: ˜g = N i=1 ∇log p(xi|˜θ) 6: end if 7: Uniformly randomly pick a set It from {1, . . . , N} (with replacement) such that |It| = n 8: Randomly draw ηt ∼N(0, ht) 9: θt+1 = θt + ht 2  ∇log p(θt) + N n  i∈It  ∇log p(xi|θt) −∇log p(xi|˜θ)  + ˜g  + ηt 10: end for 11: Output: Iterates {θt}T −1 t=0 entire data set, obtaining ˜g = N i=1 ˜gi, where ˜gi = ∇log p(xi|˜θ) is the current local gradient. ˜g then serves as an approximate gradient until the next global evaluation. This yields an update of the form Δθt = ht 2  ∇log p(θt) + N n  i∈It (∇log p(xi|θt) −˜gi) + ˜g  + ηt where ηt ∼N(0, ht) (7) Without adding noise ηt the update sequence in Equation (7) corresponds to the stochastic variance reduction gradient descent algorithm [8]. Pseudocode for this procedure is given in Algorithm 2. While the memory requirements are lower, the computational cost is higher, due to the cost of a full update of ˜g. Further, convergence may be negatively effected due to the fact that, as we move further from ˜θ, ˜g will be further from the true gradient. In practice, we found SAGA-LD to be a more effective algorithm on the datasets considered, so in the interest of space we relegate further details about SVRG-LD to the appendix. 4 Analysis Our motivation in this paper was to improve the convergence of SGLD, by reducing the variance of the gradient estimate. As we saw in Theorem 1, a high variance E[||ΔVt||2], corresponding to noisy stochastic gradients, leads to a large bound on the MSE of a test function. We expand this analysis to show that the algorithms introduced in this paper yield a tighter bound. Theorem 1 required a number of assumptions, given below in [A1]. Discussion of the reasonableness of these assumptions is provided in [3]. [A1] We assume the functional ψ that solves the Poisson equation Lψ = φ −¯φ is bounded up to 3rd-order derivatives by some function Γ, i.e., ∥Dkψ∥≤CkΓpk where D is the kth order derivative (for k = (0, 1, 2, 3)), and Ck, pk > 0. We also assume that the expectation of Γ on {θt} is bounded (supt EΓp[θt] < ∞) and that Γ is smooth such that sups∈(0,1) Γp(sθ + (1 −s)θ′) ≤C(Γp(θ) + Γp(θ′)), ∀θ, θ′, p ≤max 2pk for some C > 0. In our analysis of SAGA-LD and SVRG-LD, we make the assumptions in [A1], and add the following further assumptions about the smoothness of our gradients: [A2] We assume that the functions log p(xi|θ) are Lipschitz smooth with constant L for all i ∈[N], i.e. ∥∇log p(xi|θ) −∇log p(xi|θ′)∥≤L∥θ −θ′∥for all i ∈[N] and θ, θ′ ∈Rd. We assume that (ΔVtψ(θ))2 ≤C′∥∇Ut(θ) −∇U(θ)∥2 for some constant C′ > 0 for all θ ∈Rd, where ψ is the solution to the Poisson equation for our test function. We also assume that ∥∇log p(θ)∥≤σ and ∥∇log p(xi|θ)∥≤σ for some σ and all i ∈[N] and θ ∈Rd. The Lipschitz smoothness assumption is very common both in the optimization literature [11] and when working with Itˆo diffusions [3]. The bound on (ΔVtψ(θ))2 holds when the gradient ∥∇ψ∥is bounded. Loosely, these assumptions encode the idea that the gradients don’t change too quickly, so that we limit the errors introduced by incorporating gradients based on previous values of θ. With these assumptions, we state the following key results for SAGA-LD and SVRG-LD, which are proved in the supplement. 5 Theorem 2. Let ht = h for all t ∈{1, . . . , T}. Under the assumptions [A1],[A2], for a smooth test function φ, the MSE of SAGA-LD (in Algorithm 1) at time K = hT is bounded, for some C > 0 independent of (T, h) in the following manner: E(ˆφ −¯φ)2 ≤C  N 2 min{σ2, N 2 n2 (L2h2σ2+hd)} nT + 1 T h + h2  . (8) A similar result can be shown for SVRG-LD in Algorithm 2: Theorem 3. Let ht = h for all t ∈{1, . . . , T}. Under the assumptions [A1],[A2], for a smooth test function φ, the MSE of SVRG-LD (in Algorithm 2) at time K = hT is bounded, for some C > 0 independent of (T, h) in the following manner: E(ˆφ −¯φ)2 ≤C  N 2 min{σ2,m2(L2h2σ2+hd)} nT + 1 T h + h2 . (9) The result in Theorem 3 is qualitatively equivalent to that in Theorem 2 when m = ⌊N/n⌋. In general, such a choice of m is preferable because, in this case, the overall cost of calculation of full gradient in Algorithm 2 becomes insignificant. In order to assess the theoretical convergence of our proposed algorithm, we compare the bounds for SVRG-LD (Theorem 3) and SAGA-LD (Theorem 2) with those obtained for SGLD (Theorem 1. Under the assumptions in this section, it is easy to show that the term T1 in Theorem 1 becomes O(N 2σ2/(Tn)). In contrast, both Theorem 2 and 3 show that, due to a reduction in variance, SVRG-LD and SAGA-LD exhibit a much weaker dependence. More specifically, this is manifested in the form of the following bound: N 2 min  σ2, N 2 n2 (h2σ2+hd)  nT . Note that this is tighter than the corresponding bound on SGLD. We also note that, similar to SGLD, SAGA-LD and SVRG-LD require h →0 as T →∞. In such a scenario, the convergence becomes significantly faster relative to SGLD as h →0. 5 Experiments We present our empirical results in this section. We focus on applying our stochastic gradient method to four different machine learning tasks, carried out on benchmark datasets: (i) Bayesian linear regression (ii) Bayesian logistic regression and (iii) Independent component analysis (iv) Mixture modeling. We focus on SAGA-LD, since in the applications considered, the convergence and computational benefits of SAGA-LD are more beneficial than the memory benefits of SVRG-LD; In order to reduce the initial computational costs associated with calculating the initial average gradient, we use a variant of Algorithm 1 that calculates gα (in line 2 of Algorithm 1) in an online fashion and reweights the updates accordingly. Note that such a heuristic is also commonly used in the implementation of SAG and SAGA in the context of optimization [14, 5]. In all our experiments, we use a decreasing step size for SGLD as suggested by [15]. In particular, we use ϵt = a(b + t)−γ, where the parameters a, b and γ are chosen for each dataset to give the best performance of the algorithm on that particular dataset. For SAGA-LD, due to the benefit of variance reduction, we use a simple two phase constant step size selection strategy. In each of these phases, a constant step size is chosen such that SAGA-LD gives the best performance on the particular dataset. The minibatch size, n, in both SGLD and SAGA-LD is held at a constant value of 10 throughout our experiments. All algorithms are initialized to the same point and the same sequence of minibatches is pre-generated and used in both algorithms. 5.1 Regression We first demonstrate the performance of our algorithm on Bayesian regression. Formally, we are provided with inputs Z = {xi, yi}N i=1 where xi ∈Rd and yi ∈R. The distribution of the ith output yi is given by p(yi|xi) = N(β⊤xi, σe), where p(β) = N(0, λ−1I). Due to conjugacy, the posterior distribution over β is also normal, and the gradients of the log-likelihood and the log-prior are given 6 Number of pass through data 0 1 2 3 Test MSE 10-1 102 104 concrete SGLD SAGA-LD Number of pass through data 0 1 3 5 Test MSE 10-1 102 104 noise SGLD SAGA-LD Number of pass through data 0 1 5 10 Test MSE 10-1 102 105 parkinsons SGLD SAGA-LD Number of pass through data 0 1 5 10 Test MSE 10-1 101 103 toms SGLD SAGA-LD Number of pass through data 0 0.5 1 Test MSE 1 1.5 2 3dRoad SGLD SAGA-LD Figure 1: Performance comparison of SGLD and SAGA-LD on a regression task. The x-axis and yaxis represent the number of passes through the entire data and the average test MSE, respectively. Additional experiments are provided in the appendix. Number of pass through data 1 4 8 Average Test log-likelihood -102 -101 -100 -10-1 pima SGLD SAGA-LD Number of pass through data 0 2 4 Average Test log-likelihood -102 -101 -100 -10-1 diabetic SGLD SAGA-LD Number of pass through data 0 0.5 1 Average Test log-likelihood -101 -100 eeg SGLD SAGA-LD Number of pass through data 1 5 10 Average Test log-likelihood -100 -10-1 space SGLD SAGA-LD Number of pass through data 0.5 1 2 Average Test log-likelihood -2 -1 -0.4 susy SGLD SAGA-LD Figure 2: Comparison of performance of SGLD and SAGA-LD for Bayesian logistic regression. The x-axes and y-axes represent the number of effective passes through the dataset and the test log-likelihood, respectively. by ∇β log(P(yi|xi, β)) = −(yi −βT xi)xi and ∇β log(P(β)) = −λβ. We ran experiments on 11 standard UCI regression datasets, summarized in Table 1.2 In each case, we set the prior precision λ = 1, and we partitioned our dataset into training (70%), validation (10%), and test (20%) sets. The validation set is used to select the step size parameters, and we report the mean square error (MSE) evaluated on the test set, using 5-fold cross-validation. The average test MSE on a subset of datasets is reported in Figure 1. Due to space constraints, we relegate the remaining experimental results to the appendix. As shown in Figure 1, SAGA-LD converges much faster than the SGLD method (taking less than one pass through the whole dataset in many cases). This performance gain is consistent across all the datasets. Furthermore, the step size selection was much simpler for SAGA-LD than SGLD. Datasets concrete noise parkinson bike toms protein casp kegg 3droad music twitter N 1030 1503 5875 17379 45730 45730 53500 64608 434874 515345 583250 P 8 5 21 12 96 9 9 27 2 90 77 Table 1: Summary of datasets used for regression. 5.2 Classification We next turn our attention to classification, using Bayesian logistic regression. In this case, the input is the set Z = {xi, yi}N i=1 where xi ∈Rd, yi ∈{0, 1}. The distribution of the output yi for given sample xi is given by P(yi = 1) = φ(βT xi), where p(β) = N(0, λ−1I) and φ(z) = 1/(1 + exp(−z)). Here, the gradient of the log-likelihood and the log-prior are given by ∇β log(P(yi|xi, β)) = (yi −φ(βT xi))xi and ∇β log(P(β)) = −λβ respectively. Again, λ is set to 1 for all experiments, and the dataset split and parameter selection method is exactly same as in our regression experiments. We run experiments on five binary classification datasets in the UCI repository, summarized in Table 2, and report the the test set log-likelihood for each dataset, using 5-fold cross validation. Figure 2 shows the performance of SGLD and SAGA-LD for the classification datasets. As we saw with the regression task, SAGA-LD converges faster that SGLD on all the datasets, demonstrating the efficiency of the our algorithm in this setting. Datasets pima diabetic eeg space susy N 768 1151 14980 58000 100000 d 8 20 15 9 18 Table 2: Summary of the datasets used for classification. 2The datasets can be downloaded from https://archive.ics.uci.edu/ml/index.html 7 Number of pass through data 0 1 1.5 Average Test log-likelihood -2 -1 1 MEG SGLD SAGA-LD Number of pass through data 0 2 4 6 Variance 105 1010 Regression-concrete SGLD SAGA-LD Number of pass through data 0 1 2 3 Variance 103 104 Classification-pima SGLD SAGA-LD  -50 0 50 log-posterior 106 -3 -1 -0.01 posterior  -50 0 50 Sample count 0 7000 15000 Estimated Posterior Figure 3: The left plot shows the performance of SGLD and SAGA-LD for the ICA task. The next two plots show the variance of SGLD and SAGA-LD for regression and classification. The rightmost two plot shows true and estimated posteriors using SAGA-LD for the mixture modeling task 5.3 Bayesian Independent Component Analysis To evaluate performance under a Bayesian Independent Component Analysis (ICA) model, we assume our dataset x = {xi}N i=1 is distributed according to p(x|W) ∝| det(W)| d i=1 p(yi), Wij ∼N(0, λ), (10) where W ∈Rd×d, yi = wT i x, and p(yi) = 1/(4 cosh2( 1 2yi)). The gradient of the log-likelihood and the log-prior are ∇W log(p(xi|W)) = (W −1)T −YixT i where Yij = tanh( 1 2yij) for all j ∈[d] and ∇W log(p(W)) = −λW respectively. All other parameters are set as before. We used a standard ICA dataset for our experiment3, comprisein 17730 time-points with 122 channels from which we extracted the first 10 channels. Further experimental details are similar to those for regression and classification. The performance (in terms of test set log likelihood) of SGLD and SAGA-LD for the ICA task is shown in Figure 3. As seen in Figure 3, similar to the regression and classification tasks, SAGA-LD outperforms SGLD in the ICA task. 5.4 Mixture Model Finally, we evaluate how well SAGA-LD estimates the true posterior of parameters of mixture models. We generated 20,000 data points from a mixture of two Gaussians, given by p(x|μ, σ1, σ2, γ) = 1 2N(x; μ, σ2) + 1 2N(x; −μ + γ, σ2), where μ = −5, γ = 20, and σ = 5. We estimate the posterior distribution over μ, holding the other variables fixed. The two plots on the right of Figure 3 show that we are able to estimate the true posterior correctly. Discussion: Our experiments provide a very compelling reason to use variance reduction techniques for SGLD, complementing the theoretical justification given in Section 4. The hypothesized variance reduction is demonstrated in Figure 3, where we compare the variances of SGLD and SAGA-LD with respect to the true gradient on regression and classification tasks. As we see from all of the experimental results in this section, SAGA-LD converges with relatively very few samples compared with SGLD. This is especially important in hierarchical Bayesian models where, typically, the size of the model used is proportional to the number of observations. Thus, with SAGA-LD, we can achieve better performance with very few samples. Another advantage is that, while we require the step size to tend to zero, we can use a much simpler schedule than SGLD. 6 Discussion and Future Work SAGA-LD is a new stochastic Langevin method that obtains improved convergence by reducing the variance in the stochastic gradient. An alternative method, SVRG-LD, can be used when memory is at a premium. For both SAGA-LD and SVRG-LD, we proved a tighter convergence bound than the one previously shown for stochastic gradient Langevin dynamics. We also showed, on a variety of machine learning tasks, that SAGA-LD converges to the true posterior faster than SGLD, suggesting the widespread use of SAGA-LD in place of SGLD. We note that, unlike other stochastic Langevin methods, our sampler is non-Markovian. Since our convergence guarantees are based on bounding the error relative to the full Langevin diffusion rather than on properties of a Markov chain, this does not impact the validity of our sampler. While we showed the efficacy of using our proposed variance reduction technique to SGLD, our proposed strategy is very generic enough and can also be applied to other gradient-based MCMC techniques such as [1, 2, 9, 6, 12]. We leave this as future work. 3The dataset can be downloaded from https://www.cis.hut.fi/projects/ica/eegmeg/ MEG_data.html. 8 References [1] Sungjin Ahn, Anoop Korattikara, and Max Welling. Bayesian posterior sampling via stochastic gradient Fisher scoring. In ICML, 2012. [2] Sungjin Ahn, Babak Shahbaba, and Max Welling. Distributed stochastic gradient MCMC. In ICML, 2014. [3] Changyou Chen, Nan Ding, and Lawrence Carin. On the convergence of stochastic gradient MCMC algorithms with high-order integrators. In NIPS, 2015. [4] Tianqi Chen, Emily B. Fox, and Carlos Guestrin. Stochastic gradient Hamiltonian Monte Carlo. In ICML, 2014. [5] Aaron Defazio, Francis Bach, and Simon Lacoste-Julien. SAGA: A fast incremental gradient method with support for non-strongly convex composite objectives. In NIPS, 2014. [6] Nan Ding, Youhan Fang, Ryan Babbush, Changyou Chen, Robert D. Skeel, and Hartmut Neven. Bayesian sampling using stochastic gradient thermostats. In NIPS, 2014. [7] Mark Girolami and Ben Calderhead. Riemann manifold Langevin and Hamiltonian Monte Carlo methods. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 2011. [8] Rie Johnson and Tong Zhang. Accelerating stochastic gradient descent using predictive variance reduction. In NIPS, 2013. [9] Yi-An Ma, Tianqi Chen, and Emily Fox. A complete recipe for stochastic gradient MCMC. In NIPS, 2015. [10] Radford Neal. Mcmc using hamiltonian dynamics. In Handbook of Markov Chain Monte Carlo, 2010. [11] Yurii Nesterov. Introductory Lectures On Convex Optimization: A Basic Course. Springer, 2003. [12] Sam Patterson and Yee Whye Teh. Stochastic gradient Riemannian Langevin dynamics on the probability simplex. In NIPS, 2013. [13] Herbert Robbins and Sutton Monro. A stochastic approximation method. The Annals of Mathematical Statistics, 22(3):400–407, sep 1951. [14] Mark W. Schmidt, Nicolas Le Roux, and Francis R. Bach. Minimizing finite sums with the stochastic average gradient. arXiv:1309.2388, 2013. [15] Max Welling and Yee Whye Teh. Bayesian learning via stochastic gradient Langevin dynamics. In ICML, 2011. 9
2016
355
6,278
On Regularizing Rademacher Observation Losses Richard Nock Data61, The Australian National University & The University of Sydney richard.nock@data61.csiro.au Abstract It has recently been shown that supervised learning linear classifiers with two of the most popular losses, the logistic and square loss, is equivalent to optimizing an equivalent loss over sufficient statistics about the class: Rademacher observations (rados). It has also been shown that learning over rados brings solutions to two prominent problems for which the state of the art of learning from examples can be comparatively inferior and in fact less convenient: (i) protecting and learning from private examples, (ii) learning from distributed datasets without entity resolution. Bis repetita placent: the two proofs of equivalence are different and rely on specific properties of the corresponding losses, so whether these can be unified and generalized inevitably comes to mind. This is our first contribution: we show how they can be fit into the same theory for the equivalence between example and rado losses. As a second contribution, we show that the generalization unveils a surprising new connection to regularized learning, and in particular a sufficient condition under which regularizing the loss over examples is equivalent to regularizing the rados (i.e. the data) in the equivalent rado loss, in such a way that an efficient algorithm for one regularized rado loss may be as efficient when changing the regularizer. This is our third contribution: we give a formal boosting algorithm for the regularized exponential rado-loss which boost with any of the ridge, lasso, SLOPE, ℓ∞, or elastic net regularizer, using the same master routine for all. Because the regularized exponential rado-loss is the equivalent of the regularized logistic loss over examples we obtain the first efficient proxy to the minimization of the regularized logistic loss over examples using such a wide spectrum of regularizers. Experiments with a readily available code display that regularization significantly improves rado-based learning and compares favourably with example-based learning. 1 Introduction What kind of data should we use to train a supervised learner ? A recent result has shown that minimising the popular logistic loss over examples with linear classifiers (in supervised learning) is equivalent to the minimisation of the exponential loss over sufficient statistics about the class known as Rademacher observations (rados, [Nock et al., 2015]), for the same classifier. In short, we fit a classifier over data that is different from examples, and the same classifier generalizes well to new observations. It has been shown that rados offer solutions for two problems for which the state of the art involving examples can be comparatively significantly inferior: • protection of the examples’ privacy from various algebraic, geometric, statistical and computational standpoints, and learning from private data [Nock et al., 2015]; • learning from a large number of distributed datasets without having to perform entity resolution between datasets [Patrini et al., 2016]. Quite remarkably, the training time of the algorithms involved can be smaller than it would be on examples, by orders of magnitude [Patrini et al., 2016]. Two key problems remain however: the 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. accuracy of learning from rados can compete experimentally with that of learning from examples, yet there is a gap to reduce for rados to be not just a good material to learn from in a privacy/distributed setting, but also a serious alternative to learning from examples at large, yielding new avenues to supervised learning. Second, theoretically speaking, it is now known that two widely popular losses over examples admit an equivalent loss in the rado world: the logistic loss and the square loss [Nock et al., 2015, Patrini et al., 2016]. This inevitably suggests that this property may hold for more losses, yet barely anything displays patterns of generalizability in the existing proofs. Our contributions: in this paper, we provide answers to these two questions, with three main contributions. Our first contribution is to show that this generalization indeed holds: other example losses admit equivalent losses in the rado world, meaning in particular that their minimiser classifier is the same, regardless of the dataset of examples. The technique we use exploits a two-player zero sum game representation of convex losses, that has been very useful to analyse boosting algorithms [Schapire, 2003, Telgarsky, 2012], with one key difference: payoffs are non-linear convex, eventually non-differentiable. These also resemble the entropic dual losses [Reid et al., 2015], with the difference that we do not enforce conjugacy over the simplex. The conditions of the game are slightly different for examples and rados. We provide necessary and sufficient conditions for the resulting losses over examples and rados to be equivalent. Informally, equivalence happens iff the convex functions of the games satisfy a symmetry relationship and the weights satisfy a linear system of equations. Some popular losses fit in the equivalence [Nair and Hinton, 2010, Gentile and Warmuth, 1998, Nock and Nielsen, 2008, Telgarsky, 2012, Vapnik, 1998, van Rooyen et al., 2015]. Our second contribution came unexpectedly through this equivalence. Regularizing a loss is standard in machine learning [Bach et al., 2011]. We show a sufficient condition for the equivalence under which regularizing the example loss is equivalent to regularizing the rados in the equivalent rado loss, i.e. making a Minkowski sum of the rado set with a classifier-based set. This property is independent of the regularizer, and incidentally happens to hold for all our cases of equivalence (Cf first contribution). A regularizer added to a loss over examples thus transfers to data in the rado world, in essentially the same way for all regularizers, and if one can solve the non-trivial computational and optimization problem that poses this data modification for one regularized rado loss, then, basically, "A good optimization algorithm for this regularized rado loss may fit to other regularizers as well” Our third contribution exemplifies this. We propose an iterative boosting algorithm, Ω-R.ADABOOST, that learns a classifier from rados using the exponential regularized rado loss, with regularization choice belonging to the ridge, lasso, ℓ∞, or the recently coined SLOPE [Bogdan et al., 2015]. Since rado regularization would theoretically require to modify data at each iteration, such schemes are computationally non-trivial. We show that this modification can in fact be bypassed for the exponential rado loss, and the algorithm, Ω-R.ADABOOST, is as fast as ADABOOST. Ω-R.ADABOOST has however a key advantage over ADABOOST that to our knowledge is new in the boosting world: for any of these four regularizers, Ω-R.ADABOOST is a boosting algorithm — thus, because of the equivalence between the minimization of the logistic loss over examples and the minimization of the exponential rado loss, Ω-R.ADABOOST is in fact an efficient proxy to boost the regularized logistic loss over examples using whichever of the four regularizers, and by extension, linear combination of them (e.g., elastic net regularization [Zou and Hastie, 2005]). We are not aware of any regularized logistic loss formal boosting algorithm with such a wide spectrum of regularizers. Extensive experiments validate this property: Ω-R.ADABOOST is all the better vs ADABOOST (unregularized or regularized) as the domain gets larger, and is able to rapidly learn both accurate and sparse classifiers, making it an especially good contender for supervised learning at large on big domains. The rest of this paper is as follows. Sections §2, 3 and 4 respectively present the equivalence between example and rado losses, its extension to regularized learning and Ω-R.ADABOOST. §5 and 6 respectively present experiments, and conclude. In order not to laden the paper’s body, a Supplementary Material (SM) contains the proofs and additional theoretical and experimental results. 2 Games and equivalent example/rado losses To avoid notational load, we briefly present our learning setting to point the key quantity in our formulation of the general two players game. Let [m] .= {1, 2, ..., m} and Σm .= {−1, 1}m, for m > 0. The classical (batch) supervised learner is example-based: it is given a set of examples S = {(xi, yi), i ∈[m]} where xi ∈Rd, yi ∈Σ1, ∀i ∈[m]. It returns a classifier h : Rd →R from 2 a predefined set H. Let zi(h) .= yh(xi) and abbreviate z(h) by z for short. The learner fits h to the minimization of a loss. Table 1, column ℓe, presents some losses that can be used: we remark that h appears only through z, so let us consider in this section that the learner rather fits vector z ∈Rm. We can now define our two players game setting. Let ϕe : R →R and ϕr : R →R two convex and lower-semicontinuous generators. We define functions Le : Rm×Rm →R and Lr : R2m×Rm →R: Le(p, z) .= X i∈[m] pizi + µe X i∈[m] ϕe(pi) , (1) Lr(q, z) .= X I⊆[m] qI X i∈I zi + µr X I⊆[m] ϕr(qI) , (2) where µe, µr > 0 do not depend on z. For the notation to be meaningful, the coordinates in q are assumed (wlog) to be in bijection with 2[m]. The dependence of both problems in their respective generators is implicit and shall be clear from context. The adversary’s goal is to fit p∗(z) .= arg min p∈Rm Le(p, z) , (3) q∗(z) .= arg min q∈H2m Lr(q, z) , (4) with H2m .= {q ∈R2m : 1⊤q = 1}, so as to attain Le(z) .= Le(p∗(z), z) , (5) Lr(z) .= Lr(q∗(z), z) , (6) and let ∂Le(z) and ∂Lr(z) denote their subdifferentials. We view the learner’s task as the problem of maximising the corresponding problems in eq. (5) (with examples; this is already sketched above) or (6) (with what we shall call Rademacher observations, or rados), or equivalently minimising negative the corresponding function, and then resort to a loss function. The question of when these two problems are equivalent from the learner’s standpoint motivates the following definition. Definition 1 Two generators ϕe, ϕr are said proportionate iff ∀m > 0, there exists (µe, µr) such that Le(z) = Lr(z) + b , ∀z ∈Rm . (7) (b does not depend on z) ∀m ∈N∗, let Gm .=  0⊤ 2m−1 1⊤ 2m−1 Gm−1 Gm−1  (∈{0, 1}m×2m) (8) if m > 1, and G1 .= [0 1] otherwise (notation zd indicates a vector in Rd). Theorem 2 ϕe, ϕr are proportionate iff the optima p∗(z) and q∗(z) to eqs (3) and (4) satisfy: p∗(z) ∈ ∂Lr(z) , (9) Gmq∗(z) ∈ ∂Le(z) . (10) If ϕe, ϕr are differentiable and strictly convex, they are proportionate iff p∗(z) = Gmq∗(z). We can alleviate the fact that convexity is strict, which results in a set-valued identity for ϕe, ϕr to be proportionate. This gives a necessary and sufficient condition for two generators to be proportionate. It does not say how to construct one from the other, if possible. We now show that it is indeed possible and prune the search space: if ϕe is proportionate to some ϕr, then it has to be a “symmetrized” version of ϕr, according to the following definition. Definition 3 Let ϕr s.t. domϕr ⊇(0, 1). ϕs(r)(z) .= ϕr(z) + ϕr(1 −z) is the symmetrisation of ϕr. Lemma 4 If ϕe and ϕr are proportionate, then ϕe(z) = (µr/µe) · ϕs(r)(z) + (b/µe) (b is in (7)). 3 # ℓe(z, µe) ℓr(z, µr) ϕr(z) µe and µr ae I P i∈[m] log (1 + exp (ze i )) P I⊆[m] exp (zr I) z log z −z ∀µe = µr µe II P i∈[m] (1 + ze i )2 −(EI [−zr I] −µr · VI [−zr I]) (1/2) · z2 ∀µe = µr µe/4 III P i∈[m] max {0, ze i } max  0, maxI⊆[m]{zr I} χ[0,1](z) ∀µe, µr µe IV P i ze i EI [zr I] χ[ 1 2m , 1 2](z) ∀µe, µr µe Table 1: Examples of equivalent example and rado losses. Names of the rado-losses ℓr(z, µr) are respectively the Exponential (I), Mean-variance (II), ReLU (III) and Unhinged (IV) rado loss. We use shorthands ze i .= −(1/µe) · zi and zr I .= −(1/µr) · P i∈I zi. Parameter ae appears in eq. (14). Column “µe and µr” gives the constraints for the equivalence to hold. EI and VI are the expectation and variance over uniform sampling in sets I ⊆[m] (see text for details). To summarize, ϕe and ϕr are proportionate iff (i) they meet the structural property that ϕe is (proportional to) the symmetrized version of ϕr (according to Definition 3), and (ii) the optimal solutions p∗(z) and q∗(z) to problems (1) and (2) satisfy the conditions of Theorem 2. Depending on the direction, we have two cases to craft proportionate generators. First, if we have ϕr, then necessarily ϕe ∝ϕs(r) so we merely have to check Theorem 2. Second, if we have ϕe, then it matches Definition 31. In this case, we have to find ϕr = f + g where g(z) = −g(1 −z) and ϕe(z) = f(z) + f(1 −z). We now come back to Le(z), Lr(z) (Definition 1), and make the connection with example and rado losses. In the next definition, an e-loss ℓe(z) is a function defined over the coordinates of z, and a r-loss ℓr(z) is a function defined over the subsets of sums of coordinates. Functions can depend on other parameters as well. Definition 5 Suppose e-loss ℓe(z) and r-loss ℓr(z) are such that there exist (i) fe : R →R and fr(z) : R →R both strictly increasing and such that ∀z ∈Rm, −Le(z) = fe (ℓe(z)) , (11) −Lr(z) = fr (ℓr(z)) , (12) where Le(z) and Lr(z) are defined via two proportionate generators ϕe and ϕr (Definition 1). Then the couple (ℓe, ℓr) is called a couple of equivalent example-rado losses. Following is the main Theorem of this Section, which summarizes all the cases of equivalence between example and rado losses, and shows that the theory developed on example / rado losses with proportionate generators encompasses the specific proofs and cases already known [Nock et al., 2015, Patrini et al., 2016]. Table 1 also displays generator ϕr. Theorem 6 In each row of Table 1, ℓe(z, µe) and ℓr(z, µr) are equivalent for µe and µr as indicated. The proof (SM, Subsection 2.3) details for each case the proportionate generators ϕe and ϕr. 3 Learning with (rado) regularized losses We now detail further the learning setting. In the preceeding Section, we have definef zi(h) .= yh(xi), which we plug in the losses of Table 1 to obtain the corresponding example and rado losses. Losses simplify conveniently when H consists of linear classifiers, h(x) .= θ⊤x for some θ ∈Θ ⊆Rd. In this case, the example loss can be described using edge vectors Se .= {yi · xi, i = 1, 2, ..., m} since zi = θ⊤(yi·xi), and the rado loss can be described using rademacher observations [Nock et al., 2015], since P i∈I zi = θ⊤πσ for σi = yi iff i ∈I (and −yi otherwise) and πσ .= (1/2) · P i(σi + yi) · xi. Let us define S∗ r .= {πσ, σ ∈Σm} the set of all rademacher observations. We rewrite any couple of equivalent example and rado losses as ℓe(Se, θ) and ℓr(S∗ r , θ) respectively2, omitting parameters µe and µr, assumed to be fixed beforehand for the equivalence to hold (see Table 1). Let us regularize the example loss, so that the learner’s goal is to minimize ℓe(Se, θ, Ω) .= ℓe(Se, θ) + Ω(θ) , (13) 1Alternatively, −ϕe is permissible [Kearns and Mansour, 1999]. 2To prevent notational overload, we blend notions of (pointwise) loss and (samplewise) risk, as just “losses”. 4 Algorithm 1 Ω-R.ADABOOST Input set of rados Sr .= {π1, π2, ..., πn}; T ∈N∗; parameters γ ∈(0, 1), ω ∈R+; Step 1 : let θ0 ←0, w0 ←(1/n)1 ; Step 2 : for t = 1, 2, ..., T Step 2.1 : call the weak learner: (ι(t), rt) ←Ω-WL(Sr, wt, γ, ω, θt−1); Step 2.2 : compute update parameters αι(t) and δt (here, π∗k .= maxj |πjk|): αι(t) ←(1/(2π∗ι(t))) log((1 + rt)/(1 −rt)) and δt ←ω · (Ω(θt) −Ω(θt−1)) ; (16) Step 2.3 : update and normalize weights: for j = 1, 2, ..., n, wtj ← w(t−1)j · exp −αtπjι(t) + δt  /Zt ; (17) Return θT ; with Ωa regularizer [Bach et al., 2011]. The following shows that when fe in eq. (11) is linear, there is a rado-loss equivalent to this regularized loss, regardless of Ω. Theorem 7 Suppose H contains linear classifiers. Let (ℓe(Se, θ), ℓr(S∗ r , θ)) be any couple of equivalent example-rado losses such that fe in eq. (11) is linear: fe(z) = ae · z + be , (14) for some ae > 0, be ∈R. Then for any regularizer Ω(.) (assuming wlog Ω(0) = 0), the regularized example loss ℓe(Se, θ, Ω) is equivalent to rado loss ℓr(S∗,Ω,θ r , θ) computed over regularized rados: S∗,Ω,θ r .= S∗ r ⊕{−˜Ω(θ) · θ} , (15) Here, ⊕is Minkowski sum and ˜Ω(θ) .= ae · Ω(θ)/∥θ∥2 2 if θ ̸= 0 (and 0 otherwise). Theorem 7 applies to all rado losses (I-IV) in Table 1. The effect of regularization on rados is intuitive from the margin standpoint: assume that a “good” classifier θ is one that ensures lowerbounded inner products θ⊤z ≥τ for some margin threshold τ. Then any good classifier on a regularized rado πσ shall actually meet, over examples, P i:yi=σi θ⊤(yi · xi) ≥τ + ae · Ω(θ). This inequality ties an "accuracy" of θ (edges, left hand-side) and its sparsity (right-hand side). Clearly, Theorem 7 has an unfamiliar shape since regularisation modifies data in the rado world: a different θ, or a different Ω, yields a different S∗,Ω,θ r , and therefore it may seem very tricky to minimize such a regularized loss. Even more, iterative algorithms like boosting algorithms look at first glance a poor choice, since any update on θ implies an update on the rados as well. What we show in the following Section is essentially the opposite for the exponential rado loss, and a generalization of the RADOBOOST algorithm of Nock et al. [2015], which does not modify rados, is a formal boosting algorithm for a broad set of regularizers. Also, remarkably, only the high-level code of the weak learner depends on the regularizer; that of the strong learner is not affected. 4 Boosting with (rado) regularized losses Ω-R.ADABOOST presents our approach to learning with rados regularized with regularizer Ωto minimise loss ℓexp r (Sr, θ, Ω) in eq. (45). Classifier θt is defined as θt .= Pt t′=1 αι(t′) · 1ι(t′), where 1k is the kth canonical basis vector. The expected edge rt used to compute αt in eq. (16) is based on the following basis assignation: rι(t) ← 1 π∗ι(t) n X j=1 wtjπjι(t) (∈[−1, 1]) . (19) The computation of rt is eventually tweaked by the weak learner, as displayed in Algorithm ΩWL. We investigate four choices for Ω. For each of them, we prove the boosting ability of ΩR.ADABOOST (Γ is symmetric positive definite, Sd is the symmetric group of order d, |θ| is the 5 Algorithm 2 Ω-WL, for Ω∈{∥.∥1, ∥.∥2 Γ, ∥.∥∞, ∥.∥Φ} Input set of rados Sr .= {π1, π2, ..., πn}; weights w ∈△n; parameters γ ∈(0, 1), ω ∈R+; classifier θ ∈Rd; Step 1 : pick weak feature ι∗∈[d]; Optional — use preference order: ι ⪰ι′ ⇔|rι| −δι ≥|rι′| −δι′ // δι .= ω · (Ω(θ + αι · 1ι) −Ω(θ)), rι is given in (19) and αι is given in (16) Step 2 : if Ω= ∥.∥2 Γ then r∗ ←  rι∗ if rι∗∈[−γ, γ] sign (rι∗) · γ otherwise ; (18) else r∗←rι∗; Return (ι∗, r∗); vector whose coordinates are the absolute values of the coordinates of θ): Ω(θ) =      ∥θ∥1 .= |θ|⊤1 Lasso ∥θ∥2 Γ .= θ⊤Γθ Ridge ∥θ∥∞ .= maxk |θk| ℓ∞ ∥θ∥Φ .= maxM∈Sd(M|θ|)⊤ξ SLOPE (20) [Bach et al., 2011, Bogdan et al., 2015, Duchi and Singer, 2009, Su and Candès, 2015]. The coordinates of ξ in SLOPE are ξk .= Φ−1(1 −kq/(2d)) where Φ−1(.) is the quantile of the standard normal distribution and q ∈(0, 1); thus, the largest coordinates (in absolute value) of θ are more penalized. We now establish the boosting ability of Ω-R.ADABOOST. We give no direction for Step 1 in Ω-WL, which is consistent with the definition of a weak learner in the boosting theory: all we require from the weak learner is |r.| no smaller than some weak learning threshold γWL > 0. Definition 8 Fix any constant γWL ∈(0, 1). Ω-WL is said to be a γWL-Weak Learner iff the feature ι(t) it picks at iteration t satisfies |rι(t)| ≥γWL, for any t = 1, 2, ..., T. We also provide an optional step for the weak learner in Ω-WL, which we exploit in the experimentations, which gives a total preference order on features to optimise further Ω-R.ADABOOST. Theorem 9 (boosting with ridge). Take Ω(.) = ∥.∥2 Γ. Fix any 0 < a < 1/5, and suppose that ω and the number of iterations T of Ω-R.ADABOOST are chosen so that ω < (2a min k max j π2 jk)/(TλΓ) , (21) where λΓ > 0 is the largest eigenvalue of Γ. Then there exists some γ > 0 (depending on a, and given to Ω-WL) such that for any fixed 0 < γWL < γ, if Ω-WL is a γWL-Weak Learner, then Ω-R.ADABOOST returns at the end of the T boosting iterations a classifier θT which meets: ℓexp r (Sr, θT , ∥.∥2 Γ) ≤ exp(−aγ2 WLT/2) . (22) Furthermore, if we fix a = 1/7, then we can fix γ = 0.98, and if a = 1/10, then we can fix γ = 0.999. Two remarks are in order. First, the cases a = 1/7, 1/10 show that Ω-WL can still obtain large edges in eq. (19), so even a “strong” weak learner might fit in for Ω-WL, without clamping edges. Second, the right-hand side of ineq. (21) may be very large if we consider that mink maxj π2 jk may be proportional to m2. So the constraint on ω is in fact loose. Theorem 10 (boosting with lasso or ℓ∞). Take Ω(.) ∈{∥.∥1, ∥.∥∞}. Suppose Ω-WL is a γWL-Weak Learner for some γWL > 0. Suppose ∃0 < a < 3/11 s. t. ω satisfies: ω = aγWL min k max j |πjk| . (23) Then Ω-R.ADABOOST returns at the end of the T boosting iterations a classifier θT which meets: ℓexp r (Sr, θT , Ω) ≤ exp(−˜Tγ2 WL/2) , (24) 6 where ˜T = aγWLT if Ω= ∥.∥1, and ˜T = (T −T∗) + aγWL · T∗if Ω= ∥.∥∞; T∗is the number of iterations where the feature computing the ℓ∞norm was updated3. We finally investigate the SLOPE choice. The Theorem is proven for ω = 1 in Ω-R.ADABOOST, for two reasons: it matches the original definition [Bogdan et al., 2015] and furthermore it unveils an interesting connection between boosting and SLOPE properties. Theorem 11 (boosting with SLOPE). Take Ω(.) = ∥.∥Φ. Let a .= min{3γWL/11, Φ−1(1 − q/(2d))/ mink maxj |πjk|}. Suppose wlog |θT k| ≥|θT (k+1)|, ∀k, and fix ω = 1. Suppose (i) Ω-WL is a γWL-Weak Learner for some γWL > 0, and (ii) the q-value is chosen to meet: q ≥2 · max k  1 −Φ 3γWL 11 · max j |πjk|  k d  . Then classifier θT returned by Ω-R.ADABOOST at the end of the T boosting iterations satisfies: ℓexp r (Sr, θT , ∥.∥Φ) ≤ exp(−aγ2 WLT/2) . (25) Constraint (ii) on q is interesting in the light of the properties of SLOPE [Su and Candès, 2015]. Modulo some assumptions, SLOPE yields a control the false discovery rate (FDR) — i.e., negligible coefficients in the "true” linear model θ∗that are found significant in the learned θ —. Constraint (ii) links the "small” achievable FDR (upperbounded by q) to the "boostability” of the data: the fact that each feature k can be chosen by the weak learner for a "large” γWL, or has maxj |πjk| large, precisely flags potential significant features, thus reducing the risk of sparsity errors, and allowing small q, which is constraint (ii). Using the second order approximation of normal quantiles [Su and Candès, 2015], a sufficient condition for (ii) is that, for some K > 0, γWL min j max j |πjk| ≥ K · p log d + log q−1 ; (26) but minj maxj |πjk| is proportional to m, so ineq. (26), and thus (ii), may hold even for small samples and q-values. An additional Theorem deferred to SM sor space considerations shows that for any applicable choice of regularization (eq. 20), the regularized log-loss of θT over examples enjoys with high probability a monotonically decreasing upperbound with T as: ℓlog e (Se, θ, Ω) ≤ log 2 −κ · T + τ(m), with τ(m) →0 when m →∞(and τ does not depend on T), and κ > 0 does not depend on T. Hence, Ω-R.ADABOOST is an efficient proxy to boost the regularized log-loss over examples, using whichever of the ridge, lasso, ℓ∞or SLOPE regularization — establishing the first boosting algorithm for this choice —, or linear combinations of the choices, e.g. for elastic nets. If we were to compare Theorems 9 – 11 (eqs (22, 24, 25)), then the convergence looks best for ridge (the unsigned exponent is ˜O(γ2 WL)) while it looks slightly worse for ℓ∞and SLOPE (the unsigned exponent is now ˜O(γ3 WL)), the lasso being in between. 5 Experiments We have implemented Ω-WL4 using the order suggested to retrieve the topmost feature in the order. Hence, the weak learner returns the feature maximising |rι| −δι. The rationale for this comes from the proofs of Theorems 9 — 11, showing that Q t exp(−(r2 ι(t)/2 −δι(t))) is an upperbound on the exponential regularized rado-loss. We do not clamp the weak learner for Ω(.) = ∥.∥2 Γ, so the weak learner is restricted to Step 1 in Ω-WL5. The objective of these experiments is to evaluate Ω-R.ADABOOST as a contender for supervised learning per se. We compared Ω-R.ADABOOST to ADABOOST/ℓ1 regularized-ADABOOST [Schapire and Singer, 1999, Xi et al., 2009]. All algorithms are run for a total of T = 1000 iterations, and at the end of the iterations, the classifier in the sequence that minimizes the empirical loss is kept. Notice therefore that rado-based classifiers are evaluated on the training set which computes the 3If several features match this criterion, T∗is the total number of iterations for all these features. 4Code available at: http://users.cecs.anu.edu.au/∼rnock/ 5the values for ω that we test, in {10−u, u ∈{0, 1, 2, 3, 4, 5}}, are small with respect to the upperbound in ineq. (21) given the number of boosting steps (T = 1000), and would yield on most domains a maximal γ ≈1. 7 rados. To obtain very sparse solutions for regularized-ADABOOST, we pick its ω (β in [Xi et al., 2009]) in {10−4, 1, 104}. The complete results aggregate experiments on twenty (20) domains, all but one coming from the UCI [Bache and Lichman, 2013] (plus the Kaggle competition domain “Give me some credit”), with up to d =500+ features and m =100 000+ examples. Two tables, in the SM (Tables 1 and 2 in Section 3) report respectively the test errors and sparsity of classifiers, whose summary is given here in Table 2. The experimental setup is a ten-folds stratified cross validation for all algorithms and each domain. ADABOOST/regularized-ADABOOST is trained using the complete training fold. When the domain size m ≤40000, the number of rados n used for Ω-R.ADABOOST is a random subset of rados of size equal to that of the training fold. When the domain size exceeds 40000, a random set of n = 10000 rados is computed from the training fold. Thus, (i) there is no optimisation of the examples chosen to compute rados, (ii) we always keep a very small number of rados compared to the maximum available, and (iii) when the domain size gets large, we keep a comparatively tiny number of rados. Hence, the performances of Ω-R.ADABOOST do not stem from any optimization in the choice or size of the rado sample. Ada ∅ ∥.∥2 Id ∥.∥1 ∥.∥∞ ∥.∥Φ Ada 11 10 10 8 9 ∅ 9 3 3 2 1 ∥.∥2 Id 10 17 11 9 7 ∥.∥1 10 17 7 7 4 ∥.∥∞ 11 18 9 9 8 ∥.∥Φ 10 19 10 10 11 Table 2: Number of domains for which algorithm in row beats algorithm in column (Ada = best result of ADABOOST, ∅= Ω-R.ADABOOST not regularized, see text). Experiments support several key observations. First, regularization consistently reduces the test error of Ω-R.ADABOOST, by more than 15% on Magic, and 20% on Kaggle. In Table 2, Ω-R.ADABOOST unregularized ("∅") is virtually always beaten by its SLOPE regularized version. Second, Ω-R.ADABOOST is able to obtain both very sparse and accurate classifiers (Magic, Hardware, Marketing, Kaggle). Third, Ω-R.ADABOOST competes or beats ADABOOST on all domains, and is all the better as the domain gets bigger. Even qualitatively as seen in Table 2, the best result obtained by ADABOOST (regularized or not) does not manage to beat any of the regularized versions of Ω-R.ADABOOST on the majority of the domains. Fourth, it is important to have several choices of regularizers at hand. On domain Statlog, the difference in test error between the worst and the best regularization of Ω-R.ADABOOST exceeds 15%. Fifth, as already remarked [Nock et al., 2015], significantly subsampling rados (e.g. Marketing, Kaggle) still yields very accurate classifiers. Sixth, regularization in Ω-R.ADABOOST successfully reduces sparsity to learn more accurate classifiers on several domains (Spectf, Transfusion, Hill-noise, Winered, Magic, Marketing), achieving efficient adaptive sparsity control. Last, the comparatively extremely poor results of ADABOOST on the biggest domains seems to come from another advantage of rados that the theory developed so far does not take into account: on domains for which some features are significantly correlated with the class and for which we have a large number of examples, the concentration of the expected feature value in rados seems to provide leveraging coefficients that tend to have much larger (absolute) value than in ADABOOST, making the convergence of Ω-R.ADABOOST significantly faster than ADABOOST. For example, we have checked that it takes much more than the T = 1000 iterations for ADABOOST to start converging to the results of regularized Ω-R.ADABOOST on Hardware or Kaggle. 6 Conclusion We have shown that the recent equivalences between two example and rado losses can be unified and generalized via a principled representation of a loss function in a two-player zero-sum game. Furthermore, we have shown that this equivalence extends to regularized losses, where the regularization in the rado loss is performed over the rados themselves with Minkowski sums. Our theory and experiments on Ω-R.ADABOOST with prominent regularizers (including ridge, lasso, ℓ∞, SLOPE) indicate that when such a simple regularized form of the rado loss is available, it may help to devise accurate and efficient workarounds to boost a regularized loss over examples via the rado loss, even when the regularizer is significantly more involved like e.g. for group norms [Bach et al., 2011]. Acknowledgments Thanks are due to Stephen Hardy and Giorgio Patrini for stimulating discussions around this material. 8 References F. Bach, R. Jenatton, J. Mairal, and G. Obozinski. Optimization with sparsity-inducing penalties. Foundations and Trends in Machine Learning, 4:1–106, 2011. K. Bache and M. Lichman. UCI machine learning repository, 2013. M Bogdan, E. van den Berg, C. Sabatti, W. Su, and E.-J. Candès. SLOPE – adaptive variable selection via convex optimization. Annals of Applied Statistics, 2015. Also arXiv:1310.1969v2. J.-C. Duchi and Y. Singer. Efficient learning using forward-backward splitting. In NIPS*22, pages 495–503, 2009. C. Gentile and M. Warmuth. Linear hinge loss and average margin. In NIPS*11, pages 225–231, 1998. M.J. Kearns and Y. Mansour. On the boosting ability of top-down decision tree learning algorithms. J. Comp. Syst. Sc., 58:109–128, 1999. V. Nair and G. Hinton. Rectified linear units improve restricted boltzmann machines. In 27th ICML, pages 807–814, 2010. R. Nock and F. Nielsen. On the efficient minimization of classification-calibrated surrogates. In NIPS*21, pages 1201–1208, 2008. R. Nock, G. Patrini, and A Friedman. Rademacher observations, private data, and boosting. In 32nd ICML, pages 948–956, 2015. G. Patrini, R. Nock, S. Hardy, and T. Caetano. Fast learning from distributed datasets without entity matching. In 26 th IJCAI, 2016. M.-D. Reid, R.-M. Frongillo, R.-C. Williamson, and N.-A. Mehta. Generalized mixability via entropic duality. In 28th COLT, pages 1501–1522, 2015. R.-E. Schapire. The boosting approach to machine learning: An overview. In D.-D. Denison, M.-H. Hansen, C.-C. Holmes, B. Mallick, and B. Yu, editors, Nonlinear Estimation and Classification, volume 171 of Lecture Notes in Statistics, pages 149–171. Springer Verlag, 2003. R. E. Schapire and Y. Singer. Improved boosting algorithms using confidence-rated predictions. MLJ, 37:297–336, 1999. W. Su and E.-J. Candès. SLOPE is adaptive to unkown sparsity and asymptotically minimax. CoRR, abs/1503.08393, 2015. M. Telgarsky. A primal-dual convergence analysis of boosting. JMLR, 13:561–606, 2012. B. van Rooyen, A. Menon, and R.-C. Williamson. Learning with symmetric label noise: The importance of being unhinged. In NIPS*28, 2015. V. Vapnik. Statistical Learning Theory. John Wiley, 1998. Y.-T. Xi, Z.-J. Xiang, P.-J. Ramadge, and R.-E. Schapire. Speed and sparsity of regularized boosting. In 12th AISTATS, pages 615–622, 2009. H. Zou and T. Hastie. Regularization and variable selection via the elastic net. Journal of the Royal Statistical Society B, 67:301–321, 2005. 9
2016
356
6,279
A scalable end-to-end Gaussian process adapter for irregularly sampled time series classification Steven Cheng-Xian Li Benjamin Marlin College of Information and Computer Sciences University of Massachusetts Amherst Amherst, MA 01003 {cxl,marlin}@cs.umass.edu Abstract We present a general framework for classification of sparse and irregularly-sampled time series. The properties of such time series can result in substantial uncertainty about the values of the underlying temporal processes, while making the data difficult to deal with using standard classification methods that assume fixeddimensional feature spaces. To address these challenges, we propose an uncertaintyaware classification framework based on a special computational layer we refer to as the Gaussian process adapter that can connect irregularly sampled time series data to any black-box classifier learnable using gradient descent. We show how to scale up the required computations based on combining the structured kernel interpolation framework and the Lanczos approximation method, and how to discriminatively train the Gaussian process adapter in combination with a number of classifiers end-to-end using backpropagation. 1 Introduction In this paper, we propose a general framework for classification of sparse and irregularly-sampled time series. An irregularly-sampled time series is a sequence of samples with irregular intervals between their observation times. These intervals can be large when the time series are also sparsely sampled. Such time series data are studied in various areas including climate science [22], ecology [4], biology [18], medicine [15] and astronomy [21]. Classification in this setting is challenging both because the data cases are not naturally defined in a fixed-dimensional feature space due to irregular sampling and variable numbers of samples, and because there can be substantial uncertainty about the underlying temporal processes due to the sparsity of observations. Recently, Li and Marlin [13] introduced the mixture of expected Gaussian kernels (MEG) framework, an uncertainty-aware kernel for classifying sparse and irregularly sampled time series. Classification with MEG kernels is shown to outperform models that ignore uncertainty due to sparse and irregular sampling. On the other hand, various deep learning models including convolutional neural networks [12] have been successfully applied to fields such as computer vision and natural language processing, and have been shown to achieve state-of-the-art results on various tasks. Some of these models have desirable properties for time series classification, but cannot be directly applied to sparse and irregularly sampled time series. Inspired by the MEG kernel, we propose an uncertainty-aware classification framework that enables learning black-box classification models from sparse and irregularly sampled time series data. This framework is based on the use of a computational layer that we refer to as the Gaussian process (GP) adapter. The GP adapter uses Gaussian process regression to transform the irregular time series data into a uniform representation, allowing sparse and irregularly sampled data to be fed into any black-box classifier learnable using gradient descent while preserving uncertainty. However, the 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. O(n3) time and O(n2) space of exact GP regression makes the GP adapter prohibitively expensive when scaling up to large time series. To address this problem, we show how to speed up the key computation of sampling from a GP posterior based on combining the structured kernel interpolation (SKI) framework that was recently proposed by Wilson and Nickisch [25] with Lanczos methods for approximating matrix functions [3]. Using the proposed sampling algorithm, the GP adapter can run in linear time and space in terms of the length of the time series, and O(m log m) time when m inducing points are used. We also show that GP adapter can be trained end-to-end together with the parameters of the chosen classifier by backpropagation through the iterative Lanczos method. We present results using logistic regression, fully-connected feedforward networks, convolutional neural networks and the MEG kernel. We show that end-to-end discriminative training of the GP adapter outperforms a variety of baselines in terms of classification performance, including models based only on GP mean interpolation, or with GP regression trained separately using marginal likelihood. 2 Gaussian processes for sparse and irregularly-sampled time series Our focus in this paper is on time series classification in the presence of sparse and irregular sampling. In this problem, the data D contain N independent tuples consisting of a time series Si and a label yi. Thus, D = {(S1, y1), . . . , (SN, yN)}. Each time series Si is represented as a list of time points ti = [ti1, . . . , ti|Si|]⊤, and a list of corresponding values vi = [vi1, . . . , vi|Si|]⊤. We assume that each time series is observed over a common time interval [0, T]. However, different time series are not necessarily observed at the same time points (i.e. ti ̸= tj in general). This implies that the number of observations in different time series is not necessary the same (i.e. |Si| ̸= |Sj| in general). Furthermore, the time intervals between observation within a single time series are not assumed to be uniform. Learning in this setting is challenging because the data cases are not naturally defined in a fixeddimensional feature space due to the irregular sampling. This means that commonly used classifiers that take fixed-length feature vectors as input are not applicable. In addition, there can be substantial uncertainty about the underlying temporal processes due to the sparsity of observations. To address these challenges, we build on ideas from the MEG kernel [13] by using GP regression [17] to provide an uncertainty-aware representation of sparse and irregularly sampled time series. We fix a set of reference time points x = [x1, . . . , xd]⊤and represent a time series S = (t, v) in terms of its posterior marginal distribution at these time points. We use GP regression with a zero-mean GP prior and a covariance function k(·, ·) parameterized by kernel hyperparameters η. Let σ2 be the independent noise variance of the GP regression model. The GP parameters are θ = (η, σ2). Under this model, the marginal posterior GP at x is Gaussian distributed with the mean and covariance given by µ = Kx,t(Kt,t + σ2I)−1v, (1) Σ = Kx,x −Kx,t(Kt,t + σ2I)−1Kt,x (2) where Kx,t denotes the covariance matrix with [Kx,t]ij = k(xi, tj). We note that it takes O(n3+nd) time to exactly compute the posterior mean µ, and O(n3 + n2d + nd2) time to exactly compute the full posterior covariance matrix Σ, where n = |t| and d = |x|. 3 The GP adapter and uncertainty-aware time series classification In this section we describe our framework for time series classification in the presence of sparse and irregular sampling. Our framework enables any black-box classifier learnable by gradient-based methods to be applied to the problem of classifying sparse and irregularly sampled time series. 3.1 Classification frameworks and the Gaussian process adapter In Section 2 we described how we can represent a time series through the marginal posterior it induces under a Gaussian process regression model at any set of reference time points x. By fixing a common 2 set of reference time points x for all time series in a data set, every time series can be transformed into a common representation in the form of a multivariate Gaussian N(z|µ, Σ; θ) with z being the random vector distributed according to the posterior GP marginalized over the time points x.1 Here we assume that the GP parameters θ are shared across the entire data set. If the z values were observed, we could simply apply a black-box classifier. A classifier can be generally defined by a mapping function f(z; w) parameterized by w, associated with a loss function ℓ(f(z; w), y) where y is a label value from the output space Y. However, in our case z is a Gaussian random variable, which means ℓ(f(z; w), y) is now itself a random variable given a label y. Therefore, we use the expectation Ez∼N (µ,Σ;θ)  ℓ(f(z; w), y)  as the overall loss between the label y and a time series S given its Gaussian representation N(µ, Σ; θ). The learning problem becomes minimizing the expected loss over the entire data set: w∗, θ∗= argmin w,θ N X i=1 Ezi∼N (µi,Σi;θ)  ℓ(f(zi; w), yi)  . (3) Once we have the optimal parameters w∗and θ∗, we can make predictions on unseen data. In general, given an unseen time series S and its Gaussian representation N(µ, Σ; θ∗), we can predict its label using (4), although in many cases this can be simplified into a function of f(z; w∗) with the expectation taken on or inside of f(z; w∗). y∗= argmin y∈Y Ez∼N (µ,Σ;θ∗)  ℓ(f(z; w∗), y)  (4) We name the above approach the Uncertainty-Aware Classification (UAC) framework. Importantly, this framework propagates the uncertainty in the GP posterior induced by each time series all the way through to the loss function. Besides, we call the transformation S 7→(µ, Σ) the Gaussian process adapter, since it provides a uniform representation to connect the raw irregularly sampled time series data to a black-box classifier. Variations of the UAC framework can be derived by taking the expectation at various position of f(z; w) where z ∼N(µ, Σ; θ). Taking the expectation at an earlier stage simplifies the computation, but the uncertainty information will be integrated out earlier as well.2 In the extreme case, if the expectation is computed immediately followed by the GP adapter transformation, it is equivalent to using a plug-in estimate µ for z in the loss function, ℓ(f(Ez∼N (µ,Σ;θ)[z]; w), y) = ℓ(f(µ; w), y). We refer to this as the IMPutation (IMP) framework. The IMP framework discards the uncertainty information completely, which further simplifies the computation. This simplified variation may be useful when the time series are more densely sampled, where the uncertainty is less of a concern. In practice, we can train the model using the UAC objective (3) and predict instead by IMP. In that case, the predictions would be deterministic and can be computed efficiently without drawing samples from the posterior GP as described later in Section 4. 3.2 Learning with the GP adapter In the previous section, we showed that the UAC framework can be trained using (3). In this paper, we use stochastic gradient descent to scalably optimize (3) by updating the model using a single time series at a time, although it can be easily modified for batch or mini-batch updates. From now on, we will focus on the optimization problem minw,θ Ez∼N (µ,Σ;θ)  ℓ(f(z; w), y)  where µ, Σ are the output of the GP adapter given a time series S = (t, v) and its label y. For many classifiers, the expected loss Ez∼N (µ,Σ;θ)  ℓ(f(z; w), y)  cannot be analytically computed. In such cases, we use the Monte Carlo average to approximate the expected loss: Ez∼N (µ,Σ;θ)  ℓ(f(z; w), y)  ≈1 S S X s=1 ℓ(f(zs; w), y), where zs ∼N(µ, Σ; θ). (5) To learn the parameters of both the classifier w and the Gaussian process regression model θ jointly under the expected loss, we need to be able to compute the gradient of the expectation given in (5). 1 The notation N(µ, Σ; θ) explicitly expresses that both µ and Σ are functions of the GP parameters θ. Besides, they are also functions of S = (t, v) as shown in (1) and (2). 2 For example, the loss of the expected output of the classifier ℓ(Ez∼N (µ,Σ;θ)[f(z; w)], y). 3 To achieve this, we reparameterize the Gaussian random variable using the identity z = µ + Rξ where ξ ∼N(0, I) and R satisfies Σ = RR⊤[11]. The gradients under this reparameterization are given below, both of which can be approximated using Monte Carlo sampling as in (5). We will focus on efficiently computing the gradient shown in (7) since we assume that the gradient of the base classifier f(z; w) can be computed efficiently. ∂ ∂wEz∼N (µ,Σ;θ)  ℓ(f(z; w), y)  = Eξ∼N (0,I)  ∂ ∂wℓ(f(z; w), y)  (6) ∂ ∂θ Ez∼N (µ,Σ;θ)  ℓ(f(z; w), y)  = Eξ∼N (0,I) "X i ∂ℓ(f(z; w), y) ∂zi ∂zi ∂θ # (7) There are several choices for R that satisfy Σ = RR⊤. One common choice of R is the Cholesky factor, a lower triangular matrix, which can be computed using Cholesky decomposition in O(d3) for a d × d covariance matrix Σ [7]. We instead use the symmetric matrix square root R = Σ 1/2. We will show that this particular choice of R leads to an efficient and scalable approximation algorithm in Section 4.2. 4 Fast sampling from posterior Gaussian processes The computation required by the GP adapter is dominated by the time needed to draw samples from the marginal GP posterior using z = µ + Σ 1/2ξ. In Section 2 we noted that the time complexity of exactly computing the posterior mean µ and covariance Σ is O(n3 + nd) and O(n3 + n2d + nd2), respectively. Once we have both µ and Σ we still need to compute the square root of Σ, which requires an additional O(d3) time to compute exactly. In this section, we show how to efficiently generate samples of z. 4.1 Structured kernel interpolation for approximating GP posterior means The main idea of the structured kernel interpolation (SKI) framework recently proposed by Wilson and Nickisch [25] is to approximate a stationary kernel matrix Ka,b by the approximate kernel eKa,b defined below where u = [u1, . . . , um]⊤is a collection of evenly-spaced inducing points. Ka,b ≈eKa,b = WaKu,uW⊤ b . (8) Letting p = |a| and q = |b|, Wa ∈Rp×m is a sparse interpolation matrix where each row contains only a small number of non-zero entries. We use local cubic convolution interpolation (cubic interpolation for short) [10] as suggested in Wilson and Nickisch [25]. Each row of the interpolation matrices Wa, Wb has at most four non-zero entries. Wilson and Nickisch [25] showed that when the kernel is locally smooth (under the resolution of u), cubic interpolation results in accurate approximation. This can be justified as follows: with cubic interpolation, the SKI kernel is essentially the two-dimensional cubic interpolation of Ka,b using the exact regularly spaced samples stored in Ku,u, which corresponds to classical bicubic convolution. In fact, we can show that eKa,b asymptotically converges to Ka,b as m increases by following the derivation in Keys [10]. Plugging the SKI kernel into (1), the posterior GP mean evaluated at x can be approximated by µ = Kx,t Kt,t + σ2I −1 v ≈WxKu,uW⊤ t WtK−1 u,uW⊤ t + σ2I −1 v. (9) The inducing points u are chosen to be evenly-spaced because Ku,u forms a symmetric Toeplitz matrix under a stationary covariance function. A symmetric Toeplitz matrix can be embedded into a circulant matrix to perform matrix vector multiplication using fast Fourier transforms [7]. Further, one can use the conjugate gradient method to solve for (WtK−1 u,uW⊤ t +σ2I)−1v which only involves computing the matrix-vector product (WtK−1 u,uW⊤ t + σ2I)v. In practice, the conjugate gradient method converges within only a few iterations. Therefore, approximating the posterior mean µ using SKI takes only O(n+d+m log m) time to compute. In addition, since a symmetric Toeplitz matrix Ku,u can be uniquely characterized by its first column, and Wt can be stored as a sparse matrix, approximating µ requires only O(n + d + m) space. 4 Algorithm 1: Lanczos method for approximating Σ 1/2ξ Input: covariance matrix Σ, dimension of the Krylov subspace k, random vector ξ β1 = 0 and d0 = 0 d1 = ξ/∥ξ∥ for j = 1 to k do d = Σdj −βjdj−1 αj = d⊤ j d d = d −αjdj βj+1 = ∥d∥ dj+1 = d/βj+1 D = [d1, . . . , dk] H = tridiagonal(β, α, β) return ∥ξ∥DH 1/2e1 // e1 = [1, 0, . . . , 0]⊤ H = tridiagonal(β, α, β) =   α1 β2 β2 α2 β3 β3 α3 ... ... ... βk βk αk   4.2 The Lanczos method for covariance square root-vector products With the SKI techniques, although we can efficiently approximate the posterior mean µ, computing Σ 1/2ξ is still challenging. If computed exactly, it takes O(n3 + n2d + nd2) time to compute Σ and O(d3) time to take the square root. To overcome the bottleneck, we apply the SKI kernel to the Lanczos method, one of the Krylov subspace approximation methods, to speed up the computation of Σ 1/2ξ as shown in Algorithm 1. The advantage of the Lanczos method is that neither Σ nor Σ 1/2 needs to be computed explicitly. Like the conjugate gradient method, another example of the Krylov subspace method, it only requires the computation of matrix-vector products with Σ as the matrix. The idea of the Lanczos method is to approximate Σ 1/2ξ in the Krylov subspace Kk(Σ, ξ) = span{ξ, Σξ, . . . , Σk−1ξ}. The iteration in Algorithm 1, usually referred to the Lanczos process, essentially performs the Gram-Schmidt process to transform the basis {ξ, Σξ, . . . , Σk−1ξ} into an orthonormal basis {d1, . . . , dk} for the subspace Kk(Σ, ξ). The optimal approximation of Σ 1/2ξ in the Krylov subspace Kk(Σ, ξ) that minimizes the ℓ2-norm of the error is the orthogonal projection of Σ 1/2ξ onto Kk(Σ, ξ) as y∗= DD⊤Σ 1/2ξ. Since we choose d1 = ξ/∥ξ∥, the optimal projection can be written as y∗= ∥ξ∥DD⊤Σ 1/2De1 where e1 = [1, 0, . . . , 0]⊤is the first column of the identify matrix. One can show that the tridiagonal matrix H defined in Algorithm 1 satisfies D⊤ΣD = H [20]. Also, we have D⊤Σ 1/2D ≈(D⊤ΣD) 1/2 since the eigenvalues of H approximate the extremal eigenvalues of Σ [19]. Therefore we have y∗= ∥ξ∥DD⊤Σ 1/2De1 ≈∥ξ∥DH 1/2e1. The error bound of the Lanczos method is analyzed in Ili´c et al. [9]. Alternatively one can show that the Lanczos approximation converges superlinearly [16]. In practice, for a d × d covariance matrix Σ, the approximation is sufficient for our sampling purpose with k ≪d. As H is now a k × k matrix, we can use any standard method to compute its square root in O(k3) time [2], which is considered O(1) when k is chosen to be a small constant. Now the computation of the Lanczos method for approximating Σ 1/2ξ is dominated by the matrix-vector product Σd during the Lanczos process. Here we apply the SKI kernel trick again to efficiently approximate Σd by Σd ≈WxKu,uW⊤ x d −WxKu,uW⊤ t WtKu,uW⊤ t + σ2I −1 WtKu,uW⊤ x d. (10) Similar to the posterior mean, Σd can be approximated in O(n + d + m log m) time and linear space. Therefore, for k = O(1) basis vectors, the entire Algorithm 1 takes O(n + d + m log m) time and O(n + d + m) space, which is also the complexity to draw a sample from the posterior GP. To reduce the variance when estimating the expected loss (5), we can draw multiple samples from the posterior GP: {Σ 1/2ξs}s=1,...,S where ξs ∼N(0, I). Since all of the samples are associated with the same covariance matrix Σ, we can use the block Lanczos process [8], an extension to the single-vector Lanczos method presented in Algorithm 1, to simultaneously approximate Σ 1/2Ξ for all S random 5 vectors Ξ = [ξ1, . . . , ξS]. Similarly, during the block Lanczos process, we use the block conjugate gradient method [6, 5] to simultaneously solve the linear equation (WtKu,uW⊤ t + σ2I)−1α for multiple α. 5 End-to-end learning with the GP adapter The most common way to train GP parameters is through maximizing the marginal likelihood [17] log p(v|t, θ) = −1 2v⊤Kt,t + σ2I −1 v −1 2 log Kt,t + σ2I −n 2 log 2π. (11) If we follow this criterion, training the UAC framework becomes a two-stage procedure: first we learn GP parameters by maximizing the marginal likelihood. We then compute µ and Σ given each time series S and the learned GP parameters θ∗. Both µ and Σ are then fixed and used to train the classifier using (6). In this section, we describe how to instead train the GP parameters discriminatively end-to-end using backpropagation. As mentioned in Section 3, we train the UAC framework by jointly optimizing the GP parameters θ and the parameters of the classifier w according to (6) and (7). The most challenging part in (7) is to compute ∂z = ∂µ + ∂(Σ 1/2ξ).3 For ∂µ, we can derive the gradient of the approximating posterior mean (9) as given in Appendix A. Note that the gradient ∂µ can be approximated efficiently by repeatedly applying fast Fourier transforms and the conjugate gradient method in the same time and space complexity as computing (9). On the other hand, ∂(Σ 1/2ξ) can be approximated by backpropagating through the Lanczos method described in Algorithm 1. To carry out backpropagation, all operations in the Lanczos method must be differentiable. For the approximation of Σd during the Lanczos process, we can similarly compute the gradient of (10) efficiently using the SKI techniques as in computing ∂µ (see Appendix A). The gradient ∂H 1/2 for the last step of Algorithm 1 can be derived as follows. From H = H 1/2H 1/2, we have ∂H = (∂H 1/2)H 1/2 + H 1/2(∂H 1/2). This is known as the Sylvester equation, which has the form of AX + XB = C where A, B, C are matrices and X is the unknown matrix to solve for. We can compute the gradient ∂H 1/2 by solving the Sylvester equation using the Bartels-Stewart algorithm [1] in O(k3) time for a k × k matrix H, which is considered O(1) for a small constant k. Overall, training the GP adapter using stochastic optimization with the aforementioned approach takes O(n + d + m log m) time and O(n + d + m) space for m inducing points, n observations in the time series, and d features generated by the GP adapter. 6 Related work The recently proposed mixtures of expected Gaussian kernels (MEG) [13] for classification of irregular time series is probably the closest work to ours. The random feature representation of the MEG kernel is in the form of p 2/m Ez∼N (µ,Σ)  cos(w⊤ i z + bi)  , which the algorithm described in Section 4 can be applied to directly. However, by exploiting the spectral property of Gaussian kernels, the expected random feature of the MEG kernel is shown to be analytically computable by p 2/m exp(−w⊤ i Σwi/2) cos(w⊤ i µ+bi). With the SKI techniques, we can efficiently approximate both w⊤ i Σwi and w⊤ i µ in the same time and space complexity as the GP adapter. Moreover, the random features of the MEG kernel can be viewed as a stochastic layer in the classification network, with no trainable parameters. All {wi, bi}i=1,...,m are randomly initialized once in the beginning and associated with the output of the GP adapter in a nonlinear way described above. Moreover, the MEG kernel classification is originally a two-stage method: one first estimates the GP parameters by maximizing the marginal likelihood and then uses the optimized GP parameters to compute the MEG kernel for classification. Since the random feature is differentiable, with the approximation of ∂µ and ∂(Σd) described in Section 5, we can form a similar classification network that can be efficiently trained end-to-end using the GP adapter. In Section 7.2, we will show that training the MEG kernel end-to-end leads to better classification performance. 3 For brevity, we drop 1/∂θ from the gradient notation in this section. 6 3 4 5 6 7 8 9 10 log2(# inducing points) 10−3 10−2 10−1 100 101 error 0 5 10 15 20 # Lanczos iterations 10−3 10−2 10−1 100 error length of time series: 1000 2000 3000 5 10 15 20 25 30 length of time series (×100) 100 101 102 103 time (log scale) exact exact BP Lanczos Lanczos BP Figure 1: Left: Sample approximation error versus the number of inducing points. Middle: Sample approximation error versus the number of Lanczos iterations. Right: Running time comparisons (in seconds). BP denotes computing the gradient of the sample using backpropagation. 7 Experiments In this section, we present experiments and results exploring several facets of the GP adapter framework including the quality of the approximations and the classification performance of the framework when combined with different base classifiers. 7.1 Quality of GP sampling approximations The key to scalable learning with the GP adapter relies on both fast and accurate approximation for drawing samples from the posterior GP. To assess the approximation quality, we first generate a synthetic sparse and irregularly-sampled time series S by sampling from a zero-mean Gaussian process at random time points. We use the squared exponential kernel k(ti, tj) = a exp(−b(ti −tj)2) with randomly chosen hyperparameters. We then infer µ and Σ at some reference x given S. Let ez denote our approximation of z = µ + Σ 1/2ξ. In this experiment, we set the output size z to be |S|, that is, d = n. We evaluate the approximation quality by assessing the error ∥ez −z∥computed with a fixed random vector ξ. The leftmost plot in Figure 1 shows the approximation error under different numbers of inducing points m with k = 10 Lanczos iterations. The middle plot compares the approximation error as the number of Lanczos iterations k varies, with m = 256 inducing points. These two plots show that the approximation error drops as more inducing points and Lanczos iterations are used. In both plots, the three lines correspond to different sizes for z: 1000 (bottom line), 2000 (middle line), 3000 (top line). The separation between the curves is due to the fact that the errors are compared under the same number of inducing points. Longer time series leads to lower resolution of the inducing points and hence the higher approximation error. Note that the approximation error comes from both the cubic interpolation and the Lanczos method. Therefore, to achieve a certain normalized approximation error across different data sizes, we should simultaneously use more inducing points and Lanczos iterations as the data grows. In practice, we find that k ≥3 is sufficient for estimating the expected loss for classification. The rightmost plot in Figure 1 compares the time to draw a sample using exact computation versus the approximation method described in Section 4 (exact and Lanczos in the figure). We also compare the time to compute the gradient with respect to the GP parameters by both the exact method and the proposed approximation (exact BP and Lanczos BP in the figure) because this is the actual computation carried out during training. In this part of the experiment, we use k = 10 and m = 256. The plot shows that Lanczos approximation with the SKI kernel yields speed-ups of between 1 and 3 orders of magnitude. Interestingly, for the exact approach, the time for computing the gradient roughly doubles the time of drawing samples. (Note that time is plotted in log scale.) This is because computing gradients requires both forward and backward propagation, whereas drawing samples corresponds to only the forward pass. Both the forward and backward passes take roughly the same computation in the exact case. However, the gap is relatively larger for the approximation approach due to the recursive relationship of the variables in the Lanczos process. In particular, dj is defined recursively in terms of all of d1, . . . , dj−1, which makes the backpropagation computation more complicated than the forward pass. 7 Table 1: Comparison of classification accuracy (in percent). IMP and UAC refer to the loss functions for training described in Section 3.1, and we use IMP predictions throughout. Although not belonging to the UAC framework, we put the MEG kernel in UAC since it is also uncertainty-aware. LogReg MLP ConvNet MEG kernel Marginal likelihood IMP 77.90 85.49 87.61 – UAC 78.23 87.05 88.17 84.82 End-to-end IMP 79.12 86.49 89.84 – UAC 79.24 87.95 91.41 86.61 7.2 Classification with GP adapter In this section, we evaluate the performance of classifying sparse and irregularly-sampled time series using the UAC framework. We test the framework on the uWave data set,4 a collection of gesture samples categorized into eight gesture patterns [14]. The data set has been split into 3582 training instances and 896 test instances. Each time series contains 945 fully observed samples. Following the data preparation procedure in the MEG kernel work [13], we randomly sample 10% of the observations from each time series to simulate the sparse and irregular sampling scenario. In this experiment, we use the squared exponential covariance function k(ti, tj) = a exp(−b(ti −tj)2) for a, b > 0. Together with the independent noise parameter σ2 > 0, the GP parameters are {a, b, σ2}. To bypass the positive constraints on the GP parameters, we reparameterize them by {α, β, γ} such that a = eα, b = eβ, and σ2 = eγ. To demonstrate that the GP adapter is capable of working with various classifiers, we use the UAC framework to train three different classifiers: a multi-class logistic regression (LogReg), a fullyconnected feedforward network (MLP), and a convolutional neural network (ConvNet). The detailed architecture of each model is described in Appendix C. We use m = 256 inducing points, d = 254 features output by the GP adapter, k = 5 Lanczos iterations, and S = 10 samples. We split the training set into two partitions: 70% for training and 30% for validation. We jointly train the classifier with the GP adapter using stochastic gradient descent with Nesterov momentum. We apply early stopping based on the validation set. We also compare to classification with the MEG kernel implemented using our GP adapter as described in Section 6. We use 1000 random features trained with multi-class logistic regression. Table 1 shows that among all three classifiers, training GP parameters discriminatively always leads to better accuracy than maximizing the marginal likelihood. This claim also holds for the results using the MEG kernel. Further, taking the uncertainty into account by sampling from the posterior GP always outperforms training using only the posterior means. Finally, we can also see that the classification accuracy improves as the model gets deeper. 8 Conclusions and future work We have presented a general framework for classifying sparse and irregularly-sampled time series and have shown how to scale up the required computations using a new approach to generating approximate samples. We have validated the approximation quality, the computational speed-ups, and the benefit of the proposed approach relative to existing baselines. There are many promising directions for future work including investigating more complicated covariance functions like the spectral mixture kernel [24], different classifiers including the encoder LSTM [23], and extending the framework to multi-dimensional time series and GPs with multidimensional index sets (e.g., for spatial data). Lastly, the GP adapter can also be applied to other problems such as dimensionality reduction by combining it with an autoencoder. Acknowledgements This work was supported by the National Science Foundation under Grant No. 1350522. 4 The data set UWaveGestureLibraryAll is available at http://timeseriesclassification.com. 8 References [1] Richard H. Bartels and GW Stewart. Solution of the matrix equation AX + XB = C. Communications of the ACM, 15(9):820–826, 1972. [2] Åke Björck and Sven Hammarling. A Schur method for the square root of a matrix. Linear algebra and its applications, 52:127–140, 1983. [3] Edmond Chow and Yousef Saad. Preconditioned krylov subspace methods for sampling multivariate gaussian distributions. SIAM Journal on Scientific Computing, 36(2):A588–A608, 2014. [4] J.S. Clark and O.N. Bjørnstad. Population time series: process variability, observation errors, missing values, lags, and hidden states. Ecology, 85(11):3140–3150, 2004. [5] Augustin A Dubrulle. Retooling the method of block conjugate gradients. Electronic Transactions on Numerical Analysis, 12:216–233, 2001. [6] YT Feng, DRJ Owen, and D Peri´c. A block conjugate gradient method applied to linear systems with multiple right-hand sides. Computer methods in applied mechanics and engineering, 1995. [7] Gene H Golub and Charles F Van Loan. Matrix computations, volume 3. JHU Press, 2012. [8] Gene Howard Golub and Richard Underwood. The block Lanczos method for computing eigenvalues. Mathematical software, 3:361–377, 1977. [9] M Ili´c, Ian W Turner, and Daniel P Simpson. A restarted Lanczos approximation to functions of a symmetric matrix. IMA journal of numerical analysis, page drp003, 2009. [10] Robert G Keys. Cubic convolution interpolation for digital image processing. Acoustics, Speech and Signal Processing, IEEE Transactions on, 29(6):1153–1160, 1981. [11] Diederik P Kingma and Max Welling. Auto-encoding variational bayes. Proceedings of the 2nd International Conference on Learning Representations (ICLR), 2014. [12] Yann LeCun, Fu Jie Huang, and Leon Bottou. Learning methods for generic object recognition with invariance to pose and lighting. In Proceedings of Computer Vision and Pattern Recognition (CVPR), 2004. [13] Steven Cheng-Xian Li and Benjmain M. Marlin. Classification of sparse and irregularly sampled time series with mixtures of expected Gaussian kernels and random features. In 31st Conference on Uncertainty in Artificial Intelligence, 2015. [14] Jiayang Liu, Lin Zhong, Jehan Wickramasuriya, and Venu Vasudevan. uwave: Accelerometer-based personalized gesture recognition and its applications. Pervasive and Mobile Computing, 2009. [15] Benjamin M. Marlin, David C. Kale, Robinder G. Khemani, and Randall C. Wetzel. Unsupervised pattern discovery in electronic health care data using probabilistic clustering models. In Proceedings of the 2nd ACM SIGHIT International Health Informatics Symposium, pages 389–398, 2012. [16] Beresford N Parlett. The symmetric eigenvalue problem, volume 7. SIAM, 1980. [17] Carl Edward Rasmussen. Gaussian processes for machine learning. 2006. [18] T. Ruf. The lomb-scargle periodogram in biological rhythm research: analysis of incomplete and unequally spaced time-series. Biological Rhythm Research, 30(2):178–201, 1999. [19] Yousef Saad. On the rates of convergence of the Lanczos and the block-Lanczos methods. SIAM Journal on Numerical Analysis, 17(5):687–706, 1980. [20] Yousef Saad. Iterative methods for sparse linear systems. Siam, 2003. [21] Jeffrey D Scargle. Studies in astronomical time series analysis. ii-statistical aspects of spectral analysis of unevenly spaced data. The Astrophysical Journal, 263:835–853, 1982. [22] M. Schulz and K. Stattegger. Spectrum: Spectral analysis of unevenly spaced paleoclimatic time series. Computers & Geosciences, 23(9):929–945, 1997. [23] Ilya Sutskever, Oriol Vinyals, and Quoc V Le. Sequence to sequence learning with neural networks. In Advances in neural information processing systems, pages 3104–3112, 2014. [24] Andrew Gordon Wilson and Ryan Prescott Adams. Gaussian process kernels for pattern discovery and extrapolation. In Proceedings of the 30th International Conference on Machine Learning, 2013. [25] Andrew Gordon Wilson and Hannes Nickisch. Kernel interpolation for scalable structured Gaussian processes (KISS-GP). In Proceedings of the 32nd International Conference on Machine Learning, 2015. 9
2016
357
6,280
x2 x1 0 0.2 0.4 0.6 0.8 1 0 10 20 30 40 50 F−Score OKM OKM* OKM*+LPE OKM*+NPE 0 0.2 0.4 0.6 0.8 1 0 20 40 60 80 100 F−Score OKM* OKM*+LPE OKM*+NPE
2016
358
6,281
Equality of Opportunity in Supervised Learning Moritz Hardt Google m@mrtz.org Eric Price∗ UT Austin ecprice@cs.utexas.edu Nathan Srebro TTI-Chicago nati@ttic.edu Abstract We propose a criterion for discrimination against a specified sensitive attribute in supervised learning, where the goal is to predict some target based on available features. Assuming data about the predictor, target, and membership in the protected group are available, we show how to optimally adjust any learned predictor so as to remove discrimination according to our definition. Our framework also improves incentives by shifting the cost of poor classification from disadvantaged groups to the decision maker, who can respond by improving the classification accuracy. We enourage readers to consult the more complete manuscript on the arXiv. 1 Introduction As machine learning increasingly affects decisions in domains protected by anti-discrimination law, there is much interest in algorithmically measuring and ensuring fairness in machine learning. In domains such as advertising, credit, employment, education, and criminal justice, machine learning could help obtain more accurate predictions, but its effect on existing biases is not well understood. Although reliance on data and quantitative measures can help quantify and eliminate existing biases, some scholars caution that algorithms can also introduce new biases or perpetuate existing ones [1]. In May 2014, the Obama Administration’s Big Data Working Group released a report [2] arguing that discrimination can sometimes “be the inadvertent outcome of the way big data technologies are structured and used” and pointed toward “the potential of encoding discrimination in automated decisions”. A subsequent White House report [3] calls for “equal opportunity by design” as a guiding principle in domains such as credit scoring. Despite the demand, a vetted methodology for avoiding discrimination against protected attributes in machine learning is lacking. A naïve approach might require that the algorithm should ignore all protected attributes such as race, color, religion, gender, disability, or family status. However, this idea of “fairness through unawareness” is ineffective due to the existence of redundant encodings, ways of predicting protected attributes from other features [4]. Another common conception of non-discrimination is demographic parity [e.g. 5, 6, 7]. Demographic parity requires that a decision—such as accepting or denying a loan application—be independent of the protected attribute. Through its various equivalent formalizations this idea appears in numerous papers. Unfortunately, the notion is seriously flawed on two counts [8]. First, it doesn’t ensure fairness. The notion permits that we accept the qualified applicants in one demographic, but random individuals in another, so long as the percentages of acceptance match. This behavior can arise naturally, when there is little or no training data available for one of the demographics. Second, demographic parity often cripples the utility that we might hope to achieve, especially in the common scenario in which an outcome to be predicated, e.g. whether the loan be will defaulted, is correlated with the protected attribute. Demographic parity would not allow the ideal prediction, namely giving loans exactly to those who won’t default. As a result, the loss in utility of introducing demographic parity can be substantial. ∗Work partially performed while at OpenAI. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. In this paper, we consider non-discrimination from the perspective of supervised learning, where the goal is to predict a true outcome Y from features X based on labeled training data, while ensuring the prediction is “non-discriminatory” with respect to a specified protected attribute A. The main question here, for which we suggest an answer, is what does it mean for such a prediction to be non-discriminatory. As in the usual supervised learning setting, we assume that we have access to labeled training data, in our case indicating also the protected attribute A. That is, to samples from the joint distribution of (X, A, Y ). This data is used to construct a (possibly randomized) predictor ˆY (X) or ˆY (X, A), and we also use such labeled data to test for non-discriminatory. The notion we propose is “oblivious”, in that it is based only on the joint distribution, or joint statistics, of the true target Y , the predictions ˆY , and the protected attribute A. In particular, it does not evaluate the features in X nor the functional form of the predictor ˆY (X) nor how it was derived. This matches other tests recently proposed and conducted, including demographic parity and different analyses of common risk scores. In many cases, only oblivious analysis is possible as the functional form of the score and underlying training data are not public. The only information about the score is the score itself, which can then be correlated with the target and protected attribute. Furthermore, even if the features or the functional form are available, going beyond oblivious analysis essentially requires subjective interpretation or casual assumptions about specific features, which we aim to avoid. In a recent concurrent work, Kleinberg, Mullainathan and Raghavan [9] showed that the only way for a meaningful score that is calibrated within each group to satisfy a criterion equivalent to equalized odds is for the score to be a perfectly accurate predictor. This result highlights a contrast between equalized odds and other desirable properties of a score, as well the relationship between nondiscrimination and accuracy, which we also discuss. Contributions We propose a simple, interpretable, and easily checkable notion of nondiscrimination with respect to a specified protected attributes. We argue that, unlike demographic parity, our notion provides a meaningful measure of discrimination, while allowing for higher utility. Unlike demographic parity, our notion always allows for the perfectly accurate solution of bY = Y. More broadly, our criterion is easier to achieve the more accurate the predictor bY is, aligning fairness with the central goal in supervised learning of building more accurate predictors. Our notion is actionable, in that we give a simple and effective framework for constructing classifiers satisfying our criterion from an arbitrary learned predictor. Our notion can also be viewed as shifting the burden of uncertainty in classification from the protected class to the decision maker. In doing so, our notion helps to incentivize the collection of better features, that depend more directly on the target rather then the protected attribute, and of data that allows better prediction for all protected classes. In an updated and expanded paper, arXiv:1610.02413, we also capture the inherent limitations of our approach, as well as any other oblivious approach, through a non-identifiability result showing that different dependency structures with possibly different intuitive notions of fairness cannot be separated based on any oblivious notion or test. We strongly encourage readers to consult arXiv:1610.02413 instead of this shortened presentation. 2 Equalized odds and equal opportunity We now formally introduce our first criterion. Definition 2.1 (Equalized odds). We say that a predictor bY satisfies equalized odds with respect to protected attribute A and outcome Y, if bY and A are independent conditional on Y. Unlike demographic parity, equalized odds allows bY to depend on A but only through the target variable Y. This encourages the use of features that relate to Y directly, not through A. As stated, equalized odds applies to targets and protected attributes taking values in any space, including discrete and continuous spaces. But in much of our presentation we focus on binary targets Y, bY and protected attributes A, in which case equalized odds is equivalent to: Pr n bY = 1 | A = 0, Y = y o = Pr n bY = 1 | A = 1, Y = y o , y ∈{0, 1} (2.1) 2 For the outcome y = 1, the constraint requires that bY has equal true positive rates across the two demographics A = 0 and A = 1. For y = 0, the constraint equalizes false positive rates. Equalized odds thus enforces both equal bias and equal accuracy in all demographics, punishing models that perform well only on the majority. Equal opportunity In the binary case, we often think of the outcome Y = 1 as the “advantaged” outcome, such as “not defaulting on a loan”, “admission to a college” or “receiving a promotion”. A possible relaxation of equalized odds is to require non-discrimination only within the “advantaged” outcome group. That is, to require that people who pay back their loan, have an equal opportunity of getting the loan in the first place (without specifying any requirement for those that will ultimately default). This leads to a relaxation of our notion that we call “equal opportunity”. Definition 2.2 (Equal opportunity). We say that a binary predictor bY satisfies equal opportunity with respect to A and Y if Pr{bY = 1 | A = 0, Y = 1} = Pr{bY = 1 | A = 1, Y = 1} . Equal opportunity is a weaker, though still interesting, notion of non-discrimination, and can thus allows for better utility. Real-valued scores Even if the target is binary, a real-valued predictive score R = f(X, A) is often used (e.g. FICO scores for predicting loan default), with the interpretation that higher values of R correspond to greater likelihood of Y = 1 and thus a bias toward predicting bY = 1. A binary classifier bY can be obtained by thresholding the score, i.e. setting bY = I{R > t} for some threshold t. Varying this threshold changes the trade-off between sensitivity and specificity. Our definition for equalized odds can be applied also to score functions: a score R satisfies equalized odds if R is independent of A given Y . If a score obeys equalized odds, then any thresholding bY = I{R > t} of it also obeys equalized odds In Section 3, we will consider scores that might not satisfy equalized odds, and see how equalized odds predictors can be derived from them by using different (possibly randomized) thresholds depending on the value of A. Oblivious measures Our notions of non-discrimination are oblivious in the following formal sense: Definition 2.3. A property of a predictor bY or score R is said to be oblivious if it only depends on the joint distribution of (Y, A, bY ) or (Y, A, R), respectively. As a consequence of being oblivious, all the information we need to verify our definitions is contained in the joint distribution of predictor, protected group and outcome, (bY , A, Y ). In the binary case, when A and Y are reasonably well balanced, the joint distribution of (bY , A, Y ) is determined by 8 parameters that can be estimated to very high accuracy from samples. We will therefore ignore the effect of finite sampling and instead assume that we know the joint distribution of (bY , A, Y ). 3 Achieving non-discrimination We now explain how to obtain an equalized odds or equal opportunity predictor eY from a, possibly discriminatory, learned binary predictor bY or score R. We envision that bY or R are whatever comes out of the existing training pipeline for the problem at hand. Importantly, we do not require changing the training process, as this might introduce additional complexity, but rather only a post-learning step. Instead, we will construct a non-discriminating predictor which is derived from bY or R: Definition 3.1 (Derived predictor). A predictor eY is derived from a random variable R and the protected attribute A if it is a possibly randomized function of the random variables (R, A) alone. In particular, eY is independent of X conditional on (R, A). The definition asks that the value of a derived predictor eY should only depend on R and the protected attribute, though it may introduce additional randomness. But the formulation of eY (that is, the function applied to the values of R and A), depends on information about the joint distribution of (R, A, Y ). In other words, this joint distribution (or an empirical estimate of it) is required at training time in order to construct the predictor eY , but at prediction time we only have access to values of (R, A). No further data about the underlying features X, nor their distribution, is required. 3 0.0 0.2 0.4 0.6 0.8 1.0 Pr[eY = 1 | A, Y = 0] 0.0 0.2 0.4 0.6 0.8 1.0 Pr[eY = 1 | A, Y = 1] For equal odds, result lies below all ROC curves. Achievable region (A=0) Achievable region (A=1) Overlap Result for eY = bY Result for eY = 1 −bY Equal-odds optimum Equal opportunity (A=0) Equal opportunity (A=1) 0.0 0.2 0.4 0.6 0.8 1.0 Pr[eY = 1 | A, Y = 0] 0.0 0.2 0.4 0.6 0.8 1.0 Pr[eY = 1 | A, Y = 1] For equal opportunity, results lie on the same horizontal line Figure 1: Finding the optimal equalized odds predictor (left), and equal opportunity predictor (right). Loss minimization. It is always easy to construct a trivial predictor satisfying equalized odds, by making decisions independent of X, A and R. For example, using the constant predictor bY = 0 or bY = 1. The goal, of course, is to obtain a good predictor satisfying the condition. To quantify the notion of “good”, we consider a loss function ℓ: {0, 1}2 →R that takes a pair of labels and returns a real number ℓ(by, y) ∈R which indicates the loss (or cost, or undesirability) of predicting by when the correct label is y. Our goal is then to design derived predictors eY that minimize the expected loss Eℓ(eY , Y ) subject to one of our definitions. 3.1 Deriving from a binary predictor In designing a derived predictor from binary bY and A we can only set four parameters: the conditional probabilities pya = Pr{eY = 1 | bY = a, A = a}. These four parameters, p = (p00, p01, p10, p11), together specify the derived predictor eYp. To check whether eYp satisfies equalized odds we need to verify the two equalities specified by (2.1), for both values of y. To this end, we denote γa(eY ) def =  Pr{eY = 1 | A = a, Y = 0}, Pr{eY = 1 | A = a, Y = 1}  . (3.1) The components of γa(eY ) are the false positive rate and the true positive rate within the demographic A = a. Following (2.1), eY satisfies equalized odds iff γ0(eY ) = γ1(eY ). But γa(eYp) is just a linear function of p, with coefficients determined by the joint distribution of (Y, bY , A). Since the expected loss Eℓ(eYp, Y ) is also linear in p, we have that the optimal derived predictor can be obtained as a solution to the following linear program with four variables and two equality constraints: min p Eℓ(eYp, Y ) (3.2) s.t. γ0(eYp) = γ1(eYp) (3.3) ∀y,a0 ⩽pya ⩽1 (3.4) To better understand this linear program, let us understand the range of values γa(eYp) can take: Claim 3.2. {γa(eYp) | 0 ⩽p ⩽1} = Pa(bY ) def = convhull n (0, 0), γa(bY )γa(1 −bY ), (1, 1) o These polytopes are visualized in Figure 1. Since each γa(eYp), for each demographic A = a, depends on two different coordinates of p, the choice of γ0 ∈P0 and γ1 ∈P1 is independent. Requiring γ0(eYp) = γ1(eYp) then restricts us exactly to the intersection P0 ∩P1, and this intersection exactly specifies the range of possible tradeoffs between the false-positive-rate and true-positive-rate for derived predictors eY (see Figure 1). Solving the linear program (3.2) amounts to finding the tradeoff in P0 ∩P1 that optimizes the expected loss. For equalized opportunity, we only require the first components of γ agree, removing one of the equality constraints from the linear program. Now, any γ0 ∈P0 and γ1 ∈P1 that are on the same horizontal line are feasible. 3.2 Deriving from a score function A “protected attribute blind” way of deriving a binary predictor from a score R would be to threshold it, i.e. using bY = I{R > t}. If R satisfied equalized odds, then so will such a predictor, and the 4 optimal threshold should be chosen to balance false and true positive rates so as to minimize the expected loss. When R does not already satisfy equalized odds, we might need to use different thresholds for different values of A (different protected groups), i.e. ˜Y = I{R > tA}. As we will see, even this might not be sufficient, and we might need to introduce randomness also here. Central to our study is the ROC (Receiver Operator Characteristic) curve of the score, which captures the false positive and true positive (equivalently, false negative) rates at different thresholds. These are curves in a two dimensional plane, where the horizontal axes is the false positive rate of a predictor and the vertical axes is the true positive rate. As discussed in the previous section, equalized odds can be stated as requiring the true positive and false positive rates, (Pr{bY = 1 | Y = 0, A = a}, Pr{bY = 1 | Y = 1, A = a}), agree between different values of a of the protected attribute. That is, that for all values of the protected attribute, the conditional behavior of the predictor is at exactly the same point in this space. We will therefor consider the A-conditional ROC curves Ca(t) def =  Pr{ bR > t | A = a, Y = 0}, Pr{ bR > t | A = a, Y = 1}  . Since the ROC curves exactly specify the conditional distributions R|A, Y , a score function obeys equalized odds if and only if the ROC curves for all values of the protected attribute agree, that is Ca(t) = Ca′(t) for all values of a and t. In this case, any thresholding of R yields an equalized odds predictor (all protected groups are at the same point on the curve, and the same point in false/true-positive plane). When the ROC curves do not agree, we might choose different thresholds ta for the different protected groups. This yields different points on each A-conditional ROC curve. For the resulting predictor to satisfy equalized odds, these must be at the same point in the false/true-positive plane. This is possible only at points where all A-conditional ROC curves intersect. But the ROC curves might not all intersect except at the trivial endpoints, and even if they do, their point of intersection might represent a poor tradeoff between false positive and false negatives. As with the case of correcting a binary predictor, we can use randomization to fill the span of possible derived predictors and allow for significant intersection in the false/true-positive plane. In particular, for every protected group a, consider the convex hull of the image of the conditional ROC curve: Da def = convhull {Ca(t): t ∈[0, 1]} (3.5) The definition of Da is analogous to the polytope Pa in the previous section, except that here we do not consider points below the main diagonal (line from (0, 0) to (1, 1)), which are worse than “random guessing” and hence never desirable for any reasonable loss function. Deriving an optimal equalized odds threshold predictor. Any point in the convex hull Da represents the false/true positive rates, conditioned on A = a, of a randomized derived predictor based on R. In particular, since the space is only two-dimensional, such a predictor ˜Y can always be taken to be a mixture of two threshold predictors (corresponding to the convex hull of two points on the ROC curve). Conditional on A = a, the predictor ˜Y behaves as ˜Y = I{R > Ta} , where Ta is a randomized threshold assuming the value ta with probability pa and the value ta with probability pa. In other words, to construct an equalized odds predictor, we should choose a point in the intersection of these convex hulls, γ = (γ[0], γ[1]) ∈∩aDa, and then for each protected group realize the true/false-positive rates γ with a (possible randomized) predictor ˜Y |(A = a) = I{R > Ta} resulting in the predictor ˜Y = Pr I{R > TA}. For each group a, we either use a fixed threshold Ta = ta or a mixture of two thresholds ta < ta. In the latter case, if A = a and R < ta we always set ˜Y = 0, if R > ta we always set ˜Y = 1, but if ta < R < ta, we flip a coin and set ˜Y = 1 with probability pa. The feasible set of false/true positive rates of possible equalized odds predictors is thus the intersection of the areas under the A-conditional ROC curves, and above the main diagonal (see Figure 2). Since for any loss function the optimal false/true-positive rate will always be on the upper-left boundary of this feasible set, this is effectively the ROC curve of the equalized odds predictors. This ROC curve is the pointwise minimum of all A-conditional ROC curves. The performance of 5 0.0 0.2 0.4 0.6 0.8 1.0 Pr[eY = 1 | A, Y = 0] 0.0 0.2 0.4 0.6 0.8 1.0 Pr[eY = 1 | A, Y = 1] Within each group, max profit is a tangent of the ROC curve 0.0 0.2 0.4 0.6 0.8 1.0 Pr[eY = 1 | A, Y = 0] 0.0 0.2 0.4 0.6 0.8 1.0 Pr[eY = 1 | A, Y = 1] Equal odds makes the average vector tangent to the interior 0.0 0.2 0.4 0.6 0.8 1.0 Cost of best solution for given true positive rate 0.0 0.2 0.4 0.6 0.8 1.0 Pr[eY = 1 | A, Y = 1] Equal opportunity cost is convex function of TP rate A = 0 A = 1 Average Optimal Figure 2: Finding the optimal equalized odds threshold predictor (middle), and equal opportunity threshold predictor (right). For the equal opportunity predictor, within each group the cost for a given true positive rate is proportional to the horizontal gap between the ROC curve and the profit-maximizing tangent line (i.e., the two curves on the left plot), so it is a convex function of the true positive rate (right). This lets us optimize it efficiently with ternary search. an equalized odds predictor is thus determined by the minimum performance among all protected groups. Said differently, requiring equalized odds incentivizes the learner to build good predictors for all classes. For a given loss function, finding the optimal tradeoff amounts to optimizing (assuming w.l.o.g. ℓ(0, 0) = ℓ(1, 1) = 0): min ∀a: γ∈Da γ[0]ℓ(1, 0) + (1 −γ[1])ℓ(0, 1) (3.6) This is no longer a linear program, since Da are not polytopes, or at least are not specified as such. Nevertheless, (3.6) can be efficiently optimized numerically using ternary search. For an optimal equation opportunity derived predictor the construction is similar, except its sufficient to find points in Da that are on the same horizontal line. Assuming continuity of the conditional ROC curves, we can always take points on the ROC curve Ca itself and no randomization is necessary. 4 Bayes optimal predictors In this section, we develop the theory a theory for non-discriminating Bayes optimal classification. We will first show that a Bayes optimal equalized odds predictor can be obtained as an derived threshold predictor of the Bayes optimal regressor. Second, we quantify the loss of deriving an equalized odds predictor based on a regressor that deviates from the Bayes optimal regressor. This can be used to justify the approach of first training classifiers without any fairness constraint, and then deriving an equalized odds predictor in a second step. Definition 4.1 (Bayes optimal regressor). Given random variables (X, A) and a target variable Y, the Bayes optimal regressor is R = arg minr(x,a) E  (Y −r(X, A))2 = r∗(X, A) with r∗(x, a) = E[Y | X = x, A = a]. The Bayes optimal classifier, for any proper loss, is then a threshold predictor of R, where the threshold depends on the loss function (see, e.g., [10]). We will extend this result to the case where we additionally ask the classifier to satisfy an oblivious property: Proposition 4.2. For any source distribution over (Y, X, A) with Bayes optimal regressor R(X, A), any loss function, and any oblivious property C, there exists a predictor Y ∗(R, A) such that: 1. Y ∗is an optimal predictor satisfying C. That is, Eℓ(Y ∗, Y ) ⩽Eℓ(bY , Y ) for any predictor bY (X, A) which satisfies C. 2. Y ∗is derived from (R, A). Corollary 4.3 (Optimality characterization). An optimal equalized odds predictor can be derived from the Bayes optimal regressor R and the protected attribute A. The same is true for an optimal equal opportunity predictor. 6 We can furthermore show that if we can approximate the (unconstrained) Bayes optimal regressor well enough, then we can also construct a nearly optimal non-discriminating classifier: Definition 4.4. We define the conditional Kolmogorov distance between two random variables R, R′ ∈[0, 1] in the same probability space as A and Y as: dK(R, R′) def = max a,y∈{0,1} sup t∈[0,1] |Pr {R > t | A = a, Y = y} −Pr {R′ > t | A = a, Y = y}| . (4.1) Theorem 4.5 (Near optimality). Assume that ℓis a bounded loss function, and let bR ∈[0, 1] be an arbitrary random variable. Then, there is an optimal equalized odds predictor Y ∗and an equalized odds predictor bY derived from ( bR, A) such that Eℓ(bY , Y ) ⩽Eℓ(Y ∗, Y ) + 2 √ 2 · dK( bR, R∗) , where R∗is the Bayes optimal regressor. The same claim is true for equal opportunity. 5 Case study: FICO scores FICO scores are a proprietary classifier widely used in the United States to predict credit worthiness [11]. These scores, ranging from 300 to 850, try to predict credit risk; they form our score R. People were labeled as in default if they failed to pay a debt for at least 90 days on at least one account in the ensuing 18-24 month period; this gives an outcome Y . Our protected attribute A is race, which is restricted to four values: Asian, white non-Hispanic (labeled “white” in figures), Hispanic, and black. FICO scores are complicated proprietary classifiers based on features, like number of bank accounts kept, that could interact with culture and race. 300 400 500 600 700 800 FICO score 0 20 40 60 80 100 Non-default rate Non-default rate by FICO score Asian White Hispanic Black 300 400 500 600 700 800 900 FICO score 0.0 0.2 0.4 0.6 0.8 1.0 Fraction of group below CDF of FICO score by group Asian White Hispanic Black Figure 3: These two marginals, and the number of people per group, constitute our input data. To illustrate the effect of non-discrimination on utility we used a loss in which false positives (giving loans to people that default on any account) is 82/18 as expensive as false negatives (not giving a loan to people that don’t default). Given the marginal distributions for each group (Figure 3), we can then study the optimal profit-maximizing classifier under five different constraints on allowed predictors: • Max profit has no fairness constraints, and will pick for each group the threshold that maximizes profit. This is the score at which 82% of people in that group do not default. • Race blind requires the threshold to be the same for each group. Hence it will pick the single threshold at which 82% of people do not default overall. • Demographic parity picks for each group a threshold such that the fraction of group members that qualify for loans is the same. • Equal opportunity picks for each group a threshold such that the fraction of non-defaulting group members that qualify for loans is the same. • Equalized odds requires both the fraction of non-defaulters that qualify for loans and the fraction of defaulters that qualify for loans to be constant across groups. This might require randomizing between two thresholds for each group. Our proposed fairness definitions give thresholds between those of max-profit/race-blind thresholds and of demographic parity. Figure 4 shows the thresholds used by each predictor, and Figure 5 plots the ROC curves for each group, and the per-group false and true positive rates for each resulting predictor. Differences in the ROC curve indicate differences in predictive accuracy between groups (not differences in default rates), demonstrating that the majority (white) group is classified more accurately than other. 7 0 20 40 60 80 100 Within-group FICO score percentile Max profit Single threshold Opportunity Demography Equal odds FICO score thresholds (within-group) 300 400 500 600 700 800 FICO score Max profit Single threshold Opportunity Demography Equal odds FICO score thresholds (raw) Asian White Hispanic Black Figure 4: FICO thresholds for various definitions of fairness. The equal odds method does not give a single threshold, but instead Pr[bY = 1 | R, A] increases over some not uniquely defined range; we pick the one containing the fewest people. 0.0 0.2 0.4 0.6 0.8 1.0 Fraction defaulters getting loan 0.0 0.2 0.4 0.6 0.8 1.0 Fraction non-defaulters getting loan Per-group ROC curve classifying non-defaulters using FICO score Asian White Hispanic Black 0.00 0.05 0.10 0.15 0.20 0.25 Fraction defaulters getting loan 0.4 0.5 0.6 0.7 0.8 0.9 1.0 Fraction non-defaulters getting loan Zoomed in view Max profit Single threshold Opportunity Equal odds Figure 5: The ROC curve for using FICO score to identify non-defaulters. Within a group, we can achieve any convex combination of these outcomes. Equality of opportunity picks points along the same horizontal line. Equal odds picks a point below all lines. We can compute the profit achieved by each method, as a fraction of the max profit achievable. A race blind threshold gets 99.3% of the maximal profit, equal opportunity gets 92.8%, equalized odds gets 80.2%, and demographic parity only 69.8%. 6 Conclusions We proposed a fairness measure that accomplishes two important desiderata. First, it remedies the main conceptual shortcomings of demographic parity as a fairness notion. Second, it is fully aligned with the central goal of supervised machine learning, that is, to build higher accuracy classifiers. Our notion requires access to observed outcomes such as default rates in the loan setting. This is precisely the same requirement that supervised learning generally has. The broad success of supervised learning demonstrates that this requirement is met in many important applications. That said, having access to reliable “labeled data” is not always possible. Moreover, the measurement of the target variable might in itself be unreliable or biased. Domain-specific scrutiny is required in defining and collecting a reliable target variable. Requiring equalized odds creates an incentive structure for the entity building the predictor that aligns well with achieving fairness. Achieving better prediction with equalized odds requires collecting features that more directly capture the target, unrelated to its correlation with the protected attribute. An equalized odds predictor derived from a score depends on the pointwise minimum ROC curve among different protected groups, encouraging constructing of predictors that are accurate in all groups, e.g., by collecting data appropriately or basing prediction on features predictive in all groups. An important feature of our notion is that it can be achieved via a simple and efficient post-processing step. In fact, this step requires only aggregate information about the data and therefore could even be carried out in a privacy-preserving manner (formally, via Differential Privacy). 8 References [1] Solon Barocas and Andrew Selbst. Big data’s disparate impact. California Law Review, 104, 2016. [2] John Podesta, Penny Pritzker, Ernest J. Moniz, John Holdren, and Jefrey Zients. Big data: Seizing opportunities and preserving values. Executive Office of the President, May 2014. [3] Big data: A report on algorithmic systems, opportunity, and civil rights. Executive Office of the President, May 2016. [4] Dino Pedreshi, Salvatore Ruggieri, and Franco Turini. Discrimination-aware data mining. In Proc. 14th ACM SIGKDD, 2008. [5] T. Calders, F. Kamiran, and M. Pechenizkiy. Building classifiers with independency constraints. In In Proc. IEEE International Conference on Data Mining Workshops, pages 13–18, 2009. [6] Indre Zliobaite. On the relation between accuracy and fairness in binary classification. CoRR, abs/1505.05723, 2015. [7] Muhammad Bilal Zafar, Isabel Valera, Manuel Gomez Rodriguez, and Krishna P Gummadi. Learning fair classifiers. CoRR, abs:1507.05259, 2015. [8] Cynthia Dwork, Moritz Hardt, Toniann Pitassi, Omer Reingold, and Richard S. Zemel. Fairness through awareness. In Proc. ACM ITCS, pages 214–226, 2012. [9] Jon M. Kleinberg, Sendhil Mullainathan, and Manish Raghavan. Inherent trade-offs in the fair determination of risk scores. CoRR, abs/1609.05807, 2016. [10] Larry Wasserman. All of Statistics: A Concise Course in Statistical Inference. Springer, 2010. [11] US Federal Reserve. Report to the congress on credit scoring and its effects on the availability and affordability of credit, 2007. 9
2016
359
6,282
Optimal Sparse Linear Encoders and Sparse PCA Malik Magdon-Ismail Rensselaer Polytechnic Institute, Troy, NY 12211 magdon@cs.rpi.edu Christos Boutsidis New York, NY christos.boutsidis@gmail.com Abstract Principal components analysis (PCA) is the optimal linear encoder of data. Sparse linear encoders (e.g., sparse PCA) produce more interpretable features that can promote better generalization. (i) Given a level of sparsity, what is the best approximation to PCA? (ii) Are there efficient algorithms which can achieve this optimal combinatorial tradeoff? We answer both questions by providing the first polynomial-time algorithms to construct optimal sparse linear auto-encoders; additionally, we demonstrate the performance of our algorithms on real data. 1 Introduction The data matrix is X ∈Rn×d (a row xT i ∈R1×d is a data point in d dimensions). auto-encoders transform (encode) the data into a low dimensional feature space and then lift (decode) it back to the original space, reconstructing the data through a bottleneck. If the reconstruction is close to the original, then the encoder preserved most of the information using just a small number of features. Auto-encoders are important in machine learning because they perform information preserving dimension reduction. Our focus is the linear auto-encoder, which, for k < d, is a pair of linear mappings h : Rd 7→Rk and g : Rk 7→Rd, specified by an encoder matrix H ∈Rd×k and a decoder matrix G ∈Rk×d. For data point x ∈Rd, the encoded feature is z = h(x) = HTx ∈Rk and the reconstructed datum is ˆx = g(z) = GTz ∈Rd. The reconstructed data matrix is ˆX = XHG. The pair (H, G) is a good auto-encoder if ˆX ≈X under some loss metric (we use squared loss): Definition 1 (Loss ℓ(H, X)). The loss of encoder H is the minimum possible Frobenius reconstruction error (over all linear decoders G) when using H as encoder for X: ℓ(H, X) = minG∈Rk×d ∥X −XHG∥2 F = ∥X −XH(XH)†X∥ 2 F. The loss is defined for an encoder H alone, by choosing the decoder optimally. The literature considers primarily the symmetric auto-encoder which places the additional restriction that G = H† [18]. To get the most useful features, one should not place unnecessary constraints on the decoder. Principal Component Analysis (PCA) is the most famous linear auto-encoder, because it is optimal (and symmetric). Since rank(XHG) ≤k, the loss is bounded by ℓ(H, X) ≥∥X −Xk∥2 F (Xk is its best rank-k approximation to X). By the Eckart-Young theorem Xk = XVkVT k, where Vk ∈ Rd×k is the matrix whose columns are the top-k right singular vectors of X (see, for example, eChapter 9 of [14]). Thus, the optimal linear encoder is Hopt = Vk, and the top-k PCA-features are Zpca = XVk. Since its early beginings, [19], PCA has evolved into a classic tool for data analysis. While PCA simplifies the data by concentrating the maximum information into a few components, those components may be hard to interpret. In many applications, it is desirable to “explain” the features using a few original variables (for example, genes in a biological application or assets in a financial application). One trades off the fidelity of the features (their ability to reconstruct the data) with the interpretability of the features using a few original features (sparsity of the encoder H). We introduce a sparsity parameter r and require that every column of H have at most r non-zero elements. Every feature in an r-sparse encoding can be “explained” using at most r original features. We now formally state the sparse linear encoder problem: 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. Problem 1: Optimal r-sparse encoder (Sparse PCA) Given X ∈Rn×d, ε > 0 and k < rank(A), find an r-sparse encoder H with minimum r, for which the loss is a (1 + ǫ) relative approximation to the optimal loss, ℓ(H, X) = ∥X −XH(XH)†X∥ 2 F ≤(1 + ε)∥X −Xk∥2 F. Our Contributions. First, we are proposing the “sparse-PCA” problem defined above in lieu of traditional sparse-PCA which is based on maximizing variance, not minimizing loss. With no sparsity constraint, variance maximization and loss minimization are equivalent, both being solved by PCA. Historically, variance maximization became the norm for sparse-PCA. However, minimizing loss better achieves the machine learning goal of preserving information. The table below compares the 10-fold cross-validation error Eout for an SVM classifier using features from popular variance maximizing sparse-PCA encoders and our loss minimizing sparse-encoder (k = 6 and r = 7), d SVM T-Power [23] G-Power-ℓ0 [10] G-Power-ℓ1 [10] Our Algorithm Eout Eout Loss Var Eout Loss Var Eout Loss Var Eout Loss Var ARCENE 104 0.44 matrix to large 0.325 2.5 0.01 0.35 2.5 0.01 0.29 1.4 0.005 Gisette 5000 0.44 0.45 1.17 0.1 0.49 1.2 0.02 0.50 1.2 0.02 0.31 1.1 0.02 Madelon 500 0.51 0.46 1.3 0.09 0.33 1.08 0.08 0.46 1.33 0.05 0.24 1.07 0.03 “1” vs “5” 256 0.35 0.30 2.4 0.21 0.34 2.28 0.27 0.33 2.3 0.19 0.01 1.2 0.03 SECOM 691 0.07 0.34 1.3 0.96 0.35 2.9 0.79 0.33 2.9 0.79 0.31 1.0 0.46 Spam 57 0.17 0.20 1.00 1.0 0.22 1.03 1.0 0.20 1.02 1.0 0.21 1.02 1.0 Lower loss gives lower error. Our experiments are not exhaustive, but their role is modest: to motivate minimizing loss as the right machine learning objective for sparse encoders (Problem 1). Our main contribution is polynomial sparse encoder algorithms with theoretical guarantees that solve Problem 1. We give a (1+ǫ)-optimal encoder with sparsity O(k/ε) (Theorem 7). This sparsity cannot be beaten by any algorithm that guarantees a (1+ε)-approximation (Theorem 8). Ours is the first theoretical guarantee for a k-component sparse linear encoder with respect to the optimal PCA. Our algorithm constructs sparse PCA features (columns of the encoder H) which preserve almost as much information as optimal PCA-features. Our second technical contribution (Theorem 11) is an algorithm to construct sparse features iteratively (typical of sparse-PCA algorithms). Iterative algorithms are notoriously hard to analyze, and we give the first theoretical guarantees for an iterative sparse encoder. (Detailed proofs are postponed to a full version.) Notation. Let ρ ≤min{n, d} = rank(X) (typically ρ = d). We use A, B, C, . . . for matrices and a, b, c, . . . for vectors. The Euclidean basis is e1, e2, . . . (dimension can inferred from context). For an n × d matrix X, the singular value decomposition (SVD) gives X = UΣVT, where the columns of U ∈Rn×ρ are the left singular vectors, the columns of V ∈Rd×ρ are the right singular vectors, and Σ ∈Rρ×ρ is the positive diagonal matrix of singular values σ1 ≥· · · ≥σρ; U and V are orthonormal, UTU = VTV = Iρ. For integer k, we use Uk ∈Rn×k (resp. Vk ∈Rd×k) for the first k left (resp. right) singular vectors, and Σk ∈Rk×k is the diagonal matrix with the top-k singular values. We can view a matrix as a row of columns. So, X = [f1, . . . , fd], U = [u1, . . . , uρ], V = [v1, . . . , vρ], Uk = [u1, . . . , uk] and Vk = [v1, . . . , vk]. We use f for the columns of X, the features, and we reserve xi for the data points (rows of X), XT = [x1, . . . , xn]. A = [a1, . . . , ak] is (r1, . . . , rk)-sparse if ∥ai∥0 ≤ri; if all ri are equal to r, we say the matrix is r-sparse. The Frobenius (Euclidean) norm of a matrix A is ∥A∥2 F = P ij A2 ij = Tr(ATA) = Tr(AAT). The pseudo-inverse A† of A with SVD UAΣAVT A is A† = VAΣ−1 A UT A; AA† = UAUT A is a symmetric projection operator. For matrices A, B with ATB = 0, a generalized Pythagoras theorem holds, ∥A + B∥2 F = ∥A∥2 F + ∥B∥2 F. ∥A∥2 is the operator norm (top singular value) of A. Discussion of Related Work. PCA is the optimal (and most popular) linear auto-encoder. Nonlinear auto-encoders became prominent with auto-associative neural networks [7, 3, 4, 17, 18]. There is some work on sparse linear auto-encoders (e.g. [15]) and a lot of research on “sparse PCA”. The importance of sparse factors in dimensionality reduction has been recognized in some early work: the varimax criterion [11] has been used to rotate the factors to encourage sparsity, and this has been used in multi-dimensional scaling approaches to dimension reduction [20, 12]. One of the first attempts at sparse PCA used axis rotations and component thresholding [6]. The traditional formulation of sparse PCA is as cardinality constrained variance maximization: maxv vTAv subject to vTv = 1 and ∥v∥0 ≤r, which is NP-hard [14]. The exhaustive algorithm requires O dr2( d r )  2 computation which can be improved to O(dq+1) for a rank-q perturbation of the identity [2]. These algorithms are not practical. Several heuristics exist. [22] and [24] take an L1 penalization view. DSPCA (direct sparse PCA) [9] also uses an L1 sparsifier but solves a relaxed convex semidefinite program which is further refined in [8] where they also give a tractable sufficient condition for testing optimality. The simplest algorithms use greedy forward and backward subset selection. For example, [16] develop a greedy branch and bound algorithm based on spectral bounds with O(d3) running time for forward selection and O(d4) running time for backward selection. An alternative view of the problem is as a sparse matrix reconstruction problem; for example [21] obtain sparse principal components using regularized low-rank matrix approximation. Most existing SPCA algorithms find one sparse principal component. One applies the algorithm iteratively on the residual after projection to get additional sparse principal components [13]. There are no polynomial algorithms with optimality guarantees. [1] considers sparse PCA with a non-negativity constraint: they give an algorithm with input parameter k and running time O(dk+1 log d + dkr3) which constructs a sparse component within (1 −n r ∥X −Xk∥2/∥X∥2) from optimal. The running time is not practical when k is large; further, the approximation guarantee relies on rapid spectral decay of X and only applies to the first component, not to further iterates. Explained Variance vs. Loss. For symmetric auto-encoders, minimizing loss is equivalent to maximizing the symmetric explained variance ∥XHH†∥ 2 F due to the identity var(X) = ∥X∥2 F = ∥X(I −HH†) + XHH†∥ 2 F = ∥X −XHH†∥ 2 F + ∥XHH†∥ 2 F (the last equality is from Pythagoras’ theorem). The PCA auto-encoder is symmetric, V† k = VT k. So the optimal encoder for maximum variance or minimum loss are the same: PCA. But, when it comes to approximation, an approximation algorithm for loss can be converted to an approximation algorithm for variance maximization (the reverse is not true). Theorem 2. If ∥X −XHH†∥ 2 F ≤(1 + ε)∥X −Xk∥2 F, then ∥XHH†∥ 2 F ≥  1 −ρ−k k ε  ∥Xk∥2 F . When factors are not decorrelated, explained variance is not well defined [24], whereas loss is well defined for any encoder. Minimizing loss and maximizing the explained variance are both ways of encouraging H to be close to Vk. However, when H is constrained (for example to be sparse), these optimization objectives can produce very different solutions. From the machine learning perspective, symmetry is an unnecessary constaint on the auto-encoder. All we want is an encoder that produces a compact representation of the data while capturing as much information as possible. 2 Optimal Sparse Linear Encoder We show a black-box reduction of sparse encoding to the column subset selection problem (CSSP). We then use column subset selection algorithms to construct provably accurate sparse auto-encoders. For X = [f1, . . . , fd], we let C = [fi1, fi2 . . . , fir] denote a matrix formed using r columns “sampled” from X, where 1 ≤i1 < i2 · · · < ir ≤d are distinct column indices. We can use a matrix Ω∈Rd×r to perform the sampling, C = XΩ, where Ω= [ei1, ei2 . . . , eir] and ei are the standard basis vectors in Rd (post-multiplying X by ei “samples” the ith column of X). The columns of C span a subspace in the range of X. A sampling matrix can be used to construct an r-sparse matrix. Lemma 3. Let Ω= [ei1, ei2 . . . , eir] and let A ∈Rr×k be any matrix. Then ΩA is r-sparse. Define XC = CC†X, the projection of X onto the column space of C. Let XC,k ∈Rn×d be the optimal rank-k approximation to XC obtained via the SVD of XC. Lemma 4 (See, for example, [5]). XC,k is a rank-k matrix whose columns are in the span of C. Let ˆX be any rank-k matrix whose columns are in the span of C. Then, ∥X −XC,k∥F ≤∥X −ˆX∥F. That is, XC,k is the best rank-k approximation to X whose columns are in the span of C. An efficient algorithm to compute XC,k is also given in [5]. The algorithm runs in O(ndr + (n + d)r2) time. 2.1 Sparse Linear Encoders from Column Subset Selection We show that a set of columns C for which XC,k is a good approximation to X can produce a good sparse linear encoder. In the algorithm below we assume (not essential) that C has full column rank. The algorithm uses standard linear algebra operations and has total runtime in O(ndr + (n + d)r2). 3 Blackbox algorithm to compute encoder from CSSP Inputs: X ∈Rn×d; C ∈Rn×r with C = XΩand Ω= [ei1, . . . , eir]; k ≤r. Output: r-sparse linear encoder H ∈Rd×k. 1: Compute a QR-factorization of C as C = QR, with Q ∈Rn×r, R ∈Rr×r. 2: Obtain the SVD of R−1(QTX)k, R−1(QTX)k = URΣRVT R. (UR ∈Rr×k, ΣR ∈Rk×k and VR ∈Rd×k) 3: Return H = ΩUR ∈Rd×k. In step 2, even though R−1(QTX)k is an r × d matrix, it has rank k, hence the dimensions of UR, ΣR, VR depend on k, not r. By Lemma 3, the encoder H is r-sparse. Also, H has orthonormal columns, as is typically desired for an encoder (HTH = UT RΩTΩUR = UT RUR = I). In every column of our encoder, the non-zeros are at the same r coordinates which is much stronger than r-sparsity. The next theorem shows that our encoder is good if C contains a good rank-k approximation XC,k. Theorem 5 (Blackbox encoder from CSSP). Given X ∈Rn×d, C = XΩ∈Rn×r with Ω= [ei1, . . . , eir] and k ≤r, let H be the r-sparse linear encoder produced by the algorithm above in O(ndr + (n + d)r2) time. Then, the loss satisfies ℓ(H, X) = ∥X −XH(XH)†X∥ 2 F ≤∥X −XC,k∥2 F. The theorem says that if we can find a set of r columns within which a good rank-k approximation to X exists, then we can construct a good sparse linear encoder. What remains is to find a sampling matrix Ωwhich gives a good set of columns C = XΩfor which ∥X −XC,k∥2 F is small. The main tool to obtain C and Ωwas developed in [5] which gave a constant factor deterministic approximation algorithm and a relative-error randomized approximation algorithm. We state a simplified form of the result and then discuss various ways in which this result can be enhanced. Any algorithm to construct a good set of columns can be used as a black box to get a sparse linear encoder. Theorem 6 (Near-optimal CSSP [5]). Given X ∈Rn×d of rank ρ and target rank k: (i) (Theorem 2 in [5]) For sparsity parameter r > k, there is a deterministic algorithm which runs in time TVk + O(ndk + dk3) to construct a sampling matrix Ω= [ei1, . . . , eir] and corresponding columns C = XΩsuch that ∥X −XC,k∥2 F ≤  1 + (1 − p k/r)−2 ∥X −Xk∥2 F. (ii) (Simplified Theorem 5 in [5]) For sparsity parameter r > 5k, there is a randomized algorithm which runs in time O(ndk + dk3 + r log r) to construct a sampling matrix Ω= [ei1, . . . , eir] and corresponding columns C = XΩsuch that E h ∥X −XC,k∥2 F i ≤  1 + 5k r −5k  ∥X −Xk∥2 F. Our “batch” sparse linear encoder uses Theorem 6 in our black-box CSSP-encoder. “Batch” Sparse Linear Encoder Algorithm Inputs: X ∈Rn×d; rank k ≤rank(X); sparsity r > k. Output: r-sparse linear encoder H ∈Rd×k. 1: Use Theorem 6-(ii) to compute columns C = XΩ∈Rn×r, with inputs X, k, r. 2: Return H computed with X, C, k as input to the CSSP-blackbox encoder algorithm. Using Theorem 6 in Theorem 5, we have an approximation guarantee for our algorithm. Theorem 7 (Sparse Linear Encoder). Given X ∈Rn×d of rank ρ, the target number of sparse PCA vectors k ≤ρ, and sparsity parameter r > 5k, the “batch” sparse linear encoder algorithm above runs in time O(ndr + (n + d)r2 + dk3) and constructs an r-sparse encoder H such that: E h ∥X −XH(XH)†X∥ 2 F i ≤  1 + 5k r −5k  ∥X −Xk∥2 F. Comments. The expectation is over the random choices in the algorithm, and the bound can be boosted to hold with high probability or even deterministically. 2. The guarantee is with respect to ∥X −Xk∥2 F (optimal dense PCA): sparsity r = O(k/ε) suffices to mimic top-k (dense) PCA. 4 We now give the lower bound on sparsity, showing that our result is worst-case optimal. Define the row-sparsity of H as the number of its rows that are non-zero. When k=1, the row-sparsity equals the sparsity of the single factor. The row-sparsity is the total number of dimensions which have nonzero loadings among all the factors. Our algorithm produces an encoder with row-sparsity O(k/ε) and comes within (1 + ε) of the minimum possible loss. This is worst case optimal: Theorem 8 (Lower Bound). There is a matrix X for which any linear encoder that achieves a (1 + ε)-approximate loss as compared to PCA must have a row-sparsity r ≥k/ε. The common case that in the literature is with k = 1 (top sparse component). Our lower bound shows that Ω(1/ε)-sparsity is required and our algorithm asymptotically achieves this lower bound. To prove Theorem 8, we show the converse of Theorem 5: a good linear auto-encoder with rowsparsity r can be used to construct r columns C for which XC,k approximates X. Lemma 9. Suppose H is a linear encoder for X with row-sparsity r and decoder G. Then, BHG = CY, where C is a set of r columns of X and Y ∈Rr×d. Given Lemma 9, a sketch of the rest of the argument is as follows. Section 9.2 of [5] demonstrates a matrix for which there do not exist r good columns. Since a good r-sparse encoder gives r good columns, no r-sparse encoder can be (1 + k/r)-optimal: No linear encoder with row-sparsity r achieves a loss within (1 + k/r) of PCA. Our construction is asymptotically worst case optimal. The lower bound holds for general linear auto-encoders, and so this lower bound also applies to the symmetric auto-encoder HH†, the traditional formulation of sparse PCA. When k = 1, for any r-sparse unit norm v, there exists X for which ∥X −XvvT∥2 F ≥(1 + 1 r)∥X −X1∥2 F, or in terms of the symmetric explained variance vTBTBv ≤∥B1∥2 F −1 r∥B −B1∥2 F. 3 Iterative Sparse Linear Encoders Our CSSP-based algorithm is “batch” in that all k factors are constructed simultaneously. Every feature in the encoder is r-sparse with non-zero loadings on the same set of r original dimensions; and, you cannot do better with a row-sparsity of r. Further, the batch algorithm does not distinguish between the k-factors. That is, there is no top component, second component, and so on. The traditional techniques for sparse PCA construct the factors iteratively. We can too: run our batch algorithm in an iterative mode, where in each step we set k = 1 and compute a sparse factor for a residual matrix. By constructing our k features iteratively (and adaptively), we identify an ordering among the k features. Further, we might be able to get each feature sparser while still maintaining a bound on the row-sparsity. We now give an iterative version of our algorithm. In each iteration, we augment H by computing a top sparse encoder for the residual obtained using the current H. Iterative Sparse Linear Encoder Algorithm Inputs: X ∈Rn×d; rank k ≤rank(X); sparsity parameters r1, . . . , rk. Output: (r1, . . . , rk)-sparse linear encoder 1: Set the residual ∆= X and H = [ ]. 2: for i = 1 to k do 3: Use the batch algorithm to compute encoder h for ∆, with k = 1 and r = ri. 4: Add h to the encoder: H ←[H, h]. 5: Update the residual ∆: ∆←X −XH(XH)†X. 6: Return the (r1, . . . , rk)-sparse encoder H ∈Rn×k. The next lemma bounds the reconstruction error for this iterative step in the algorithm. Lemma 10. Suppose, for k ≥1, Hk = [h1, . . . , hk] is an encoder for X, satisfying ∥X −XHk(XHk)†X∥ 2 F = err. Given a sparsity r > 5 and δ ≤5/(r−5), one can compute in time O(ndr+(n+d)r2) an r-sparse feature hk+1 such that the reconstruction error of the encoder Hk+1 = [h1, . . . , hk, hk+1] satisfies E h ∥X −XHk+1(XHk+1)†X∥ 2 F i = (1 + δ)(err −∥X −XHk(XHk)†X∥ 2 2). 5 Lemma 10 gives a bound on the reconstruction error for an iterative addition of the next sparse encoder vector. To see how Lemma 10 is useful, consider target rank k = 2. First construct h1 with sparsity r1 = 5 + 5/ε, which gives (1 + ε)∥X −X1∥2 F loss. Now construct h2, also with sparsity r2 = 5 + 5/ε. The loss for H = [h1, h2] is bounded by ℓ(H, X) ≤(1 + ε)2∥X −X2∥2 F + ε(1 + ε)∥X −X1∥2 2. On the other hand, our batch algorithm uses sparsity r = 10 + 10/ε in each encoder h1, h2 and achieves reconstruction error (1 + ε)∥X −X2∥2 F. The iterative algorithm uses sparser features, but pays for it a little in reconstruction error. The second term is small, O(ε), and depends on ∥X −X1∥2 2 = σ2 2, which in practice is smaller than ∥X −X2∥2 F = σ2 3 + · · · + σ2 d. Using the iterative algorithm, we can tailor the sparsity of each encoder vector separately to achieve a desired accuracy. It is algebraically intense to prove a bound for a general choice of the sparsity parameters r1, . . . , rk, so for simplicity, we prove a bound for a specific choice of the sparsity parameters which slowly increase with each iterate. The proof idea is similar to our example with k = 2. Theorem 11 (Iterative Encoder). Given X ∈Rn×d of rank ρ and k < ρ, set rj = 5 + ⌈5j/ε ⌉in our iterative encoder to compute the (r1, . . . , rk)-sparse encoder H = [h1, h2, . . . , hk]. Then, for every ℓ= 1, . . . , k, the encoder H = [h1, h2, . . . , hk] has reconstruction error E h ∥X −XHℓ(XHℓ)†X∥ 2 F i ≤ (eℓ)ε∥X −Xℓ∥2 F + εℓ1+ε∥Xℓ−X1∥2 F. (1) The running time to compute all the encoder vectors is O(ndk2ε−1 + (n + d)k3ε−2). Comments. This is the first theoretical guarantee for iterative sparse encoders. Up to a small additive term, we have a relative error approximation because (eℓ)ε = 1 + O(ǫ log ℓ) grows slowly with ℓ. Each successive encoder vector has a larger sparsity (as opposed to a fixed sparsity r = 5k + 5k/ε in the batch algorithm). If we used a constant sparsity rj = 5 + 5k/ε for every encoder vector in the iterative algorithm, the relative error term becomes 1 + O(εℓ) as opposed to 1 + O(ε log ℓ). Just as with the PCA vectors v1, v2, . . ., we have a provably good encoder for any ℓby taking the first ℓ factors h1, . . . , hℓ. In the batch-encoder H = [h1, . . . , hk], we cannot guarantee that h1 will give a reconstruction comparable with X1. The detailed proof is in the supplementary matrrial. Proof. (Sketch) For ℓ≥1, we define two quantities Qℓ, Pℓfor that will be useful in the proof. Qℓ = (1 + ε)(1 + 1 2ε)(1 + 1 3ε)(1 + 1 4ε) · · · (1 + 1 ℓε); Pℓ= Qℓ−1 = (1 + ε)(1 + 1 2ε)(1 + 1 3ε)(1 + 1 4ε) · · · (1 + 1 ℓε) −1. Using Lemma 10 and induction, we can prove a bound on the loss of Hℓ. E h ∥X −XHℓ(XHℓ)†X∥ 2 F i ≤Qℓ∥X −Xℓ∥2 F + Qℓ ℓ X j=2 σ2 j Pj−1 Qj−1 . (∗) When ℓ= 1, the claim is that E[∥X −XH1(XH1)†X∥ 2 F] ≤(1+ε)∥X −X1∥2 F (since the summation is empty), which is true by construction of H1 = [h1] because r1 = 5 + 5/ε. For the induction step, we apply Lemma 10 with δ = ε/(ℓ+ 1), condition on err = ∥X −XHℓ(XHℓ)†X∥ 2 F whose expectation is given in (∗), and use iterated expectation. The details are given in the supplementary material. The first term in the bound (1) follows by bounding Qℓusing elementary calculus: log Qℓ= ℓ X i=1 log  1 + ε i  ≤ ℓ X i=1 ε i ≤ε log(eℓ), where we used log(1 + x) ≤x for x ≥0 and the well known upper bound log(eℓ) for the ℓth harmonic number 1 + 1 2 + 1 3 + · · · + 1 ℓ. Thus, Qℓ≤(eℓ)ε. The rest of the proof is to bound the second term in (∗) to obtain the second term in (1). Obeserve that for i ≥1, Pi = Qi −1 = ε Qi Q1 + Qi Q1 −1 ≤ε Qi Q1 + Qi−1 −1 = ε Qi Q1 + Pi−1, where we used Qi/Q1 ≤Qi−1 and we define P0 = 0. After some algebra which we omit, ℓ X j=2 σ2 j Pj−1 Qj−1 ≤ε Q1 ∥Xℓ−X1∥2 F + ℓ X j=3 σ2 j Pj−2 Qj−2 . 6 2 4 6 8 10 1 1.1 1.2 1.3 1.4 Sparsity r Information Loss PitProps Batch Iterative Tpower Gpower−0 Gpower−1 5 10 15 20 25 30 35 1 1.1 1.2 1.3 1.4 1.5 1.6 Sparsity r Information Loss Lymphoma Batch Iterative Tpower Gpower−0 Gpower−1 10 20 30 40 1 1.1 1.2 1.3 1.4 1.5 1.6 Sparsity r Information Loss Colon Batch Iterative Tpower Gpower−0 Gpower−1 2 4 6 8 10 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Sparsity r Symmetric Variance PitProps Batch Iterative Tpower Gpower−0 Gpower−1 5 10 15 20 25 30 35 0 0.1 0.2 0.3 0.4 Sparsity r Symmetric Variance Lymphoma Batch Iterative Tpower Gpower−0 Gpower−1 10 20 30 40 0 0.1 0.2 0.3 0.4 0.5 Sparsity r Symmetric Variance Colon Batch Iterative Tpower Gpower−0 Gpower−1 Figure 1: Performance of the sparse encoder algorithms on the PitProps data (left), Lymphoma data (middle) and Colon data (right) data: We Information loss (top) and symmetric explained variance (bottom) with k = 2. Our algorithms give the minimum information loss which decreases inversely with r as the theory predicts. It is no surprise that existing sparse-PCA algorithms do better at maximizing symmetric explained variance. Using this reduction it is now an elementary task to prove by induction that ℓ X j=2 σ2 j Pj−1 Qj−1 ≤ε Q1 ℓ−1 X j=1 ∥Xℓ−Xj∥2 F. Since ∥Xℓ−Xj∥2 F ≤∥Xℓ−X1∥2 F(ℓ−j)/(ℓ−1), we have that ℓ X j=2 σ2 j Pj−1 Qj−1 ≤ε∥Xℓ−X1∥2 F Q1(ℓ−1) ℓ−1 X j=1 ℓ−j = εℓ∥Xℓ−X1∥2 F 2Q1 . Using (∗), we have that ∥X −XHℓ(XHℓ)†X∥ 2 F ≤(eℓ)ε∥X −Xℓ∥2 F + εℓ∥Xℓ−X1∥2 F 2 · Qℓ Q1 . The result finally follows because log Qℓ Q1 = ℓ X i=2 log  1 + ε i  ≤ε ℓ X i=2 1 i ≤ε(log(eℓ) −1) = ε log ℓ, and so Qℓ/Q1 ≤ℓε. 4 Demonstration We empirically demonstrate our algorithms against existing state-of-the-art sparse PCA methods. The inputs are X ∈Rn×d, the number of components k and the sparsity parameter r. The output is the sparse encoder H = [h1, h2, . . . , hk] ∈Rn×k with ∥hi∥0 ≤r; H is used to project X onto some subspace to obtain a reconstruction ˆX which decomposes the variance into two terms: ∥X∥2 F = ∥X −ˆX∥ 2 F + ∥ˆX∥ 2 F = Loss + Explained Variance For symmetric auto-encoders, minimizing loss is equivalent to maximizing the symmetric explained variance, the path traditional sparse-PCA takes, Symmetric Explained Variance = ∥XHH†∥ 2 F/∥Xk∥2 F ≤1 To capture how informative the sparse components are, we can use the normalized loss: Loss = ∥X −XH(XH)†X∥ 2 F/∥X −Xk∥2 F ≥1. 7 We report the symmetric explained variance primarily for historical reasons because existing sparse PCA methods have constructed auto-encoders to optimize the symmetric explained variance. We implemented an instance of the sparse PCA algorithm of Theorem 7 with the deterministic technique described in part (i) in Theorem 6. (This algorithm gives a constant factor approximation, as opposed to the relative error approximation of the algorithm in Theorem 7, but it is deterministic and simpler to implement.) We call this the “Batch” sparse linear auto-encoder algorithm. We correspondingly implement an “Iterative” version with fixed sparsity r in each principal component. In each step of the iterative sparse auto-encoder algorithm we use the above batch algorithm to select one principal component with sparsity at most r. We compare our to the following state-of-the-art sparse PCA algorithms: (1) T-Power: truncated power method [23]. (2) G-power-ℓ0: generalized power method with ℓ0 regularization [10]. (3) G-power-ℓ1: generalized power method with ℓ1 regularization [10]. All these algorithms were designed to operate for k = 1 (notice our algorithms handle any k) so to pick k components, we use the “deflation” method suggested in [13]. We use the same data sets used by these prior algorithms (all available in [23]): PitProps (X ∈R13×13); Colon (X ∈R500×500); Lymphoma (X ∈R500×500). The qualitative results for different k are similar so we only show k = 2 in Figure 1. The take-away is that loss and symmetric variance give very different sparse encoders (example encoders [h1, h2] with r = 5 are shown on the right). This underlines why the correct objective is important. The machine learning goal is to preserve as much information as possible, which makes loss the compeling objective. The figures show that as r increases, our algorithms deliver nearoptimal 1+O(1/r) normalized loss, as the theory guarantees. The “iterative” algorithm has better empirical performance than the batch algorithm. Batch Iter. TP GP-ℓ0 GP-ℓ1 h1 h2 0 0 −0.8 −0.3 0 0 0 −0.8 0 0 0 0 0 0 −0.3 0.3 0 0 0 0 0 0 0 0 0.5 −0.4 h1 h2 0 0 −0.6 −0.8 0 −0.4 0 −0.2 0 0 0 0 −0.7 −0.1 0 0 −0.3 0 −0.1 0 0 0 0 −0.2 0 0 h1 h2 0.5 0 0.5 0 0 0.6 0 0.6 0 0 0 0.3 0.4 0 0 0 0.4 0 0.4 −0.2 0 0 0 0.3 0 0 h1 h2 0.7 0 0.7 0 0 0.7 0 0.7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 h1 h2 0.6 0 0.6 0 0 0.7 0 0.7 0 0 0 0 0 0 0 0 0.5 0 0 0 0 0 0 0 0 0 Summary. Loss minimization and variance maximization give very different encoders under a sparsity constraint. The empirical performance of our loss minimization algorithms follows the theory. Our iterative algorithm is empirically better though it has a slightly worse theoretical guarantee. 5 Discussion Historically, sparse PCA was cardinality constrained variance maximization. Variance per se has no intrinsic value, and is hard to define for non-orthogonal or correlated encoders, which is to be expected once you introduce a sparsity constraint. Our definition of loss is general and captures the machine learning goal of preserving as much information as possible. We gave theoretical guarantees for sparse encoders. Our iterative algorithm has a weaker bound than our batch algorithm, yet the iterative algorithm is better empirically. Iterative algorithms are tough to analyze, and it remains open whether a tighter analysis can be given. We conjecture that the iterative algorithm is as good or better than the batch algorithm, though proving it seems elusive. Finally, we have not optimized for running times. Considerable speed-ups may be possible without sacrificing accuracy. For example, in the iterative algorithm (which repeatedly calls the CSSP algorithm with k = 1), it should be possible significantly speed up the generic algorithm (for arbitrary k) to a specialized one for k = 1. We leave such implementation optimizations for future work. Acknowledgments. Magdon-Ismail was partially supported by NSF:IIS 1124827 and by the Army Research Laboratory under Cooperative Agreement W911NF-09-2-0053 (the ARL-NSCTA). The views and conclusions contained in this document are those of the authors and should not be interpreted as representing the official policies, either expressed or implied, of the Army Research Laboratory or the U.S. Government. The U.S. Government is authorized to reproduce and distribute reprints for Government purposes notwithstanding any copyright notation here on. 8 References [1] M. Asteris, D. Papailiopoulos, and A. Dimakis. Non-negative sparse PCA with provable guarantees. In Proc. ICML, 2014. [2] M. Asteris, D. Papailiopoulos, and G. Karystinos. Sparse principal component of a rank-deficient matrix. In Proc. ISIT, 2011. [3] P. Baldi and K. Hornik. Neural networks and principal component analysis: Learning from examples without local minima. Neural Networks, 2:53–58, 1988. [4] H. Bourlard and Y. Kamp. Auto-association by multilayer perceptrons and singular value decomposition. Biological Cybernetics, 59:291–294, 1988. [5] C. Boutsidis, P. Drineas, and M. Magdon-Ismail. Near-optimal column-based matrix reconstruction. SIAM Journal on Computing, 43(2), 2014. [6] J. Cadima and I. Jolliffe. Loadings and correlations in the interpretation of principal components. Applied Statistics, 22:203–214, 1995. [7] G. Cottrell and P. Munro. Principal components analysis of images via back propagation. In Proc. SPIE 1001, Visual Communications and Image Processing ’88, 1988. [8] A. d’Aspremont, F. Bach, and L. E. Ghaoui. Optimal solutions for sparse principal component analysis. Journal of Machine Learning Research, 9:1269–1294, June 2008. [9] A. d’Aspremont, L. El Ghaoui, M. I. Jordan, and G. R. G. Lanckriet. A direct formulation for sparse PCA using semidefinite programming. SIAM Review, 49(3):434–448, 2007. [10] M. Journ´ee, Y. Nesterov, P. Richt´arik, and R. Sepulchre. Generalized power method for sparse principal component analysis. The Journal of Machine Learning Research, 11:517–553, 2010. [11] H. Kaiser. The varimax criterion for analytic rotation in factor analysis. Psychometrika, 23(3):187–200, 1958. [12] J. Kruskal. Multidimensional scaling by optimizing goodness of fit to a nonmetric hypothesis. Psychometrika, 29(1):1–27, 1964. [13] L. W. Mackey. Deflation methods for sparse PCA. In Proc. NIPS, pages 1017–1024, 2009. [14] M. Magdon-Ismail. Np-hardness and inapproximability of sparse pca. arXiv:1502.05675, 2015. [15] A. Makhzani and B. Frey. k-sparse autoencoders. In ICLR, 2014. [16] B. Moghaddam, Y. Weiss, and S. Avidan. Generalized spectral bounds for sparse LDA. In ICML, 2006. [17] E. Oja. Data compression, feature extraction and autoassociation in feedforward neural networks. In Artificial Neural Networks, volume 1, pages 737–745, 1991. [18] E. Oja. Principal components, minor components and linear neural networks. Neural Networks, 5:927– 935, 1992. [19] K. Pearson. On lines and planes of closest fit to systems of points in space. Philosophical Magazine, 2:559–572, 1901. [20] J. Sammon. A nonlinear mapping for data structure analysis. IEEE Transactions on Computers, C18(5):401–409, 1969. [21] H. Shen and J. Z. Huang. Sparse principal component analysis via regularized low rank matrix approximation. Journal of Multivariate Analysis, 99:1015–1034, July 2008. [22] N. Trendafilov, I. T. Jolliffe, and M. Uddin. A modified principal component technique based on the lasso. Journal of Computational and Graphical Statistics, 12:531–547, 2003. [23] X.-T. Yuan and T. Zhang. Truncated power method for sparse eigenvalue problems. The Journal of Machine Learning Research, 14(1):899–925, 2013. [24] H. Zou, T. Hastie, and R. Tibshirani. Sparse principal component analysis. Journal of Computational & Graphical Statistics, 15(2):265–286, 2006. 9
2016
36
6,283
Kernel Observers: Systems-Theoretic Modeling and Inference of Spatiotemporally Evolving Processes Hassan A. Kingravi Pindrop Atlanta, GA 30308 hkingravi@pindrop.com Harshal Maske and Girish Chowdhary University of Illinois at Urbana Champaign Urbana, IL 61801 hmaske2@illinois.edu, girishc@illinois.edu Abstract We consider the problem of estimating the latent state of a spatiotemporally evolving continuous function using very few sensor measurements. We show that layering a dynamical systems prior over temporal evolution of weights of a kernel model is a valid approach to spatiotemporal modeling, and that it does not require the design of complex nonstationary kernels. Furthermore, we show that such a differentially constrained predictive model can be utilized to determine sensing locations that guarantee that the hidden state of the phenomena can be recovered with very few measurements. We provide sufficient conditions on the number and spatial location of samples required to guarantee state recovery, and provide a lower bound on the minimum number of samples required to robustly infer the hidden states. Our approach outperforms existing methods in numerical experiments. 1 Introduction Modeling of large-scale stochastic phenomena with both spatial and temporal (spatiotemporal) evolution is a fundamental problem in the applied sciences and social networks. The spatial and temporal evolution in such domains is constrained by stochastic partial differential equations, whose structure and parameters may be time-varying and unknown. While modeling spatiotemporal phenomena has traditionally been the province of the field of geostatistics, it has in recent years gained more attention in the machine learning community [2]. The data-driven models developed through machine learning techniques provide a way to capture complex spatiotemporal phenomena that are not easily modeled by first-principles alone, such as stochastic partial differential equations. In the machine learning community, kernel methods represent a class of extremely well-studied and powerful methods for inference in spatial domains; in these techniques, correlations between the input variables are encoded through a covariance kernel, and the model is formed through a linear weighted combination of the kernels [14]. In recent years, kernel methods have been applied to spatiotemporal modeling with varying degrees of success [2, 14]. Many recent techniques in spatiotemporal modeling have focused on nonstationary covariance kernel design and associated hyperparameter learning algorithms [4, 7, 12]. The main benefit of careful design of covariance kernels over approaches that simply include time as an additional input variable is that they can account for intricate spatiotemporal couplings. However, there are two key challenges with these approaches: the first is ensuring the scalability of the model to large scale phenomena, which manifests due to the fact that the hyperparameter optimization problem is not convex in general, leading to methods that are difficult to implement, susceptible to local minima, and that can become computationally intractable for large datasets. In addition to the challenge of modeling spatiotemporally varying processes, we are interested in addressing the second very important, and widely unaddressed challenge: given a predictive model of the spatiotemporal phenomena, how can the current latent state of the phenomena be estimated using as few sensor measurements as possible? This is called the monitoring problem. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. Monitoring a spatiotemporal phenomenon is concerned with estimating its current state, predicting its future evolution, and inferring the initial conditions utilizing limited sensor measurements. The key challenges here manifest due to the fact that it is typically infeasible or expensive to deploy sensors at a large scale across vast spatial domains. To minimize the number of sensors deployed, a predictive data-driven model of the spatiotemporal evolution could be learned from historic datasets or through remote sensing (e.g. satellite, radar) datasets. Then, to monitor the phenomenon, the key problem would boil down to reliably and quickly estimating the evolving latent state of the phenomena utilizing measurements from very few sampling locations. In this paper, we present an alternative perspective on solving the spatiotemporal monitoring problem that brings together kernel-based modeling, systems theory, and Bayesian filtering. Our main contributions are two-fold: first, we demonstrate that spatiotemporal functional evolution can be modeled using stationary kernels with a linear dynamical systems layer on their mixing weights. In other words, the model proposed here posits differential constraints, embodied as a linear dynamical system, on the spatiotemporal evolution of a kernel based models, such as Gaussian Processes. This approach does not necessarily require the design of complex spatiotemporal kernels, and can accommodate positive-definite kernels on any domain on which it’s possible to define them, which includes non-Euclidean domains such as Riemannian manifolds, strings, graphs and images [6]. Second, we show that the model can be utilized to determine sensing locations that guarantee that the hidden states of functional evolution can be estimated using a Bayesian state-estimator with very few measurements. We provide sufficient conditions on the number and location of sensor measurements required and prove non-conservative lower bounds on the minimum number of sampling locations. The validity of the presented model and sensing techniques is corroborated using synthetic and large real datasets. 1.1 Related Work There is a large body of literature on spatiotemporal modeling in geostatistics where specific processdependent kernels can be used [17, 2]. From the machine learning perspective, a naive approach is to utilize both spatial and temporal variables as inputs to a Mercer kernel [10]. However, this technique leads to an ever-growing kernel dictionary. Furthermore, constraining the dictionary size or utilizing a moving window will occlude learning of long-term patterns. Periodic or nonstationary covariance functions and nonlinear transformations have been proposed to address this issue [7, 14]. Work focusing on nonseparable and nonstationary covariance kernels seeks to design kernels optimized for environment-specific dynamics, and to tune their hyperparameters in local regions of the input space. Seminal work in [5] proposes a process convolution approach for space-time modeling. This model captures nonstationary structure by allowing the convolution kernel to vary across the input space. This approach can be extended to a class of nonstationary covariance functions, thereby allowing the use of a Gaussian process (GP) framework, as shown in [9]. However, since this model’s hyperparameters are inferred using MCMC integration, its application has been limited to smaller datasets. To overcome this limitation, [12] proposes to use the mean estimates of a second isotropic GP (defined over latent length scales) to parameterize the nonstationary covariances. Finally, [4] considers nonistropic variation across different dimension of input space for the second GP as opposed to isotropic variation by [12]. Issues with this line of approach include the nonconvexity of the hyperparameter optimization problem and the fact that selection of an appropriate nonstationary covariance function for the task at hand is a nontrivial design decision (as noted in [16]). Apart from directly modeling the covariance function using additional latent GPs, there exist several other approaches for specifying nonstationary GP models. One approach maps the nonstationary spatial process into a latent space, in which the problem becomes approximately stationary [15]. Along similar lines, [11] extends the input space by adding latent variables, which allows the model to capture nonstationarity in original space. Both these approaches require MCMC sampling for inference, and as such are subject to the limitations mentioned in the preceding paragraph. A geostatistics approach that finds dynamical transition models on the linear combination of weights of a parameterized model [2, 8] is advantageous when the spatial and temporal dynamics are hierarchically separated, leading to a convex learning problem. As a result, complex nonstationary kernels are often not necessary (although they can be accommodated). The approach presented in this paper aligns closely with this vein of work. A system theoretic study of this viewpoint enables the fundamental contributions of the paper, which are 1) allowing for inference on more general domains with a larger class of basis functions than those typically considered in the geostatistics community, 2 Figure 1: Two types of Hilbert space evolutions. Left: discrete switches in RKHS H; Right: smooth evolution in H. 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 (a) 1-shaded (Def. 1) 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 (b) 2-shaded (Eq. (4)) Figure 2: Shaded observation matrices for dictionary of atoms. and 2) quantifying the minimum number of measurements required to estimate the state of functional evolution. It should be noted that the contribution of the paper concerning sensor placement is to provide sufficient conditions for monitoring rather than optimization of the placement locations, hence a comparison with these approaches is not considered in the experiments. 2 Kernel Observers This section outlines our modeling framework and presents theoretical results associated with the number of sampling locations required for monitoring functional evolution. 2.1 Problem Formulation We focus on predictive inference of a time-varying stochastic process, whose mean f evolves temporally as fτ+1 ∼F(fτ, ητ), where F is a distribution varying with time τ and exogenous inputs η. Our approach builds on the fact that in several cases, temporal evolution can be hierarchically separated from spatial functional evolution. A classical and quite general example of this is the abstract evolution equation (AEO), which can be defined as the evolution of a function u embedded in a Banach space B: ˙u(t) = Lu(t), subject to u(0) = u0, and L : B →B determines spatiotemporal transitions of u ∈B [1]. This model of spatiotemporal evolution is very general (AEOs, for example, model many PDEs), but working in Banach spaces can be computationally taxing. A simple way to make the approach computationally realizable is to place restrictions on B: in particular, we restrict the sequence fτ to lie in a reproducing kernel Hilbert space (RKHS), the theory of which provides powerful tools for generating flexible classes of functions with relative ease [14]. In a kernel-based model, k : Ω× Ω→R is a positive-definite Mercer kernel on a domain Ωthat models the covariance between any two points in the input space, and implies the existence of a smooth map ψ : Ω→H, where H is an RKHS with the property k(x, y) = ⟨ψ(x), ψ(y)⟩H. The key insight behind the proposed model is that spatiotemporal evolution in the input domain corresponds to temporal evolution of the mixing weights of a kernel model alone in the functional domain. Therefore, fτ can be modeled by tracing the evolution of its mean embedded in a RKHS using switched ordinary differential equations (ODE) when the evolution is continuous, or switched difference equations when it is discrete (Figure 1). The advantage of this approach is that it allows us to utilize powerful ideas from systems theory for deriving necessary and sufficient conditions for spatiotemporal monitoring. In this paper, we restrict our attention to the class of functional evolutions F defined by linear Markovian transitions in an RKHS. While extension to the nonlinear case is possible (and non-trivial), it is not pursued in this paper to help ease the exposition of the key ideas. The class of linear transitions in RKHS is rich enough to model many real-world datasets, as suggested by our experiments. Let yτ ∈RN be the measurements of the function available from N sensors at time τ, A : H →H be a linear transition operator in the RKHS H, and K : H →RN be a linear measurement operator. The model for the functional evolution and measurement studied in this paper is: fτ+1 = Afτ + ητ, yτ = Kfτ + ζτ, (1) where ητ is a zero-mean stochastic process in H, and ζτ is a Wiener process in RN. Classical treatments of kernel methods emphasize that for most kernels, the feature map ψ is unknown, and possibly infinite-dimensional; this forces practioners to work in the dual space of H, whose dimensionality is the number of samples in the dataset being modeled. This conventional wisdom precludes the use of kernel methods for most tasks involving modern datasets, which may have 3 millions and sometimes billions of samples [13]. An alternative is to work with a feature map bψ(x) := [ b ψ1(x) ··· b ψM(x) ] to an approximate feature space b H, with the property that for every element f ∈H, ∃bf ∈b H and an ϵ > 0 s.t. ∥f −bf∥< ϵ for an appropriate function norm. A few such approximations are listed below. Dictionary of atoms Let Ωbe compact. Given points C = {c1, . . . , cM}, ci ∈Ω, we have a dictionary of atoms FC = {ψ(c1), · · · , ψ(cM)}, ψ(ci) ∈H, the span of which is a strict subspace b H of the RKHS H generated by the kernel. Here, bψi(x) := ⟨ψ(x), ψ(ci)⟩H = k(x, ci) (2) Low-rank approximations Let Ωbe compact, let C = {c1, . . . , cM}, ci ∈Ω, and let K ∈RM×M, Kij := k(ci, cj) be the Gram matrix computed from C. This matrix can be diagonalized to compute approximations (bλi, bφi(x)) of the eigenvalues and eigenfunctions (λi, φi(x)) of the kernel [18]. These spectral quantities can then be used to compute bψi(x) := p bλi bφi(x). Random Fourier features Let Ω⊂Rn be compact, and let k(x, y) = e−∥x−y∥2/2σ2 be the Gaussian RBF kernel. Then random Fourier features approximate the kernel feature map as bψω : Ω→b H, where ω is a sample from the Fourier transform of k(x, y), with the property that k(x, y) = Eω[⟨bψω(x), bψω(y)⟩b H] [13]. In this case, if V ∈RM/2×n is a random matrix representing the sample ω, then bψi(x) := [ 1 √ M sin([V x]i), 1 √ M cos([V x]i) ]. Similar approximations exist for other radially symmetric and dot product kernels. In the approximate space case, we replace the transition operator A : H →H in (1) by b A : b H →b H. This approximate regime, which trades off the flexibility of a truly nonparametric approach for computational realizability, still allows for the representation of rich phenomena, as will be seen in the sequel. The finite-dimensional evolution equations approximating (1) in dual form are wτ+1 = bAwτ + ητ, yτ = Kwτ + ζτ, (3) where we have matrices bA ∈RM×M, K ∈RN×M, the vectors wτ ∈RM, and where we have slightly abused notation to let ητ and ζτ denote their b H counterparts. Here K is the matrix whose rows are of the form K(i) = bΨ(xi) = [ b ψ1(xi) b ψ2(xi) ··· b ψM(xi) ]. In systems-theoretic language, each row of K corresponds to a measurement at a particular location, and the matrix itself acts as a measurement operator. We define the generalized observability matrix [20] as OΥ =  K b Aτ1 ··· K b AτL  where Υ = {τ1, . . . , τL} are the set of instances τi when we apply the operator K. A linear system is said to be observable if OΥ has full column rank (i.e. RankOΥ = M) for Υ = {0, 1, . . . , M −1} [20]. Observability guarantees two critical facts: firstly, it guarantees that the state w0 can be recovered exactly from a finite series of measurements {yτ1, yτ2, . . . , yτL}; in particular, defining yΥ = yT τ1, yT τ2, · · · , yτ T L T , we have that yΥ = OΥw0. Secondly, it guarantees that a feedback based observer can be designed such that the estimate of wτ, denoted by bwτ, converges exponentially fast to wτ in the limit of samples. Note that all our theoretical results assume bA is available: while we perform system identification in the experiments (Section 3.3), it is not the focus of the paper. We are now in a position to formally state the spatiotemporal modeling and inference problem considered: given a spatiotemporally evolving system modeled using (3), choose a set of N sensing locations such that even with N ≪M, the functional evolution of the spatiotemporal model can be estimated (which corresponds to monitoring) and can be predicted robustly (which corresponds to Bayesian filtering). Our approach to solve this problem relies on the design of the measurement operator K so that the pair (K, bA) is observable: any Bayesian state estimator (e.g. a Kalman filter) utilizing this pair is denoted as a kernel observer 1. We will leverage the spectral decomposition of bA for this task (see §?? in supplementary for details on spectral decomposition). 2.2 Main Results In this section, we prove results concerning the observability of spatiotemporally varying functions modeled by the functional evolution and measurement equations (3) formulated in Section 2.1. In 1In the case where no measurements are taken, for the sake of consistency, we denote the state estimator as an autonomous kernel observer, despite this being something of an oxymoron. 4 particular, observability of the system states implies that we can recover the current state of the spatiotemporally varying function using a small number of sampling locations N, which allows us to 1) track the function, and 2) predict its evolution forward in time. We work with the approximation b H ≈H: given M basis functions, this implies that the dual space of b H is RM. Proposition 1 shows that if bA has a full-rank Jordan decomposition, the observation matrix K meeting a condition called shadedness (Definition 1) is sufficient for the system to be observable. Proposition 2 provides a lower bound on the number of sampling locations required for observability which holds for any bA. Proposition 3 constructively shows the existence of an abstract measurement map eK achieving this lower bound. Finally, since the measurement map does not have the structure of a kernel matrix, a slightly weaker sufficient condition for the observability of any bA is in Theorem 1. Proofs of all claims are in the supplementary material. Definition 1. (Shaded Observation Matrix) Given k : Ω× Ω→R positive-definite on a domain Ω, let { bψ1(x), . . . , bψM(x)} be the set of bases generating an approximate feature map bψ : Ω→b H, and let X = {x1, . . . , xN}, xi ∈Ω. Let K ∈RN×M be the observation matrix, where Kij := bψj(xi). For each row K(i) := [ b ψ1(xi) ··· b ψM(xi) ], define the set I(i) := {ι(i) 1 , ι(i) 2 , . . . , ι(i) Mi} to be the indices in the observation matrix row i which are nonzero. Then if S i∈{1,...,N} I(i) = {1, 2, . . . , M}, we denote K as a shaded observation matrix (see Figure 2a). This definition seems quite abstract, so the following remark considers a more concrete example. Remark 1. Let bψ be generated by the dictionary given by C = {c1, . . . , cM}, ci ∈Ω. Note that since bψj(xi) = ⟨ψ(xi), ψ(cj)⟩H = k(xi, cj), K is the kernel matrix between X and C. For the kernel matrix to be shaded thus implies that there does not exist an atom ψ(cj) such that the projections ⟨ψ(xi), ψ(cj)⟩H vanish for all xi, 1 ≤i ≤N. Intuitively, the shadedness property requires that the sensor locations xi are privy to information propagating from every cj. As an example, note that, in principle, for the Gaussian kernel, a single row generates a shaded kernel matrix2. Proposition 1. Given k : Ω× Ω→R positive-definite on a domain Ω, let { bψ1(x), . . . , bψM(x)} be the set of bases generating an approximate feature map bψ : Ω→b H, and let X = {x1, . . . , xN}, xi ∈Ω. Consider the discrete linear system on b H given by the evolution and measurement equations (3). Suppose that a full-rank Jordan decomposition of bA ∈RM×M of the form bA = PΛP −1 exists, where Λ = [ Λ1 ··· ΛO ], and there are no repeated eigenvalues. Then, given a set of time instances Υ = {τ1, τ2, . . . , τL}, and a set of sampling locations X = {x1, . . . , xN}, the system (3) is observable if the observation matrix Kij is shaded according to Definition 1, Υ has distinct values, and |Υ| ≥M. When the eigenvalues of the system matrix are repeated, it is not enough for K to be shaded. In the next proposition, we take a geometric approach and utilize the rational canonical form of bA to obtain a lower bound on the number of sampling locations required. Let r be the number of unique eigenvalues of bA, and let γλi denote the geometric multiplicity of eigenvalue λi. Then the cyclic index of bA is defined as ℓ= max1≤i≤r γλi[19] (see supplementary section ?? for details). Proposition 2. Suppose that the conditions in Proposition 1 hold, with the relaxation that the Jordan blocks [ Λ1 ··· ΛO ] may have repeated eigenvalues (i.e. ∃Λi and Λj s.t. λi = λj). Then there exist kernels k(x, y) such that the lower bound ℓon the number of sampling locations N is given by the cyclic index of bA. Section ?? in supplementary gives a concrete example to build intuition regarding this lower bound. We now show how to construct a matrix eK corresponding to the lower bound ℓ. Proposition 3. Given the conditions stated in Proposition 2, it is possible to construct a measurement map eK ∈Rℓ×M for the system given by (3), such that the pair ( eK, bA) is observable. The construction provided in the proof of Proposition 3 is utilized in Algorithm 1, which uses the rational canonical structure of bA to generate a series of vectors vi ∈RM, whose iterations 2However, in this case, the matrix can have many entries that are extremely close to zero, and will probably be very ill-conditioned. 5 Algorithm 1 Measurement Map eK Input: b A ∈RM×M Compute rational canonical form, such that C = Q−1 b AT Q. Set C0 := C, and M0 := M. for i = 1 to ℓdo Obtain MP αi(λ) of Ci−1. This returns associated indices J (i) ⊂{1, 2, . . . , Mi−1}. Construct vector vi ∈RM such that ξvi(λ) = αi(λ) . Use indices {1, 2, . . . , Mi−1} \ J (i) to select matrix Ci. Set Mi := |{1, 2, . . . , Mi−1} \ J (i)| end for Compute ˚ K = [vT 1 , vT 2 , ..., vT ℓ]T Output: e K = ˚ KQ−1 {v1, . . . , bAm1−1v1, . . . , vℓ, . . . , bAmℓ−1vℓ} generate a basis for RM. Unfortunately, the measurement map eK, being an abstract construction unrelated to the kernel, does not directly select X. We will show how to use the measurement map to guide a search for X in Remark ??. For now, we state a sufficient condition for observability of a general system. Theorem 1. Suppose that the conditions in Proposition 1 hold, with the relaxation that the Jordan blocks [Λ1 · · · ΛO] may have repeated eigenvalues. Let ℓbe the cyclic index of bA. Define K = [ K(1)T ··· K(ℓ)T ]T (4) as the ℓ-shaded matrix which consists of ℓshaded matrices with the property that any subset of ℓ columns in the matrix are linearly independent from each other. Then system (3) is observable if Υ has distinct values, and |Υ| ≥M. While Theorem 1 is a quite general result, the condition that any ℓcolumns of K be linearly independent is a very stringent condition. One scenario where this condition can be met with minimal measurements is in the case when the feature map bψ(x) is generated by a dictionary of atoms with the Gaussian RBF kernel evaluated at sampling locations {x1, . . . , xN} according to (2), where xi ∈Ω⊂Rd, and xi are sampled from a non-degenerate probability distribution on Ωsuch as the uniform distribution. For a semi-deterministic approach, when the dynamics matrix bA is block-diagonal, a simple heuristic is given in Remark ?? in the supplementary. Note that in practice the matrix bA needs to be inferred from measurements of the process fτ. If no assumptions are placed on bA, at least M sensors are required for the system identification phase. Future work will study the precise conditions under which system identification is possible with less than M sensors. Finally, computing the Jordan and rational canonical forms can be computationally expensive: see the supplementary for more details. We note that the crucial step in our approach is computing the cyclic index, which gives us the minimum number of sensors that need to be deployed, the computational complexity of which is O(M 3). Computation of the canonical forms is required in the case we need to strictly realize the lower bound on the number of sensors. 3 Experimental Results 3.1 Sampling Locations for Synthetic Data Sets The goal of this experiment is to investigate the dependency of the observability of system (3) on the shaded observation matrix and the lower bound presented in Proposition 2. The domain is fixed on the interval Ω= [0, 2π]. First, we pick sets of points C(ι) = {c1, . . . , cMι}, cj ∈Ω, M = 50, and construct a dynamics matrix A = Λ ∈RM×M, with cyclic index 5. We pick the RBF kernel k(x, y) = e−∥x−y∥2/2σ2, σ = 0.02. Generating samples X = {x1, . . . , xN}, xi ∈Ωrandomly, we compute the ℓ-shaded property and observability for this system. Figure 3a shows how shadedness is a necessary condition for observability, validating Proposition 1: the slight gap between shadedness and observability here can be explained due to numerical issues in computing the rank of OΥ. Next, we again pick M = 50, but for a system with a cyclic index ℓ= 18. We constructed the measurement map eK using Algorithm 1, and the heuristic in Remark ?? (Algorithm 2 in the supplementary) as well as random sampling to generate the sampling locations X. These results are presented in Figure 3b. The plot for random sampling has been averaged over 100 runs. It is evident from the plot that 6 observability cannot be achieved for a number of samples N < ℓ. Clearly, the heuristic presented outperforms random sampling; note however, that our intent is not to compare the heuristic against random sampling, but to show that the lower bound ℓprovides decisive guidelines for selecting the number of samples while using the computationally efficient random approach. 3.2 Comparison With Nonstationary Kernel Methods on Real-World Data We use two real-world datasets to evaluate and compare the kernel observer with the two different lines of approach for non-stationary kernels discussed in Section 1.1. For the Process Convolution with Local Smoothing Kernel (PCLSK) and Latent Extension of Input Space (LEIS) approaches, we compare with NOSTILL-GP [4] and [11] respectively, on the Intel Berkeley and Irish Wind datasets. Model inference for the kernel observer involved three steps: 1) picking the Gaussian RBF kernel k(x, y) = e−∥x−y∥2/2σ2, a search for the ideal σ is performed for a sparse Gaussian Process model (with a fixed basis vector set C selected using the method in [3]. For the data set discussed in this section, the number of basis vectors were equal to the number of sensing locations in the training set, with the domain for input set defined over R2; 2) having obtained σ, Gaussian process inference is used to generate weight vectors for each time-step in the training set, resulting in the sequence wτ, τ ∈{1, . . . , T}; 3) matrix least-squares is applied to this sequence to infer bA (Algorithm 3 in the supplementary). For prediction in the autonomous setup, bA is used to propagate the state wτ forward to make predictions with no feedback, and in the observer setup, a Kalman filter (Algorithm 4 in the supplementary) with N determined using Proposition 2, and locations picked randomly, is used to propagate wτ forward to make predictions. We also compare with a baseline GP (denoted by ‘original GP’), which is the sparse GP model trained using all of the available data. Our first dataset, the Intel Berkeley research lab temperature data, consists of 50 wireless temperature sensors in indoor laboratory region spanning 40.5 meters in length and 31 meters in width3. Training data consists of temperature data on March 6th 2004 at intervals of 20 minutes (beginning 00:20 hrs) which totals to 72 timesteps. Testing is performed over another 72 timesteps beginning 12:20 hrs of the same day. Out of 50 locations, we uniformly selected 25 locations each for training and testing purposes. Results of the prediction error are shown in box-plot form in Figure 4a and as a time-series in Figure 4b, note that ‘Auto’ refers to autonomous set up. Here, the cyclic index of bA was determined to be 2, so N was set to 2 for the kernel observer with feedback. Note that here, even the autonomous kernel observer outperforms PCLSK and LEIS overall, and the kernel observer with feedback N = 2 does so significantly, which is why we did not include results with N > 2. The second dataset is the Irish wind dataset, consisting of daily average wind speed data collected from year 1961 to 1978 at 12 meteorological stations in the Republic of Ireland4. The prediction error is in box-plot form in Figure 5a and as a time-series in Figure 5b. Again, the cyclic index of bA was determined to be 2. In this case, the autonomous kernel observer’s performance is comparable to PCLSK and LEIS, while the kernel observer with feedback with N = 2 again outperforms all other methods. Table ?? in the supplementary reports the total training and prediction times associated with PCLSK, LEIS, and the kernel observer. We observed that 1) the kernel observer is an order of magnitude faster, and 2) even for small sets, competing methods did not scale well. 3.3 Prediction of Global Ocean Surface Temperature We analyzed the feasibility of our approach on a large dataset from the National Oceanographic Data Center: the 4 km AVHRR Pathfinder project, which is a satellite monitoring global ocean surface temperature (Fig. 6a). This dataset is challenging, with measurements at over 37 million possible coordinates, but with only around 3-4 million measurements available per day, leading to a lot of missing data. The goal was to learn the day and night temperature models on data from the year 2011, and to monitor thereafter for 2012. Success in monitoring would demonstrate two things: 1) the modeling process can capture spatiotemporal trends that generalize across years, and 2) the observer framework allows us to infer the state using a number of measurements that are an order of magnitude fewer than available. Note that due to the size of the dataset and the high computational requirements of the nonstationary kernel methods, a comparison with them was not pursued. To build the autonomous kernel observer and general kernel observer models, we followed the same procedure outlined in Section 3.2, but with C = {c1, . . . , cM}, cj ∈R2, |C| = 300. Cyclic 3http://db.csail.mit.edu/labdata/labdata.html 4http://lib.stat.cmu.edu/datasets/wind.desc 7 10 20 30 40 50 0 0.2 0.4 0.6 0.8 1 1.2 Samples Percentage Observable obs. shaded (a) Shaded vs. observability 10 20 30 40 50 0 0.2 0.4 0.6 0.8 1 1.2 Samples Percentage Observable Random Heuristic (b) Heuristic vs. random Figure 3: Kernel observability results. 1 1.5 2 2.5 3 3.5 4 4.5 5 Original Auto Observer PCLSK LEIS RMS Error in Temperature (oC) (a) Error (boxplot) 0 20 40 60 80 0 1 2 3 4 5 6 Timesteps RMS Error in Temperature (oC) Original Autonomous Kernel Observer N = 2 PCLSK LEIS (b) Error (time-series) Figure 4: Comparison of kernel observer to PCLSK and LEIS methods on Intel dataset. 0 2 4 6 8 10 Original Auto Observer PCLSK LEIS RMS Error in Wind Speed (knots) (a) Error (boxplot) 0 10 20 30 40 0 2 4 6 8 10 12 Timesteps RMS Error in Wind Speed (knots) Original Autonomous Kernel Observer N = 2 PCLSK LEIS (b) Error (time-series) Figure 5: Irish Wind 270 275 280 285 290 295 300 305 310 (a) AVHHR estimate Jul 11 Sep 11 Nov 11 Jan 12 Mar 12 May 12 2 4 6 8 10 12 14 16 18 20 Timesteps RMS Error in Temperature (K) Original Autonomous KO (N = 1000) (b) Error-day (time-series) Jul 11 Sep 11 Nov 11 Jan 12 Mar 12 May 12 2 4 6 8 10 12 14 16 18 20 Timesteps RMS Error in Temperature (K) Original Autonomous KO (N = 1000) (c) Error-night (time-series) 2 4 6 8 10 12 14 16 18 20 Original Auto N=250 N=500 N=1000 RMS Error in Temperature (K) (d) Error-day (boxplot) 2 4 6 8 10 12 14 16 18 20 Original Auto N=250 N=500 N=1000 RMS Error in Temperature (K) (e) Error-night (boxplot) 0 1 2 3 4 5 6 Original Auto N=250 N=500 N=1000 Training Time (seconds) (f) Estimation time (day) Figure 6: Performance of the kernel observer over AVVHR satellite 2011-12 data with different numbers of observation locations. index of bA was determined to be 250 and hence the Kalman filter for kernel observer model using N ∈{250, 500, 1000} at random locations was utilized to track the system state given a random initial condition w0. As a fair baseline, the observers are compared to training a sparse GP model (labeled ‘original’) on approximately 400, 000 measurements per day. Figures 6b and 6c compare the autonomous and feedback approach with 1, 000 samples to the baseline GP; here, it can be seen that the autonomous does well in the beginning, but then incurs an unacceptable amount of error when the time series goes into 2012, i.e. where the model has not seen any training data, whereas KO does well throughout. Figures 6d and 6e show a comparison of the RMS error of estimated values from the real data. This figure shows the trend of the observer getting better state estimates as a function of the number of sensing locations N 5. Finally, the prediction time of KO is much less than retraining the model every time step, as shown in Figure 6f. 4 Conclusions This paper presented a new approach to the problem of monitoring complex spatiotemporally evolving phenomena with limited sensors. Unlike most Neural Network or Kernel based models, the presented approach inherently incorporates differential constraints on the spatiotemporal evolution of the mixing weights of a kernel model. In addition to providing an elegant and efficient model, the main benefit of the inclusion of the differential constraint in the model synthesis is that it allowed the derivation of fundamental results concerning the minimum number of sampling locations required, and the identification of correlations in the spatiotemporal evolution, by building upon the rich literature in systems theory. These results are non-conservative, and as such provide direct guidance in ensuring robust real-world predictive inference with distributed sensor networks. Acknowledgment This work was supported by AFOSR grant #FA9550-15-1-0146. 5Note that we checked the performance of training a GP with only 1, 000 samples as a control, but the average error was about 10 Kelvins, i.e. much worse than KO. 8 References [1] Haim Brezis. Functional analysis, Sobolev spaces and partial differential equations. Springer Science & Business Media, 2010. [2] Noel Cressie and Christopher K Wikle. Statistics for spatio-temporal data. John Wiley & Sons, 2011. [3] Lehel Csatö and Manfred Opper. Sparse on-line gaussian processes. Neural computation, 14(3):641–668, 2002. [4] Sahil Garg, Amarjeet Singh, and Fabio Ramos. Learning non-stationary space-time models for environmental monitoring. In Proceedings of the Twenty-Sixth AAAI Conference on Artificial Intelligence, July 22-26, 2012, Toronto, Ontario, Canada., 2012. [5] David Higdon. A process-convolution approach to modelling temperatures in the north atlantic ocean. Environmental and Ecological Statistics, 5(2):173–190, 1998. [6] Sadeep Jayasumana, Richard Hartley, Mathieu Salzmann, Hongdong Li, and Mehrtash Harandi. Kernel Methods on Riemannian Manifolds with Gaussian RBF Kernels. IEEE Transactions on Pattern Analysis and Machine Intelligence (TPAMI), 2015. [7] Chunsheng Ma. Nonstationary covariance functions that model space–time interactions. Statistics & Probability Letters, 61(4):411–419, 2003. [8] Kanti V Mardia, Colin Goodall, Edwin J Redfern, and Francisco J Alonso. The kriged kalman filter. Test, 7(2):217–282, 1998. [9] C Paciorek and M Schervish. Nonstationary covariance functions for gaussian process regression. Advances in neural information processing systems, 16:273–280, 2004. [10] Fernando Pérez-Cruz, Steven Van Vaerenbergh, Juan José Murillo-Fuentes, Miguel LázaroGredilla, and Ignacio Santamaria. Gaussian processes for nonlinear signal processing: An overview of recent advances. Signal Processing Magazine, IEEE, 30(4):40–50, 2013. [11] Tobias Pfingsten, Malte Kuss, and Carl Edward Rasmussen. Nonstationary gaussian process regression using a latent extension of the input space, 2006. [12] Christian Plagemann, Kristian Kersting, and Wolfram Burgard. Nonstationary gaussian process regression using point estimates of local smoothness. In Machine learning and knowledge discovery in databases, pages 204–219. Springer, 2008. [13] Ali Rahimi and Benjamin Recht. Random features for large-scale kernel machines. In NIPS, pages 1177–1184, 2007. [14] Carl E. Rasmussen and Christopher K. I. Williams. Gaussian Processes for Machine Learning. The MIT Press, December 2005. [15] Alexandra M Schmidt and Anthony O’Hagan. Bayesian inference for non-stationary spatial covariance structure via spatial deformations. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 65(3):743–758, 2003. [16] Amarjeet Singh, Fabio Ramos, H Durrant-Whyte, and William J Kaiser. Modeling and decision making in spatio-temporal processes for environmental surveillance. In Robotics and Automation (ICRA), 2010 IEEE International Conference on, pages 5490–5497. IEEE, 2010. [17] Christopher K Wikle. A kernel-based spectral model for non-gaussian spatio-temporal processes. Statistical Modelling, 2(4):299–314, 2002. [18] Christopher Williams and Matthias Seeger. Using the Nyström method to speed up kernel machines. In NIPS, pages 682–688, 2001. [19] W Murray Wonham. Linear multivariable control. Springer, 1974. [20] Kemin Zhou, John C. Doyle, and Keith Glover. Robust and Optimal Control. Prentice Hall, Upper Saddle River, NJ, 1996. 9
2016
360
6,284
Hierarchical Question-Image Co-Attention for Visual Question Answering Jiasen Lu∗, Jianwei Yang∗, Dhruv Batra∗† , Devi Parikh∗† ∗Virginia Tech, † Georgia Institute of Technology {jiasenlu, jw2yang, dbatra, parikh}@vt.edu Abstract A number of recent works have proposed attention models for Visual Question Answering (VQA) that generate spatial maps highlighting image regions relevant to answering the question. In this paper, we argue that in addition to modeling “where to look” or visual attention, it is equally important to model “what words to listen to” or question attention. We present a novel co-attention model for VQA that jointly reasons about image and question attention. In addition, our model reasons about the question (and consequently the image via the co-attention mechanism) in a hierarchical fashion via a novel 1-dimensional convolution neural networks (CNN). Our model improves the state-of-the-art on the VQA dataset from 60.3% to 60.5%, and from 61.6% to 63.3% on the COCO-QA dataset. By using ResNet, the performance is further improved to 62.1% for VQA and 65.4% for COCO-QA.1. 1 Introduction Visual Question Answering (VQA) [2, 6, 14, 15, 27] has emerged as a prominent multi-discipline research problem in both academia and industry. To correctly answer visual questions about an image, the machine needs to understand both the image and question. Recently, visual attention based models [18, 21–23] have been explored for VQA, where the attention mechanism typically produces a spatial map highlighting image regions relevant to answering the question. So far, all attention models for VQA in literature have focused on the problem of identifying “where to look” or visual attention. In this paper, we argue that the problem of identifying “which words to listen to” or question attention is equally important. Consider the questions “how many horses are in this image?” and “how many horses can you see in this image?". They have the same meaning, essentially captured by the first three words. A machine that attends to the first three words would arguably be more robust to linguistic variations irrelevant to the meaning and answer of the question. Motivated by this observation, in addition to reasoning about visual attention, we also address the problem of question attention. Specifically, we present a novel multi-modal attention model for VQA with the following two unique features: Co-Attention: We propose a novel mechanism that jointly reasons about visual attention and question attention, which we refer to as co-attention. Unlike previous works, which only focus on visual attention, our model has a natural symmetry between the image and question, in the sense that the image representation is used to guide the question attention and the question representation(s) are used to guide image attention. Question Hierarchy: We build a hierarchical architecture that co-attends to the image and question at three levels: (a) word level, (b) phrase level and (c) question level. At the word level, we embed the words to a vector space through an embedding matrix. At the phrase level, 1-dimensional convolution neural networks are used to capture the information contained in unigrams, bigrams and trigrams. 1The source code can be downloaded from https://github.com/jiasenlu/HieCoAttenVQA 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. Ques%on:  What  color  on  the                                                          stop  light  is  lit  up    ?     …   …   color  stop  light  lit   co-­‐a7en%on   color   …   stop     light     …     What   color   …   the   stop   light     light     …     What   color   What  color  on  the  stop  light  is  lit  up   …   …   the  stop  light   …   …   stop     Image   Answer:  green   Figure 1: Flowchart of our proposed hierarchical co-attention model. Given a question, we extract its word level, phrase level and question level embeddings. At each level, we apply co-attention on both the image and question. The final answer prediction is based on all the co-attended image and question features. Specifically, we convolve word representations with temporal filters of varying support, and then combine the various n-gram responses by pooling them into a single phrase level representation. At the question level, we use recurrent neural networks to encode the entire question. For each level of the question representation in this hierarchy, we construct joint question and image co-attention maps, which are then combined recursively to ultimately predict a distribution over the answers. Overall, the main contributions of our work are: • We propose a novel co-attention mechanism for VQA that jointly performs question-guided visual attention and image-guided question attention. We explore this mechanism with two strategies, parallel and alternating co-attention, which are described in Sec. 3.3; • We propose a hierarchical architecture to represent the question, and consequently construct image-question co-attention maps at 3 different levels: word level, phrase level and question level. These co-attended features are then recursively combined from word level to question level for the final answer prediction; • At the phrase level, we propose a novel convolution-pooling strategy to adaptively select the phrase sizes whose representations are passed to the question level representation; • Finally, we evaluate our proposed model on two large datasets, VQA [2] and COCO-QA [15]. We also perform ablation studies to quantify the roles of different components in our model. 2 Related Work Many recent works [2, 6, 11, 14, 15, 25] have proposed models for VQA. We compare and relate our proposed co-attention mechanism to other vision and language attention mechanisms in literature. Image attention. Instead of directly using the holistic entire-image embedding from the fully connected layer of a deep CNN (as in [2, 13–15]), a number of recent works have explored image attention models for VQA. Zhu et al. [26] add spatial attention to the standard LSTM model for pointing and grounded QA. Andreas et al. [1] propose a compositional scheme that consists of a language parser and a number of neural modules networks. The language parser predicts which neural module network should be instantiated to answer the question. Some other works perform image attention multiple times in a stacked manner. In [23], the authors propose a stacked attention network, which runs multiple hops to infer the answer progressively. To capture fine-grained information from the question, Xu et al. [22] propose a multi-hop image attention scheme. It aligns words to image patches in the first hop, and then refers to the entire question for obtaining image attention maps in the second hop. In [18], the authors generate image regions with object proposals and then select the regions relevant to the question and answer choice. Xiong et al. [21] augments dynamic memory network with a new input fusion module and retrieves an answer from an attention based GRU. In 2 concurrent work, [5] collected ‘human attention maps’ that are used to evaluate the attention maps generated by attention models for VQA. Note that all of these approaches model visual attention alone, and do not model question attention. Moreover, [22, 23] model attention sequentially, i.e., later attention is based on earlier attention, which is prone to error propagation. In contrast, we conduct co-attention at three levels independently. Language Attention. Though no prior work has explored question attention in VQA, there are some related works in natural language processing (NLP) in general that have modeled language attention. In order to overcome difficulty in translation of long sentences, Bahdanau et al. [3] propose RNNSearch to learn an alignment over the input sentences. In [8], the authors propose an attention model to circumvent the bottleneck caused by fixed width hidden vector in text reading and comprehension. A more fine-grained attention mechanism is proposed in [16]. The authors employ a word-by-word neural attention mechanism to reason about the entailment in two sentences. Also focused on modeling sentence pairs, the authors in [24] propose an attention-based bigram CNN for jointly performing attention between two CNN hierarchies. In their work, three attention schemes are proposed and evaluated. In [17], the authors propose a two-way attention mechanism to project the paired inputs into a common representation space. 3 Method We begin by introducing the notation used in this paper. To ease understanding, our full model is described in parts. First, our hierarchical question representation is described in Sec. 3.2 and the proposed co-attention mechanism is then described in Sec. 3.3. Finally, Sec. 3.4 shows how to recursively combine the attended question and image features to output answers. 3.1 Notation Given a question with T words, its representation is denoted by Q = {q1, . . . qT }, where qt is the feature vector for the t-th word. We denote qw t , qp t and qs t as word embedding, phrase embedding and question embedding at position t, respectively. The image feature is denoted by V = {v1, ..., vN}, where vn is the feature vector at the spatial location n. The co-attention features of image and question at each level in the hierarchy are denoted as ˆvr and ˆqr where r ∈{w, p, s}. The weights in different modules/layers are denoted with W , with appropriate sub/super-scripts as necessary. In the exposition that follows, we omit the bias term b to avoid notational clutter. 3.2 Question Hierarchy Given the 1-hot encoding of the question words Q = {q1, . . . , qT }, we first embed the words to a vector space (learnt end-to-end) to get Qw = {qw 1 , . . . , qw T }. To compute the phrase features, we apply 1-D convolution on the word embedding vectors. Concretely, at each word location, we compute the inner product of the word vectors with filters of three window sizes: unigram, bigram and trigram. For the t-th word, the convolution output with window size s is given by ˆqp s,t = tanh(W s c qw t:t+s−1), s ∈{1, 2, 3} (1) where W s c is the weight parameters. The word-level features Qw are appropriately 0-padded before feeding into bigram and trigram convolutions to maintain the length of the sequence after convolution. Given the convolution result, we then apply max-pooling across different n-grams at each word location to obtain phrase-level features qp t = max(ˆqp 1,t, ˆqp 2,t, ˆqp 3,t), t ∈{1, 2, . . . , T} (2) Our pooling method differs from those used in previous works [9] in that it adaptively selects different gram features at each time step, while preserving the original sequence length and order. We use a LSTM to encode the sequence qp t after max-pooling. The corresponding question-level feature qs t is the LSTM hidden vector at time t. Our hierarchical representation of the question is depicted in Fig. 3(a). 3.3 Co-Attention We propose two co-attention mechanisms that differ in the order in which image and question attention maps are generated. The first mechanism, which we call parallel co-attention, generates 3 (b)     Image A A A Ques+on 0   Q V (a)   Image Ques+on x x Q V C x x WvV WqQ aq av 1.   2.   3.   ˆq ˆq ˆs ˆv ˆv Figure 2: (a) Parallel co-attention mechanism; (b) Alternating co-attention mechanism. image and question attention simultaneously. The second mechanism, which we call alternating co-attention, sequentially alternates between generating image and question attentions. See Fig. 2. These co-attention mechanisms are executed at all three levels of the question hierarchy. Parallel Co-Attention. Parallel co-attention attends to the image and question simultaneously. Similar to [22], we connect the image and question by calculating the similarity between image and question features at all pairs of image-locations and question-locations. Specifically, given an image feature map V ∈Rd×N, and the question representation Q ∈Rd×T , the affinity matrix C ∈RT ×N is calculated by C = tanh(QT WbV ) (3) where Wb ∈Rd×d contains the weights. After computing this affinity matrix, one possible way of computing the image (or question) attention is to simply maximize out the affinity over the locations of other modality, i.e. av[n] = maxi(Ci,n) and aq[t] = maxj(Ct,j). Instead of choosing the max activation, we find that performance is improved if we consider this affinity matrix as a feature and learn to predict image and question attention maps via the following Hv = tanh(WvV + (WqQ)C), Hq = tanh(WqQ + (WvV )CT ) av = softmax(wT hvHv), aq = softmax(wT hqHq) (4) where Wv, Wq ∈Rk×d, whv, whq ∈Rk are the weight parameters. av ∈RN and aq ∈RT are the attention probabilities of each image region vn and word qt respectively. The affinity matrix C transforms question attention space to image attention space (vice versa for CT ). Based on the above attention weights, the image and question attention vectors are calculated as the weighted sum of the image features and question features, i.e., ˆv = N X n=1 av nvn, ˆq = T X t=1 aq tqt (5) The parallel co-attention is done at each level in the hierarchy, leading to ˆvr and ˆqr where r ∈ {w, p, s}. Alternating Co-Attention. In this attention mechanism, we sequentially alternate between generating image and question attention. Briefly, this consists of three steps (marked in Fig. 2b): 1) summarize the question into a single vector q; 2) attend to the image based on the question summary q; 3) attend to the question based on the attended image feature. Concretely, we define an attention operation ˆx = A(X; g), which takes the image (or question) features X and attention guidance g derived from question (or image) as inputs, and outputs the attended image (or question) vector. The operation can be expressed in the following steps H = tanh(WxX + (Wgg)1T ) ax = softmax(wT hxH) ˆx = X ax i xi (6) 4 “What              color            on        the        …                      up    ?”   Word  embedding Convolu1on  layer   with  mul1ple  filter   of  different  widths Max-­‐over  different   filter  pooling  layer LSTM  ques1on   encoding LSTM   LSTM   LSTM   LSTM   …   …   …   …   (a)   (b)   Answer   ˆq p ˆv p ˆqs ˆvs h p hw ˆqw ˆvw +   +   +   hs so;max   Figure 3: (a) Hierarchical question encoding (Sec. 3.2); (b) Encoding for predicting answers (Sec. 3.4). where 1 is a vector with all elements to be 1. Wx, Wg ∈Rk×d and whx ∈Rk are parameters. ax is the attention weight of feature X. The alternating co-attention process is illustrated in Fig. 2 (b). At the first step of alternating coattention, X = Q, and g is 0; At the second step, X = V where V is the image features, and the guidance g is intermediate attended question feature ˆs from the first step; Finally, we use the attended image feature ˆv as the guidance to attend the question again, i.e., X = Q and g = ˆv. Similar to the parallel co-attention, the alternating co-attention is also done at each level of the hierarchy. 3.4 Encoding for Predicting Answers Following [2], we treat VQA as a classification task. We predict the answer based on the coattended image and question features from all three levels. We use a multi-layer perceptron (MLP) to recursively encode the attention features as shown in Fig. 3(b). hw = tanh(Ww(ˆqw + ˆvw)) hp = tanh(Wp[(ˆqp + ˆvp), hw]) hs = tanh(Ws[(ˆqs + ˆvs), hp]) p = softmax(Whhs) (7) where Ww, Wp, Ws and Wh are the weight parameters. [·] is the concatenation operation on two vectors. p is the probability of the final answer. 4 Experiment 4.1 Datasets We evaluate the proposed model on two datasets, the VQA dataset [2] and the COCO-QA dataset [15]. VQA dataset [2] is the largest dataset for this problem, containing human annotated questions and answers on Microsoft COCO dataset [12]. The dataset contains 248,349 training questions, 121,512 validation questions, 244,302 testing questions, and a total of 6,141,630 question-answers pairs. There are three sub-categories according to answer-types including yes/no, number, and other. Each question has 10 free-response answers. We use the top 1000 most frequent answers as the possible outputs similar to [2]. This set of answers covers 86.54% of the train+val answers. For testing, we train our model on VQA train+val and report the test-dev and test-standard results from the VQA evaluation server. We use the evaluation protocol of [2] in the experiment. COCO-QA dataset [15] is automatically generated from captions in the Microsoft COCO dataset [12]. There are 78,736 train questions and 38,948 test questions in the dataset. These questions are based on 8,000 and 4,000 images respectively. There are four types of questions including object, number, color, and location. Each type takes 70%, 7%, 17%, and 6% of the whole dataset, respectively. All answers in this data set are single word. As in [15], we report classification accuracy as well as Wu-Palmer similarity (WUPS) in Table 2. 5 Table 1: Results on the VQA dataset. “-” indicates the results is not available. Open-Ended Multiple-Choice test-dev test-std test-dev test-std Method Y/N Num Other All All Y/N Num Other All All LSTM Q+I [2] 80.5 36.8 43.0 57.8 58.2 80.5 38.2 53.0 62.7 63.1 Region Sel. [18] 77.6 34.3 55.8 62.4 SMem [22] 80.9 37.3 43.1 58.0 58.2 SAN [23] 79.3 36.6 46.1 58.7 58.9 FDA [10] 81.1 36.2 45.8 59.2 59.5 81.5 39.0 54.7 64.0 64.2 DMN+ [21] 80.5 36.8 48.3 60.3 60.4 Oursp+VGG 79.5 38.7 48.3 60.1 79.5 39.8 57.4 64.6 Oursa+VGG 79.6 38.4 49.1 60.5 79.7 40.1 57.9 64.9 Oursa+ResNet 79.7 38.7 51.7 61.8 62.1 79.7 40.0 59.8 65.8 66.1 4.2 Setup We use Torch [4] to develop our model. We use the Rmsprop optimizer with a base learning rate of 4e-4, momentum 0.99 and weight-decay 1e-8. We set batch size to be 300 and train for up to 256 epochs with early stopping if the validation accuracy has not improved in the last 5 epochs. For COCO-QA, the size of hidden layer Ws is set to 512 and 1024 for VQA since it is a much larger dataset. All the other word embedding and hidden layers were vectors of size 512. We apply dropout with probability 0.5 on each layer. Following [23], we rescale the image to 448 × 448, and then take the activation from the last pooling layer of VGGNet [19] or ResNet [7] as its feature. 4.3 Results and Analysis There are two test scenarios on VQA: open-ended and multiple-choice. The best performing method deeper LSTM Q + norm I from [2] is used as our baseline. For open-ended test scenario, we compare our method with the recent proposed SMem [22], SAN [23], FDA [10] and DMN+ [21]. For multiple choice, we compare with Region Sel. [18] and FDA [10]. We compare with 2VIS+BLSTM [15], IMG-CNN [13] and SAN [23] on COCO-QA. We use Oursp to refer to our parallel co-attention, Oursa for alternating co-attention. Table 1 shows results on the VQA test sets for both open-ended and multiple-choice settings. We can see that our approach improves the state of art from 60.4% (DMN+ [21]) to 62.1% (Oursa+ResNet) on open-ended and from 64.2% (FDA [10]) to 66.1% (Oursa+ResNet) on multiple-choice. Notably, for the question type Other and Num, we achieve 3.4% and 1.4% improvement on open-ended questions, and 4.0% and 1.1% on multiple-choice questions. As we can see, ResNet features outperform or match VGG features in all cases. Our improvements are not solely due to the use of a better CNN. Specifically, FDA [10] also uses ResNet [7], but Oursa+ResNet outperforms it by 1.8% on test-dev. SMem [22] uses GoogLeNet [20] and the rest all use VGGNet [19], and Ours+VGG outperforms them by 0.2% on test-dev (DMN+ [21]). Table 2 shows results on the COCO-QA test set. Similar to the result on VQA, our model improves the state-of-the-art from 61.6% (SAN(2,CNN) [23]) to 65.4% (Oursa+ResNet). We observe that parallel co-attention performs better than alternating co-attention in this setup. Both attention mechanisms have their advantages and disadvantages: parallel co-attention is harder to train because of the dot product between image and text which compresses two vectors into a single value. On the other hand, alternating co-attention may suffer from errors being accumulated at each round. 4.4 Ablation Study In this section, we perform ablation studies to quantify the role of each component in our model. Specifically, we re-train our approach by ablating certain components: • Image Attention alone, where in a manner similar to previous works [23], we do not use any question attention. The goal of this comparison is to verify that our improvements are not the result of orthogonal contributions. (say better optimization or better CNN features). 6 Table 2: Results on the COCO-QA dataset. “-” indicates the results is not available. Method Object Number Color Location Accuracy WUPS0.9 WUPS0.0 2-VIS+BLSTM [15] 58.2 44.8 49.5 47.3 55.1 65.3 88.6 IMG-CNN [13] 58.4 68.5 89.7 SAN(2, CNN) [23] 64.5 48.6 57.9 54.0 61.6 71.6 90.9 Oursp+VGG 65.6 49.6 61.5 56.8 63.3 73.0 91.3 Oursa+VGG 65.6 48.9 59.8 56.7 62.9 72.8 91.3 Oursa+ResNet 68.0 51.0 62.9 58.8 65.4 75.1 92.0 • Question Attention alone, where no image attention is performed. • W/O Conv, where no convolution and pooling is performed to represent phrases. Instead, we stack another word embedding layer on the top of word level outputs. • W/O W-Atten, where no word level co-attention is performed. We replace the word level attention with a uniform distribution. Phrase and question level co-attentions are still modeled. • W/O P-Atten, where no phrase level co-attention is performed, and the phrase level attention is set to be uniform. Word and question level co-attentions are still modeled. • W/O Q-Atten, where no question level co-attention is performed. We replace the question level attention with a uniform distribution. Word and phrase level co-attentions are still modeled. Table 3 shows the comparison of our full approach w.r.t these ablations on the VQA validation set (test sets are not recommended to be used for such experiments). The deeper LSTM Q + norm I baseline in [2] is also reported for comparison. We can see that image-attention-alone does improve performance over the holistic image feature (deeper LSTM Q + norm I), which is consistent with findings of previous attention models for VQA [21, 23]. Table 3: Ablation study on the VQA dataset using Oursa+VGG. validation Method Y/N Num Other All LSTM Q+I 79.8 32.9 40.7 54.3 Image Atten 79.8 33.9 43.6 55.9 Question Atten 79.4 33.3 41.7 54.8 W/O Q-Atten 79.6 32.1 42.9 55.3 W/O P-Atten 79.5 34.1 45.4 56.7 W/O W-Atten 79.6 34.4 45.6 56.8 Full Model 79.6 35.0 45.7 57.0 Comparing the full model w.r.t. ablated versions without word, phrase, question level attentions reveals a clear interesting trend – the attention mechanisms closest to the ‘top’ of the hierarchy (i.e. question) matter most, with a drop of 1.7% in accuracy if not modeled; followed by the intermediate level (i.e. phrase), with a drop of 0.3%; finally followed by the ‘bottom’ of the hierarchy (i.e. word), with a drop of 0.2% in accuracy. We hypothesize that this is because the question level is the ‘closest’ to the answer prediction layers in our model. Note that all levels are important, and our final model significantly outperforms not using any linguistic attention (1.1% difference between Full Model and Image Atten). The question attention alone model is better than LSTM Q+I, with an improvement of 0.5% and worse than image attention alone, with a drop of 1.1%. Oursa further improves if we performed alternating co-attention for one more round, with an improvement of 0.3%. 4.5 Qualitative Results We now visualize some co-attention maps generated by our method in Fig. 4. At the word level, our model attends mostly to the object regions in an image, e.g., heads, bird. At the phrase level, the image attention has different patterns across images. For the first two images, the attention transfers from objects to background regions. For the third image, the attention becomes more focused on the objects. We suspect that this is caused by the different question types. On the question side, our model is capable of localizing the key phrases in the question, thus essentially discovering the question types in the dataset. For example, our model pays attention to the phrases “what color” and “how many snowboarders”. Our model successfully attends to the regions in images and phrases in the questions appropriate for answering the question, e.g., “color of the bird” and bird region. Because 7 Q: what is the man holding a snowboard on top of a snow covered? A: mountain what is the man holding a snowboard on top of a snow covered what is the man holding a snowboard on top of a snow covered ? what is the man holding a snowboard on top of a snow covered ? Q: what is the color of the bird? A: white what is the color of the bird ? what is the color of the bird ? what is the color of the bird ? Q: how many snowboarders in formation in the snow, four is sitting? A: 5 how many snowboarders in formation in the snow , four is sitting ? how many snowboarders in formation in the snow , four is sitting ? how many snowboarders in formation in the snow , four is sitting ? Figure 4: Visualization of image and question co-attention maps on the COCO-QA dataset. From left to right: original image and question pairs, word level co-attention maps, phrase level co-attention maps and question level co-attention maps. For visualization, both image and question attentions are scaled (from red:high to blue:low). Best viewed in color. our model performs co-attention at three levels, it often captures complementary information from each level, and then combines them to predict the answer. 5 Conclusion In this paper, we proposed a hierarchical co-attention model for visual question answering. Coattention allows our model to attend to different regions of the image as well as different fragments of the question. We model the question hierarchically at three levels to capture information from different granularities. The ablation studies further demonstrate the roles of co-attention and question hierarchy in our final performance. Through visualizations, we can see that our model co-attends to interpretable regions of images and questions for predicting the answer. Though our model was evaluated on visual question answering, it can be potentially applied to other tasks involving vision and language. Acknowledgements This work was funded in part by NSF CAREER awards to DP and DB, an ONR YIP award to DP, ONR Grant N00014-14-1-0679 to DB, a Sloan Fellowship to DP, ARO YIP awards to DB and DP, a Allen Distinguished Investigator award to DP from the Paul G. Allen Family Foundation, ICTAS Junior Faculty awards to DB and DP, Google Faculty Research Awards to DP and DB, AWS in Education Research grant to DB, and NVIDIA GPU donations to DB. The views and conclusions contained herein are those of the authors and should not be interpreted as necessarily representing the official policies or endorsements, either expressed or implied, of the U.S. Government or any sponsor. References [1] Jacob Andreas, Marcus Rohrbach, Trevor Darrell, and Dan Klein. Deep compositional question answering with neural module networks. In CVPR, 2016. [2] Stanislaw Antol, Aishwarya Agrawal, Jiasen Lu, Margaret Mitchell, Dhruv Batra, C Lawrence Zitnick, and Devi Parikh. Vqa: Visual question answering. In ICCV, 2015. [3] Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. In ICLR, 2015. 8 [4] R. Collobert, K. Kavukcuoglu, and C. Farabet. Torch7: A matlab-like environment for machine learning. In BigLearn, NIPS Workshop, 2011. [5] Abhishek Das, Harsh Agrawal, C Lawrence Zitnick, Devi Parikh, and Dhruv Batra. Human attention in visual question answering: Do humans and deep networks look at the same regions? arXiv preprint arXiv:1606.03556, 2016. [6] Haoyuan Gao, Junhua Mao, Jie Zhou, Zhiheng Huang, Lei Wang, and Wei Xu. Are you talking to a machine? dataset and methods for multilingual image question answering. In NIPS, 2015. [7] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016. [8] Karl Moritz Hermann, Tomas Kocisky, Edward Grefenstette, Lasse Espeholt, Will Kay, Mustafa Suleyman, and Phil Blunsom. Teaching machines to read and comprehend. In NIPS, 2015. [9] Baotian Hu, Zhengdong Lu, Hang Li, and Qingcai Chen. Convolutional neural network architectures for matching natural language sentences. In NIPS, 2014. [10] Ilija Ilievski, Shuicheng Yan, and Jiashi Feng. A focused dynamic attention model for visual question answering. arXiv:1604.01485, 2016. [11] Ranjay Krishna, Yuke Zhu, Oliver Groth, Justin Johnson, Kenji Hata, Joshua Kravitz, Stephanie Chen, Yannis Kalantidis, Li-Jia Li, David A Shamma, et al. Visual genome: Connecting language and vision using crowdsourced dense image annotations. arXiv preprint arXiv:1602.07332, 2016. [12] Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dollár, and C Lawrence Zitnick. Microsoft coco: Common objects in context. In ECCV, 2014. [13] Lin Ma, Zhengdong Lu, and Hang Li. Learning to answer questions from image using convolutional neural network. In AAAI, 2016. [14] Mateusz Malinowski, Marcus Rohrbach, and Mario Fritz. Ask your neurons: A neural-based approach to answering questions about images. In ICCV, 2015. [15] Mengye Ren, Ryan Kiros, and Richard Zemel. Exploring models and data for image question answering. In NIPS, 2015. [16] Tim Rocktäschel, Edward Grefenstette, Karl Moritz Hermann, Tomáš Koˇcisk`y, and Phil Blunsom. Reasoning about entailment with neural attention. In ICLR, 2016. [17] Cicero dos Santos, Ming Tan, Bing Xiang, and Bowen Zhou. Attentive pooling networks. arXiv preprint arXiv:1602.03609, 2016. [18] Kevin J Shih, Saurabh Singh, and Derek Hoiem. Where to look: Focus regions for visual question answering. In CVPR, 2016. [19] Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. CoRR, abs/1409.1556, 2014. [20] Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott Reed, Dragomir Anguelov, Dumitru Erhan, Vincent Vanhoucke, and Andrew Rabinovich. Going deeper with convolutions. In CVPR, 2015. [21] Caiming Xiong, Stephen Merity, and Richard Socher. Dynamic memory networks for visual and textual question answering. In ICML, 2016. [22] Huijuan Xu and Kate Saenko. Ask, attend and answer: Exploring question-guided spatial attention for visual question answering. arXiv preprint arXiv:1511.05234, 2015. [23] Zichao Yang, Xiaodong He, Jianfeng Gao, Li Deng, and Alex Smola. Stacked attention networks for image question answering. In CVPR, 2016. [24] Wenpeng Yin, Hinrich Schütze, Bing Xiang, and Bowen Zhou. Abcnn: Attention-based convolutional neural network for modeling sentence pairs. In ACL, 2016. [25] Peng Zhang, Yash Goyal, Douglas Summers-Stay, Dhruv Batra, and Devi Parikh. Yin and yang: Balancing and answering binary visual questions. arXiv preprint arXiv:1511.05099, 2015. [26] Yuke Zhu, Oliver Groth, Michael Bernstein, and Li Fei-Fei. Visual7w: Grounded question answering in images. In CVPR, 2016. [27] C Lawrence Zitnick, Aishwarya Agrawal, Stanislaw Antol, Margaret Mitchell, Dhruv Batra, and Devi Parikh. Measuring machine intelligence through visual question answering. AI Magazine, 37(1), 2016. 9
2016
361
6,285
Double Thompson Sampling for Dueling Bandits Huasen Wu University of California, Davis hswu@ucdavis.edu Xin Liu University of California, Davis xinliu@ucdavis.edu Abstract In this paper, we propose a Double Thompson Sampling (D-TS) algorithm for dueling bandit problems. As its name suggests, D-TS selects both the first and the second candidates according to Thompson Sampling. Specifically, D-TS maintains a posterior distribution for the preference matrix, and chooses the pair of arms for comparison according to two sets of samples independently drawn from the posterior distribution. This simple algorithm applies to general Copeland dueling bandits, including Condorcet dueling bandits as a special case. For general Copeland dueling bandits, we show that D-TS achieves O(K2 log T) regret. Moreover, using a back substitution argument, we refine the regret to O(K log T + K2 log log T) in Condorcet dueling bandits and most practical Copeland dueling bandits. In addition, we propose an enhancement of D-TS, referred to as D-TS+, to reduce the regret in practice by carefully breaking ties. Experiments based on both synthetic and real-world data demonstrate that D-TS and D-TS+ significantly improve the overall performance, in terms of regret and robustness. 1 Introduction The dueling bandit problem [1] is a variant of the classical multi-armed bandit (MAB) problem, where the feedback comes in the form of pairwise comparison. This model has attracted much attention as it can be applied in many systems such as information retrieval (IR) [2, 3], where user preferences are easier to obtain and typically more stable. Most earlier work [1, 4, 5] focuses on Condorcet dueling bandits, where there exists an arm, referred to as the Condorcet winner, that beats all other arms. Recent work [6, 7] turns to a more general and practical case of a Copeland winner(s), which is the arm (or arms) that beats the most other arms. Existing algorithms are mainly generalized from traditional MAB algorithms along two lines: 1) UCB (Upper Confidence Bound)-type algorithms, such as RUCB [4] and CCB [6]; and, 2) MED (Minimum Empirical Divergence)-type algorithms, such as RMED [5] and CW-RMED/ECW-RMED [7]. In traditional MAB, an alternative effective solution is Thompson Sampling (TS) [8]. Its principle is to choose the optimal action that maximizes the expected reward according to the randomly drawn belief. TS has been successfully applied in traditional MAB [9, 10, 11, 12] and other online learning problems [13, 14]. In particular, empirical studies in [9] show that TS not only achieves lower regret than other algorithms in practice, but is also more robust as a randomized algorithm. In the wake of the success of TS in these online learning problems, a natural question is whether and how TS can be applied to dueling bandits to further improve the performance. However, it is challenging to apply the standard TS framework to dueling bandits, because not all comparisons provide information about the system statistics. Specifically, a good learning algorithm for dueling bandits will eventually compare the winner against itself. However, comparing one arm against itself does not provide any statistical information, which is critical in TS to update the posterior distribution. Thus, TS needs to be adjusted so that 1) comparing the winners against themselves is allowed, but, 2) trapping in comparing a non-winner arm against itself is avoided. In this paper, we propose a Double Thompson Sampling (D-TS) algorithm for dueling bandits, including both Condorcet dueling bandits and general Copeland dueling bandits. As its name suggests, D-TS typically selects both the first and the second candidates according to samples independently drawn from the posterior distribution. D-TS also utilizes the idea of confidence bounds to eliminate the likely non-winner arms, and thus avoids trapping in suboptimal comparisons. Compared to prior studies on dueling bandits, D-TS has both practical and theoretical advantages. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. First, the double sampling structure of D-TS better suits the nature of dueling bandits. Launching two independent rounds of sampling provides us the opportunity to select the same arm in both rounds and thus to compare the winners against themselves. This double sampling structure also leads to more extensive utilization of TS (e.g., compared to RCS [3]), and significantly reduces the regret. In addition, this simple framework applies to general Copeland dueling bandits and achieves lower regret than existing algorithms such as CCB [6]. Moreover, as a randomized algorithm, D-TS is more robust in practice. Second, this double sampling structure enables us to obtain theoretical bounds for the regret of D-TS. As noted in traditional MAB literature [10, 15], theoretical analysis of TS is usually more difficult than UCB-type algorithms. The analysis in dueling bandits is even more challenging because the selection of arms involves more factors and the two selected arms may be correlated. To address this issue, our D-TS algorithm draws the two sets of samples independently. Because their distributions are fully captured by historic comparison results, when the first candidate is fixed, the comparison between it and all other arms is similar to traditional MAB and thus we can borrow ideas from traditional MAB. Using the properties of TS and confidence bounds, we show that D-TS achieves O(K2 log T) regret for a general K-armed Copeland dueling bandit. More interestingly, the property that the sample distribution only depends on historic comparing results (but not t) enables us to refine the regret using a back substitution argument, where we show that D-TS achieves O(K log T + K2 log log T) in Condorcet dueling bandits and many practical Copeland dueling bandits. Based on the analysis, we further refine the tie-breaking criterion in D-TS and propose its enhancement called D-TS+. D-TS+ achieves the same theoretical regret bound as D-TS, but performs better in practice especially when there are multiple winners. In summary, the main contributions of this paper are as follows: • We propose a D-TS algorithm and its enhancement D-TS+ for general Copeland dueling bandits. The double sampling structure suits the nature of dueling bandits and leads to more extensive usage of TS, which significantly reduces the regret. • We obtain theoretical regret bounds for D-TS and D-TS+. For general Copeland dueling bandits, we show that D-TS and D-TS+ achieve O(K2 log T) regret. In Condorcet dueling bandits and most practical Copeland dueling bandits, we further refine the regret bound to O(K log T + K2 log log T) using a back substitution argument. • We evaluate the D-TS and D-TS+ algorithms through experiments based on both synthetic and real-world data. The results show that D-TS and D-TS+ significantly improve the overall performance, in terms of regret and robustness, compared to existing algorithms. 2 Related Work Early dueling bandit algorithms study finite-horizon settings, using the “explore-then-exploit” approaches, such as IF [1], BTM [16], and SAVAGE [17]. For infinite horizon settings, recent work has generalized the traditional MAB algorithms to dueling bandits along two lines. First, RUCB [4] and CCB [6] are generalizations of UCB for Condorcet and general Copeland dueling bandits, respectively. In addition, [18] reduces dueling bandits to traditional MAB, which is then solved by UCB-type algorithms, called MutiSBM and Sparring. Second, [5] and [7] extend the MED algorithm to dueling bandits, where they present the lower bound on the regret and propose the corresponding optimal algorithms, including RMED for Condorcet dueling bandits [5], CW-RMED and its computationally efficient version ECW-RMED for general Copeland dueling bandits [7]. Different from such existing work, we study algorithms for dueling bandits from the perspective of TS, which typically achieves lower regret and is more robust in practice. Dated back to 1933, TS [8] is one of the earliest algorithms for exploration/exploitation tradeoff. Nowadays, it has been applied in many variants of MAB [11, 12, 13] and other more complex problems, e.g., [14], due to its simplicity, good performance, and robustness [9]. Theoretical analysis of TS is much more difficult. Only recently, [10] proposes a logarithmic bound for the standard frequentist expected regret, whose constant factor is further improved in [15]. Moreover [19, 20] derive the bounds for its Bayesian expected regret through information-theoretic analysis. TS has been preliminarily considered for dueling bandits [3, 21]. In particular, recent work [3] proposes a Relative Confidence Sampling (RCS) algorithm that combines TS with RUCB [4] for Condorcet dueling bandits. Under RCS, the first arm is selected by TS while the second arm is selected according to their RUCB. Empirical studies demonstrate the performance improvement of using RCS in practice, but no theoretical bounds on the regret are provided. 2 3 System Model We consider a dueling bandit problem with K (K ≥2) arms, denoted by A = {1, 2, . . . , K}. At each time-slot t > 0, a pair of arms (a(1) t , a(2) t ) is displayed to a user and a noisy comparison outcome wt is obtained, where wt = 1 if the user prefers a(1) t to a(2) t , and wt = 2 otherwise. We assume the user preference is stationary over time and the distribution of comparison outcomes is characterized by the preference matrix P = [pij]K×K, where pij is the probability that the user prefers arm i to arm j, i.e., pij = P{i ≻j}, i, j = 1, 2, . . . , K. We assume that the displaying order does not affect the preference, and hence, pij + pji = 1 and pii = 1/2. We say that arm i beats arm j if pij > 1/2. We study the general Copeland dueling bandits, where the Copeland winner is defined as the arm (or arms) that maximizes the number of other arms it beats [6, 7]. Specifically, the Copeland score is defined as P j̸=i 1(pij > 1/2), and the normalized Copeland score is defined as ζi = 1 K−1 P j̸=i 1(pij > 1/2), where 1(·) is the indicator function. Let ζ∗be the highest normalized Copeland score, i.e., ζ∗= max1≤i≤K ζi. Then the Copeland winner is defined as the arm (or arms) with the highest normalized Copeland score, i.e., C∗= {i : 1 ≤i ≤K, ζi = ζ∗}. Note that the Condorcet winner is a special case of Copeland winner with ζ∗= 1. A dueling bandit algorithm Γ decides which pair of arms to compare depending on the historic observations. Specifically, define a filtration Ht−1 as the history before t, i.e., Ht−1 = {a(1) τ , a(2) τ , wτ, τ = 1, 2, . . . , t −1}. Then a dueling bandit algorithm Γ is a function that maps Ht−1 to (a(1) t , a(2) t ), i.e., (a(1) t , a(2) t ) = Γ(Ht−1). The performance of a dueling bandit algorithm Γ is measured by its expected cumulative regret, which is defined as RΓ(T) = ζ∗T −1 2 T X t=1 E  ζa(1) t + ζa(2) t  . (1) The objective of Γ is then to minimize RΓ(T). As pointed out in [6], the results can be adapted to other regret definitions because the above definition bounds the number of suboptimal comparisons. 4 Double Thompson Sampling 4.1 D-TS Algorithm We present the D-TS algorithm for Copeland dueling bandits, as described in Algorithm 1 (time index t is omitted in pseudo codes for brevity). As its name suggests, the basic idea of D-TS is to select both the first and the second candidates by TS. For each pair (i, j) with i ̸= j, we assume a beta prior distribution for its preference probability pij. These distributions are updated according to the comparison results Bij(t −1) and Bji(t −1), where Bij(t −1) (resp. Bji(t −1)) is the number of time-slots when arm i (resp. j) beats arm j (resp. i) before t. D-TS selects the two candidates by sampling from the posterior distributions. Specifically, at each time-slot t, the D-TS algorithm consists of two phases that select the first and the second candidates, respectively. When choosing the first candidate a(1) t , we first use the RUCB [4] of pij to eliminate the arms that are unlikely to be the Copeland winner, resulting in a candidate set Ct (Lines 4 to 6). The algorithm then samples θ(1) ij (t) from the posterior beta distribution, and the first candidate a(1) t is chosen by “majority voting”, i.e., the arm within Ct that beats the most arms according to θ(1) ij (t) will be selected (Lines 7 to 11). The ties are broken randomly here for simplicity and will be refined later in Section 4.3. A similar idea is applied to select the second candidate a(2) t , where new samples θ(2) ia(1) t (t) are generated and the arm with the largest θ(2) ia(1) t (t) among all arms with lia(1) t ≤1/2 is selected as the second candidate (Lines 13 to 14). The double sampling structure of D-TS is designed based on the nature of dueling bandits, i.e., at each time-slot, two arms are needed for comparison. Unlike RCS [3], D-TS selects both candidates using TS. This leads to more extensive utilization of TS and thus achieves much lower regret. Moreover, the two sets of samples are independently distributed, following the same posterior that is only determined by the comparison statistics Bij(t −1) and Bji(t −1). This property enables us to obtain an O(K2 log T) regret bound and further refine it by a back substitution argument, as discussed later. We also note that RUCB-based elimination (Lines 4 to 6) and RLCB (Relative Lower Confidence Bound)-based elimination (Line 14) are essential in D-TS. Without these eliminations, the algorithm 3 Algorithm 1 D-TS for Copeland Dueling Bandits 1: Init: B ←0K×K; // Bij is the number of time-slots that the user prefers arm i to j. 2: for t = 1 to T do 3: // Phase 1: Choose the first candidate a(1) 4: U := [uij], L := [lij], where uij = Bij Bij+Bji + q α log t Bij+Bji , lij = Bij Bij+Bji − q α log t Bij+Bji , if i ̸= j, and uii = lii = 1/2, ∀i; // x 0 := 1 for any x. 5: ˆζi ← 1 K−1 P j̸=i 1(uij > 1/2); // Upper bound of the normalized Copeland score. 6: C ←{i : ˆζi = maxj ˆζj}; 7: for i, j = 1, . . . , K with i < j do 8: Sample θ(1) ij ∼Beta(Bij + 1, Bji + 1); 9: θ(1) ji ←1 −θ(1) ij ; 10: end for 11: a(1) ←arg max i∈C P j̸=i 1(θ(1) ij > 1/2); // Choosing from C to eliminate likely non-winner arms; Ties are broken randomly. 12: // Phase 2: Choose the second candidate a(2) 13: Sample θ(2) ia(1) ∼Beta(Bia(1) + 1, Ba(1)i + 1) for all i ̸= a(1), and let θ(2) a(1)a(1) = 1/2; 14: a(2) ←arg max i:lia(1)≤1/2 θ(2) ia(1); // Choosing only from uncertain pairs. 15: // Compare and Update 16: Compare pair (a(1), a(2)) and observe the result w; 17: Update B: Ba(1)a(2) ←Ba(1)a(2) + 1 if w = 1, or Ba(2)a(1) ←Ba(2)a(1) + 1 if w = 2; 18: end for may trap in suboptimal comparisons. Consider one extreme case in Condorcet dueling bandits1: assume arm 1 is the Condorcet winner with p1j = 0.501 for all j > 1, and arm 2 is not the Condorcet winner, but with p2j = 1 for all j > 2. Then for a larger K (e.g., K > 4), without RUCB-based elimination, the algorithm may trap in a(1) t = 2 for a long time, because arm 2 is likely to receive higher score than arm 1. This issue can be addressed by RUCB-based elimination as follows: when chosen as the first candidate, arm 2 has a great probability to compare with arm 1; after sufficient comparisons with arm 1, arm 2 will have u21(t) < 1/2 with high probability; then arm 2 is likely to be eliminated because arm 1 has ˆζ1(t) = 1 > ˆζ2(t) with high probability. Similarly, RLCB-based elimination (Line 14, where we restrict to the arms with lia(1) t (t) ≤1/2) is important especially for non-Condorcet dueling bandits. Specifically, lia(1) t (t) > 1/2 indicates that arm i beats a(1) t with high probability. Thus, comparing a(1) t and arm i brings little information gain and thus should be eliminated to minimize the regret. 4.2 Regret Analysis Before conducting the regret analysis, we first introduce certain notations that will be used later. Gap to 1/2: In dueling bandits, an important benchmark for pij is 1/2, and thus we let ∆ij be the gap between pij and 1/2, i.e., ∆ij = |pij −1/2|. Number of Comparisons: Under D-TS, (i, j) can be compared in the form of (a(1) t , a(2) t ) = (i, j) and (a(1) t , a(2) t ) = (j, i). We consider these two cases separately and define the following counters: N (1) ij (t) = Pt τ=1 1(a(1) τ = i, a(2) τ = j) and N (2) ij (t) = Pt τ=1 1(a(1) τ = j, a(2) τ = i). Then the total number of comparisons is Nij(t) = N (1) ij (t) + N (2) ij (t) for i ̸= j, and Nii(t) = N (1) ii (t) = N (2) ii (t) for i = j. 4.2.1 O(K2 log T) Regret To obtain theoretical bounds for the regret of D-TS, we make the following assumption: 1A Borda winner may be more appropriate in this special case [22], and we mainly use it to illustrate the dilemma. 4 Assumption 1: The preference probability pij ̸= 1/2 for any i ̸= j. Under Assumption 1, we present the first result for D-TS in general Copeland dueling bandits: Proposition 1. When applying D-TS with α > 0.5 in a Copeland dueling bandit with a preference matrix P = [pij]K×K satisfying Assumption 1, its regret is bounded as: RD-TS(T) ≤ X i̸=j:pij<1/2 4α log T ∆2 ij + (1 + ϵ) log T D(pij||1/2)  + O(K2 ϵ2 ), (2) where ϵ > 0 is an arbitrary constant, and D(p||q) = p log p q + (1 −p) log 1−p 1−q is the KL divergence. The summation operation in Eq. (2) is conducted over all pairs (i, j) with pij < 1/2. Thus, Proposition 1 states that D-TS achieves O(K2 log T) regret in Copeland dueling bandits. To the best of our knowledge, this is the first theoretical bound for TS in dueling bandits. The scaling behavior of this bound with respect to T is order optimal, since a lower bound Ω(log T) has been shown in [7]. The refinement of the scaling behavior with respect to K will be discussed later. Proving Proposition 1 needs to bound the number of comparisons for all pairs (i, j) with i /∈C∗ or j /∈C∗. When fixing the first candidate as a(1) t = i, the selection of the second candidate a(2) t is similar to a traditional K-armed bandit problem with expected utilities pji (j = 1, 2, . . . , K). However, the analysis is more complex here since different arms are eliminated differently depending on the value of pji. We prove Proposition 1 through Lemmas 1 to 3, which bound the number of comparisons for all suboptimal pairs (i, j) under different scenarios, i.e., pji < 1/2, pji > 1/2, and pji = 1/2 (j = i /∈C∗), respectively. Lemma 1. Under D-TS, for an arbitrary constant ϵ > 0 and one pair (i, j) with pji < 1/2, we have E[N (1) ij (T)] ≤(1 + ϵ) log T D(pji||1/2) + O( 1 ϵ2 ). (3) Proof. We can prove this lemma by viewing the comparison between the first candidate arm i and its inferiors as a traditional MAB. In fact, it may be even simpler than that in [15] because under D-TS, arm j with pji < 1/2 is competing with arm i with pii = 1/2, which is known and fixed. Then we can bound E[N (1) ij (T)] using the techniques in [15]. Details can be found in Appendix B.1. Lemma 2. Under D-TS with α > 0.5, for one pair (i, j) with pji > 1/2, we have E[N (1) ij (T)] ≤4α log T ∆2 ji + O(1). (4) Proof. We note that when a(1) t = i, arm j can be selected as a(2) t only when its RLCB lji(t) ≤1/2. Then we can bound E[N (1) ij (T)] by O( 4α log T ∆2 ji ) similarly to the analysis of traditional UCB algorithms [23]. Details can be found in Appendix B.2. Lemma 3. Under D-TS, for any arm i /∈C∗, we have E[Nii(T)] ≤O(K) + X k:pki>1/2 Θ 1 ∆2 ki + 1 ∆2 kiD(1/2||pki) + 1 ∆4 ki  = O(K). (5) Before proving Lemma 3, we present an important property for ˆζ∗(t) := max1≤i≤K ˆζi(t). Recall that ζ∗is the maximum normalized Copeland score. Using the concentration property of RUCB (Lemma 6 in Appendix A), the following lemma shows that ˆζ∗(t) is indeed a UCB of ζ∗. Lemma 4. For any α > 0.5 and t > 0, P{ˆζ∗(t) ≥ζ∗} ≥1 −K  log t log(α+1/2) + 1  t− 2α α+1/2 . Return to the proof of Lemma 3. To prove Lemma 3, we consider the cases of ˆζ∗(t) < ζ∗and ˆζ∗(t) ≥ζ∗. The former case ˆζ∗(t) < ζ∗can be bounded by Lemma 4. For the latter case, we note that when ˆζ∗(t) ≥ζ∗, the event (a(1) t , a(2) t ) = (i, i) occurs only if: a) there exists at least one k ∈K with pki > 1/2, such that lki(t) ≤1/2; and b) θ(2) ki (t) ≤1/2 for all k with lki(t) ≤1/2. In this case, we can bound the probability of (a(1) t , a(2) t ) = (i, i) by that of (a(1) t , a(2) t ) = (i, k), for k with pki > 1/2 but lki(t) ≤1/2, where the coefficient decays exponentially. Then we can bound E[Nii(T)] by O(1) similar to [15]. Details of proof can be found in Appendix B.4. The conclusion of Proposition 1 then follows by combining Lemmas 1 to 3. 5 4.2.2 Regret Bound Refinement In this section, we refine the regret bound for D-TS and reduce its scaling factor with respect to the number of arms K. We sort the arms for each i /∈C∗in the descending order of pji, and let (σi(1), σi(2), . . . , σi(K)) be a permutation of (1, 2, . . . , K), such that pσi(1),i ≥pσi(2),i ≥. . . ≥pσi(K),i. In addition, for a Copeland winner i∗∈C, let LC = PK j=1 1(pji∗> 1/2) be the number of arms that beat arm i∗. To refine the regret, we introduce an additional no-tie assumption: Assumption 2: For each arm i /∈C∗, pσi(LC +1),i > pσi(j),i for all j > LC + 1. We present a refined regret bound for D-TS as follows: Theorem 1. When applying D-TS with α > 0.5 in a Copeland dueling bandit with a preference matrix P = [pij]K×K satisfying Assumptions 1 and 2, its regret is bounded as: RD-TS(T) ≤ X i∈C∗  X j:pji>1/2 4α log T ∆2 ji + X j:pji<1/2 (1 + ϵ) log T D(pji||1/2)  + X i/∈C∗ LC+1 X j=1 4α log T ∆2 σi(j),i +β(1 + ϵ)2 X i/∈C∗ K X j=LC+2 log log T D(pσi(j),i||pσi(LC +1),i) + O(K3) + O(K2 ϵ2 ), (6) where β > 2 and ϵ > 0 are constants, and D(·||·) is the KL-divergence. In (6), the first term corresponds to the regret when the first candidate a(1) t is a winner, and is O(K|C∗| log T). The second term corresponds to the comparisons between a non-winner arm and its first LC + 1 superiors, which is bounded by O(K(LC + 1) log T). The remaining terms correspond to the comparisons between a non-winner arm and the remaining arms, and is bounded by O K2 log log T  . As demonstrated in [6], LC is relatively small compared to K, and can be viewed as a constant. Thus, the total regret RD-TS(T) is bounded as RD-TS(T) = O(K log T +K2 log log T). In particular, this asymptotic trend can be easily seen for Condorcet dueling bandits where LC = 0. Comparing Eq. (6) with Eq. (2), we can see the difference is the third and fourth terms in (6), which refine the regret of comparing a suboptimal arm and its last (K −LC −1) inferiors into O(log log T). Thus, to prove Theorem 1, it suffices to show the following additional lemma: Lemma 5. Under Assumptions 1 and 2, for any suboptimal arm i /∈C∗and j > LC + 1, we have E[N (1) iσi(j)(T)] ≤ β(1 + ϵ)2 log log T D(pσi(j),i||pσi(LC +1),i) + O(K) + O( 1 ϵ2 ), (7) where β > 2 and ϵ > 0 are constants. Proof. We prove this lemma using a back substitution argument. The intuition is that when fixing the first candidate as a(1) t = i, the comparison between a(1) t and the other arms is similar to a traditional MAB with expected utilities pji (1 ≤j ≤K). Let N (1) i (T) = PT t=1 1(a(1) t = i) be the number of time-slots when this type of MAB is played. Using the fact that the distribution of the samples only depends on the historic comparison results (but not t), we can show E[N (1) i,σi(j)(T)|N (1) i (T)] = O(log N (1) i (T)), which holds for any N (1) i (T). We have shown that E[N (1) i (T)] = O(K log T) for any i ̸= C∗when proving Proposition 1. Then, substituting the bound of E[N (1) i (T)] back and using the concavity of the log(·) function, we have E[N (1) i,σi(j)(T)] = E  E[N (1) i,σi(j)(T)|N (1) i (T)]  ≤ O(log E[N (1) i (T)]) = O(log log T + log K). Details can be found in Appendix C.1 4.3 Further Improvement: D-TS+ D-TS is a TS framework for dueling bandits, and its performance can be improved by refining certain components of it. In this section, we propose an enhanced version of D-TS, referred to as D-TS+, that carefully breaks the ties to reduce the regret. Note that by randomly breaking the ties (Line 11 in Algorithm 1), D-TS tends to explore all potential winners. This may be desirable in certain applications such as restaurant recommendation, where 6 users may not want to stick to a single winner. However, because of this, the regret of D-TS scales with the number of winners |C∗| as shown in Theorem 1. To further reduce the regret, we can break the ties according to estimated regret. Specifically, with samples θ(1) ij (t), the normalized Copeland score for each arm i can be estimated as ˜ζi(t) = 1 K−1 P j̸=i 1(θ(1) ij (t) > 1/2). Then the maximum normalized Copeland score is ˜ζ∗(t) = maxi ˜ζi(t), and the loss of comparing arm i and arm j is ˜rij(t) = ˜ζ∗(t) −1 2 ˜ζi(t) + ˜ζj(t)  . For pij ̸= 1/2, we need about Θ( log T D(pij||1/2)) time-slots to distinguish it from 1/2 [5]. Thus, when choosing i as the first candidate, the regret of comparing it with all other arms can be estimated by ˜R(1) i (t) = P j:θ(1) ij (t)̸=1/2 ˜rij(t)/D(θ(1) ij (t)||1/2). We propose the following D-TS+ algorithm that breaks the ties to minimize ˜R(1) i (t). D-TS+: Implement the same operations as D-TS, except for the selection of the first candidate (Line 11 in Algorithm 1) is replaced by the following two steps: A(1) ←{i ∈C : ζi = max i∈C X j̸=i 1(θ(1) ij > 1/2)}; a(1) ←arg min i∈A(1) ˜R(1) i ; D-TS+ only changes the tie-breaking criterion in selecting the first candidate. Thus, the regret bound of D-TS directly applies to D-TS+: Corollary 1. The regret of D-TS+, RD-TS+(T), satisfies inequality (6) under Assumptions 1 and 2. Corollary 1 provides an upper bound for the regret of D-TS+. In practice, however, D-TS+ performs better than D-TS in the scenarios with multiple winners, as we can see in Section 5 and Appendix D. Our conjecture is that with this regret-minimization criterion, the D-TS+ algorithm tends to focus on one of the winners (if there is no tie in terms of expected regret), and thus reduces the first term in (6) from O(K|C∗| log T) to O(K log T). The proof of this conjecture requires properties for the evolution of the statistics for all arms and the majority voting results based on the Thompson samples, and is complex. This is left as part of our future work. In the above D-TS+ algorithm, we only consider the regret of choosing i as the first candidate. From Theorem 1, we know that comparing other arms with their superiors will also result in Θ(log T) regret. Thus, although the current D-TS+ algorithm performs well in most practical scenarios, one may further improve its performance by taking these additional comparisons into account in ˜R(1) i (t). 5 Experiments To evaluate the proposed D-TS and D-TS+ algorithms, we run experiments based on synthetic and real-world data. Here we present the results for experiments based on the Microsoft Learning to Rank (MSLR) dataset [24], which provides the relevance for queries and ranked documents. Based on this dataset, [6] derives a preference matrix for 136 rankers, where each ranker is a function that maps a user’s query to a document ranking and can be viewed as one arm in dueling bandits. We use the two 5-armed submatrices in [6], one for Condorcet dueling bandit and the other for non-Condorcet dueling bandit. More experiments and discussions can be found in Appendix D 2. We compare D-TS and D-TS+ with the following algorithms: BTM [16], SAVAGE [17], Sparring [18], RUCB [4], RCS [3], CCB [6], SCB [6], RMED1 [5], and ECW-RMED [7]. For BTM, we set the relaxed factor γ = 1.3 as [16]. For algorithms using RUCB and RLCB, including D-TS and D-TS+, we set the scale factor α = 0.51. For RMED1, we use the same settings as [5], and for ECW-RMED, we use the same setting as [7]. For the “explore-then-exploit” algorithms, BTM and SAVAGE, each point is obtained by resetting the time horizon as the corresponding value. The results are averaged over 500 independent experiments, where in each experiment, the arms are randomly shuffled to prevent algorithms from exploiting special structures of the preference matrix. In Condorcet dueling bandits, our D-TS and D-TS+ algorithms achieve almost the same performance and both perform much better than existing algorithms, as shown in Fig. 1(a). In particular, compared with RCS, we can see that the full utilization of TS in D-TS and D-TS+ significantly reduces the 2Source codes are available at https://github.com/HuasenWu/DuelingBandits. 7 Time t 102 104 106 Regret 0 500 1000 1500 RUCB/CCB RCS/RMED1/ECW-RMED D-TS/D-TS+ BTM SAVAGE RUCB RCS Sparring CCB SCB RMED1 ECW-RMED D-TS D-TS+ (a) K = 5, Condorcet Time t 104 105 106 107 Regret #104 0 5 10 15 CCB D-TS ECW-RMED BTM SAVAGE RUCB RCS Sparring CCB SCB RMED1 ECW-RMED D-TS D-TS+ D-TS+ (b) K = 5, non-Condorcet Figure 1: Regret in MSLR dataset. In (b), there are 3 Copeland winners with normalized Copeland score ζ∗= 3/4. Dataset K = 5, Condorcet K = 5, non-Condorcet Normalized STD of regret 0 50 100 150 200 29.37% 193.09% 27.65% 29.12% 30.51% 13.16% ECW-RMED D-TS D-TS+ Figure 2: Standard deviation (STD) of regret for T = 106 (normalized by RECW−RMED(T)). regret. Compared with RMED1 and ECW-RMED, our D-TS and D-TS+ algorithms also perform better. [5] has shown that RMED1 is optimal in Condorcet dueling bandits, not only in the sense of asymptotic order, but also the coefficients in the regret bound. The simulation results show that D-TS and D-TS+ not only achieve the similar slope as RMED1/ECW-RMED, but also converge faster to the asymptotic regime and thus achieve much lower regret. This inspires us to further refine the regret bounds for D-TS and D-TS+ in the future. In non-Condorcet dueling bandits, as shown in Fig. 1(b), D-TS and D-TS+ significantly reduce the regret compared to the UCB-type algorithm, CCB (e.g., the regret of D-TS+ is less than 10% of that of CCB). Compared with ECW-RMED, D-TS achieves higher regret, mainly because it randomly explores all Copeland winners due to the random tie-breaking rule. With a regret-minimization tie-breaking rule, D-TS+ further reduces the regret, and outperforms ECW-RMED in this dataset. Moreover, as randomized algorithms, D-TS and D-TS+ are more robust to the preference probabilities. As shown in Fig. 2, D-TS and D-TS+ have much smaller regret STD than that of ECW-RMED in the non-Condorcet dataset, where certain preference probabilities (for different arms) are close to 1/2. In particular, the STD of regret for ECW-RMED is almost 200% of its mean value, while it is only 13.16% for D-TS+. In addition, as shown in Appendix D.2.3, D-TS and D-TS+ are also robust to delayed feedback, which is typically batched and provided periodically in practice. Overall, D-TS and D-TS+ significantly outperform all existing algorithms, with the exception of ECW-RMED. Compared to ECW-RMED, D-TS+ achieves much lower regret in the Condorcet case, lower or comparable regret in the non-Condorcet case, and much more robustness in terms of regret STD and delayed feedback. Thus, the simplicity, good performance, and robustness of D-TS and D-TS+ make them good algorithms in practice. 6 Conclusions and Future Work In this paper, we study TS algorithms for dueling bandits. We propose a D-TS algorithm and its enhanced version D-TS+ for general Copeland dueling bandits, including Condorcet dueling bandits as a special case. Our study reveals desirable properties of D-TS and D-TS+ from both theoretical and practical perspectives. Theoretically, we show that the regret of D-TS and D-TS+ is bounded by O(K2 log T) in general Copeland dueling bandits, and can be refined to O(K log T + K2 log log T) in Condorcet dueling bandits and most practical Copeland dueling bandits. Practically, experimental results demonstrate that these simple algorithms achieve significantly better overall-performance than existing algorithms, i.e., D-TS and D-TS+ typically achieve much lower regret in practice and are robust to many practical factors, such as preference matrix and feedback delay. Although logarithmic regret bounds have been obtained for D-TS and D-TS+, our analysis relies heavily on the properties of RUCB/RLCB and the regret bounds are likely loose. In fact, we see from experiments that RUCB-based elimination seldom occurs under most practical settings. We will further refine the regret bounds by investigating the properties of TS-based majority-voting. Moreover, results from recent work such as [7] may be leveraged to improve TS algorithms. Last, it is also an interesting future direction to study D-TS type algorithms for dueling bandits with other definition of winners. Acknowledgements: This research was supported in part by NSF Grants CCF-1423542, CNS1457060, and CNS-1547461. The authors would like to thank Prof. R. Srikant (UIUC), Prof. Shipra Agrawal (Columbia University), Masrour Zoghi (University of Amsterdam), and Dr. Junpei Komiyama (University of Tokyo) for their helpful discussions and suggestions. 8 References [1] Y. Yue, J. Broder, R. Kleinberg, and T. Joachims. The k-armed dueling bandits problem. Journal of Computer and System Sciences, 78(5):1538–1556, 2012. [2] Y. Yue and T. Joachims. Interactively optimizing information retrieval systems as a dueling bandits problem. In International Conference on Machine Learning (ICML), pages 1201–1208, 2009. [3] M. Zoghi, S. A. Whiteson, M. De Rijke, and R. Munos. Relative confidence sampling for efficient on-line ranker evaluation. In ACM International Conference on Web Search and Data Mining, pages 73–82, 2014. [4] M. Zoghi, S. Whiteson, R. Munos, and M. D. Rijke. Relative upper confidence bound for the k-armed dueling bandit problem. In International Conference on Machine Learning (ICML), pages 10–18, 2014. [5] J. Komiyama, J. Honda, H. Kashima, and H. Nakagawa. Regret lower bound and optimal algorithm in dueling bandit problem. In Proceedings of Conference on Learning Theory, 2015. [6] M. Zoghi, Z. S. Karnin, S. Whiteson, and M. de Rijke. Copeland dueling bandits. In Advances in Neural Information Processing Systems, pages 307–315, 2015. [7] J. Komiyama, J. Honda, and H. Nakagawa. Copeland dueling bandit problem: Regret lower bound, optimal algorithm, and computationally efficient algorithm. In International Conference on Machine Learning (ICML), 2016. [8] W. R. Thompson. On the likelihood that one unknown probability exceeds another in view of the evidence of two samples. Biometrika, pages 285–294, 1933. [9] O. Chapelle and L. Li. An empirical evaluation of Thompson Sampling. In Advances in Neural Information Processing Systems, pages 2249–2257, 2011. [10] S. Agrawal and N. Goyal. Analysis of Thompson Sampling for the multi-armed bandit problem. In Conference on Learning Theory (COLT), 2012. [11] J. Komiyama, J. Honda, and H. Nakagawa. Optimal regret analysis of Thompson Sampling in stochastic multi-armed bandit problem with multiple plays. In International Conference on Machine Learning (ICML), 2015. [12] Y. Xia, H. Li, T. Qin, N. Yu, and T.-Y. Liu. Thompson sampling for budgeted multi-armed bandits. In International Joint Conference on Artificial Intelligence, 2015. [13] A. Gopalan, S. Mannor, and Y. Mansour. Thompson sampling for complex online problems. In International Conference on Machine Learning (ICML), pages 100–108, 2014. [14] A. Gopalan and S. Mannor. Thompson sampling for learning parameterized Markov decision processes. In Proceedings of Conference on Learning Theory, pages 861–898, 2015. [15] S. Agrawal and N. Goyal. Further optimal regret bounds for Thompson Sampling. In International Conference on Artificial Intelligence and Statistics, pages 99–107, 2013. [16] Y. Yue and T. Joachims. Beat the mean bandit. In International Conference on Machine Learning (ICML), pages 241–248, 2011. [17] T. Urvoy, F. Clerot, R. Féraud, and S. Naamane. Generic exploration and k-armed voting bandits. In International Conference on Machine Learning (ICML), pages 91–99, 2013. [18] N. Ailon, Z. Karnin, and T. Joachims. Reducing dueling bandits to cardinal bandits. In Proceedings of The 31st International Conference on Machine Learning, pages 856–864, 2014. [19] D. Russo and B. Van Roy. An information-theoretic analysis of Thompson Sampling. arXiv preprint arXiv:1403.5341, 2014. [20] D. Russo and B. Van Roy. Learning to optimize via posterior sampling. Mathematics of Operations Research, 39(4):1221–1243, 2014. [21] N. Welsh. Thompson sampling for the dueling bandits problem. In Large-Scale Online Learning and Decision Making (LSOLDM) Workshop, 2012. available at http://videolectures.net/lsoldm2012_welsh_bandits_problem/. [22] K. Jamieson, S. Katariya, A. Deshpande, and R. Nowak. Sparse dueling bandits. In Conference on Learning Theory (COLT), 2015. [23] S. Bubeck. Bandits games and clustering foundations. PhD thesis, Université des Sciences et Technologie de Lille-Lille I, 2010. [24] Microsoft Research, Microsoft Learning to Rank Datasets. http://research.microsoft.com/enus/projects/mslr/, 2010. 9
2016
362
6,286
A state-space model of cross-region dynamic connectivity in MEG/EEG Ying Yang∗ Elissa M. Aminoff† Michael J. Tarr∗ Robert E. Kass∗ ∗Carnegie Mellon University, †Fordham University ying.yang.cnbc.cmu@gmail.com, {eaminoff@fordham, michaeltarr@cmu, kass@stat.cmu}.edu Abstract Cross-region dynamic connectivity, which describes the spatio-temporal dependence of neural activity among multiple brain regions of interest (ROIs), can provide important information for understanding cognition. For estimating such connectivity, magnetoencephalography (MEG) and electroencephalography (EEG) are well-suited tools because of their millisecond temporal resolution. However, localizing source activity in the brain requires solving an under-determined linear problem. In typical two-step approaches, researchers first solve the linear problem with generic priors assuming independence across ROIs, and secondly quantify cross-region connectivity. In this work, we propose a one-step state-space model to improve estimation of dynamic connectivity. The model treats the mean activity in individual ROIs as the state variable and describes non-stationary dynamic dependence across ROIs using time-varying auto-regression. Compared with a two-step method, which first obtains the commonly used minimum-norm estimates of source activity, and then fits the auto-regressive model, our state-space model yielded smaller estimation errors on simulated data where the model assumptions held. When applied on empirical MEG data from one participant in a scene-processing experiment, our state-space model also demonstrated intriguing preliminary results, indicating leading and lagged linear dependence between the early visual cortex and a higher-level scene-sensitive region, which could reflect feedforward and feedback information flow within the visual cortex during scene processing. 1 Introduction Cortical regions in the brain are anatomically connected, and the joint neural activity in connected regions are believed to underlie various perceptual and cognitive functions. Besides anatomical connectivity, researchers are particularly interested in the spatio-temporal statistical dependence across brain regions, which may vary quickly in different time stages of perceptual and cognitive processes. Descriptions of such spatio-temporal dependence, which we call dynamic connectivity, not only help to model the joint neural activity, but also provide insights to understand how information flows in the brain. To estimate dynamic connectivity in human brains, we need non-invasive techniques to record neural activity with high temporal resolution. Magnetoencephalography (MEG) and electroencephalography (EEG) are well-suited tools for such purposes, in that they measure changes of magnetic fields or scalp voltages, which are almost instantaneously induced by electric activity of neurons. However, spatially localizing the source activity in MEG/EEG is challenging. Assuming the brain source space is covered by m discrete points, each representing an electric current dipole generated by the activity of the local population of neurons, then the readings of n MEG/EEG sensors can be approximated with a linear transformation of the m-dimensional source activity. The linear transformation, known as the forward model, is computed using Maxwell equations given the relative 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. positions of sensors with respect to the scalp (1). Typically m ≈103 ∼104 whereas n ≈102 ≪m, so the source localization problem — estimating the source activity from the sensor data— is underdetermined. Previous work has exploited various constraints or priors for regularization, including L2 norm penalty (2; 3), sparsity-inducing penalty (4), and priors that encourage local spatial smoothness or temporal smoothness (5; 6; 7; 8). When estimating dynamic connectivity from MEG/EEG recordings, especially among several predefined regions of interest (ROIs), researchers often use a two-step procedure: Step 1, estimating source activity using one of the common source localization methods, for example, the minimum norm estimate (MNE) that penalizes squared L2 norm (2); Step 2, extracting the mean activity of source points within each ROI, and then quantifying the statistical dependence among the ROIs, using various methods ranging from pairwise correlations of time series to Granger causality and other extensions (9). However, most of the popular methods in Step 1 do not assume dependence across ROIs. For example, MNE assumes that all source points have independent and identical priors. Even in methods that assume auto-regressive structures of source activity (6; 8), only dependence on the one-step-back history of a source point itself and its adjacent neighbors is considered, while long-range dependence across ROIs is ignored. Biases due to these assumptions in Step 1 can not be adjusted in Step 2 and thus may result in additional errors in the connectivity analysis. Alternatively, one can combine source localization and connectivity analysis jointly in one step. Two pioneering methods have explored this direction. The dynamical causal modeling (DCM (10)) assumes the source activity includes only one single current dipole in each ROI, and the ROI dipoles are modeled with a nonlinear, neurophysiology-informed dynamical system, where timeinvariant coefficients describe how the current activity in each ROI is dependent on the history of all ROIs. Another method (11) does not use pre-defined ROIs, but builds a time-invariant multivariate auto-regressive (AR) model of all m source points, where the AR coefficients are constrained by structural white-matter connectivity and sparsity-inducing priors. Both methods use static parameters to quantify connectivity, but complex perceptual or cognitive processes may involve fast changes of neural activity, and correspondingly require time-varying models of dynamic connectivity. Here, we propose a new one-step state-space model, designed to estimate dynamic spatio-temporal dependence across p given ROIs directly from MEG/EEG sensor data. We define the mean activity of the source points within each individual ROI as our p-dimensional state variable, and use a timevarying multivariate auto-regressive model to describe how much the activity in each ROI is predicted by the one-step-back activity in the p ROIs. More specifically, we utilize the common multi-trial structure of MEG/EEG experiments, which gives independent observations at each time point and facilitates estimating the time-varying auto-regressive coefficients. Given the state variable at each time point, activities of source points within each ROI are modeled as independent Gaussian variables, with the ROI activity as the mean and a shared ROI-specific variance; activities of source points outside of all ROIs are also modeled as independent Gaussian variables with a zero mean and a shared variance. Finally, along with the forward model that projects source activity to the sensor space, we build a direct relationship between the state variables (ROI activities) and the sensor observations, yielding a tractable Kalman filter model. Comparing with the previous one-step methods (10; 11), the main novelty of our model is the time-varying description of connectivity. We note that the previous methods and our model all utilize specific assumptions to regularize the under-determined source localization problem. These assumptions may not always be satisfied universally. However, we expect our model to serve as a good option in the one-step model toolbox for researchers, when the assumptions are reasonably met. In this paper, we mainly compare our model with a two-step procedure using the commonly applied MNE method, on simulated data and in a real-world MEG experiment. 2 Model Model formulation In MEG/EEG experiments, researchers typically acquire multiple trials of the same condition and treat them as independent and identically distributed (i.i.d.) samples. Each trial includes a fixed time window of (T+1) time points, aligned to the stimulus onset. Assuming there are n sensors and q trials, we use y(r) t to denote the n-dimensional sensor readings at time t (t = 0, 1, 2, · · · , T) in the rth trial (r = 1, 2, · · · , q). To be more succinct, when alluding to the sensor readings in a generic trial without ambiguity, we drop the superscript (r) and use yt instead; the same omission works for source activity and the latent ROI activity described below. We also 2 assume the mean of sensor data across trials is an n × (T + 1) zero matrix; this assumption can be easily met by subtracting the n × (T + 1) sample mean across trials from the data. MEG and EEG are mainly sensitive to electric currents in the pyramidal cells, which are perpendicular to the folded cortical surfaces (12). Here we define the source space as a discrete mesh of m source points distributed on the cortical surfaces, where each source point represents an electric current dipole along the local normal direction. If we use an m-dimensional vector Jt to denote the source activity at time t in a trial, then the corresponding sensor data yt has the following form sensor model (forward model): yt = GJt + et, et i.i.d ∼N(0, Qe) (1) where the n × m matrix G describes the linear projection of the source activity into the sensor space, and the sensor noise, et, is modeled as temporally independent draws from an n-dimensional Gaussian distribution N(0, Qe). The noise covariance Qe can be pre-measured using recordings in the empty room or in a baseline time window before experimental tasks. Standard source localization methods aim to solve for Jt given yt, G and Qe. In contrast, our model aims to estimate dynamic connectivity among p pre-defined regions of interest (ROIs) in the source space (see Figure 1 for an illustration). We assume at each time point in each trial, the current dipoles of the source points within each ROI share a common mean. Given p ROIs, we have a p-dimensional state variable ut at time t in a trial, where each element represents the mean activity in one ROI. The state variable ut follows a time-varying auto-regressive model of order 1 ROI model: u0 ∼N(0, Q0) ut = Atut−1 + ϵt, ϵt ∼N(0, Q), for t = 1, · · · , T. (2) where Q0 is a p × p covariance matrix at t = 0, and Ats are the time-varying auto-regressive coefficients, which describe lagged dependence across ROIs. The p-dimensional Gaussian noise term ϵt is independent of the past, with a zero mean and a covariance matrix Q. ... ... ... sensor space source space state space (ROI means) sensor model source model ROI model Figure 1: Illustration of the one-step state-space model Now we describe how the source activity is distributed given the state variable (i.e., the ROI means). Below, we denote the lth element in a vector a by a[l], and the entry in ith row and jth column of a matrix L by L[i, j]. Let Ai be the set of indices of source points in the ith ROI (i = 1, 2, · · · , p); then for any l ∈Ai, the activity of the lth source point at time t in a trial (scalar Jt[l]) is modeled as the ROI mean plus noise, Jt[l] = ut[i] + wt[l], wt[l] i.i.d. ∼N(0, σ2 i ), ∀l ∈Ai, (3) where wt denotes the m-dimensional noise on the m source points given the ROI means ut, at time t in the trial. Note that the mean ut[i] is shared by all source points within the ith ROI, and the noise term wt[l] given the mean is independent and identically distributed as N(0, σ2 i ) for all source points within the ROI, at any time in any trial. Additionally, we denote the indices of source points outside of any ROIs by A0 = {l, l /∈∪p i=1Ai}, and similarly, for each such source point, we also assume its activity at time t in each trial has a Gaussian distribution, but with a zero mean, and a variance σ2 0 Jt[l] = 0 + wt[l], wt[l] i.i.d. ∼N(0, σ2 0), ∀l ∈A0. (4) We can concisely re-write (3) and (4) as source model: Jt = Lut + wt, wt i.i.d. ∼N(0, QJ) (5) 3 where L is a 0/1 m × p matrix indicating whether a source point is in an ROI (i.e., L[l, i] = 1 if l ∈Ai and L[l, i] = 0 otherwise). The covariance QJ is an m × m diagonal matrix, where each diagonal element is one among {σ2 0, σ2 1, · · · σ2 p}, depending on which region the corresponding source point is in; that is, QJ[l, l] = σ2 0 if l ∈A0 (outside of any ROIs), and QJ[l, l] = σ2 1 if l ∈A1, QJ[l, l] = σ2 2 if l ∈A2 and so on. Combining the conditional distributions of (yt|Jt) given by (1) and (Jt|ut) given by (5), we can eliminate Jt (by integrating over all values of Jt) and obtain the following conditional distribution for (yt|ut) yt = Cut + ηt, ηt i.i.d. ∼N(0, R) where C = GL, R = Qe + GQJG′ (6) where G′ is the transpose of G. Putting (2) and (6) together, we have a time-varying Kalman filter model, where the observed sensor data from q trials {y(r) t }T,q t=0,r=1 and parameters Qe, G and L are given, and the unknown set of parameters θ = {{At}T t=1, Q0, Q, {σ2 i }p i=0} are to be estimated. Among these parameters, we are mainly interested in {At}T t=1, which describes the spatio-temporal dependence. Let f(·) denote probability density functions in general. We can add optional priors on θ (denoted by f(θ)) to regularize the parameters. For example, we can use f(θ) = f({At}T t=1) ∝exp(−(λ0 PT t=1 ∥At∥2 F + λ1 PT t=2 ∥At −At−1∥2 F )), which penalizes the squared Frobenius norm (∥· ∥F ) of Ats and encourages temporal smoothness. Fitting the parameters using the expectation-maximization (EM) algorithm To estimate θ, we maximize the objective function log f({y(r) t }T,q t=0,r=1; θ) + log f(θ) using the standard expectationmaximization (EM) algorithm (13). Here log f({y(r) t }T,q t=0,r=1; θ) is the marginal log-likelihood of the sensor data, and log f(θ) is the logarithm of the prior. We alternate between an E-step and an M-step. In the E-step, given an estimate of the parameters (denoted by ˜θ), we use the forward and backward steps in the Kalman smoothing algorithm (13) to obtain the posterior mean of ut, u(r) t|T def = E(u(r) t |{y(r) τ }T τ=0), the posterior covariance of ut, P (r) t|T def = cov(u(r) t |{y(r) τ }T τ=0), and the posterior cross covariance of ut and ut−1, P (r) (t,t−1)|T def = cov(u(r) t , u(r) t−1|{y(r) τ }T τ=0), for each t in each trial r. Here E(·) and cov(·) denote the expectation and the covariance. More details are in Appendix and (13). In the M-step, we maximize the expectation of log f({y(r) t }T,q t=0,r=1, {u(r) t }T,q t=0,r=1; θ) + log f(θ), with respect to the posterior distribution ˜f def = f({u(r) t }T,q t=0,r=1|{y(r) t }T,q t=0,r=1; ˜θ). Let tr(·) and det(·) denote the trace and the determinant of a matrix. Given results in the E-step based on ˜θ, the M-step is equivalent to minimizing three objectives separately min θ (−E ˜ f(log f({y(r) t }T,q t=0,r=1, {u(r) t }T,q t=0,r=1; θ)) −log f(θ)) ≡min Q0 L1 + min Q,{At}T t=1 L2 + min {σ2 i }p i=0 L3. (7) L1(Q0) = q log det(Q0) + tr(Q−1 0 B0) where B0 = Xq r=1(P (r) 0|T + u(r) 0|T (u(r) 0|T )′) (8) L2(Q, {At}T t=1) = qT log det(Q) + tr(Q−1 XT t=1(B1t −AtB′ 2t −B2tA′ t + AtB3tA′ t)) + log f({At}T t=1) (9) where B1t = Xq r=1(P (r) t|T + u(r) t|T (u(r) t|T )′), B2t = Xq r=1(P (r) (t,t−1)|T + u(r) t|T (u(r) (t−1)|T )′, ) B3t = Xq r=1(P (r) (t−1)|T + u(r) (t−1)|T (u(r) (t−1)|T )′) L3({σ2 i }p i=0) = q(T + 1) log det(R) + tr(R−1B4), where R = Qe + GQJG′, (10) and B4 = Xq r=1 XT t=0[(y(r) t −Cu(r) t|T )(y(r) t −Cu(r) t|T )′ + CP (r) t|T C′)] The optimization for the three separate objectives is relatively easy. 4 • For L1, the analytical solution is Q0 ←(1/q)(B0). • For L2, optimization for {At}T t=1 and Q can be done in alternations. Given {At}T t=1, Q has the analytical solution Q ←1/(qT) PT t=1(B1t −AtB′ 2t −B2tA′ t + AtB3tA′ t). Given Q, we use gradient descent with back-tracking line search (14) to solve for {At}T t=1, where the gradients are ∂L2 ∂At = 2Q−1(−B2t + AtB3t) + 2Dt, Dt = λ1(2At −At+1 − At−1) + λ0At for t = 2, · · · , T −1, Dt = λ1(A1 −A2) + λ0A1 for t = 1, and Dt = λ1(At −AT −1) + λ0At for t = T. • For L3, we can also use gradient descent to solve for σi, with the gradient ∂L3 ∂σi = tr(( ∂L3 ∂R )′ ∂R ∂σi ), where ∂L3 ∂R = R−1−R−1B4R−1 and ∂R ∂σi = 2σiG[:, l ∈Ai]G[:, l ∈Ai]′. Here G[:, l ∈Ai] denotes the columns in G corresponding to source points in the ith region. Because the E-M algorithm only guarantees to find a local optimum, we use multiple initializations, and select the solution that yields the best objective function log f({y(r) t }T,q t=0,r=1) + log f(θ) (see the appendix on computing log f({y(r) t }T,q t=0,r=1; θ)). The implementation of the model and the E-M algorithm in Python is available at github.com/YingYang/MEEG_connectivity. Visualizing the connectivity We visualize the lagged linear dependence between any pair of ROIs. According to the auto-regressive model in (2), given {At}T t=1, we can characterize the linear dependence of ROI means at time t + h on those at time t by ut+h = ˜At,t+hut + noise independent of ut where ˜At,t+h = Qt+1 τ=t+h Aτ, and in Qt+1 τ=t+h, τ decreases from t+h to t+1. For two ROIs indexed by i1 and i2, ˜At,t+h[i1, i2] indicates the linear dependence of the activity in ROI i1 at time t + h on the activity in ROI i2 at time t, where the linear dependence on the activity at time t in other ROIs and ROI i1 itself is accounted for; similarly, ˜At,t+h[i2, i1] indicates the linear dependence of the activity in ROI i2 at time t + h on the activity in ROI i1 at time t. Therefore, we can create a T × T matrix ∆for any pair of ROIs (i1 and i2) to describe their linear dependence at any time lag: ∆[t, t + h] = ˜At,t+h[i2, i1] (i1 leading i2) and ∆[t + h, t] = ˜At,t+h[i1, i2] (i2 leading i1), for t = 1, · · · , T and h = 1, · · · , T −t −1. 3 Results To examine whether our state-space model can improve dynamic connectivity estimation empirically, compared with the two-step procedure, we applied both approaches on simulated and real MEG data. We implemented the following two-step method as a baseline for comparison. In Step 1, we applied the minimum-norm estimate (MNE (2)), one of the most commonly used source localization methods, to estimate Jt for each time point in each trial. This is a Bayesian estimate assuming an L2 prior on the source activity. Given G, Qe and a prior Jt ∼N(0, (1/λ)I), λ > 0 and the corresponding yt, the estimate is Jt ←G′(GG′ + λQe)−1yt. We averaged the MNE estimates for source points within each ROI, at each time point and in each trial respectively, and treated the averages as an estimate of the ROI means {ut}T,q t=0,r=1. In Step 2, according to the auto-regressive model in (2), we estimated Q0, {At}T t=1 and Q by maximizing the sum of the log-likelihood and the logarithm of the prior (log f({ut}T,q t=0,r=1) + log f({At}T t=1); the maximization is very similar to the optimization for L2 in the M-step. Details are deferred to the appendix. 3.1 Simulation We simulated MEG sensor data according to our model assumptions. The source space was defined as m ≈5000 source points covering the cortical surfaces of a real brain, with 6.2 mm spacing on average, and n = 306 sensors were used. The sensor noise covariance matrix Qe was estimated from real data. Two bilaterally merged ROIs were used: the pericalcarine area (ROI 1), and the parahippocampal gyri (ROI 2) (see Figure 2a). We selected these two regions, because they were of interest when we applied the models on the real MEG data (see Section 3.2). We generated the auto-regressive coefficients for T = 20 time points, where for each At, the diagonal entries were 5 set to 0.5, and the off-diagonal entries were generated as a Morlet function multiplied by a random scalar drawn uniformly from the interval (−1, 1) (see Figure 2b for an example). The covariances Q0 and Q were random positive definite matrices, whose diagonal entries were a constant a. The variances of source space noise {σ2 i }p i=0 were randomly drawn from a Gamma distribution with the shape parameter being 2 and the scale parameter being 1. We used two different values, a = 2 and a = 5, respectively, where the relative strength of the ROI means compared with the source variance {σ2 i }p i=0 were different. Each simulation had q = 200 trials, and 5 independent simulations for each a value were generated. The unit of the source activity was nanoampere meter (nAm). When running the two-step MNE method for each simulation, a wide range of penalization values (λ) were used. When fitting the state-space model, multiple initializations were used, including one of the two-step MNE estimates. In the prior of {At}T t=1, we set λ0 = 0 and λ1 = 0.1. For the fitted parameters {At}T t=1 and Q we defined the relative error as the Frobenius norm of the difference between the estimate and the true parameter, divided by the Frobenius norm of the true parameter (e.g., for the true Q and the estimate ˆQ, the relative error was ∥ˆQ −Q∥F /∥Q∥F ). For different two-step MNE estimates with different λs, the smallest relative error was selected for comparison. Figure 2c and 2d show the relative errors and paired differences in errors between the two methods; in these simulations, the state-space model yielded smaller estimation errors than the two-step MNE method. ROI 1 ROI 2 right hemisphere left hemisphere A[:,1,1] A[:,2,2] A[:,1,2] A[:,2,1] (a) 0 5 10 15 20 time index −1.0 −0.5 0.0 0.5 1.0 A[:,1,1] truth ss mne 0 5 10 15 20 −1.0 −0.5 0.0 0.5 1.0 A[:,1,2] 0 5 10 15 20 −1.0 −0.5 0.0 0.5 1.0 A[:,2,1] 0 5 10 15 20 −1.0 −0.5 0.0 0.5 1.0 A[:,2,2] (b) 2 5 a −1.0 −0.5 0.0 0.5 1.0 A error ss mne diff ss-mne (c) 2 5 a −1.0 −0.5 0.0 0.5 1.0 Q error (d) Figure 2: Simulation results. (a), Illustration of the two ROIs. (b), The auto-regressive coefficients {At}T t=1 of T = 20 time points in one example simulation (a = 5). Here A[:, i1, i2] indicates the time-varying coefficient in At[i1, i2], for i1, i2 = 1, 2. (The legends: truth (blue), true values; ss (green), estimates by the state-space model; mne (red), estimates by the two-step MNE method.) (c) and (d), Comparison of the state-space model (ss) with the two-step MNE method (mne) in relative errors of {At}T t=1 (c) and Q (d). The error bars show standard errors across individual simulations. 3.2 Real MEG data on scene processing We also applied our state-space model and the two-step MNE method on real MEG data, to explore the dynamic connectivity in the visual cortex during scene processing. It is hypothesized that the ventral visual pathway, which underlies recognition of what we see, is organized in a hierarchical manner—along the pathway, regions at each level of the hierarchy receive inputs from previous levels, and perform transformations to extract features that are more and more related to semantics (e.g., categories of objects/scenes ) (15). Besides such feedfoward processing, a large number of top-down anatomical connections along the hypothesized hierarchy also suggest feedback effects 6 (16). Evidence for both directions has been reported previously (17; 18). However, details of the dynamic information flow during scene processing, such as when and how significant the feedback effect is, is not well understood. Here, as an exploratory step, we estimate dynamic connectivity between two regions in the ventral pathway: the early visual cortex (EVC) at the lowest level (in the pericalcarine areas), which is hypothesized to process low-level features such as local edges, and the parahippocampal place area (PPA), which is a scene-sensitive region on the higher level of the hierarchy and has been implicated in processing semantic information (19). The 306-channel MEG data were recorded while a human participant was viewing 362 photos of various scenes. Each image was presented for 200 ms and repeated 5 times across the session, and data across the repetitions were averaged, resulting in q = 362 observations. The data was down-sampled from a sampling rate of 1 kHz to 100 Hz, and cropped within −100 ∼700 ms, where 0 ms marked the stimulus onset. Together, we had T + 1 = 80 time points (see the appendix for more preprocessing details). Given the data, we estimated the dynamic connectivity between the neural responses to the 362 images in the two ROIs (EVC and PPA), using our state-space model and the two-step MNE method. We created a source space including m ≈5000 source points for the participant. In the prior of {At}T t=1, we set λ0 = 0 and λ1 = 1.0; in the two-step MNE method, we used the default value of the tuning parameter (λ) for single-trial data in the MNE-python software (20). After fitting Q0, {At}T t=1 and Q, we computed the ∆matrix, as defined in Section 2, to visualize the lagged linear dependence between the two ROIs (EVC and PPA). We also bootstrapped the 362 observations 27 times to obtain standard deviations of entries in ∆, and then computed a z-score for each entry, defined as the ratio between the estimated value and the bootstrapped standard deviation. Note that the sign of the source activity only indicates the direction of the electric current, so negative entries in ∆are as meaningful as positive ones. We ran two-tailed z-tests on the z-scores (assuming a standard normal null distribution); then we plotted the absolute values of the z-scores that passed a threshold where the p-value < 0.05/(T 2), using the Bonferroni correction for T 2 comparisons in all the entries (Figure 3). Larger absolute values indicate more significant non-zero entries of ∆, and more significant lagged linear dependence. As illustrated in Figure 3a, the lower right triangle of ∆indicates the linear dependence of PPA activity on previous EVC activity (EVC leading PPA, lower- to higher-level), whereas the upper left triangle indicates the linear dependence of EVC activity on previous PPA activity (PPA leading EVC, higher- to lower-level). PPA right hemisphere left hemisphere EVC PPA EVC PPA leading EVC EVC leading PPA (a) Illustration of the ROIs and ∆ 0 100 200 300 400 500 600 700 PPA time (ms) 0 100 200 300 400 500 600 700 EVC time (ms) 0 1 2 3 4 5 6 7 8 9 10 (b) Results by the state-space model 0 100 200 300 400 500 600 700 PPA time (ms) 0 100 200 300 400 500 600 700 EVC time (ms) 0 1 2 3 4 5 6 7 8 9 10 (c) Results by the two-step MNE Figure 3: Results from real MEG data on scene processing. (a), illustration of ROIs and the triangular parts of ∆. (b) and (c), thresholded z-scores of ∆by the state-space model (b) and by the two-step MNE method (c). Figure 3b and 3c show the thresholded absolute values of the z-scores by the state-space model and the two-step MNE method. In Figure 3b by the state-space model, we observed clusters indicating significant non-zero lagged dependence, in the lower right triangle, spanning roughly from 60 to 280 ms in EVC and from 120 to 300 ms in PPA, which suggests earlier responses in EVC can predict later responses in PPA in these windows. This pattern could result from feedforward information flow, which starts when EVC first receives the visual input near 60 ms. In the upper left triangle, we also observed clusters spanning from 100 to 220 ms in PPA and from 140 to 300 ms in EVC, suggesting earlier responses in PPA can predict later responses in EVC, which could reflect feedback along the top-down direction of the hierarchy. Figure 3c by the two-step MNE method also shows clusters in similar time windows, yet the earliest cluster in the lower right triangle appeared before 0 ms in EVC, which could be a false positive as visual input is unlikely to reach EVC that early. 7 We also observed a small cluster in the top right corner near the diagonal by both methods. This cluster could indicate late dependence between the two regions, but it was later than the typically evoked responses before 500 ms. These preliminary results were based on only one participant, and further analysis for more participants is needed. In addition, the apparent lagged dependence between the two regions are not necessarily direct or causal interactions; instead, it could be mediated by other intermediate or higher-level regions, as well as by the stimulus-driven effects. For example, the disappearance of the stimuli at 200 ms could cause an image-specific offset-response starting at 260 ms in the EVC, which could make it seem that image-specific responses in PPA near 120 ms predicted the responses at EVC after 260 ms. Therefore further analysis including more regions is needed, and the stimulus-driven effect needs to be considered as well. Nevertheless, the interesting patterns in Figure 3b suggest that our one-step state-space model can be a promising tool to explore the timing of feedforward and feedback processing in a data-driven manner, and such analysis can help to generate specific hypotheses about information flow for further experimental testing. 4 Discussion We propose a state-space model to directly estimate the dynamic connectivity across regions of interest from MEG/EEG data, with the source localization step embedded. In this model, the mean activities in individual ROIs, (i.e., the state variable), are modeled with time-varying auto-regression, which can flexibly describe the spatio-temporal dependence of non-stationary neural activity. Compared with a two-step method, which first obtains the commonly used minimum-norm estimate of source activity, and then fits the auto-regressive model, our state-space model yielded smaller estimation errors than the two-step method in simulated data, where the assumptions in our model held. When applied on empirical MEG data from one participant in a scene-processing experiment, our statespace model also demonstrated intriguing preliminary results, indicating leading and lagged linear dependence between the early visual cortex and a higher-level scene-sensitive region, which could reflect feedforward and feedback information flow within the visual cortex. In sum, these results shed some light on how to better study dynamic connectivity using MEG/EEG and how to exploit the estimated connectivity to study information flow in cognition. One limitation of the work here is that we did not compare with other one-step models (10; 11). In future work, we plan to do comprehensive empirical evaluations of the available one-step methods. Another issue is there can be violations of our model assumptions in practice. First, given the ROI means, the noise on source points could be spatially and temporally correlated, rather than independently distributed. Secondly, if we fail to include an important ROI, the connectivity estimates may be inaccurate—the estimates may not even be equivalent to the estimates when this ROI is marginalized out, due to the under-determined nature of source localization. Thirdly, the assumption that source points within an ROI share a common mean is typically correct for small ROIs but could be less accurate for larger ROIs, where the diverse activities of many source points might not be well-represented by a one-dimensional mean activity. That being said, as long as the activity in different source points within the ROI is not fully canceled, positive dependence effects of the kind identified by our model would still be meaningful in the sense that they reflect some cross-region dependence. To deal with the last two issues, one may divide the entire source space into sufficiently small, non-overlapping ROIs, when applying our state-space model. In such cases, the number of parameters can be large, and some sparsity-inducing regularization (such as the one in (11)) can be applied. In ongoing and future work, we plan to explore this idea and also address the effect of potential assumption violations. Acknowledgments This work was supported in part by the National Science Foundation Grant 1439237, the National Institute of Mental Health Grant RO1 MH64537, as well as the Henry L. Hillman Presidential Fellowship at Carnegie Mellon University. References [1] J. C. Mosher, R. M. Leahy, and P. S. Lewis. EEG and MEG: forward solutions for inverse methods. Biomedical Engineering, IEEE Transactions on, 46(3):245–259, 1999. 8 [2] M. Hamalainen and R. Ilmoniemi. Interpreting magnetic fields of the brain: minimum norm estimates. Med. Biol. Eng. Comput., 32:35–42, 1994. [3] A. M. Dale, A. K. Liu, B. R. Fischl, R. L. Buckner, J. W. Belliveau, J. D. Lewine, and E. Halgren. Dynamic statistical parametric mapping: combining fMRI and MEG for high-resolution imaging of cortical activity. Neuron, 26(1):55–67, 2000. [4] A. Gramfort, M. Kowalski, and M. Hamaleinen. Mixed-norm estimates for the m/eeg inverse problem using accelerated gradient methods. Physics in Medicine and Biology, 57:1937–1961, 2012. [5] R. D. Pascual-Marqui, C. M. Michel, and D. Lehmann. Low resolution electromagnetic tomography: a new method for localizing electrical activity in the brain. International Journal of psychophysiology, 18(1):49–65, 1994. [6] A. Galka, O. Y. T. Ozaki, R. Biscay, and P. Valdes-Sosa. A solution to the dynamical inverse problem of eeg generation using spatiotemporal kalman filtering. NeuroImage, 23:435–453, 2004. [7] J. Mattout, C. Phillips, W. D. Penny, M. D. Rugg, and K. J. Friston. MEG source localization under multiple constraints: an extended bayesian framework. NeuroImage, 30(3):753–767, 2006. [8] C. Lamus, M. S. Hamalainen, S. Temereanca, E. N. Brown, and P. L. Purdon. A spatiotemporal dynamic distributed solution to the MEG inverse problem. NeuroImage, 63:894–909, 2012. [9] V. Sakkalis. Review of advanced techniques for the estimation of brain connectivity measured with EEG/MEG. Computers in biology and medicine, 41(12):1110–1117, 2011. [10] O. David, S. J. Kiebel, L. M. Harrison, J. Mattout, J. M. Kilner, and K. J. Friston. Dynamic causal modeling of evoked responses in EEG and MEG. NeuroImage, 30(4):1255–1272, 2006. [11] M. Fukushima, O. Yamashita, T. R. Knösche, and M.-a. Sato. MEG source reconstruction based on identification of directed source interactions on whole-brain anatomical networks. NeuroImage, 105:408–427, 2015. [12] M. Hamalainen, R. Hari, R. J. Ilmoniemi, J. Knuutila, and O. V. Lounasmaa. Magnetoencephalography–theory, instrumentation, to noninvasive studies of the working human brain. Reviews of Modern Physics, 65:414–487, 1993. [13] R. H. Shumway and D. S. Stoffer. An approach to time series smoothing and forecasting using the EM algorithm. Journal of time series analysis, 3(4):253–264, 1982. [14] S. Boyd and L. Vandenberghe. Convex Optimization. Cambridge University Press, New York, NY, USA, 2004. [15] J. J. DiCarlo and D. D. Cox. Untangling invariant object recognition. Trends in cognitive sciences, 11(8):333–341, 2007. [16] D. J. Felleman and D. C. Van Essen. Distributed hierarchical processing in the primate cerebral cortex. Cerebral cortex, 1(1):1–47, 1991. [17] R. M. Cichy, A. Khosla, D. Pantazis, A. Torralba, and A. Oliva. Deep neural networks predict hierarchical spatio-temporal cortical dynamics of human visual object recognition. arXiv preprint arXiv:1601.02970, 2016. [18] M. Bar, K. S. Kassam, A. S. Ghuman, J. Boshyan, A. M. Schmid, A. M. Dale, M. S. Hämäläinen, K. Marinkovic, D. L. Schacter, B. R. Rosen, et al. Top-down facilitation of visual recognition. Proceedings of the National Academy of Sciences of the United States of America, 103(2):449– 454, 2006. [19] R. Epstein, A. Harris, D. Stanley, and N. Kanwisher. The parahippocampal place area: Recognition, navigation, or encoding? Neuron, 23(1):115–125, 1999. [20] A. Gramfort, M. Luessi, E. Larson, D. A. Engemann, D. Strohmeier, C. Brodbeck, R. Goj, M. Jas, T. Brooks, L. Parkkonen, et al. Meg and eeg data analysis with mne-python. Frontiers in neuroscience, 7:267, 2013. 9
2016
363
6,287
Using Fast Weights to Attend to the Recent Past Jimmy Ba University of Toronto jimmy@psi.toronto.edu Geoffrey Hinton University of Toronto and Google Brain geoffhinton@google.com Volodymyr Mnih Google DeepMind vmnih@google.com Joel Z. Leibo Google DeepMind jzl@google.com Catalin Ionescu Google DeepMind cdi@google.com Abstract Until recently, research on artificial neural networks was largely restricted to systems with only two types of variable: Neural activities that represent the current or recent input and weights that learn to capture regularities among inputs, outputs and payoffs. There is no good reason for this restriction. Synapses have dynamics at many different time-scales and this suggests that artificial neural networks might benefit from variables that change slower than activities but much faster than the standard weights. These “fast weights” can be used to store temporary memories of the recent past and they provide a neurally plausible way of implementing the type of attention to the past that has recently proved very helpful in sequence-to-sequence models. By using fast weights we can avoid the need to store copies of neural activity patterns. 1 Introduction Ordinary recurrent neural networks typically have two types of memory that have very different time scales, very different capacities and very different computational roles. The history of the sequence currently being processed is stored in the hidden activity vector, which acts as a short-term memory that is updated at every time step. The capacity of this memory is O(H) where H is the number of hidden units. Long-term memory about how to convert the current input and hidden vectors into the next hidden vector and a predicted output vector is stored in the weight matrices connecting the hidden units to themselves and to the inputs and outputs. These matrices are typically updated at the end of a sequence and their capacity is O(H2) + O(IH) + O(HO) where I and O are the numbers of input and output units. Long short-term memory networks [Hochreiter and Schmidhuber, 1997] are a more complicated type of RNN that work better for discovering long-range structure in sequences for two main reasons: First, they compute increments to the hidden activity vector at each time step rather than recomputing the full vector1. This encourages information in the hidden states to persist for much longer. Second, they allow the hidden activities to determine the states of gates that scale the effects of the weights. These multiplicative interactions allow the effective weights to be dynamically adjusted by the input or hidden activities via the gates. However, LSTMs are still limited to a short-term memory capacity of O(H) for the history of the current sequence. Until recently, there was surprisingly little practical investigation of other forms of memory in recurrent nets despite strong psychological evidence that it exists and obvious computational reasons why it was needed. There were occasional suggestions that neural networks could benefit from a third form of memory that has much higher storage capacity than the neural activities but much faster dynamics than the standard slow weights. This memory could store information specific to the history of the current sequence so that this information is available to influence the ongoing processing 1This assumes the “remember gates ” of the LSTM memory cells are set to one. without using up the memory capacity of the hidden activities. Hinton and Plaut [1987] suggested that fast weights could be used to allow true recursion in a neural network and Schmidhuber [1993] pointed out that a system of this kind could be trained end-to-end using backpropagation, but neither of these papers actually implemented this method of achieving recursion. 2 Evidence from physiology that temporary memory may not be stored as neural activities Processes like working memory, attention, and priming operate on timescale of 100ms to minutes. This is simultaneously too slow to be mediated by neural activations without dynamical attractor states (10ms timescale) and too fast for long-term synaptic plasticity mechanisms to kick in (minutes to hours). While artificial neural network research has typically focused on methods to maintain temporary state in activation dynamics, that focus may be inconsistent with evidence that the brain also—or perhaps primarily—maintains temporary state information by short-term synaptic plasticity mechanisms [Tsodyks et al., 1998, Abbott and Regehr, 2004, Barak and Tsodyks, 2007]. The brain implements a variety of short-term plasticity mechanisms that operate on intermediate timescale. For example, short term facilitation is implemented by leftover [Ca2+] in the axon terminal after depolarization while short term depression is implemented by presynaptic neurotransmitter depletion Zucker and Regehr [2002]. Spike-time dependent plasticity can also be invoked on this timescale [Markram et al., 1997, Bi and Poo, 1998]. These plasticity mechanisms are all synapsespecific. Thus they are more accurately modeled by a memory with O(H2) capacity than the O(H) of standard recurrent artificial recurrent neural nets and LSTMs. 3 Fast Associative Memory One of the main preoccupations of neural network research in the 1970s and early 1980s [Willshaw et al., 1969, Kohonen, 1972, Anderson and Hinton, 1981, Hopfield, 1982] was the idea that memories were not stored by somehow keeping copies of patterns of neural activity. Instead, these patterns were reconstructed when needed from information stored in the weights of an associative network and the very same weights could store many different memories An auto-associative memory that has N 2 weights cannot be expected to store more that N real-valued vectors with N components each. How close we can come to this upper bound depends on which storage rule we use. Hopfield nets use a simple, one-shot, outer-product storage rule and achieve a capacity of approximately 0.15N binary vectors using weights that require log(N) bits each. Much more efficient use can be made of the weights by using an iterative, error correction storage rule to learn weights that can retrieve each bit of a pattern from all the other bits [Gardner, 1988], but for our purposes maximizing the capacity is less important than having a simple, non-iterative storage rule, so we will use an outer product rule to store hidden activity vectors in fast weights that decay rapidly. The usual weights in an RNN will be called slow weights and they will learn by stochastic gradient descent in an objective function taking into account the fact that changes in the slow weights will lead to changes in what gets stored automatically in the fast associative memory. A fast associative memory has several advantages when compared with the type of memory assumed by a Neural Turing Machine (NTM) [Graves et al., 2014], Neural Stack [Grefenstette et al., 2015], or Memory Network [Weston et al., 2014]. First, it is not at all clear how a real brain would implement the more exotic structures in these models e.g., the tape of the NTM, whereas it is clear that the brain could implement a fast associative memory in synapses with the appropriate dynamics. Second, in a fast associative memory there is no need to decide where or when to write to memory and where or when to read from memory. The fast memory is updated all the time and the writes are all superimposed on the same fast changing component of the strength of each synapse. Every time the input changes there is a transition to a new hidden state which is determined by a combination of three sources of information: The new input via the slow input-to-hidden weights, C, the previous hidden state via the slow transition weights, W, and the recent history of hidden state vectors via the fast weights, A. The effect of the first two sources of information on the new hidden state can be computed once and then maintained as a sustained boundary condition for a brief iterative settling process which allows the fast weights to influence the new hidden state. Assuming that the fast weights decay exponentially, we now show that the effect of the fast weights on the hidden vector 2 . . . . Sustained boundary condition Slow transition weights Fast transition weights Figure 1: The fast associative memory model. during an iterative settling phase is to provide an additional input that is proportional to the sum over all recent hidden activity vectors of the scalar product of that recent hidden vector with the current hidden activity vector, with each term in this sum being weighted by the decay rate raised to the power of how long ago that hidden vector occurred. So fast weights act like a kind of attention to the recent past but with the strength of the attention being determined by the scalar product between the current hidden vector and the earlier hidden vector rather than being determined by a separate parameterized computation of the type used in neural machine translation models [Bahdanau et al., 2015]. The update rule for the fast memory weight matrix, A, is simply to multiply the current fast weights by a decay rate, λ, and add the outer product of the hidden state vector, h(t), multiplied by a learning rate, η: A(t) = λA(t −1) + ηh(t)h(t)T (1) The next vector of hidden activities, h(t + 1), is computed in two steps. The “preliminary” vector h0(t + 1) is determined by the combined effects of the input vector x(t) and the previous hidden vector: h0(t + 1) = f(Wh(t) + Cx(t)), where W and C are slow weight matrices and f(.) is the nonlinearity used by the hidden units. The preliminary vector is then used to initiate an “inner loop” iterative process which runs for S steps and progressively changes the hidden state into h(t + 1) = hS(t + 1) hs+1(t + 1) = f([Wh(t) + Cx(t)] + A(t)hs(t + 1)), (2) where the terms in square brackets are the sustained boundary conditions. In a real neural net, A could be implemented by rapidly changing synapses but in a computer simulation that uses sequences which have fewer time steps than the dimensionality of h, A will be of less than full rank and it is more efficient to compute the term A(t)hs(t+1) without ever computing the full fast weight matrix, A. Assuming A is 0 at the beginning of the sequence, A(t) = η τ=t X τ=1 λt−τh(τ)h(τ)T (3) A(t)hs(t + 1) = η τ=t X τ=1 λt−τh(τ)[h(τ)T hs(t + 1)] (4) The term in square brackets is just the scalar product of an earlier hidden state vector, h(τ), with the current hidden state vector, hs(t+1), during the iterative inner loop. So at each iteration of the inner loop, the fast weight matrix is exactly equivalent to attending to past hidden vectors in proportion to their scalar product with the current hidden vector, weighted by a decay factor. During the inner loop iterations, attention will become more focussed on past hidden states that manage to attract the current hidden state. The equivalence between using a fast weight matrix and comparing with a set of stored hidden state vectors is very helpful for computer simulations. It allows us to explore what can be done with fast 3 weights without incurring the huge penalty of having to abandon the use of mini-batches during training. At first sight, mini-batches cannot be used because the fast weight matrix is different for every sequence, but comparing with a set of stored hidden vectors does allow mini-batches. 3.1 Layer normalized fast weights A potential problem with fast associative memory is that the scalar product of two hidden vectors could vanish or explode depending on the norm of the hidden vectors. Recently, layer normalization [Ba et al., 2016] has been shown to be very effective at stablizing the hidden state dynamics in RNNs and reducing training time. Layer normalization is applied to the vector of summed inputs to all the recurrent units at a particular time step. It uses the mean and variance of the components of this vector to re-center and re-scale those summed inputs. Then, before applying the nonlinearity, it includes a learned, neuron-specific bias and gain. We apply layer normalization to the fast associative memory as follows: hs+1(t + 1) = f(LN[Wh(t) + Cx(t) + A(t)hs(t + 1)]) (5) where LN[.] denotes layer normalization. We found that applying layer normalization on each iteration of the inner loop makes the fast associative memory more robust to the choice of learning rate and decay hyper-parameters. For the rest of the paper, fast weight models are trained using layer normalization and the outer product learning rule with fast learning rate of 0.5 and decay rate of 0.95, unless otherwise noted. 4 Experimental results To demonstrate the effectiveness of the fast associative memory, we first investigated the problems of associative retrieval (section 4.1) and MNIST classification (section 4.2). We compared fast weight models to regular RNNs and LSTM variants. We then applied the proposed fast weights to a facial expression recognition task using a fast associative memory model to store the results of processing at one level while examining a sequence of details at a finer level (section 4.3). The hyper-parameters of the experiments were selected through grid search on the validation set. All the models were trained using mini-batches of size 128 and the Adam optimizer [Kingma and Ba, 2014]. A description of the training protocols and the hyper-parameter settings we used can be found in the Appendix. Lastly, we show that fast weights can also be used effectively to implement reinforcement learning agents with memory (section 4.4). 4.1 Associative retrieval We start by demonstrating that the method we propose for storing and retrieving temporary memories works effectively for a toy task to which it is very well suited. Consider a task where multiple key-value pairs are presented in a sequence. At the end of the sequence, one of the keys is presented and the model must predict the value that was temporarily associated with the key. We used strings that contained characters from English alphabet, together with the digits 0 to 9. To construct a training sequence, we first randomly sample a character from the alphabet without replacement. This is the first key. Then a single digit is sampled as the associated value for that key. After generating a sequence of K character-digit pairs, one of the K different characters is selected at random as the query and the network must predict the associated digit. Some examples of such string sequences and their targets are shown below: Input string Target c9k8j3f1??c 9 j0a5s5z2??a 5 where ‘?’ is the token to separate the query from the key-value pairs. We generated 100,000 training examples, 10,000 validation examples and 20,000 test examples. To solve this task, a standard RNN has to end up with hidden activities that somehow store all of the key-value pairs after the keys and values are presented sequentially. This makes it a significant challenge for models only using slow weights. We used a neural network with a single recurrent layer for this experiment. The recurrent network processes the input sequence one character at a time. The input character is first converted into a 4 Model R=20 R=50 R=100 IRNN 62.11% 60.23% 0.34% LSTM 60.81% 1.85% 0% A-LSTM 60.13% 1.62% 0% Fast weights 1.81% 0% 0% Table 1: Classification error rate comparison on the associative retrieval task. 0 20 40 60 80 100 120 140 Updates x 5000 0.0 0.5 1.0 1.5 2.0 Negative log likelihood A-LSTM 50 IRNN 50 LSTM 50 FW 50 Figure 2: Comparison of the test log likelihood on the associative retrieval task with 50 recurrent hidden units. learned 100-dimensional embedding vector which then provides input to the recurrent layer2. The output of the recurrent layer at the end of the sequence is then processed by another hidden layer of 100 ReLUs before the final softmax layer. We augment the ReLU RNN with a fast associative memory and compare it to an LSTM model with the same architecture. Although the original LSTMs do not have explicit long-term storage capacity, recent work from Danihelka et al. [2016] extended LSTMs by adding complex associative memory. In our experiments, we compared fast associative memory to both LSTM variants. Figure 2 and Table 1 show that when the number of recurrent units is small, the fast associative memory significantly outperforms the LSTMs with the same number of recurrent units. The result fits with our hypothesis that the fast associative memory allows the RNN to use its recurrent units more effectively. In addition to having higher retrieval accuracy, the model with fast weights also converges faster than the LSTM models. 4.2 Integrating glimpses in visual attention models Despite their many successes, convolutional neural networks are computationally expensive and the representations they learn can be hard to interpret. Recently, visual attention models [Mnih et al., 2014, Ba et al., 2015, Xu et al., 2015] have been shown to overcome some of the limitations in ConvNets. One can understand what signals the algorithm is using by seeing where the model is looking. Also, the visual attention model is able to selectively focus on important parts of visual space and thus avoid any detailed processing of much of the background clutter. In this section, we show that visual attention models can use fast weights to store information about object parts, though we use a very restricted set of glimpses that do not correspond to natural parts of the objects. Given an input image, a visual attention model computes a sequence of glimpses over regions of the image. The model not only has to determine where to look next, but also has to remember what it has seen so far in its working memory so that it can make the correct classification later. Visual attention models can learn to find multiple objects in a large static input image and classify them correctly, but the learnt glimpse policies are typically over-simplistic: They only use a single scale of glimpses and they tend to scan over the image in a rigid way. Human eye movements and fixations are far more complex. The ability to focus on different parts of a whole object at different scales allows humans to apply the very same knowledge in the weights of the network at many different scales, but it requires some form of temporary memory to allow the network to integrate what it discovered in a set of glimpses. Improving the model’s ability to remember recent glimpses should help the visual attention model to discover non-trivial glimpse policies. Because the fast weights can store all the glimpse information in the sequence, the hidden activity vector is freed up to learn how to intelligently integrate visual information and retrieve the appropriate memory content for the final classifier. To explicitly verify that larger memory capacity is beneficial to visual attention-based models, we simplify the learning process in the following way: First, we provide a pre-defined glimpse control signal so the model knows where to attend rather than having to learn the control policy through reinforcement learning. Second, we introduce an additional control signal to the memory cells so the attention model knows when to store the glimpse information. A typical visual attention model is 2To make the architecture for this task more similar to the architecture for the next task we first compute a 50 dimensional embedding vector and then expand this to a 100-dimensional embedding. 5 Integration transition weights Slow transition weights Fast transition weights Update fast weights and wipe out hidden state Figure 3: The multi-level fast associative memory model. Model 50 features 100 features 200 features IRNN 12.95% 1.95% 1.42% LSTM 12% 1.55% 1.10% ConvNet 1.81% 1.00% 0.9% Fast weights 7.21% 1.30% 0.85% Table 2: Classification error rates on MNIST. complex and has high variance in its performance due to the need to learn the policy network and the classifier at the same time. Our simplified learning procedure enables us to discern the performance improvement contributed by using fast weights to remember the recent past. We consider a simple recurrent visual attention model that has a similar architecture to the RNN from the previous experiment. It does not predict where to attend but rather is given a fixed sequence of locations: the static input image is broken down into four non-overlapping quadrants recursively with two scale levels. The four coarse regions, down-sampled to 7 × 7, along with their the four 7×7 quadrants are presented in a single sequence as shown in Figure 1. Notice that the two glimpse scales form a two-level hierarchy in the visual space. In order to solve this task successfully, the attention model needs to integrate the glimpse information from different levels of the hierarchy. One solution is to use the model’s hidden states to both store and integrate the glimpses of different scales. A much more efficient solution is to use a temporary “cache” to store any of the unfinished glimpse computation when processing the glimpses from a finer scale in the hierarchy. Once the computation is finished at that scale, the results can be integrated with the partial results at the higher level by “popping” the previous result from the “cache”. Fast weights, therefore, can act as a neurally plausible “cache” for storing partial results. The slow weights of the same model can then specialize in integrating glimpses at the same scale. Because the slow weights are shared for all glimpse scales, the model should be able to store the partial results at several levels in the same set of fast weights, though we have only demonstrated the use of fast weights for storage at a single level. We evaluated the multi-level visual attention model on the MNIST handwritten digit dataset. MNIST is a well-studied problem on which many other techniques have been benchmarked. It contains the ten classes of handwritten digits, ranging from 0 to 9. The task is to predict the class label of an isolated and roughly normalized 28x28 image of a digit. The glimpse sequence, in this case, consists of 24 patches of 7 × 7 pixels. Table 2 compares classification results for a ReLU RNN with a multi-level fast associative memory against an LSTM that gets the same sequence of glimpses. Again the result shows that when the number of hidden units is limited, fast weights give a significant improvement over the other 6 Figure 4: Examples of the near frontal faces from the MultiPIE dataset. IRNN LSTM ConvNet Fast Weights Test accuracy 81.11 81.32 88.23 86.34 Table 3: Classification accuracy comparison on the facial expression recognition task. models. As we increase the memory capacities, the multi-level fast associative memory consistently outperforms the LSTM in classification accuracy. Unlike models that must integrate a sequence of glimpses, convolutional neural networks process all the glimpses in parallel and use layers of hidden units to hold all their intermediate computational results. We further demonstrate the effectiveness of the fast weights by comparing to a three-layer convolutional neural network that uses the same patches as the glimpses presented to the visual attention model. From Table 2, we see that the multi-level model with fast weights reaches a very similar performance to the ConvNet model without requiring any biologically implausible weight sharing. 4.3 Facial expression recognition To further investigate the benefits of using fast weights in the multi-level visual attention model, we performed facial expression recognition tasks on the CMU Multi-PIE face database [Gross et al., 2010]. The dataset was preprocessed to align each face by eyes and nose fiducial points. It was downsampled to 48 × 48 greyscale. The full dataset contains 15 photos taken from cameras with different viewpoints for each illumination × expression × identity × session condition. We used only the images taken from the three central cameras corresponding to −15◦, 0◦, 15◦views since facial expressions were not discernible from the more extreme viewpoints. The resulting dataset contained > 100, 000 images. 317 identities appeared in the training set with the remaining 20 identities in the test set. Given the input face image, the goal is to classify the subject’s facial expression into one of the six different categories: neutral, smile, surprise, squint, disgust and scream. The task is more realistic and challenging than the previous MNIST experiments. Not only does the dataset have unbalanced numbers of labels, some of the expressions, for example squint and disgust, are are very hard to distinguish. In order to perform well on this task, the models need to generalize over different lighting conditions and viewpoints. We used the same multi-level attention model as in the MNIST experiments with 200 recurrent hidden units. The model sequentially attends to non-overlapping 12x12 pixel patches at two different scales and there are, in total, 24 glimpses. Similarly, we designed a two layer ConvNet that has a 12x12 receptive fields. From Table 3, we see that the multi-level fast weights model that knows when to store information outperforms the LSTM and the IRNN. The results are consistent with previous MNIST experiments. However, ConvNet is able to perform better than the multi-level attention model on this near frontal face dataset. We think the efficient weight-sharing and architectural engineering in the ConvNet combined with the simultaneous availability of all the information at each level of processing allows the ConvNet to generalize better in this task. Our use of a rigid and predetermined policy for where to glimpse eliminates one of the main potential advantages of the multi-level attention model: It can process informative details at high resolution whilst ignoring most of the irrelevant details. To realize this advantage we will need to combine the use of fast weights with the learning of complicated policies. 7 (a) 0 2 4 6 8 10 12 14 steps 0.8 0.6 0.4 0.2 0.0 0.2 0.4 0.6 0.8 1.0 Avgerage Reward RNN RNN+FW LSTM (b) 0 5 10 15 20 25 30 steps 1.0 0.5 0.0 0.5 1.0 Avgerage Reward RNN RNN+FW LSTM (c) Figure 5: a) Sample screen from the game ”Catch” b) Performance curves for Catch with N = 16, M = 3. c) Performance curves for Catch with N = 24, M = 5. 4.4 Agents with memory While different kinds of memory and attention have been studied extensively in the supervised learning setting [Graves, 2014, Mnih et al., 2014, Bahdanau et al., 2015], the use of such models for learning long range dependencies in reinforcement learning has received less attention. We compare different memory architectures on a partially observable variant of the game ”Catch” described in [Mnih et al., 2014]. The game is played on an N × N screen of binary pixels and each episode consists of N frames. Each trial begins with a single pixel, representing a ball, appearing somewhere in the first row of the column and a two pixel ”paddle” controlled by the agent in the bottom row. After observing a frame, the agent gets to either keep the paddle stationary or move it right or left by one pixel. The ball descends by a single pixel after each frame. The episode ends when the ball pixel reaches the bottom row and the agent receives a reward of +1 if the paddle touches the ball and a reward of −1 if it doesn’t. Solving the fully observable task is straightforward and requires the agent to move the paddle to the column with the ball. We make the task partiallyobservable by providing the agent blank observations after the Mth frame. Solving the partiallyobservable version of the game requires remembering the position of the paddle and ball after M frames and moving the paddle to the correct position using the stored information. We used the recently proposed asynchronous advantage actor-critic method [Mnih et al., 2016] to train agents with three types of memory on different sizes of the partially observable Catch task. The three agents included a ReLU RNN, an LSTM, and a fast weights RNN. Figure 5 shows learning progress of the different agents on two variants of the game N = 16, M = 3 and N = 24, M = 5. The agent using the fast weights architecture as its policy representation (shown in green) is able to learn faster than the agents using ReLU RNN or LSTM to represent the policy. The improvement obtained by fast weights is also more significant on the larger version of the game which requires more memory. 5 Conclusion This paper contributes to machine learning by showing that the performance of RNNs on a variety of different tasks can be improved by introducing a mechanism that allows each new state of the hidden units to be attracted towards recent hidden states in proportion to their scalar products with the current state. Layer normalization makes this kind of attention work much better. This is a form of attention to the recent past that is somewhat similar to the attention mechanism that has recently been used to dramatically improve the sequence-to-sequence RNNs used in machine translation. The paper has interesting implications for computational neuroscience and cognitive science. The ability of people to recursively apply the very same knowledge and processing apparatus to a whole sentence and to an embedded clause within that sentence or to a complex object and to a major part of that object has long been used to argue that neural networks are not a good model of higher-level cognitive abilities. By using fast weights to implement an associative memory for the recent past, we have shown how the states of neurons could be freed up so that the knowledge in the connections of a neural network can be applied recursively. This overcomes the objection that these models can only do recursion by storing copies of neural activity vectors, which is biologically implausible. 8 References Sepp Hochreiter and J¨urgen Schmidhuber. Long short-term memory. Neural computation, 9(8):1735–1780, 1997. Geoffrey E Hinton and David C Plaut. Using fast weights to deblur old memories. In Proceedings of the ninth annual conference of the Cognitive Science Society, pages 177–186. Erlbaum, 1987. J Schmidhuber. Reducing the ratio between learning complexity and number of time varying variables in fully recurrent nets. In ICANN93, pages 460–463. Springer, 1993. Misha Tsodyks, Klaus Pawelzik, and Henry Markram. Neural networks with dynamic synapses. Neural computation, 10(4):821–835, 1998. LF Abbott and Wade G Regehr. Synaptic computation. Nature, 431(7010):796–803, 2004. Omri Barak and Misha Tsodyks. Persistent activity in neural networks with dynamic synapses. PLoS Comput Biol, 3(2):e35, 2007. Robert S Zucker and Wade G Regehr. Short-term synaptic plasticity. Annual review of physiology, 64(1): 355–405, 2002. Henry Markram, Joachim L¨ubke, Michael Frotscher, and Bert Sakmann. Regulation of synaptic efficacy by coincidence of postsynaptic aps and epsps. Science, 275(5297):213–215, 1997. Guo-qiang Bi and Mu-ming Poo. Synaptic modifications in cultured hippocampal neurons: dependence on spike timing, synaptic strength, and postsynaptic cell type. The Journal of neuroscience, 18(24):10464– 10472, 1998. David J Willshaw, O Peter Buneman, and Hugh Christopher Longuet-Higgins. Non-holographic associative memory. Nature, 1969. Teuvo Kohonen. Correlation matrix memories. Computers, IEEE Transactions on, 100(4):353–359, 1972. James A Anderson and Geoffrey E Hinton. Models of information processing in the brain. Parallel models of associative memory, pages 9–48, 1981. John J Hopfield. Neural networks and physical systems with emergent collective computational abilities. Proceedings of the national academy of sciences, 79(8):2554–2558, 1982. Elizabeth Gardner. The space of interactions in neural network models. Journal of physics A: Mathematical and general, 21(1):257, 1988. Alex Graves, Greg Wayne, and Ivo Danihelka. Neural turing machines. arXiv preprint arXiv:1410.5401, 2014. Edward Grefenstette, Karl Moritz Hermann, Mustafa Suleyman, and Phil Blunsom. Learning to transduce with unbounded memory. In Advances in Neural Information Processing Systems, pages 1819–1827, 2015. Jason Weston, Sumit Chopra, and Antoine Bordes. Memory networks. arXiv preprint arXiv:1410.3916, 2014. D. Bahdanau, K. Cho, and Y. Bengio. Neural machine translation by jointly learning to align and translate. In International Conference on Learning Representations, 2015. J. Ba, R. Kiros, and G. Hinton. Layer normalization. arXiv:1607.06450, 2016. D. Kingma and J. L. Ba. Adam: a method for stochastic optimization. arXiv:1412.6980, 2014. Ivo Danihelka, Greg Wayne, Benigno Uria, Nal Kalchbrenner, and Alex Graves. Associative long short-term memory. arXiv preprint arXiv:1602.03032, 2016. V. Mnih, N. Heess, A. Graves, and K. Kavukcuoglu. Recurrent models of visual attention. In Neural Information Processing Systems, 2014. J. Ba, V. Mnih, and K. Kavukcuoglu. Multiple object recognition with visual attention. In International Conference on Learning Representations, 2015. Kelvin Xu, Jimmy Ba, Ryan Kiros, Aaron Courville, Ruslan Salakhutdinov, Richard Zemel, and Yoshua Bengio. Show, attend and tell: Neural image caption generation with visual attention. In International Conference on Machine Learning, 2015. Ralph Gross, Iain Matthews, Jeffrey Cohn, Takeo Kanade, and Simon Baker. Multi-pie. Image and Vision Computing, 28(5):807–813, 2010. A. Graves. Generating sequences with recurrent neural networks. arXiv:1308.0850, 2014. Volodymyr Mnih, Adria Puigdomenech Badia, Mehdi Mirza, Alex Graves, Timothy P Lillicrap, Tim Harley, David Silver, and Koray Kavukcuoglu. Asynchronous methods for deep reinforcement learning. In International Conference on Machine Learning, 2016. 9
2016
364
6,288
High-Rank Matrix Completion and Clustering under Self-Expressive Models E. Elhamifar∗ College of Computer and Information Science Northeastern University Boston, MA 02115 eelhami@ccs.neu.edu Abstract We propose efficient algorithms for simultaneous clustering and completion of incomplete high-dimensional data that lie in a union of low-dimensional subspaces. We cast the problem as finding a completion of the data matrix so that each point can be reconstructed as a linear or affine combination of a few data points. Since the problem is NP-hard, we propose a lifting framework and reformulate the problem as a group-sparse recovery of each incomplete data point in a dictionary built using incomplete data, subject to rank-one constraints. To solve the problem efficiently, we propose a rank pursuit algorithm and a convex relaxation. The solution of our algorithms recover missing entries and provides a similarity matrix for clustering. Our algorithms can deal with both low-rank and high-rank matrices, does not suffer from initialization, does not need to know dimensions of subspaces and can work with a small number of data points. By extensive experiments on synthetic data and real problems of video motion segmentation and completion of motion capture data, we show that when the data matrix is low-rank, our algorithm performs on par with or better than low-rank matrix completion methods, while for high-rank data matrices, our method significantly outperforms existing algorithms. 1 Introduction High-dimensional data, which are ubiquitous in computer vision, image processing, bioinformatics and social networks, often lie in low-dimensional subspaces corresponding to different categories they belong to [1, 2, 3, 4, 5, 6]. Clustering and finding low-dimensional representations of data are important unsupervised learning problems with numerous applications, including data compression and visualization, image/video/costumer segmentation, collaborative filtering and more. A major challenge in real problems is dealing with missing entries in data, due to sensor failure, ad-hoc data collection, or partial knowledge of relationships in a dataset. For instance, in estimating object motions in videos, the tracking algorithm may loose the track of features in some video frames [7]; in the image inpainting problem, intensity values of some pixels are missing due to sensor failure [8]; or in recommender systems, each user provides ratings for a limited number of products [9]. Prior Work. Existing algorithms that deal with missing entries in high-dimensional data can be divided into two main categories. The first group of algorithms assume that data lie in a single low-dimensional subspace. Probabilistic PCA (PPCA) [10] and Factor Analysis (FA) [11] optimize a non-convex function using Expectation Maximization (EM), estimating low-dimensional model parameters and missing entries of data in an iterative framework. However, their performance depends ∗E. Elhamifar is an Assistant Professor in the College of Computer and Information Science, Northeastern University. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. on initialization and degrades as the dimension of the subspace or the percentage of missing entries increases. Low-rank matrix completion algorithms, such as [12, 13, 14, 15, 16, 17] recover missing entries by minimizing the convex surrogate of the rank, i.e., nuclear norm, of the complete data matrix. When the underlying subspace is incoherent with standard basis vectors and missing entries locations are spread uniformly at random, they are guaranteed to recover missing entries. The second group of algorithms addresses the more general and challenging scenario where data lie in a union of low-dimensional subspaces. The goals in this case are to recover missing entries and cluster data according to subspaces. Since the union of low-dimensional subspaces is often high/full-rank, methods in the first category are not effective. Mixture of Probabilistic PCA (MPPCA) [18, 19], Mixture of Factor Analyzers (MFA) [20] and K-GROUSE [21] address clustering and completion of multi-subspace data, yet suffer from dependence on initialization and perform poorly as the dimension/number of subspaces or the percentage of missing entires increases. On the other hand, [22] requires a polynomial number of data points in the ambient space dimension, which often cannot be met in high-dimensional datasets. Building on the unpublished abstract in [23], a clustering algorithm using expectation completion on the data kernel matrix was proposed in [24]. However, the algorithm only addresses clustering and the resulting non-convex optimization is dealt with using the heuristic approach of shifting eigenvalues of the Hessian to nonnegative values. [25] assumes that the observed matrix corresponds to applying a Lipschitz, monotonic function to a low-rank matrix. While an important generalization to low-rank regime, [25] cannot cover the case of multiple subspaces. Paper Contributions. In this paper, we propose an efficient algorithm for the problem of simultaneous completion and clustering of incomplete data lying in a union of low-dimensional subspaces. Building on the Sparse Subspace Clustering (SSC) algorithm [26], we cast the problem as finding a completion of the data so that each complete point can be efficiently reconstructed using a few complete points from the same subspace. Since the formulation is non-convex and, in general, NP-hard, we propose a lifting scheme, where we cast the problem as finding a group-sparse representation of each incomplete data point in a modified dictionary, subject to a set of rank-one constraints. In our formulation, coefficients in groups correspond to pairwise similarities and missing entries of data. More specifically, our group-sparse recovery formulation finds a few incomplete data points that well reconstruct a given point and, at the same time, completes the selected data points in a globally consistent fashion. Our framework has several advantages over the state of the art: – Unlike algorithms such as [22] that require a polynomial number of points in the ambient-space dimension, our framework needs about as many points as the subspace dimension not the ambient space. In addition, we do not need to know dimensions of subspaces a priori. – While two-stage methods such as [24], which first obtain a similarity graph for clustering and then apply low-rank matrix completion to each cluster, fail when subspaces intersect or clustering fails, our method simultaneously recovers missing entries and builds a similarity matrix for clustering, hence, each goal benefits from the other. Moreover, in scenarios where a hard clustering does not exist, we can still recover missing entries. – While we motivate and present our algorithm in the context of clustering and completion of multisubspace data, our framework can address any task that relies on the self-expressiveness property of the data, e.g., column subset selection in the presence of missing data. – By experiments on synthetic and real data, we show that our algorithm performs on par with or better than low-rank matrix completion methods when the data matrix is low-rank, while it significantly outperforms state-of-the-art clustering and completion algorithms when the data matrix is high-rank. 2 Problem Statement Assume we have L subspaces {Sℓ}L ℓ=1 of dimensions {dℓ}L ℓ=1 in an n-dimensional ambient space, Rn. Let {yj}N j=1 denote a set of N data points lying in the union of subspaces, where we observe only some entries of each yj ≜[y1j y2j . . . ynj]⊤. Assume that we do not know a priori the bases for subspaces nor do we know which data points belong to which subspace. Given the incomplete data points, our goal is to recover missing entries and cluster the data into their underlying subspaces. 2 To set the notation, let Ωj ⊆{1, . . . , n} and Ωc j denote, respectively, indices of observed and missing entries of yj. Let U Ωj ∈Rn×|Ωj| be the submatrix of the standard basis whose columns are indexed by Ωj. We denote by P Ωj ∈Rn×n the projection matrix onto the subspace spanned by U Ωj, i.e., P Ωj ≜U ΩjU ⊤ Ωj. Hence, xj ≜U ⊤ Ωc j yj ∈R|Ωc j| corresponds to the vector of missing entries of yj. We denote by ¯yj an n-dimensional vector whose i-th coordinate is yij for i ∈Ωj and is zero for i ∈Ωc j, i.e., ¯yj ≜P Ωjyj ∈Rn. We can write each yj as the summation of two orthogonal vectors with observed and unobserved entries, i.e., yj = P Ωjyj + P Ωc jyj = ¯yj + U Ωc jU ⊤ Ωc jyj = ¯yj + U Ωc jxj. (1) Finally, we denote by Y ∈Rn×N and ¯Y ∈Rn×N matrices whose columns are complete data points {yj}N j=1 and zero-filled data {¯yj}N j=1, respectively. To address completion and clustering of multi-subspace data, we propose a unified framework to simultaneously recover missing entries and learn a similarity graph for clustering. To do so, we build on the SSC algorithm [26, 4], which we review next. 3 Sparse Subspace Clustering Review The sparse subspace clustering (SSC) algorithm [26, 4] addresses the problem of clustering complete multi-subspace data. It relies on the observation that in a high-dimensional ambient space, while there are many ways that each data point yj can be reconstructed using the entire dataset, a sparse representation selects a few data points from the underlying subspace of yj, since each point in Sℓ can be represented using dℓdata points, in general directions, from Sℓ. This motivates solving2 min {c1j,...,cNj} N X i=1 |cij| s. t. N X i=1 cijyi = 0, cjj = −1, (2) where the constraints express that each yj should be written as a combination of other points. To infer clustering, one builds a similarity graph using sparse coefficients, by connecting nodes i and j of the graph, representing, respectively, yi and yj, with an edge with the weight wij = |cij| + |cji|. Clustering of data is obtained then by applying spectral clustering [27] to the similarity graph. While [4, 26, 28] show that, under appropriate conditions on subspace angles and data distribution, (2) is guaranteed to recover desired representations, the algorithm requires complete data points. 3.1 Naive Extensions of SSC to Deal with Missing Entries In the presence of missing entries, the ℓ1-minimization in (2) becomes non-convex, since coefficients and a subset of data entries are both unknown. A naive approach is to solve (2) using zero-filled data points, {¯yi}N i=1, to perform clustering and then apply standard matrix completion on each cluster. However, the drawback of this approach is that not only it does not take advantage of the known locations of missing entries, but also zero-filled data will no longer lie in original subspaces, and deviate more from subspaces as the percentage of missing entries increases. Hence, a sparse representation does not necessarily find points from the same subspace and spectral clustering fails. An alternative approach to deal with incomplete data is to use standard low-rank matrix completion algorithms to recover missing values and then apply SSC to cluster data into subspaces. While this approach works when the union of subspaces is low-rank, its effectiveness diminishes as the number of subspaces or their dimensions increases and the data matrix becomes high/full-rank. 4 Sparse Subspace Clustering and Completion via Lifting In this section, we propose an algorithm to recover missing entries and build a similarity graph for clustering, given observations {yij; i ∈Ωj}N j=1 for N data points lying in a union of subspaces. 2ℓ1 is the convex surrogate of the cardinality function, PN i=1 I(|cij|), where I(·) is the indicator function. 3 4.1 SSC–Lifting Formulation To address the problem, we start from the SSC observation that, given complete data {yj}N j=1, the solution of min {cij} N X j=1 N X i=1 I(|cij|) s. t. N X i=1 cijyi = 0, cjj = −1, ∀j (3) ideally finds a representation of each yj as a linear combination of a few data points that lie in the same subspace as of yj. I(·) denotes the indicator function, which is zero when its argument is zero and is one otherwise. Notice that, using (1), we can write each yi as yi = ¯yi + U Ωc i xi = ¯yi U Ωc i   1 xi  , (4) where ¯yi is the i-th data point whose missing entries are filled with zeros and xi is the vector containing missing entries of yi. Thus, substituting (4) in the optimization (3), we would like to solve min {cij},{xi} N X j=1 N X i=1 I(|cij|) s. t. N X i=1 ¯yi U Ωc i  cij cijxi  = 0, cjj = −1, ∀j. (5) Notice that matrices ¯yi U Ωc i  ∈Rn×|Ωc i |+1 are given and known while vectors  cij cijx⊤ i ⊤∈ R|Ωc i |+1 are unknown. In fact, the optimization (5) has two sources of non-convexity: the ℓ0-norm in the objective function and the product of unknown variables {cij} and {xi} in the constraint. To pave the way for an efficient algorithm, first we use the fact that the number of nonzero coefficients cij is the same as the number of nonzero blocks  cij cijx⊤ i ⊤, since cij is nonzero if and only if cij cijx⊤ j ⊤is nonzero. Thus, we can write (5) as the equivalent group-sparse optimization min {cij},{xi} N X j=1 N X i=1 I  cij cijxi  p ! s. t. N X i=1 ¯yi U Ωc i  cij cijxi  = 0, cjj = −1, ∀j, (6) where ∥· ∥p denotes the ℓp-norm for p > 0. Next, to deal with the non-convexity of the product of cij and xi, we use the fact that for each i ∈{1, . . . , N}, the matrix Ai ≜  ci1 · · · ciN ci1xi · · · ciNxi  =  1 xi  [ci1 · · · ciN] , (7) is of rank one, since it can be written as the outer product of two vectors. This motivates to use a lifting scheme where we define new optimization variables αij ≜cijxi ∈R|Ωc i |, (8) and consider the group-sparse optimization program min {cij},{αij} cjj=−1,∀j N X j=1 N X i=1 I  cij αij  p ! s. t. N X i=1 ¯yi U Ωc i  cij αij  = 0, rk  ci1 · · · ciN αi1 · · · αiN  = 1, ∀i, j, (9) where we have replaced cijxi with αij and have introduced rank-one constraints. In fact, we show that one can recover the solution of (5) using (9) and vice versa. Proposition 1 Given a solution {cij} and {αij} of (9), by computing xi’s via the factorization in (7), {cij} and {xi} is a solution of (5). Also, given a solution {cij} and {xi} of (5), {cij} and {αij ≜cijxi} would be a solution of (9). Notice that, we have transferred the non-convexity of the product cijxi in (5) into a set of non-convex rank-one constraints in (9). However, as we will see next, (9) admits an efficient convex relaxation. 4 4.2 Relaxations and Extensions The optimization program in (9) is, in general, NP-hard, due to the mixed ℓ0/ℓp-norm in the objective function. It is non-convex due to both mixed ℓ0/ℓp-norm and rank-one constraints. To solve (9), we first take the convex surrogate of the objective function, which corresponds to an ℓ1/ℓp-norm [29, 30], where we drop the indicator function and, for p ∈{2, ∞}, solve min {cij,αij} {cjj=−1} λ N X j=1 N X i=1  cij αij  p + N X j=1 ρ N X i=1 ¯yi U Ωc i  cij αij ! s. t. rk  ci1 · · · ciN αi1 · · · αiN  =1, ∀i. (10) The nonnegative parameter λ is a regularization parameter and the function ρ(·) ∈{ρe(·), ρa(·)} enforces whether the reconstruction of each point should be exact or approximate, where ρe(u) ≜ +∞ if u ̸= 0 0 if u = 0 , ρa(u) ≜1 2∥u∥2 2. (11) More specifically, when dealing with missing entries from noise-free data, which perfectly lie in multiple subspaces, we enforce exact reconstruction by selecting ρ(·) = ρe(·). On the other hand, when dealing with real data where observed entries are corrupted by noise, exact reconstruction is infeasible or comes at the price of losing the sparsity of the solution, which is undesired. Thus, to deal with noisy incomplete data, we consider approximate reconstruction by selecting ρ(·) = ρa(·). Notice that the objective function of (10) is convex for p ≥1, while the rank-one constraints are non-convex. We can obtain a local solution, by solving (10) with an Alternating Direction Method of Multipliers (ADMM) framework using projection onto the set of rank-one matrices. To obtain a convex algorithm, we use a nuclear-norm3 relaxation [12, 14, 15] for the rank-one constraints, where we replace rank(Ai) = 1 with ∥Ai∥∗≤τ, for τ > 0. In addition, to reduce the number of constraints and the complexity of the problem, we choose to bring the nuclear norm constraints into the objective function using a Lagrange multiple γ > 0. Hence, we propose to solve min {cij,αij} {cjj=−1} λ N X j=1 N X i=1  cij αij  p + γ N X i=1  ci1 · · · ciN αi1 · · · αiN  ∗ + N X j=1 ρ N X i=1 ¯yi U Ωc i  cij αij ! , (12) which is convex for p ≥1 and can be solved efficiently using convex solvers. Finally, using the solution of (10), we recover missing entries by finding the best rank-one factorization of each block Ai as in (7), which results in4 ˆxi = PN j=1 cijαij PN j=1 c2 ij . (13) In addition, we use the coefficients {cij} to build a similarity graph with weights wij = |cij| + |cji| and obtain clustering of data using graph partitioning. It is important to note that we do not need to know dimensions of subspaces a priori, since (10) automatically selects the appropriate number of data points from each subspace. Also, it is worth metioning that we can use PN j=1 PN i=1 |cij| instead of the group-sparsity term in (10) and (12). Remark 1 Notice that when all entries of all data points are observed, i.e., Ωc i = ∅, the rankone constraints in (9) are trivially satisfied. Hence, (10) and (12) with γ = 0 reduce to the ℓ1minimization of SSC. In other words, our framework is a generalization of SSC, which simultaneously finds similarities and missing entries for incomplete data. Table 1 shows the stable rank5 [31] of blocks Ai of the solution for the synthetic dataset explained in the experiments in Section 5. As the results show, the penalized optimization successfully recovers close to rank-one solutions for practical values of γ and λ. 3The nuclear norm of A, denoted by ∥A∥∗, is the sum of its singular values, i.e., ∥A∥∗= P i σi(A). 4The denominator is always nonzero since cii = −1 for all i. 5Stable rank of B is defined as P i σ2 i / maxi σ2 i , where σi’s are singular values of B. 5 Table 1: Average stable-rank of matrices Ai for high-rank data, n = 100, L = 12, d = 10, N = 600, with ρ = 0.4, explained in section 5. Notice that rank of Ai is close to one, and as γ increases, it gets closer to one. γ = 0.001 γ = 0.01 γ = 0.1 λ = 0.01 1.015 ± 0.005 1.009 ± 0.005 1.004 ± 0.002 λ = 0.1 1.021 ± 0.007 1.011 ± 0.006 1.006 ± 0.003 · · · · · · Figure 1: Subset selection and completion via lifting on the Olivetti face dataset. Top: faces from the dataset with missing entries. Bottom: solution of our method on the dataset. We successfully recover missing entries and, at the same time, select a subset of faces as representatives. Notice that the mixed ℓ1/ℓp-norm in the objective function of (10) and (12) promotes selecting a few nonzero coefficient blocks cij α⊤ ij  . In other words, we find a representation of each incomplete data point using a few other incomplete data points, while, at the same time, find missing entries of the selected data points. On the other hand, rank constraints on the sub-blocks of the solution ensure that recovered missing entries are globally consistent, i.e., if a data point takes part in the reconstruction of multiple points, the associated missing entries in each representation are the same. Remark 2 Our lifting framework can also deal with missing entries in other tasks that rely the on the self-expressiveness property, i.e., yj = PN i=1 cijyi. Figure 1 shows results of the extension of our method to column subset selection [32, 33] with missing entries. In fact, simultaneously selecting a few data points that well reconstruct the entire dataset and recovering missing entires can be cast as a modification of (10) or (12), where we modify the first term in the objective function in order to select a few nonzero blocks, Ai. 5 Experiments We study the performance of our algorithm for completion and clustering of synthetic and real data. We implement (10) and (12) with PN j=1 PN i=1 |cij| instead of the group-sparsity term using the ADMM framework [34, 35]. Unless stated otherwise, we set λ = 0.01 and γ = 0.1. However, the results are stable for λ ∈[0.005, 0.05] and γ ∈[0.01, 0.5]. We compare our algorithm, SSC-Lifting, with MFA [20], K-Subspaces with Missing Entries (KSub-M) [21], Low-Rank Matrix Completion [13] followed by SSC (LRMC+SSC) or LSA [36] (LRMC+LSA), and SSC using Column-wise Expectation Completion (SSC-CEC) [24]. It is worth mentioning that in all experiments, we found that the performance of SSC-CEC is slightly better than SSC using zero-filled data. In addition, as reported in [21], KSub-M generally outperforms the high-rank matrix completion algorithm in [22], since the latter requires a very large number of samples, which becomes impractical in high-dimensional problems. We compute Clustering Error = # Misclassified points # All points , Completion Error = ∥ˆY −Y ∥F ∥Y ∥F , (14) where Y and ˆY denote, respectively, the true and recovered matrix and ∥· ∥F is the Frobenius norm. 5.1 Synthetic Experiments In this section, we evaluate the performance of different algorithms on synthetic data. We generate L random d-dimensional subspaces in Rn and draw Ng data points, at random, from each subspace. We consider two scenarios: 1) a low-rank data matrix whose columns lie in a union of low-dimensional subspaces; 2) a high rank data matrix whose columns lie in a union of low-dimensional subspaces. Unless stated otherwise, for low-rank matrices, we set L = 3 and d = 5, hence, Ld = 15 < n = 100, while for high-rank matrices, we set L = 12 and d = 10, hence, Ld = 120 > n = 100. Completion Performance. We generate missing entries by selecting ρ fraction of entries of the data matrix uniformly at random and dropping their values. The left and middle left plots in Figure 2 6 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 Missing entries fraction 0 0.2 0.4 0.6 0.8 1 Completion error MFA KSub-M LRMC SSC-lifting 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 Missing entries fraction 0 0.2 0.4 0.6 0.8 1 Completion error MFA KSub-M LRMC SSC-lifting 20 30 40 50 60 70 80 90 100 110 120 n 0 0.2 0.4 0.6 0.8 1 Completion error MFA KSub-M LRMC SSC-lifting 20 30 40 50 60 70 80 90 100 110 120 Ng 0 0.2 0.4 0.6 0.8 Completion error LRMC SSC-lifting Figure 2: Completion errors of different algorithms as a function of ρ. Left: low-rank matrices. Middle left: high-rank matrices. Middle right: effect of the ambient space dimension, n. Right: effect of the number of data points in each subspace, Ng, for low-rank (solid lines) and high-rank (dashed lines) matrices. show completion errors of different algorithms for low-rank and high-rank matrices, respectively, as a function of the fraction of missing entries, ρ. Notice that in both cases, MFA and KSub-M have high errors, which rapidly increase as ρ increases, due to dependence on initialization and getting trapped in local optima. In both cases, SSC-lifting outperforms all methods across all values of ρ. Specifically, in the low-rank regime, while LRMC and SSC-lifting have almost zero error for ρ ≤0.35, the performance of LRMC quickly degrades for larger ρ’s, while SSC-lifting performs well for ρ ≤0.6. On the other hand, the performance of LRMC significantly degrades for the high-rank case, with a large gap to SSC-lifting, which performs well for ρ < 0.45. The middle right plot in Figure 2 demonstrates the effect of the ambient space dimension, n, for L = 7, d = 5, Ng = 100 and ρ = 0.3. Notice that errors of MFA and KSub-M increases as n increases, due to larger number of local optima. LRMC has a large error for small values of n, where n is smaller than or close to Ld, i.e., high-rank regime. As n increases and matrices becomes low-rank, the error decreases. Notice that SSC-lifting for n ≥40 has a low error, demonstrating its effectiveness in handling both low-rank and high-rank matrices. Finally, the right plot in Figure 2 demonstrates the effect of the number of points, Ng, for low and high rank matrices with ρ = 0.5. We do not show results of MFA and KSub-M, since they have large errors for all Ng. Notice that for all values of Ng, SSC-lifting obtains smaller errors than LRMC, verifying the effectiveness of sparsity principle to complete the data. Clustering Performance. Next, we compare the clustering performance. To better study the effect of missing entries, we generate missing entries by selecting a fraction δ of data points and for each selected data point, we drop the values for a fraction ρ of its entries, both uniformly at random. We change δ in [0.1, 1.0] and ρ in [0.1, 0.9] and for each pair (ρ, δ), record the average clustering and completion errors over 20 trials, each with different random subspaces and data points. Figure 3 shows the clustering errors of different algorithms for low-rank (top row) and high-rank (bottom row) data matrices (completion errors provided in supplementary materials). In both cases, MFA performs poorly, due to local optima. While LRMC+SSC, SSC-CEC and SSC-Lifting perform similarly for low-rank matrices, SSC-Lifting performs best among all methods for high-rank matrices. In particular, when the percentage of missing entries, ρ, is more than 70%, SSC-Lifting performs significantly better than other algorithms. It is important to notice that for small values of (ρ, δ), since completion errors via SSC-Lifting and LRMC are sufficiently small, the recovered matrices will be noisy versions of the original matrices. As a result, Lasso-type optimizations of SSC and SSC-Lifting will succeed in recovering subspace-sparse representations, leading to zero clustering errors. In the high-rank case, SSC-EC has a higher clustering error than LRMC and SSC-Lifting, which is due to the fact that it relies on a heuristic of shifting eigenvalues of the kernel matrix to non-negative values. 5.2 Real Experiments on Motion Segmentation We consider the problem of motion segmentation [37, 38] with missing entries on the Hopkins 155 dataset, with 155 sequences of 2 and 3 motions. Since the dataset consists of complete feature trajectories (incomplete trajectories were removed manually to form the dataset), we select ρ fraction of feature points across all frames uniformly at random and remove their x −y coordinate values. Left plot in Figure 4 shows clustering error bars of different algorithms on the dataset as a function of ρ. Notice that in all cases, MFA and SSC-CEC have large errors, due to, respectively, dependence on initialization and the heuristic convex reformulation. On the other hand, LRMC+SSC and SSCLifting perform well, achieving less than 5% error for all values of ρ. This comes from the fact that sequences have at most L = 3 motions and dimension of each motion subspace is at most d = 4, hence, Ld ≤12 ≪2F, where F is the number of video frames. Since the data matrix is low-rank and LRMC succeeds, SSC and our method achieve roughly the same errors for different values of ρ. 7 Corrupted data fraction Missing entries fraction 0.1 0.3 0.5 0.7 0.9 1 0.8 0.6 0.4 0.2 Corrupted data fraction Missing entries fraction 0.1 0.3 0.5 0.7 0.9 1 0.8 0.6 0.4 0.2 Corrupted data fraction Missing entries fraction 0.1 0.3 0.5 0.7 0.9 1 0.8 0.6 0.4 0.2 Corrupted data fraction Missing entries fraction 0.1 0.3 0.5 0.7 0.9 1 0.8 0.6 0.4 0.2 Corrupted data fraction Missing entries fraction 0.1 0.3 0.5 0.7 0.9 1 0.8 0.6 0.4 0.2 0 0.2 0.4 0.6 0.8 Corrupted data fraction Missing entries fraction 0.1 0.3 0.5 0.7 0.9 1 0.8 0.6 0.4 0.2 Corrupted data fraction Missing entries fraction 0.1 0.3 0.5 0.7 0.9 1 0.8 0.6 0.4 0.2 Corrupted data fraction Missing entries fraction 0.1 0.3 0.5 0.7 0.9 1 0.8 0.6 0.4 0.2 Corrupted data fraction Missing entries fraction 0.1 0.3 0.5 0.7 0.9 1 0.8 0.6 0.4 0.2 Corrupted data fraction Missing entries fraction 0.1 0.3 0.5 0.7 0.9 1 0.8 0.6 0.4 0.2 0 0.2 0.4 0.6 0.8 Figure 3: Clustering errors for low-rank matrices (top row) with L = 3, d = 5, n = 100 and high-rank matrices (bottom row) with L = 12, d = 10, n = 100 as a function of (ρ, δ), where δ is the fraction of data with missing entires (vertical axis) and ρ is the fraction of missing entries in each affected point (horizontal axis). Left to Right: MFA, SSC-CEC, LRMC+SSC and SSC-Lifting. 0.1 0.2 0.3 0.4 0.5 0.6 0.7 Missing entries fraction 0 0.1 0.2 0.3 0.4 Clustering error SSC-CEC MFA LRMC+LSA LRMC+SSC SSC-lifting 5 10 15 20 0 5 10 15 Index Singular values squat run stand arm−up jump drink punch 0.1 0.2 0.3 0.4 0.5 0.6 0.7 Missing entries fraction 0 0.2 0.4 0.6 0.8 Completion error LRMC MFA SSC-lifting Figure 4: Left: Clustering error bars of MFA, LRMC+LSA, LRMC+SSC, SSC-CEC and SSC-Lifting as a function of the fraction of missing entries, ρ. Middle: Singular values of CMU Mocap data reveal that each activity lie in a low-dimensional subspace. Right: Average completion errors of MFA, LRMC and SSC-Lifting on the CMU Mocap Dataset as a function of ρ. Solid lines correspond to δ = 0.5, i.e., 50% of data have missing entries, while dashed lines correspond to δ = 1, i.e., all data have missing entries. 5.3 Real Experiments on Motion Capture Data We consider completion of time-series trajectories from motion capture sensors, where a trajectory consists of different human activities, such as running, jumping, squatting, etc. We use the CMU Mocap dataset, where each data point corresponds to measurements from n sensors at a particular time instant. Since transition from one activity to another happens gradually, we do not consider clustering. However, as the middle plot in Figure 4 shows, excluding the transition time periods, data from each activity lie in a low-rank subspace. Since typically there are L ≈7 activities, each having a dimension of d ≈8, and there are n = 42 sensors, the data matrix is full-rank, as Ld ≈56 > n = 42. To evaluate performance of different algorithms, we select δ ∈{0.5, 1.0} fraction of data points and remove entries of ρ ∈{0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7} fraction of each selected point, both uniformly at random. Right plot in Figure 4 shows completion errors of different algorithms as a function of ρ for δ ∈{0.5, 1.0}. Notice that, unlike the previous experiment, since the data matrix is high-rank, LRMC has a large completion error, similar to synthetic experiments. On the other hand, SSC-Lifting error is less than 0.1 for ρ = 0.1 and less than 0.55 for ρ = 0.7. In all cases, for δ = 1, the performance degrades with respect to δ = 0.5. Lastly, it is important to notice that MFA performs slightly better than LRMC, demonstrating the importance of the union of low-dimensional subspaces model for the problem. However, getting trapped in local optima does not allow MFA to take full advantage of such a model, as opposed to SSC-Lifting. 6 Conclusions We proposed efficient algorithms, based on lifting, for simultaneous clustering and completion of incomplete multi-subspace data. By extensive experiments on synthetic and real data, we showed that for low-rank data matrices, our algorithm performs on par with or better than low-rank matrix completion methods, while for high-rank data matrices, it significantly outperforms existing algorithms. Theoretical guarantees of the proposed method and scaling the algorithm to large data is the subject of our ongoing research. 8 References [1] R. Basri and D. Jacobs, “Lambertian reflection and linear subspaces,” IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 25, 2003. [2] T. Hastie and P. Simard, “Metrics and models for handwritten character recognition,” Statistical Science, 1998. [3] C. Tomasi and T. Kanade, “Shape and motion from image streams under orthography,” International Journal of Computer Vision, vol. 9, 1992. [4] E. Elhamifar and R. Vidal, “Sparse subspace clustering: Algorithm, theory, and applications,” IEEE Transactions on Pattern Analysis and Machine Intelligence, 2013. [5] G. Chen and G. Lerman, “Spectral curvature clustering (SCC),” International Journal of Computer Vision, vol. 81, 2009. [6] A. Zhang, N. Fawaz, S. Ioannidis, and A. Montanari, “Guess who rated this movie: Identifying users through subspace clustering,” Uncertainty in Artificial Intelligence (UAI), 2012. [7] R. Vidal, R. Tron, and R. Hartley, “Multiframe motion segmentation with missing data using PowerFactorization and GPCA,” International Journal of Computer Vision, vol. 79, 2008. [8] J. Mairal, F. Bach, J. Ponce, and G. Sapiro, “Online dictionary learning for sparse coding,” in International Conference on Machine Learning, 2009. [9] D. Park, J. Neeman, J. Zhang, S. Sanghavi, and I. S. Dhillon, “Preference completion: Large-scale collaborative ranking from pairwise comparisons,” International Conference on Machine Learning (ICML), 2015. [10] M. Tipping and C. Bishop, “Probabilistic principal component analysis,” Journal of the Royal Statistical Society, vol. 61, 1999. [11] M. Knott and D. Bartholomew, Latent variable models and factor analysis. London: Edward Arnold, 1999. [12] E. J. Candès and B. Recht, “Exact matrix completion via convex optimization,” Foundations of Computational Mathematics, vol. 9, 2008. [13] E. J. Candès and Y. Plan, “Matrix completion with noise,” Proceedings of the IEEE, 2009. [14] R. Keshavan, A. Montanari, and S. Oh, “Matrix completion from noisy entries,” IEEE Transactions on Information Theory, 2010. [15] Y. Chen, H. Xu, C. Caramanis, and S. Sanghavi, “Robust matrix completion with corrupted columns,” in International Conference on Machine Learning (ICML), 2011. [16] S. Bhojanapalli and P. Jain, “Universal matrix completion,” International Conference on Machine Learning (ICML), 2013. [17] K. Y. Chiang, C. J. Hsieh, and I. S. Dhillon, “Matrix completion with noisy side information,” Neural Information Processing Systems (NIPS), 2015. [18] M. Tipping and C. Bishop, “Mixtures of probabilistic principal component analyzers,” Neural Computation, vol. 11, 1999. [19] A. Gruber and Y. Weiss, “Multibody factorization with uncertainty and missing data using the em algorithm,” IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2004. [20] Z. Ghahramani and G. E. Hinton, “The em algorithm for mixtures of factor analyzers,” Technical Report CRG-TR-96-1, Dept. Computer Science, Univ. of Toronto, 1996. [21] L. Balzano, A. Szlam, B. Recht, and R. Nowak, “K-subspaces with missing data,” IEEE Statistical Signal Processing Workshop, 2012. [22] B. Eriksson, L. Balzano, and R. Nowak, “High rank matrix completion,” International Conference on Artificial Intelligence and Statistics, 2012. [23] E. J. Candes, L. Mackey, and M. Soltanolkotabi, “From robust subspace clustering to full-rank matrix completion,” Unpublished abstract, 2014. [24] C. Yang, D. Robinson, and R. Vidal, “Sparse subspace clustering with missing entries,” International Conference on Machine Learning (ICML), 2015. [25] R. Ganti, L. Balzano, and R. Willett, “Matrix completion under monotonic single index models,” Neural Information Processing Systems (NIPS), 2015. [26] E. Elhamifar and R. Vidal, “Sparse subspace clustering,” in IEEE Conference on Computer Vision and Pattern Recognition, 2009. [27] A. Ng, Y. Weiss, and M. Jordan, “On spectral clustering: analysis and an algorithm,” in Neural Information Processing Systems, 2001. [28] M. Soltanolkotabi, E. Elhamifar, and E. J. Candes, “Robust subspace clustering,” Annals of Statistics, 2014. [29] B. Zhao, G. Rocha, and B. Yu, “The composite absolute penalties family for grouped and hierarchical selection,” The Annals of Statistics, vol. 37, 2009. [30] R. Jenatton, J. Y. Audibert, and F. Bach, “Structured variable selection with sparsity-inducing norms,” Journal of Machine Learning Research, vol. 12, 2011. [31] J. Tropp, “Column subset selection, matrix factorization, and eigenvalue optimization,” in ACM-SIAM Symp. Discrete Algorithms (SODA), 2009. [32] E. Elhamifar, G. Sapiro, and S. S. Sastry, “Dissimilarity-based sparse subset selection,” IEEE Transactions on Pattern Analysis and Machine Intelligence, 2016. [33] E. Elhamifar, G. Sapiro, and R. Vidal, “See all by looking at a few: Sparse modeling for finding representative objects,” in IEEE Conference on Computer Vision and Pattern Recognition, 2012. [34] S. Boyd, N. Parikh, E. Chu, B. Peleato, and J. Eckstein, “Distributed optimization and statistical learning via the alternating direction method of multipliers,” Foundations and Trends in Machine Learning, vol. 3, 2010. [35] D. Gabay and B. Mercier, “A dual algorithm for the solution of nonlinear variational problems via finite-element approximations,” Comp. Math. Appl., vol. 2, 1976. [36] J. Yan and M. Pollefeys, “A general framework for motion segmentation: Independent, articulated, rigid, non-rigid, degenerate and non-degenerate,” in European Conf. on Computer Vision, 2006. [37] J. Costeira and T. Kanade, “A multibody factorization method for independently moving objects.” Int. Journal of Computer Vision, vol. 29, 1998. [38] K. Kanatani, “Motion segmentation by subspace separation and model selection,” in IEEE Int. Conf. on Computer Vision, vol. 2, 2001. 9
2016
365
6,289
Adaptive Newton Method for Empirical Risk Minimization to Statistical Accuracy Aryan Mokhtari? University of Pennsylvania aryanm@seas.upenn.edu Hadi Daneshmand? ETH Zurich, Switzerland hadi.daneshmand@inf.ethz.ch Aurelien Lucchi ETH Zurich, Switzerland aurelien.lucchi@inf.ethz.ch Thomas Hofmann ETH Zurich, Switzerland thomas.hofmann@inf.ethz.ch Alejandro Ribeiro University of Pennsylvania aribeiro@seas.upenn.edu Abstract We consider empirical risk minimization for large-scale datasets. We introduce Ada Newton as an adaptive algorithm that uses Newton’s method with adaptive sample sizes. The main idea of Ada Newton is to increase the size of the training set by a factor larger than one in a way that the minimization variable for the current training set is in the local neighborhood of the optimal argument of the next training set. This allows to exploit the quadratic convergence property of Newton’s method and reach the statistical accuracy of each training set with only one iteration of Newton’s method. We show theoretically that we can iteratively increase the sample size while applying single Newton iterations without line search and staying within the statistical accuracy of the regularized empirical risk. In particular, we can double the size of the training set in each iteration when the number of samples is sufficiently large. Numerical experiments on various datasets confirm the possibility of increasing the sample size by factor 2 at each iteration which implies that Ada Newton achieves the statistical accuracy of the full training set with about two passes over the dataset.1 1 Introduction A hallmark of empirical risk minimization (ERM) on large datasets is that evaluating descent directions requires a complete pass over the dataset. Since this is undesirable due to the large number of training samples, stochastic optimization algorithms with descent directions estimated from a subset of samples are the method of choice. First order stochastic optimization has a long history [19, 17] but the last decade has seen fundamental progress in developing alternatives with faster convergence. A partial list of this consequential literature includes Nesterov acceleration [16, 2], stochastic averaging gradient [20, 6], variance reduction [10, 26], and dual coordinate methods [23, 24]. When it comes to stochastic second order methods the first challenge is that while evaluation of Hessians is as costly as evaluation of gradients, the stochastic estimation of Hessians has proven more challenging. This difficulty is addressed by incremental computations in [9] and subsampling in [7] or circumvented altogether in stochastic quasi-Newton methods [21, 12, 13, 11, 14]. Despite this incipient progress it is nonetheless fair to say that the striking success in developing stochastic first order methods is not matched by equal success in the development of stochastic second order methods. This is because even if the problem of estimating a Hessian is solved there are still four challenges left in the implementation of Newton-like methods in ERM: 1?The first two authors have contributed equally in this work. (i) Global convergence of Newton’s method requires implementation of a line search subroutine and line searches in ERM require a complete pass over the dataset. (ii) The quadratic convergence advantage of Newton’s method manifests close to the optimal solution but there is no point in solving ERM problems beyond their statistical accuracy. (iii) Newton’s method works for strongly convex functions but loss functions are not strongly convex for many ERM problems of practical importance. (iv) Newton’s method requires inversion of Hessians which is costly in large dimensional ERM. Because stochastic Newton-like methods can’t use line searches [cf. (i)], must work on problems that may be not strongly convex [cf. (iii)], and never operate very close to the optimal solution [cf (ii)], they never experience quadratic convergence. They do improve convergence constants and, if efforts are taken to mitigate the cost of inverting Hessians [cf. (iv)] as in [21, 12, 7, 18] they result in faster convergence. But since they still converge at linear rates they do not enjoy the foremost benefits of Newton’s method. In this paper we attempt to circumvent (i)-(iv) with the Ada Newton algorithm that combines the use of Newton iterations with adaptive sample sizes [5]. Say the total number of available samples is N, consider subsets of n N samples, and suppose the statistical accuracy of the ERM associated with n samples is Vn (Section 2). In Ada Newton we add a quadratic regularization term of order Vn to the empirical risk – so that the regularized risk also has statistical accuracy Vn – and assume that for a certain initial sample size m0, the problem has been solved to its statistical accuracy Vm0. The sample size is then increased by a factor ↵> 1 to n = ↵m0. We proceed to perform a single Newton iteration with unit stepsize and prove that the result of this update solves this extended ERM problem to its statistical accuracy (Section 3). This permits a second increase of the sample size by a factor ↵and a second Newton iteration that is likewise guaranteed to solve the problem to its statistical accuracy. Overall, this permits minimizing the empirical risk in ↵/(↵−1) passes over the dataset and inverting log↵N Hessians. Our theoretical results provide a characterization of the values of ↵that are admissible with respect to different problem parameters (Theorem 1). In particular, we show that asymptotically on the number of samples n and with proper parameter selection we can set ↵= 2 (Proposition 2). In such case we can optimize to within statistical accuracy in about 2 passes over the dataset and after inversion of about 3.32 log10 N Hessians. Our numerical experiments verify that ↵= 2 is a valid factor for increasing the size of the training set at each iteration while performing a single Newton iteration for each value of the sample size. 2 Empirical risk minimization We aim to solve ERM problems to their statistical accuracy. To state this problem formally consider an argument w 2 Rp, a random variable Z with realizations z and a convex loss function f(w; z). We want to find an argument w⇤that minimizes the statistical average loss L(w) := EZ[f(w, Z)], w⇤:= argmin w L(w) = argmin w EZ[f(w, Z)]. (1) The loss in (1) can’t be evaluated because the distribution of Z is unknown. We have, however, access to a training set T = {z1, . . . , zN} containing N independent samples z1, . . . , zN that we can use to estimate L(w). We therefore consider a subset Sn ✓T and settle for minimization of the empirical risk Ln(w) := (1/n) Pn k=1 f(w, zk), w† n := argmin w Ln(w) = argmin w 1 n n X k=1 f(w, zk), (2) where, without loss of generality, we have assumed Sn = {z1, . . . , zn} contains the first n elements of T . The difference between the empirical risk in (2) and the statistical loss in (1) is a fundamental quantities in statistical learning. We assume here that there exists a constant Vn, which depends on the number of samples n, that upper bounds their difference for all w with high probability (w.h.p), sup w |L(w) −Ln(w)| Vn, w.h.p. (3) That the statement in (3) holds with w.h.p means that there exists a constant δ such that the inequality holds with probability at least 1 −δ. The constant Vn depends on δ but we keep that dependency 2 implicit to simplify notation. For subsequent discussions, observe that bounds Vn of order Vn = O(1/pn) date back to the seminal work of Vapnik – see e.g., [25, Section 3.4]. Bounds of order Vn = O(1/n) have been derived more recently under stronger regularity conditions that are not uncommon in practice, [1, 8, 3]. An important consequence of (1) is that there is no point in solving (2) to an accuracy higher than Vn. Indeed, if we find a variable w for which Ln(wn)−Ln(w†) Vn finding a better approximation of w† is moot because (3) implies that this is not necessarily a better approximation of the minimizer w⇤of the statistical loss. We say the variable wn solves the ERM problem in (2) to within its statistical accuracy. In particular, this implies that adding a regularization of order Vn to (2) yields a problem that is essentially equivalent. We can then consider a quadratic regularizer of the form cVn/2kwk2 to define the regularized empirical risk Rn(w) := Ln(w) + (cVn/2)kwk2 and the corresponding optimal argument w⇤ n := argmin w Rn(w) = argmin w Ln(w) + cVn 2 kwk2. (4) Since the regularization in (4) is of order Vn and (3) holds, the difference between Rn(w⇤ n) and L(w⇤) is also of order Vn – this may be not as immediate as it seems; see [22]. Thus, we can say that a variable wn satisfying Rn(wn) −Rn(w⇤ n) Vn solves the ERM problem to within its statistical accuracy. We accomplish this goal in this paper with the Ada Newton algorithm which we introduce in the following section. 3 Ada Newton To solve (4) suppose the problem has been solved to within its statistical accuracy for a set Sm ⇢ Sn with m = n/↵samples where ↵> 1. Therefore, we have found a variable wm for which Rm(wm) −Rm(w⇤ m) Vm. Our goal is to update wm using the Newton step in a way that the updated variable wn estimates w⇤ n with accuracy Vn. To do so compute the gradient of the risk Rn evaluated at wm rRn(wm) = 1 n n X k=1 rf(wm, zk) + cVnwm, (5) as well as the Hessian Hn of Rn evaluated at wm Hn := r2Rn(wm) = 1 n n X k=1 r2f(wm, zk) + cVnI, (6) and update wm with the Newton step of the regularized risk Rn to compute wn = wm −H−1 n rRn(wm). (7) Note that the stepsize of the Newton update in (7) is 1, which avoids line search algorithms requiring extra computation. The main contribution of this paper is to derive a condition that guarantees that wn solves Rn to within its statistical accuracy Vn. To do so, we first assume the following conditions are satisfied. Assumption 1. The loss functions f(w, z) are convex with respect to w for all values of z. Moreover, their gradients rf(w, z) are Lipschitz continuous with constant M krf(w, z) −rf(w0, z)k Mkw −w0k, for all z. (8) Assumption 2. The loss functions f(w, z) are self-concordant with respect to w for all z. Assumption 3. The difference between the gradients of the empirical loss Ln and the statistical average loss L is bounded by V 1/2 n for all w with high probability, sup w krL(w) −rLn(w)k V 1/2 n , w.h.p. (9) The conditions in Assumption 1 imply that the average loss L(w) and the empirical loss Ln(w) are convex and their gradients are Lipschitz continuous with constant M. Thus, the empirical risk 3 Algorithm 1 Ada Newton 1: Parameters: Sample size increase constants ↵0 > 1 and 0 < β < 1. 2: Input: Initial sample size n = m0 and argument wn = wm0 with krRn(wn)k < ( p 2c)Vn 3: while n N do {main loop} 4: Update argument and index: wm = wn and m = n. Reset factor ↵= ↵0 . 5: repeat {sample size backtracking loop} 6: Increase sample size: n = min{↵m, N}. 7: Compute gradient [cf. (5)]: rRn(wm) = (1/n) Pn k=1 rf(wm, zk) + cVnwm 8: Compute Hessian [cf. (6)]: Hn = (1/n) Pn k=1 r2f(wm, zk) + cVnI 9: Newton Update [cf. (7)]: wn = wm −H−1 n rRn(wm) 10: Compute gradient [cf. (5)]: rRn(wn) = (1/n) Pn k=1 rf(wn, zk) + cVnwn 11: Backtrack sample size increase ↵= β↵. 12: until krRn(wn)k < ( p 2c)Vn 13: end while Rn(w) is strongly convex with constant cVn and its gradients rRn(w) are Lipschitz continuous with parameter M + cVn. Likewise, the condition in Assumption 2 implies that the average loss L(w), the empirical loss Ln(w), and the empirical risk Rn(w) are also self-concordant. The condition in Assumption 3 says that the gradients of the empirical risk converge to their statistical average at a rate of order V 1/2 n . If the constant Vn in condition (3) is of order not faster than O(1/n) the condition in Assumption 3 holds if the gradients converge to their statistical average at a rate of order V 1/2 n = O(1/pn). This is a conservative rate for the law of large numbers. In the following theorem, given Assumptions 1-3, we state a condition that guarantees the variable wn evaluated as in (7) solves Rn to within its statistical accuracy Vn. Theorem 1. Consider the variable wm as a Vm-optimal solution of the risk Rm, i.e., a solution such that Rm(wm) −Rm(w⇤ m) Vm. Let n = ↵m > m, consider the risk Rn associated with sample set Sn ⊃Sm, and suppose assumptions 1 - 3 hold. If the sample size n is chosen such that ✓2(M + cVm)Vm cVn ◆1/2 + 2(n −m) nc1/2 + % (2 + p 2)c1/2 + ckw⇤k & (Vm −Vn) (cVn)1/2 1 4 (10) and 144 ✓ Vm + 2(n −m) n (Vn−m + Vm) + 2 (Vm −Vn) + c(Vm −Vn) 2 kw⇤k2 ◆2 Vn (11) are satisfied, then the variable wn, which is the outcome of applying one Newton step on the variable wm as in (7), has sub-optimality error Vn with high probability, i.e., Rn(wn) −Rn(w⇤ n) Vn, w.h.p. (12) Proof. See Section 4. Theorem 1 states conditions under which we can iteratively increase the sample size while applying single Newton iterations without line search and staying within the statistical accuracy of the regularized empirical risk. The constants in (10) and (11) are not easy to parse but we can understand them qualitatively if we focus on large m. This results in a simpler condition that we state next. Proposition 2. Consider a learning problem in which the statistical accuracy satisfies Vm ↵Vn for n = ↵m and limn!1 Vn = 0. If the regularization constant c is chosen so that ✓2↵M c ◆1/2 + 2(↵−1) ↵c1/2 < 1 4, (13) then, there exists a sample size ˜m such that (10) and (11) are satisfied for all m > ˜m and n = ↵m. In particular, if ↵= 2 we can satisfy (10) and (11) with c > 16(2 p M + 1)2. 4 Proof. That the condition in (11) is satisfied for all m > ˜m follows simply because the left hand side is of order V 2 m and the right hand side is of order Vn. To show that the condition in (10) is satisfied for sufficiently large m observe that the third summand in (10) is of order O((Vm −Vn)/V 1/2 n ) and vanishes for large m. In the second summand of (10) we make n = ↵m to obtain the second summand in (13) and in the first summand replace the ratio Vm/Vn by its bound ↵to obtain the first summand of (13). To conclude the proof just observe that the inequality in (13) is strict. The condition Vm ↵Vn is satisfied if Vn = 1/n and is also satisfied if Vn = 1/pn because p↵< ↵. This means that for most ERM problems we can progress geometrically over the sample size and arrive at a solution wN that solves the ERM problem RN to its statistical accuracy VN as long as (13) is satisfied . The result in Theorem 1 motivates definition of the Ada Newton algorithm that we summarize in Algorithm 1. The core of the algorithm is in steps 6-9. Step 6 implements an increase in the sample size by a factor ↵and steps 7-9 implement the Newton iteration in (5)-(7). The required input to the algorithm is an initial sample size m0 and a variable wm0 that is known to solve the ERM problem with accuracy Vm0. Observe that this initial iterate doesn’t have to be computed with Newton iterations. The initial problem to be solved contains a moderate number of samples m0, a mild condition number because it is regularized with constant cVm0, and is to be solved to a moderate accuracy Vm0 – recall that Vm0 is of order Vm0 = O(1/m0) or order Vm0 = O(1/pm0) depending on regularity assumptions. Stochastic first order methods excel at solving problems with moderate number of samples m0 and moderate condition to moderate accuracy. We remark that the conditions in Theorem 1 and Proposition 2 are conceptual but that the constants involved are unknown in practice. In particular, this means that the allowed values of the factor ↵that controls the growth of the sample size are unknown a priori. We solve this problem in Algorithm 1 by backtracking the increase in the sample size until we guarantee that wn minimizes the empirical risk Rn(wn) to within its statistical accuracy. This backtracking of the sample size is implemented in Step 11 and the optimality condition of wn is checked in Step 12. The condition in Step 12 is on the gradient norm that, because Rn is strongly convex, can be used to bound the suboptimality Rn(wn) −Rn(w⇤ n) as Rn(wn) −Rn(w⇤ n)  1 2cVn krRn(wn)k2. (14) Observe that checking this condition requires an extra gradient computation undertaken in Step 10. That computation can be reused in the computation of the gradient in Step 5 once we exit the backtracking loop. We emphasize that when the condition in (13) is satisfied, there exists a sufficiently large m for which the conditions in Theorem 1 are satisfied for n = ↵m. This means that the backtracking condition in Step 12 is satisfied after one iteration and that, eventually, Ada Newton progresses by increasing the sample size by a factor ↵. This means that Algorithm 1 can be thought of as having a damped phase where the sample size increases by a factor smaller than ⇢ and a geometric phase where the sample size grows by a factor ⇢in all subsequent iterations. The computational cost of this geometric phase is of not more than ↵/(↵−1) passes over the dataset and requires inverting not more than log↵N Hessians. If c > 16(2 p M + 1)2, we make ↵= 2 for optimizing to within statistical accuracy in about 2 passes over the dataset and after inversion of about 3.32 log10 N Hessians. 4 Convergence Analysis In this section we study the proof of Theorem 1. The main idea of the Ada Newton algorithm is introducing a policy for increasing the size of training set from m to n in a way that the current variable wm is in the Newton quadratic convergence phase for the next regularized empirical risk Rn. In the following proposition, we characterize the required condition to guarantee staying in the local neighborhood of Newton’s method. Proposition 3. Consider the sets Sm and Sn as subsets of the training set T such that Sm ⇢Sn ⇢ T . We assume that the number of samples in the sets Sm and Sn are m and n, respectively. Further, define wm as an Vm optimal solution of the risk Rm, i.e., Rm(wm) −Rm(w⇤ m) Vm. In addition, define λn(w) := % rRn(w)T r2Rn(w)−1rRn(w) &1/2 as the Newton decrement of variable w 5 associated with the risk Rn. If Assumption 1-3 hold, then Newton’s method at point wm is in the quadratic convergence phase for the objective function Rn, i.e., λn(wm) < 1/4, if we have ✓2(M + cVm)Vm cVn ◆1/2 + (2(n −m)/n)V 1/2 n + ( p 2c + 2pc + ckw⇤k)(Vm −Vn) (cVn)1/2 1 4 w.h.p. (15) Proof. See Section 7.1 in the supplementary material. From the analysis of Newton’s method we know that if the Newton decrement λn(w) is smaller than 1/4, the variable w is in the local neighborhood of Newton’s method; see e.g., Chapter 9 of [4]. From the result in Proposition 3, we obtain a sufficient condition to guarantee that λn(wm) < 1/4 which implies that wm, which is a Vm optimal solution for the regularized empirical loss Rm, i.e., Rm(wm) −Rm(w⇤ m) Vm, is in the local neighborhood of the optimal argument of Rn that Newton’s method converges quadratically. Unfortunately, the quadratic convergence of Newton’s method for self-concordant functions is in terms of the Newton decrement λn(w) and it does not necessary guarantee quadratic convergence in terms of objective function error. To be more precise, we can show that λn(wn)  γλn(wm)2; however, we can not conclude that the quadratic convergence of Newton’s method implies Rn(wn) −Rn(w⇤ n) γ0(Rn(wm) −Rn(w⇤ n))2. In the following proposition we try to characterize an upper bound for the error Rn(wn) −Rn(w⇤ n) in terms of the squared error (Rn(wm) −Rn(w⇤ n))2 using the quadratic convergence property of Newton decrement. Proposition 4. Consider wm as a variable that is in the local neighborhood of the optimal argument of the risk Rn where Newton’s method has a quadratic convergence rate, i.e., λn(wm) 1/4. Recall the definition of the variable wn in (7) as the updated variable using Newton step. If Assumption 1 and 2 hold, then the difference Rn(wn) −Rn(w⇤ n) is upper bounded by Rn(wn) −Rn(w⇤ n) 144(Rn(wm) −Rn(w⇤ n))2. (16) Proof. See Section 7.2 in the supplementary material. The result in Proposition 4 provides an upper bound for the sub-optimality Rn(wn) −Rn(w⇤ n) in terms of the sub-optimality of variable wm for the risk Rn, i.e., Rn(wm)−Rn(w⇤ n). Recall that we know that wm is in the statistical accuracy of Rm, i.e., Rm(wm) −Rm(w⇤ m) Vm, and we aim to show that the updated variable wn stays in the statistical accuracy of Rn, i.e., Rn(wn)−Rn(w⇤ n)  Vn. This can be done by showing that the upper bound for Rn(wn) −Rn(w⇤ n) in (16) is smaller than Vn. We proceed to derive an upper bound for the sub-optimality Rn(wm) −Rn(w⇤ n) in the following proposition. Proposition 5. Consider the sets Sm and Sn as subsets of the training set T such that Sm ⇢Sn ⇢ T . We assume that the number of samples in the sets Sm and Sn are m and n, respectively. Further, define wm as an Vm optimal solution of the risk Rm, i.e., Rm(wm) −R⇤ m Vm. If Assumption 1-3 hold, then the empirical risk error Rn(wm)−Rn(w⇤ n) of the variable wm corresponding to the set Sn is bounded above by Rn(wm)−Rn(w⇤ n) Vm+ 2(n −m) n (Vn−m + Vm)+2 (Vm −Vn)+ c(Vm −Vn) 2 kw⇤k2 w.h.p. (17) Proof. See Section 7.3 in the supplementary material. The result in Proposition 5 characterizes the sub-optimality of the variable wm, which is an Vm sub-optimal solution for the risk Rm, with respect to the empirical risk Rn associated with the set Sn. The results in Proposition 3, 4, and 5 lead to the result in Theorem 1. To be more precise, from the result in Proposition 3 we obtain that the condition in (10) implies that wm is in the local neighborhood of the optimal argument of Rn and λn(wm) 1/4. Hence, the hypothesis of Proposition 4 is satisfied and we have Rn(wn) −Rn(w⇤ n) 144(Rn(wm) −Rn(w⇤ n))2. This result paired with the result in Proposition 5 shows that if the condition in (11) is satisfied we can conclude that Rn(wn) −Rn(w⇤ n) Vn which completes the proof of Theorem 1. 6 0 5 10 15 20 25 Number of passes 10-10 10-8 10-6 10-4 10-2 100 RN(w) −R∗ N SGD SAGA Newton Ada Newton 0 10 20 30 40 50 60 70 80 90 Runtime (s) 10-10 10-8 10-6 10-4 10-2 100 RN(w) −R∗ N SGD SAGA Newton Ada Newton Figure 1: Comparison of SGD, SAGA, Newton, and Ada Newton in terms of number of effective passes over dataset (left) and runtime (right) for the protein homology dataset. 5 Experiments In this section, we study the performance of Ada Newton and compare it with state-of-the-art in solving a large-scale classification problem. In the main paper we only use the protein homology dataset provided on KDD cup 2004 website. Further numerical experiments on various datasets can be found in Section 7.4 in the supplementary material. The protein homology dataset contains N = 145751 samples and the dimension of each sample is p = 74. We consider three algorithms to compare with the proposed Ada Newton method. One of them is the classic Newton’s method with backtracking line search. The second algorithm is Stochastic Gradient Descent (SGD) and the last one is the SAGA method introduced in [6]. In our experiments, we use logistic loss and set the regularization parameters as c = 200 and Vn = 1/n. The stepsize of SGD in our experiments is 2⇥10−2. Note that picking larger stepsize leads to faster but less accurate convergence and choosing smaller stepsize improves the accuracy convergence with the price of slower convergence rate. The stepsize for SAGA is hand-optimized and the best performance has been observed for ↵= 0.2 which is the one that we use in the experiments. For Newton’s method, the backtracking line search parameters are ↵= 0.4 and β = 0.5. In the implementation of Ada Newton we increase the size of the training set by factor 2 at each iteration, i.e., ↵= 2 and we observe that the condition krRn(wn)k < ( p 2c)Vn is always satisfied and there is no need for reducing the factor ↵. Moreover, the size of initial training set is m0 = 124. For the warmup step that we need to get into to the quadratic neighborhood of Newton’s method we use the gradient descent method. In particular, we run gradient descent with stepsize 10−3 for 100 iterations. Note that since the number of samples is very small at the beginning, m0 = 124, and the regularizer is very large, the condition number of problem is very small. Thus, gradient descent is able to converge to a good neighborhood of the optimal solution in a reasonable time. Notice that the computation of this warm up process is very low and is equal to 12400 gradient evaluations. This number of samples is less than 10% of the full training set. In other words, the cost is less than 10% of one pass over the dataset. Although, this cost is negligible, we consider it in comparison with SGD, SAGA, and Newton’s method. We would like to mention that other algorithms such as Newton’s method and stochastic algorithms can also be used for the warm up process; however, the gradient descent method sounds the best option since the gradient evaluation is not costly and the problem is well-conditioned for a small training set . The left plot in Figure 1 illustrates the convergence path of SGD, SAGA, Newton, and Ada Newton for the protein homology dataset. Note that the x axis is the total number of samples used divided by the size of the training set N = 145751 which we call number of passes over the dataset. As we observe, The best performance among the four algorithms belongs to Ada Newton. In particular, Ada Newton is able to achieve the accuracy of RN(w) −R⇤ N < 1/N by 2.4 passes over the dataset which is very close to theoretical result in Theorem 1 that guarantees accuracy of order O(1/N) after ↵/(↵−1) = 2 passes over the dataset. To achieve the same accuracy of 1/N Newton’s method requires 7.5 passes over the dataset, while SAGA needs 10 passes. The SGD algorithm can not achieve the statistical accuracy of order O(1/N) even after 25 passes over the dataset. Although, Ada Newton and Newton outperform SAGA and SGD, their computational complexity are different. We address this concern by comparing the algorithms in terms of runtime. The right 7 plot in Figure 1 demonstrates the convergence paths of the considered methods in terms of runtime. As we observe, Newton’s method requires more time to achieve the statistical accuracy of 1/N relative to SAGA. This observation justifies the belief that Newton’s method is not practical for large-scale optimization problems, since by enlarging p or making the initial solution worse the performance of Newton’s method will be even worse than the ones in Figure 1. Ada Newton resolves this issue by starting from small sample size which is computationally less costly. Ada Newton also requires Hessian inverse evaluations, but the number of inversions is proportional to log↵N. Moreover, the performance of Ada Newton doesn’t depend on the initial point and the warm up process is not costly as we described before. We observe that Ada Newton outperforms SAGA significantly. In particular it achieves the statistical accuracy of 1/N in less than 25 seconds, while SAGA achieves the same accuracy in 62 seconds. Note that since the variable wN is in the quadratic neighborhood of Newton’s method for RN the convergence path of Ada Newton becomes quadratic eventually when the size of the training set becomes equal to the size of the full dataset. It follows that the advantage of Ada Newton with respect to SAGA is more significant if we look for a suboptimality less than Vn. We have observed similar performances for other datasets such as A9A, W8A, COVTYPE, and SUSY – see Section 7.4 in the supplementary material. 6 Discussions As explained in Section 4, Theorem 1 holds because condition (10) makes wm part of the quadratic convergence region of Rn. From this fact, it follows that the Newton iteration makes the suboptimality gap Rn(wn)−Rn(w⇤ n) the square of the suboptimality gap Rn(wm)−Rn(w⇤ n). This yields condition (11) and is the fact that makes Newton steps valuable in increasing the sample size. If we replace Newton iterations by any method with linear convergence rate, the orders of both sides on condition (11) are the same. This would make aggressive increase of the sample size unlikely. In Section 1 we pointed out four reasons that challenge the development of stochastic Newton methods. It would not be entirely accurate to call Ada Newton a stochastic method because it doesn’t rely on stochastic descent directions. It is, nonetheless, a method for ERM that makes pithy use of the dataset. The challenges listed in Section 1 are overcome by Ada Newton because: (i) Ada Newton does not use line searches. Optimality improvement is guaranteed by increasing the sample size. (ii) The advantages of Newton’s method are exploited by increasing the sample size at a rate that keeps the solution for sample size m in the quadratic convergence region of the risk associated with sample size n = ↵m. This allows aggressive growth of the sample size. (iii) The ERM problem is not necessarily strongly convex. A regularization of order Vn is added to construct the empirical risk Rn (iv) Ada Newton inverts approximately log↵N Hessians. To be more precise, the total number of inversion could be larger than log↵N because of the backtracking step. However, the backtracking step is bypassed when the number of samples is sufficiently large. It is fair to point out that items (ii) and (iv) are true only to the extent that the damped phase in Algorithm 1 is not significant. Our numerical experiments indicate that this is true but the conclusion is not warranted by out theoretical bounds except when the dataset is very large. This suggests the bounds are loose and that further research is warranted to develop tighter bounds. References [1] Peter L. Bartlett, Michael I. Jordan, and Jon D. McAuliffe. Convexity, classification, and risk bounds. Journal of the American Statistical Association, 101(473):138–156, 2006. [2] Amir Beck and Marc Teboulle. A fast iterative shrinkage-thresholding algorithm for linear inverse problems. SIAM Journal on Imaging Sciences, 2(1):183–202, 2009. [3] L´eon Bottou and Olivier Bousquet. The tradeoffs of large scale learning. In Advances in Neural Information Processing Systems 20, Vancouver, British Columbia, Canada, pages 161–168, 2007. [4] Stephen Boyd and Lieven Vandenberghe. Convex Optimization. Cambridge University Press, New York, NY, USA, 2004. 8 [5] Hadi Daneshmand, Aur´elien Lucchi, and Thomas Hofmann. Starting small - learning with adaptive sample sizes. In Proceedings of the 33nd International Conference on Machine Learning, ICML 2016, New York City, NY, USA, pages 1463–1471, 2016. [6] Aaron Defazio, Francis R. Bach, and Simon Lacoste-Julien. SAGA: A fast incremental gradient method with support for non-strongly convex composite objectives. In Advances in Neural Information Processing Systems 27, Montreal, Quebec, Canada, pages 1646–1654, 2014. [7] Murat A. Erdogdu and Andrea Montanari. Convergence rates of sub-sampled Newton methods. In Advances in Neural Information Processing Systems 28: Annual Conference on Neural Information Processing Systems 2015, Montreal, Quebec, Canada, pages 3052–3060, 2015. [8] Roy Frostig, Rong Ge, Sham M. Kakade, and Aaron Sidford. Competing with the empirical risk minimizer in a single pass. In Proceedings of The 28th Conference on Learning Theory, COLT 2015, Paris, France, July 3-6, 2015, pages 728–763, 2015. [9] Mert G¨urb¨uzbalaban, Asuman Ozdaglar, and Pablo Parrilo. A globally convergent incremental Newton method. Mathematical Programming, 151(1):283–313, 2015. [10] Rie Johnson and Tong Zhang. Accelerating stochastic gradient descent using predictive variance reduction. In Advances in Neural Information Processing Systems 26. Lake Tahoe, Nevada, United States., pages 315–323, 2013. [11] Aurelien Lucchi, Brian McWilliams, and Thomas Hofmann. A variance reduced stochastic newton method. arXiv, 2015. [12] Aryan Mokhtari and Alejandro Ribeiro. Res: Regularized stochastic BFGS algorithm. IEEE Transactions on Signal Processing, 62(23):6089–6104, 2014. [13] Aryan Mokhtari and Alejandro Ribeiro. Global convergence of online limited memory BFGS. Journal of Machine Learning Research, 16:3151–3181, 2015. [14] Philipp Moritz, Robert Nishihara, and Michael I. Jordan. A linearly-convergent stochastic L-BFGS algorithm. Proceedings of the 19th International Conference on Artificial Intelligence and Statistics, AISTATS 2016, Cadiz, Spain, pages 249–258, 2016. [15] Yu Nesterov. Introductory Lectures on Convex Programming Volume I: Basic course. Citeseer, 1998. [16] Yurii Nesterov et al. Gradient methods for minimizing composite objective function. 2007. [17] Boris T Polyak and Anatoli B Juditsky. Acceleration of stochastic approximation by averaging. SIAM Journal on Control and Optimization, 30(4):838–855, 1992. [18] Zheng Qu, Peter Richt´arik, Martin Tak´ac, and Olivier Fercoq. SDNA: stochastic dual Newton ascent for empirical risk minimization. In Proceedings of the 33nd International Conference on Machine Learning, ICML 2016, New York City, NY, USA, June 19-24, 2016, pages 1823–1832, 2016. [19] Herbert Robbins and Sutton Monro. A stochastic approximation method. The Annals of Mathematical Statistics, pages 400–407, 1951. [20] Nicolas Le Roux, Mark W. Schmidt, and Francis R. Bach. A stochastic gradient method with an exponential convergence rate for finite training sets. In Advances in Neural Information Processing Systems 25. Lake Tahoe, Nevada, United States., pages 2672–2680, 2012. [21] Nicol N. Schraudolph, Jin Yu, and Simon G¨unter. A stochastic quasi-Newton method for online convex optimization. In Proceedings of the Eleventh International Conference on Artificial Intelligence and Statistics, AISTATS 2007, San Juan, Puerto Rico, pages 436–443, 2007. [22] Shai Shalev-Shwartz, Ohad Shamir, Nathan Srebro, and Karthik Sridharan. Learnability, stability and uniform convergence. The Journal of Machine Learning Research, 11:2635–2670, 2010. [23] Shai Shalev-Shwartz and Tong Zhang. Stochastic dual coordinate ascent methods for regularized loss. The Journal of Machine Learning Research, 14:567–599, 2013. [24] Shai Shalev-Shwartz and Tong Zhang. Accelerated proximal stochastic dual coordinate ascent for regularized loss minimization. Mathematical Programming, 155(1-2):105–145, 2016. [25] Vladimir Vapnik. The nature of statistical learning theory. Springer Science & Business Media, 2013. [26] Lin Xiao and Tong Zhang. A proximal stochastic gradient method with progressive variance reduction. SIAM Journal on Optimization, 24(4):2057–2075, 2014. 9
2016
366
6,290
Yggdrasil: An Optimized System for Training Deep Decision Trees at Scale Firas Abuzaid1, Joseph Bradley2, Feynman Liang3, Andrew Feng4, Lee Yang4, Matei Zaharia1, Ameet Talwalkar5 1MIT CSAIL, 2Databricks, 3University of Cambridge, 4Yahoo, 5UCLA Abstract Deep distributed decision trees and tree ensembles have grown in importance due to the need to model increasingly large datasets. However, PLANET, the standard distributed tree learning algorithm implemented in systems such as XGBOOST and Spark MLLIB, scales poorly as data dimensionality and tree depths grow. We present YGGDRASIL, a new distributed tree learning method that outperforms existing methods by up to 24×. Unlike PLANET, YGGDRASIL is based on vertical partitioning of the data (i.e., partitioning by feature), along with a set of optimized data structures to reduce the CPU and communication costs of training. YGGDRASIL (1) trains directly on compressed data for compressible features and labels; (2) introduces efficient data structures for training on uncompressed data; and (3) minimizes communication between nodes by using sparse bitvectors. Moreover, while PLANET approximates split points through feature binning, YGGDRASIL does not require binning, and we analytically characterize the impact of this approximation. We evaluate YGGDRASIL against the MNIST 8M dataset and a high-dimensional dataset at Yahoo; for both, YGGDRASIL is faster by up to an order of magnitude. 1 Introduction Decision tree-based methods, such as random forests and gradient-boosted trees, have a rich and successful history in the machine learning literature. They remain some of the most widely-used models for both regression and classification tasks, and have proven to be practically advantageous for several reasons: they are arbitrarily expressive, can naturally handle categorical features, and are robust to a wide range of hyperparameter settings [4]. As datasets have grown in scale, there is an increasing need for distributed algorithms to train decision trees. Google’s PLANET framework [12] has been the de facto approach for distributed tree learning, with several popular open source implementations, including Apache Mahout, Spark MLLIB, and XGBOOST [1, 11, 7]. PLANET partitions the training instances across machines and parallelizes the computation of split points and stopping criteria over them, thus effectively leveraging a large cluster. While PLANET works well for shallow trees and small numbers of features, it has high communication costs when tree depths and data dimensionality grow. PLANET’s communication cost is linear in the number of features p, and is linear in 2D, where D is the tree depth. As demonstrated by several studies [13, 3, 8], datasets have become increasingly high-dimensional (large p) and complex, often requiring high-capacity models (e.g., deep trees with large D) to achieve good predictive accuracy. We present YGGDRASIL, a new distributed tree learning system that scales well to high-dimensional data and deep trees. Unlike PLANET, YGGDRASIL is based on vertical partitioning of the data [5]: it assigns a subset of the features to each worker machine, and asks it to compute an optimal split for each of its features. These candidate splits are then sent to a master, which selects the best one. On top of the basic idea of vertical partitioning, YGGDRASIL introduces three novel optimizations: 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. • Training on compressed data without decompression: YGGDRASIL compresses features via run-length encoding and encodes labels using dictionary compression. We design a novel splitfinding scheme that trains directly on compressed data for compressible features, which reduces runtime by up to 20%. • Efficient training on uncompressed data: YGGDRASIL’s data structures let each worker implicitly store the split history of the tree without introducing any memory overheads. Each worker requires only a sequential scan over the data to perform greedy split-finding across all leaf nodes in the tree, and only one set of sufficient statistics is kept in memory at a time. • Minimal communication between nodes: YGGDRASIL uses sparse bit vectors to reduce intermachine communication costs during training. Together, these optimizations yield an algorithm that is asymptotically less expensive than PLANET on high-dimensional data and deep trees: YGGDRASIL’s communication cost is O(2D + Dn), in contrast to O(2Dp) for PLANET-based methods, and its data structure optimizations yield up to 2× savings in memory and 40% savings in time over a naive implementation of vertical partitioning. These optimizations enable YGGDRASIL to scale up to thousands of features and tree depths up to 20. On tree depths greater than 10, YGGDRASIL outperforms MLLIB and XGBOOST by up to 6× on the MNIST 8M dataset, and up to 24× on a dataset with 2 million training examples and 3500 features modeled after the production workload at Yahoo. Notation We define n and p as the number of instances and features in the training set, D as the maximum depth of the tree, B as the number of histogram buckets to use in PLANET, k as the number of workers in the cluster, and Wj as the jth worker. 2 PLANET: Horizontal Partitioning We now describe the standard algorithm for training a decision tree in a distributed fashion via horizontal partitioning, inspired by PLANET [12]. We assume that B potential thresholds for each of the p features are considered; thus, we define S as the set of cardinality pB containing all split candidates. For a given node i, define the set I as the instances belonging to this node. We can then express the splitting criterion Split(·) for node i as Split(i) = arg maxs∈S f(P x∈I g(x, s)) for functions f and g where f : Rc →R, g : Rp × N →Rc, and c ∈O(1). Intuitively, for each split candidate s ∈S, g(x, s) computes the c sufficient statistics for each point x; f(·) aggregates these sufficient statistics to compute the node purity for candidate s; and Split(i) returns the split candidate that maximizes the node purity. Hence, if worker j contains instances in the set J , we have: Split(i) = arg max s∈S f k X j=1 gj(s) ! where gj(s) = X x∈I∩J g(x, s) (1) This observation suggests a natural distributed algorithm. We assume a star-shaped distributed architecture with a master node and k worker nodes. Data are distributed using horizontal partitioning; i.e., each worker node stores a subset of the n instances. For simplicity, we assume that we train our tree to a fixed depth D. On the tth iteration of the algorithm, we compute the optimal splits for all nodes on the tth level of the tree via a single round trip of communication between the master and the workers. Each tree node i is split as follows: 1. The jth worker locally computes sufficient statistics gj(s) from Equation 1 for all s ∈S. 2. Each worker communicates all statistics gj(s) to the master (Bp in total). 3. The master computes the best split s∗= Split(i) from Equation 1. 4. The master broadcasts s∗to the workers, who update their local states to keep track of which instances are assigned to which child nodes. Overall, the computation is linear in n, p, and D, and is trivially parallelizable. Yet the algorithm is communication-intensive. For each tree node, step 2 above requires communicating kBp tuples of size c. With 2D total nodes, the total communication is 2DkpBc floating point values, which is exponential in tree depth D, and linear in B, the number of thresholds considered for each feature. Moreover, using B < n thresholds results in an approximation of the tree trained on a single machine, and can result in adverse statistical consequences, as noted empirically by [7]. We present a theoretical analysis of the impact of this approximation in Section 4. 2 3 YGGDRASIL: Vertical Partitioning We propose an alternative algorithm to address the aforementioned shortcomings. Rather than partition the data by instance, we partition by feature: each of the k worker machines stores all feature values for  p k  of the features, as well the labels for all instances. This organizational strategy has two crucial benefits: (1) each worker can locally compute the node purity for a subset of the split candidates, which significantly reduces the communication bottleneck; and (2) we can efficiently consider all possible B = n −1 splits. We can derive an expression for Split(i) with vertical partitioning analogous to Equation 1. Redefining J to be the set of features stored on the jth worker, we have Split(i) = arg max j fj where fj = arg max s∈J f X x∈I g(x, s) ! (2) Intuitively, each worker identifies its top split candidate among its set of features, and the master then chooses the best split candidate among these top k candidates. As with horizontal partitioning, computation is linear in n, p, and D, and is easily parallelizable. However, the communication profile is quite different, with two major sources of communication. For each node, each worker communicates one tuple of size c, resulting in 2Dkc communication for all nodes. When training each level of the tree, n bits are communicated to indicate the split direction (left/right) for each training point. Hence, the overall communication is O(2Dk + Dnk). In contrast to the O(2DkpB) communication cost of horizontal partitioning, vertical partitioning has no dependence on p, and, for large n, the O(Dnk) term will likely be the bottleneck. n 2n 4n 8n Num. Instances, Log Scale p 2p 3p 4p 5p 6p 7p 8p Num. Features Horizontal Partitioning Better Vertical Partitioning Better (a) Regimes of (n, p) where each partitioning strategy dominates for D = 15, k = 16, B = 32. n 2n 4n 8n Num. Instances, Log Scale D 2D 3D 4D 5D Tree Depth Horizontal Partitioning Better Vertical Partitioning Better (b) Regimes of (n, D) where each partitioning strategy dominates for p = 2500, k = 16, B = 32. Figure 1: Communication cost tradeoffs between vertical and horizontal partitioning Thus, there exists a set of tradeoffs between horizontal and vertical partitioning across different regimes of n, p, and D, as illustrated in Figure 1. The overall trend is clear: for large p and D, vertical partitioning can drastically reduce communication. 3.1 Algorithm The YGGDRASIL algorithm works as follows: at iteration t, we compute the optimal splits for all nodes on the tth level of the tree via two round trips of communication between the master and the workers. Like PLANET, all splits for a single depth t are computed at once. For each node i at depth t, the following steps are performed: ComputeBestSplit(i): • The jth worker locally computes fj from Equation 2 and sends this to the master. • The master selects s∗= Split(i). Let f ∗ j denote the optimal feature selected for s∗, and let W ∗ j be the worker containing this optimal feature: f ∗ j ∈W ∗ j . bitV ector = CollectBitVector(W ∗ j ): 3 • The master requests a bitvector from W ∗ j in order to determine which child node (either left or right) each training point x ∈I should be assigned to. BroadcastSplitInfo(bitV ector): • The master then broadcasts the bitvector to all k workers. Each worker then updates its internal state to prepare for the next iteration of training. 3.2 Optimizations As we previously showed, vertical partitioning leads to asymptotically lower communication costs as p and D increase. However, this asymptotic behavior does not necessarily translate to more efficient tree learning; on the contrary, a naive implementation may easily lead to high CPU and memory overheads, communication overhead, and poor utilization of the CPU cache. In YGGDRASIL, we introduce three novel optimizations for vertically partitioned tree learning that significantly improve its scalability, memory usage and performance. 3.2.1 Sparse Bitvectors for Reduced Communication Overhead Once the master has found the optimal split s∗for each leaf node i in the tree, each worker must then update its local features to reflect that the instances have been divided into new child nodes. To accomplish this while minimizing communication, the workers and master communicate using bitvectors. Specifically, after finding the optimal split, the master requests from worker W ∗ j a corresponding bitvector for s∗; this bitvector encodes the partitioning of instances between the two children of i. Once the master has collected all optimal splits for all leaf nodes, it broadcasts the bitvectors out to all workers. This means that (assuming a fully balanced tree), for every depth t during training, 2t bitvectors – for a total of n bits – are sent from the k workers. Additionally, the n bits are encoded in a sparse format [6], which offers much better compression via packed arrays than a naive bitvector. This sparse encoding is particularly useful for imbalanced trees: rather than allocate memory to encode a potential split for all nodes at depth t, we only allocate memory for the nodes in which an optimal split was found. By taking advantage of sparsity, we can send the n bits between the master and the workers at only a fraction of the cost. 3.2.2 Training on Compressed Data without Decompression In addition to its more favorable communication cost for large p and D, YGGDRASIL’s vertical partitioning strategy presents a unique optimization opportunity: the ability to efficiently compress data by feature. Furthermore, because the feature values must be in sorted order to perform greedy split-finding, we can use this to our advantage to perform lossless compression without sacrificing recoverability. This leads to a clear optimization: feature compression via run-length encoding (RLE), an idea that has been explored extensively in column-store databases [10, 14]. In addition to the obvious in-memory savings, this technique also impacts the runtime performance of split-finding, since the vast majority of feature values are now able to reside in the L3 cache. To the best of our knowledge, YGGDRASIL is the first system to apply this optimization to decision tree learning. Many features compress well using RLE: sparse features, continuous features with few distinct values, and categorical features with low arity. However, to train directly on compressed data without decompressing, we must maintain the feature in sorted order throughout the duration of training, a prerequisite for RLE. Therefore, to compute all splits for a given depth t, we introduce a data structure to record the most recent splits at depth t −1. Specifically, we create a mapping between each feature value and the node i at depth t that it is currently assigned to. At the end of an iteration of training, each worker updates this data structure by applying the bitvector it receives from the master, which requires a single sequential scan over the data. All random accesses are confined to the labels, which we also encode (when feasible) using dictionary compression. This gives us much better cache density during split-finding: all random accesses no longer touch DRAM and instead read from the last-level cache. To minimize the number of additional passes, we compute the optimal split across all leaf nodes as we iterate over a given feature. This means that each feature requires only two sequential scans over the data for each iteration of training: one to update the value-node mapping, and one to compute the entire set of optimal splits for iteration t + 1. However, as a tradeoff, we must maintain the 4 sufficient statistics for all splits in memory as we scan over the feature. For categorical features (especially those with high arity), this cost in memory overhead proves to be too exorbitant, and the runtime performance suffers despite obtaining excellent compression. For sparse continuous features, however, the improvements are significant: on MNIST 8M, we achieve 2× compression (including the auxiliary data structure) and obtain a 20% reduction in runtime. 3.2.3 Efficient Training on Uncompressed Data For features that aren’t highly compressible, YGGDRASIL uses a different scheme that, in contrast, does not use any auxiliary data structures to keep track of the split history. Since features no longer need to stay sorted in perpetuity, YGGDRASIL implicitly encodes the split partitions by recursively dividing its features into sub-arrays – each feature value is assigned to a sub-array based on the bit assigned to it and its previous sub-array assignment. Because the feature is initially sorted, a sequential scan over the sub-arrays maintains the sorted-order invariant, and we construct the sub-arrays for the next iteration of training in O(n) time, requiring only a single pass over the feature. By using this implicit representation of the split history, we’re left only with the feature values and label indices stored in memory. Therefore, the memory load does not increase during training for uncompressed features – it remains constant at 2×. This scheme yields another additional benefit: when computing the next iteration of splits for depth t + 1, YGGDRASIL only maintains the sufficient statistics for one node at a time, rather than for all leaf nodes. Furthermore, YGGDRASIL still only requires a single sequential scan through the entire feature to compute all splits. This means that, as was the case for compressed features, every iteration of training requires only two sequential scans over each feature, and all random accesses are again confined to the dictionary-compressed labels. Finally, for imbalanced trees, we can skip entire sub-arrays that no longer need to be split, which saves additional time as trees grow deeper. ci = bitVector = 100101 0 1 0 2 3 1 0 0 1 1 2 3 0 1 2 0 1 3 sort by value split found, sort by bitvector i0 i1 i2 sorted feature before training 2) original feature 1) after 1st iteration of training 3) Entire Cluster Single Worker Figure 2: Overview of one iteration of uncompressed training in YGGDRASIL. Left side: Root node i0 is split into nodes i1 and i2; the split is encoded by a bitvector. Right side: Prior to training, the feature ci is sorted to optimize split-finding. Once a split has been found, ci is re-sorted into two sub-arrays: the 1st, 4th, and last values (the “on” bits) are sorted into i1’s sub-array, and the “off” bits are sorted into i2’s sub-array. Each sub-array is in sorted order for the next iteration of training. 4 Discretization Error Analysis Horizontal partitioning requires each worker to communicate the impurity on its subset of data for all candidate splits associated with each of the p features, and to do so for all 2D tree nodes. For continuous features where each training instance could have a distinct value, up to n candidate splits are possible so the communication cost is O(2Dkpn). To improve efficiency, continuous features are instead commonly discretized to B discrete bins such that only B rather than n −1 candidate splits are considered at each tree node [9]. In contrast, discretization of continuous features is not required in YGGDRASIL, since all n values for a particular feature are stored on a single worker (due to vertical partitioning). Hence, the impurity for the best split rather than all splits is communicated. This discretization heuristic results in the approximation of continuous values by discrete representatives, and can adversely impact the statistical performance of the resulting decision tree, as demonstrated empirically by [7]. Prior work has shown that the number of bins can be chosen such that the decrease in information gain at any internal tree node between the continuous and discretized 5 feature can be made arbitrarily small [2]. However, their proof does not quantify the effects of discretization on a decision tree’s performance. To understand the impact of discretization on accuracy, we analyze the simplified setting of training a decision stump classifier on a single continuous feature x ∈[0, 1]. Suppose the feature data is drawn i.i.d. from a uniform distribution, i.e., x(i) iid ∼U[0, 1] for i = 1, 2, . . . , n, and that labels are generated according to some threshold ttruth ∼U[0, 1], i.e., y(i) = sgn(x(i) −ttruth). The decision stump training criterion seeks to choose a splitting threshold at one of the training instances x(i) in order to minimize ˆtn = arg maxt∈{x(i)} f(t), where f(t) is some purity measure. In our analysis, we will define the purity measure to be information gain. In our simplified setting, we show that there is a natural relationship between the misclassification probability Perr(t), and the approximation error of our decision stump, i.e., |t −ttruth|. All proofs are deferred to the appendix. Observation 1. For an undiscretized decision stump, as n →∞, Perr(ˆtn) a.s. →0. Observation 2. Maximizing information gain is equivalent to minimizing absolute distance, i.e., ˆtn = arg max t∈{x(i)}n i=1 f(t) = arg min t∈{x(i)}n i=1 |t −ttruth| . Moreover, Perr(t) = |t −ttruth|. We now present our main result. This intuitive result shows that increasing the number of discretization bins B leads to a reduction in the expected probability of error. Theorem 1. Let ˆtN,B denote the threshold learned by a decision stump on n training instances discretized to B + 1 levels. Then E  Perr(ˆtN,B)  a.s. → 1 4B . 5 Evaluation We developed YGGDRASIL on top of Spark 1.6.0 with an API compatible with MLLIB. Our implementation is 1385 lines of code, excluding comments and whitespace. Our implementation is open-source and publicly available.1 Our experimental results show that, for large p and D, YGGDRASIL outperforms PLANET by an order of magnitude, corroborating our analysis in Section 3. 5.1 Experimental Setup We benchmarked YGGDRASIL against two implementations of PLANET: Spark MLLIB v1.6.0, and XGBOOST4J-SPARK v0.47. These two implementations are slightly different from the algorithm from Panda et al. In particular, the original PLANET algorithm has separate subroutines for distributed vs. “local” training. By default, PLANET executes the horizontally partitioned algorithm in Section 2 using on-disk data; however, if the instances assigned to a given tree node fit in-memory on a single worker, then PLANET moves all the data for that node to one worker and switches to in-memory training on that worker. In contrast, MLLIB loads all the data into distributed memory across the cluster at the beginning and executes all training passes in memory. XGBOOST extends PLANET with several additional optimizations; see [7] for details. We ran all experiments on 16 Amazon EC2 r3.2xlarge machines. Each machine has an Intel Xeon E5-2670 v2 CPU, 61 GB of memory, and 1 Gigabit Ethernet connectivity. Prior to our experiments, we tuned Spark’s memory configuration (heap memory used for storage, number of partitions, etc.) for optimal performance. All results are averaged over five trials. 5.2 Large-scale experiments To examine the performance of YGGDRASIL and PLANET, we trained a decision tree on two largescale datasets: the MNIST 8 million dataset, and another modeled after a private Yahoo dataset that is used for search ranking. Table 1 summarizes the parameters of these datasets. 1Yggdrasil has been published as a Spark package at the following URL: https://spark-packages. org/package/fabuzaid21/yggdrasil 6 6 8 10 12 14 16 18 20 Tree Depth 0 500 1000 1500 2000 2500 Training Time (s) Yggdrasil vs. PLANET and XGBoost: MNIST 8M MLlib Yggdrasil XGBoost 6 8 10 12 14 16 18 Tree Depth 0 2000 4000 6000 8000 10000 Training Time (s) Yggdrasil vs. PLANET and XGBoost: Yahoo 2M MLlib Yggdrasil XGBoost Figure 3: Training time vs. tree depth for MNIST 8M and Yahoo 2M. Dataset # instances # features Size Task MNIST 8M 8.1×106 784 18.2 GiB classification Yahoo 2M 2×106 3500 52.2 GiB regression Table 1: Parameters of the datasets for our experiments Figure 3 shows the training time across various tree depths for MNIST 8M and Yahoo 2M. For both datasets, we carefully tuned XGBOOST to run on the maximum number of threads and the optimal number of partitions. Despite this, XGBOOST was unable to train trees deeper than D = 13 without crashing due to OutOfMemory exceptions. While Spark MLLIB’s implementation of PLANET is marginally faster for shallow trees, its runtime increases exponentially as D increases. YGGDRASIL, on the other hand, scales well up to D = 20, for which it runs up to 6× faster. For the Yahoo dataset, YGGDRASIL’s speed-up is even greater because of the higher number of features p – recall that the communication cost for PLANET is proportional to 2D and p. Thus, for D = 18, YGGDRASIL is up to 24× faster than Spark MLLIB. 5.3 Study of Individual Optimizations To understand the impacts of the optimizations in Section 3.2, we measure each optimization’s effect on YGGDRASIL runtime. To fully evaluate our optimizations – including feature compression – we chose MNIST 8M, whose features are all sparse, for this study. The results are in Figure 6: we see that the total improvement from the naive baseline to the fully optimized algorithm is a 40% reduction in runtime. Using sparse bitvectors reduces the communication overhead between the master and the workers, giving a modest speedup. Encoding the labels and compressing the features via run-length encoding each yield 20% improvements. As discussed, these speedups are due to improved cache utilization: encoding the labels via dictionary compression reduces their size in memory by 8×; as a result, the labels entirely fit in the last-level cache. The feature values also fit in cache after applying RLE, and we gain 2× in memory overhead once we factor in needed auxiliary data structures. 5.4 Scalability experiments To further demonstrate the scalability of YGGDRASIL vs. PLANET for high-dimensional datasets, we measured the training time on a series of synthetic datasets parameterized by p. For each dataset, approximately p 2 features were categorical, while the remaining features were continuous. From Figure 4, we see that, YGGDRASIL scales much more effectively as p increases, especially for larger D. In particular, for D = 15, YGGDRASIL is initially 3× faster than PLANET for p = 500, but is more than 8× faster for p = 4000. This confirms our asymptotic analysis in Section 3. 6 Related Work Vertical Partitioning. Several authors have proposed partitioning data by feature for training decision trees; to our knowledge, none of these systems perform the communication and data structure optimizations in YGGDRASIL, and none report results at the same scale. Svore and Burges 7 500 1000 1500 2000 2500 3000 3500 4000 Num. Features 0 200 400 600 800 1000 1200 1400 1600 1800 Training Time (s) Yggdrasil vs. PLANET: Number of Features MLlib, D = 15 MLlib, D = 13 Yggdrasil, D = 15 Yggdrasil, D = 13 Figure 4: Training time vs. number of features for n = 2 × 106, k = 16, B = 32. Because the communication cost of PLANET scales linearly with p, the total runtime increases at a much faster rate. 1 2 3 4 5 6 7 8 9 10 Tree Depth 104 105 106 107 108 109 1010 1011 Number of Bytes Sent, Log Scale Yggdrasil vs. PLANET: Communication Cost MLlib, p = 1K MLlib, p = 2K MLlib, p = 4K Yggdrasil, p = {1K, 2K, 4K} Figure 5: Number of bytes sent vs. tree depth for n = 2 × 106, k = 16, B = 32. For YGGDRASIL, the communication cost is the same for all p; each worker sends its best local feature to the master. [15] treat data as vertical columns, but place a full copy of the dataset on every worker node, an approach that is not scalable for large datasets. Caragea et al. [5] analyze the costs of horizontal and vertical partitioning but do not include an implementation. Ye et al. [16] implement vertical partitioning using MapReduce or MPI and benchmark data sizes up to 1.2 million rows and 520 features. None of these systems compress columnar data on each node, communicate using sparse bitvectors, or optimize for cache locality as YGGDRASIL does (Section 3.2). These optimizations yield significant speedups over a basic implementation of vertical partitioning (Section 5.3). uncompressed training uncompressed + sparse bitvectors uncompressed + sparse bitvectors + label encoding RLE + sparse bitvectors + label encoding 0 20 40 60 80 100 120 140 Training Time (s) 134 s 125 s 101 s 81 s Yggdrasil: Impact of Individual Optimizations Figure 6: YGGDRASIL runtime improvements from specific optimizations, on MNIST 8M at D = 10. Distributed Tree Learning. The most widely used distributed tree learning method is PLANET ([12]), which is also implemented in open-source libraries such as Apache Mahout ([1]) and MLLIB ([11]). As shown in Figure 1, PLANET works well for shallow trees and small numbers of features, but its cost grows quickly with tree depth and is proportional to the number of features and the number of bins used for discretization. This makes it suboptimal for some largescale tree learning problems. XGBOOST ([7]) uses a partitioning scheme similar to PLANET, but uses a compressed, sorted columnar format inside each “block” of data. Its communication cost is therefore similar to PLANET, but its memory consumption is smaller. XGBOOST is optimized for gradient-boosted trees, in which case each tree is relatively shallow. It does not perform as well as YGGDRASIL on deeper trees, such as those needed for random forests, as shown in our evaluation. XGBOOST also lacks some of the processing optimizations in YGGDRASIL, such as label encoding to maximize cache density and training directly on run-length encoded features without decompressing. 7 Conclusion Decision trees and tree ensembles are an important class of models, but previous distributed training algorithms were optimized for small numbers of features and shallow trees. We have presented YGGDRASIL, a new distributed tree learning system optimized for deep trees and thousands of features. Through vertical partitioning of the data and a set of data structure and algorithmic optimizations, YGGDRASIL outperforms existing tree learning systems by up to 24×, while simultaneously eliminating the need to approximate data through binning. YGGDRASIL is easily implementable on parallel engines like MapReduce and Spark. 8 References [1] Apache Mahout. https://mahout.apache.org/, 2015. [2] Y. Ben-Haim and E. Tom-Tov. A streaming parallel decision tree algorithm. The Journal of Machine Learning Research, 11:849–872, 2010. [3] L. Breiman. Random forests. Machine learning, 45(1):5–32, 2001. [4] L. Breiman, J. Friedman, C. J. Stone, and R. A. Olshen. Classification and regression trees. CRC press, 1984. [5] D. Caragea, A. Silvescu, and V. Honavar. A framework for learning from distributed data using sufficient statistics and its application to learning decision trees. International Journal of Hybrid Intelligent Systems, 1(1, 2):80–89, 2004. [6] S. Chambi, D. Lemire, O. Kaser, and R. Godin. Better bitmap performance with roaring bitmaps. Software: Practice and Experience, 2015. [7] T. Chen and C. Guestrin. Xgboost: A scalable tree boosting system. arXiv preprint arXiv:1603.02754, 2016. [8] C. Cortes, M. Mohri, and U. Syed. Deep boosting. In ICML, 2014. [9] U. M. Fayyad and K. B. Irani. On the handling of continuous-valued attributes in decision tree generation. Mach. Learn., 8(1):87–102, Jan. 1992. ISSN 0885-6125. doi: 10.1023/A: 1022638503176. URL http://dx.doi.org/10.1023/A:1022638503176. [10] A. Lamb, M. Fuller, R. Varadarajan, N. Tran, B. Vandiver, L. Doshi, and C. Bear. The vertica analytic database: C-store 7 years later. Proceedings of the VLDB Endowment, 5(12):1790–1801, 2012. [11] X. Meng, J. K. Bradley, B. Yavuz, E. R. Sparks, S. Venkataraman, D. Liu, J. Freeman, D. B. Tsai, M. Amde, S. Owen, D. Xin, R. Xin, M. J. Franklin, R. Zadeh, M. Zaharia, and A. Talwalkar. MLlib: Machine learning in apache spark. arXiv:1505.06807, 2015. [12] B. Panda, J. S. Herbach, S. Basu, and R. J. Bayardo. Planet: Massively parallel learning of tree ensembles with mapreduce. International Conference on Very Large Data Bases, 2009. [13] S. R. Safavian and D. Landgrebe. A survey of decision tree classifier methodology. IEEE transactions on systems, man, and cybernetics, 21(3):660–674, 1991. [14] M. Stonebraker, D. J. Abadi, A. Batkin, X. Chen, M. Cherniack, M. Ferreira, E. Lau, A. Lin, S. Madden, E. O’Neil, et al. C-store: a column-oriented dbms. In Proceedings of the 31st international conference on Very large data bases, pages 553–564. VLDB Endowment, 2005. [15] K. M. Svore and C. Burges. Large-scale learning to rank using boosted decision trees. Scaling Up Machine Learning: Parallel and Distributed Approaches, 2, 2011. [16] J. Ye, J.-H. Chow, J. Chen, and Z. Zheng. Stochastic gradient boosted distributed decision trees. In Proceedings of the 18th ACM Conference on Information and Knowledge Management, CIKM ’09, pages 2061–2064, New York, NY, USA, 2009. ACM. ISBN 978-1-60558-5123. doi: 10.1145/1645953.1646301. URL http://doi.acm.org/10.1145/1645953. 1646301. 9
2016
367
6,291
Adaptive Maximization of Pointwise Submodular Functions With Budget Constraint Nguyen Viet Cuong1 Huan Xu2 1Department of Engineering, University of Cambridge, vcn22@cam.ac.uk 2Stewart School of Industrial & Systems Engineering, Georgia Institute of Technology, huan.xu@isye.gatech.edu Abstract We study the worst-case adaptive optimization problem with budget constraint that is useful for modeling various practical applications in artificial intelligence and machine learning. We investigate the near-optimality of greedy algorithms for this problem with both modular and non-modular cost functions. In both cases, we prove that two simple greedy algorithms are not near-optimal but the best between them is near-optimal if the utility function satisfies pointwise submodularity and pointwise cost-sensitive submodularity respectively. This implies a combined algorithm that is near-optimal with respect to the optimal algorithm that uses half of the budget. We discuss applications of our theoretical results and also report experiments comparing the greedy algorithms on the active learning problem. 1 Introduction Consider problems where we need to adaptively make a sequence of decisions while taking into account the outcomes of previous decisions. For instance, in the sensor placement problem [1, 2], one needs to sequentially place sensors at some pre-specified locations, taking into account the working conditions of previously deployed sensors. The aim is to cover as large an area as possible while keeping the cost of placement within a given budget. As another example, in the pool-based active learning problem [3, 4], one needs to sequentially select unlabeled examples and query their labels, taking into account the previously observed labels. The aim is to learn a good classifier while ensuring that the cost of querying does not exceed some given budget. These problems can usually be considered under the framework of adaptive optimization with budget constraint. In this framework, the objective is to find a policy for making decisions that maximizes the value of some utility function. With a budget constraint, such a policy must have a cost no higher than the budget given by the problem. Adaptive optimization with budget constraint has been previously studied in the average case [2, 5, 6] and worst case [7]. In this paper, we focus on this problem in the worst case. In contrast to previous works on adaptive optimization with budget constraint (both in the average and worst cases) [2, 8], we consider not only modular cost functions but also general, possibly non-modular, cost functions on sets of decisions. For example, in the sensor placement problem, the cost of a set of deployed sensors may be the weight of the minimum spanning tree connecting those sensors, where the weight of the edge between any two sensors is the distance between them.1 In this case, the cost of deploying a sensor is not fixed, but depends on the set of previously deployed sensors. This setting allows the cost function to be non-modular, and thus is more general than the setting in previous works, which usually assume the cost to be modular. 1This cost function is reasonable in practice if we think of it as the minimal necessary communication cost to keep the sensors connected (rather than the placement cost). 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. When cost functions are modular, we focus on the useful class of pointwise submodular utility functions [2, 7, 8] that has been applied to interactive submodular set cover and active learning problems [7, 8]. With this class of utilities, we investigate the near-optimality of greedy policies for worst-case adaptive optimization with budget constraint. A policy is near-optimal if its worst-case utility is within a constant factor of the optimal worst-case utility. We first consider two greedy policies: one that maximizes the worst-case utility gain and one that maximizes the worst-case utility gain per unit cost increment at each step. If the cost is uniform and modular, it is known that these two policies are equivalent and near-optimal [8]; however, we show in this paper that they cannot achieve near-optimality with non-uniform modular costs. Despite this negative result, we can prove that the best between these two greedy policies always achieves near-optimality. This suggests we can combine the two policies into one greedy policy that is near-optimal with respect to the optimal worst-case policy that uses half of the budget. We discuss applications of our theoretical results to the budgeted adaptive coverage problem and the budgeted pool-based active learning problem, both of which can be modeled as worst-case adaptive optimization problems with budget constraint. We also report experimental results comparing the greedy policies on the latter problem. When cost functions are general and possibly non-modular, we propose a novel class of utility functions satisfying a property called pointwise cost-sensitive submodularity. This property is a generalization of cost-sensitive submodularity to the adaptive setting. In essence, cost-sensitive submodularity means the utility is more submodular than the cost. Submodularity [9] and pointwise submodularity are special cases of cost-sensitive submodularity and pointwise cost-sensitive submodularity respectively when the cost is modular. With this new class of utilities, we prove similar near-optimality results for the greedy policies as in the case of modular costs. Our proofs build upon the proof techniques for worst-case adaptive optimization with uniform modular costs [8] and non-adaptive optimization with non-uniform modular costs [10] but go beyond them to handle general, possibly non-uniform and non-modular, costs. 2 Worst-case Adaptive Optimization with Budget Constraint We now formalize the framework for worst-case adaptive optimization with budget constraint. Let X be a finite set of items (or decisions) and Y be a finite set of possible states (or outcomes). Each item in X can be in any particular state in Y. Let h : X →Y be a deterministic function that maps each item x ∈X to its state h(x) ∈Y. We call h a realization. Let H ≜YX = {h | h : X →Y} be the realization set consisting of all possible realizations. We consider the problem where we sequentially select a subset of items from X as follows: we select an item, observe its state, then select the next item, observe its state, etc. After some iterations, our observations so far can be represented as a partial realization, which is a partial function from X to Y. An adaptive strategy to select items takes into account the states of all previous items when deciding the next item to select. Each adaptive strategy can be encoded as a deterministic policy for selecting items, where a policy is a function from a partial realization to the next item to select. A policy can be represented by a policy tree in which each node is an item to be selected and edges below a node correspond to its states. We assume there is a cost function c : 2X →R≥0, where 2X is the power set of X. For any set of items S ⊆X, c(S) is the cost incurred if we select the items in S and observe their states. For simplicity, we also assume c(∅) = 0 and c(S) > 0 for S ̸= ∅. If c is modular, then c(S) = P x∈S c({x}) for all S. In general, c can be non-modular. We shall consider the modular cost setting in Section 3 and the non-modular cost setting in Section 4. For a policy π, we define the cost of π as the maximum cost incurred by a set of items selected along any path of the policy tree of π. Note that if we fix a realization h, the set of items selected by the policy π is fixed, and we denote this set by xπ h. The set xπ h corresponds to a path of the policy tree of π, and thus the cost of π can be formally defined as c(π) ≜maxh∈H c(xπ h). In the worst-case adaptive optimization problem, we have a utility function f : 2X × H →R≥0 that we wish to maximize in the worst case. The utility function f(S, h) depends on a set S of selected items and a realization h that determines the states of all items. Essentially, f(S, h) denotes the value of selecting S, given that the true realization is h. We assume f(∅, h) = 0 for all h. For a policy π, we define its worst-case utility as fworst(π) ≜minh∈H f(xπ h, h). Given a budget K > 0, our goal is to find a policy π∗whose cost does not exceed K and π∗maximizes fworst. 2 Formally, π∗≜arg maxπ fworst(π) subject to c(π) ≤K. We call this the problem of worst-case adaptive optimization with budget constraint. 3 Modular Cost Setting In this section, we consider the setting where the cost function is modular. This setting is very common in the literature (e.g., see [2, 10, 11, 12]). We will describe the assumptions on the utility function, the greedy algorithms for worst-case adaptive optimization with budget constraint, and the analyses of these algorithms. Proofs in this section are given in the supplementary material. 3.1 Assumptions on the Utility Function Adaptive optimization with an arbitrary utility function is often infeasible, so we only focus on a useful class of utility functions: the pointwise monotone submodular functions. Recall that a set function g : 2X →R is submodular if it satisfies the following diminishing return property: for all A ⊆B ⊆X and x ∈X \ B, g(A ∪{x}) −g(A) ≥g(B ∪{x}) −g(B). Furthermore, g is monotone if g(A) ≤g(B) for all A ⊆B. In our setting, the utility function f(S, h) depends on both the selected items and the realization, and we assume it satisfies the pointwise submodularity, pointwise monotonicity, and minimal dependency properties below. Definition 1 (Pointwise Submodularity). A utility function f(S, h) is pointwise submodular if the set function fh(S) ≜f(S, h) is submodular for all h ∈H. Definition 2 (Pointwise Monotonicity). A utility function f(S, h) is pointwise monotone if the set function fh(S) ≜f(S, h) is monotone for all h ∈H. Definition 3 (Minimal Dependency). A utility function f(S, h) satisfies minimal dependency if the value of f(S, h) only depends on the items in S and their states (with respect to the realization h). These properties are useful for worst-case adaptive optimization and were also considered in [8] for uniform modular costs. Pointwise submodularity is an extension of submodularity and pointwise monotonicity is an extension of monotonicity to the adaptive setting. Minimal dependency is needed to make sure the value of f only depends on what have already been observed. Without this property, the value of f may be unpredictable and is hard to be reasoned about. The three assumptions above hold for practical utility functions that we will describe in Section 5.1. 3.2 Greedy Algorithms and Theoretical Results Our paper focuses on greedy algorithms (or greedy policies) to maximize the worst-case utility with a budget constraint. We are interested in a theoretical guarantee for these policies: the near-optimality guarantee. Specifically, a policy is near-optimal if its worst-case utility is within a constant factor of the optimal worst-case utility. In this section, we consider two intuitive greedy policies and prove that each of these policies is individually not near-optimal but the best between them will always be near-optimal. We shall also discuss a combined policy and its guarantee in this section. 3.2.1 Two Greedy Policies We consider two greedy policies in Figure 1. These policies are described in the general form and can be used for both modular and non-modular cost functions. In these policies, D is the partial realization that we have observed so far, and XD ≜{x ∈X | (x, y) ∈D for some y ∈Y} is the domain of D (i.e., the set of selected items in D). For any item x, we write δ(x | D) to denote the worst-case utility gain if x is selected after we observe D. That is, δ(x | D) ≜min y∈Y{f(XD ∪{x}, D ∪{(x, y)}) −f(XD, D)}. (1) In this definition, note that we have extended the utility function f to take a partial realization as the second parameter (instead of a full realization). This extension is possible because the utility function is assumed to satisfy minimal dependency, and thus its value only depends on the partial realization that we have observed so far. In the policy π1, for any item x ∈X and any S ⊆X, we define: ∆c(x | S) ≜c(S ∪{x}) −c(S), (2) which is the cost increment of selecting x after S has been selected. If the cost function c is modular, then ∆c(x | S) = c({x}). 3 Cost-average Greedy Policy π1: D ←∅; U ←X; repeat Pick x∗∈U that maximizes δ(x∗| D)/∆c(x∗| XD); if c(XD ∪{x∗}) ≤K then Observe state y∗of x∗; D ←D ∪{(x∗, y∗)}; end U ←U \ {x∗}; until U = ∅; Cost-insensitive Greedy Policy π2: D ←∅; U ←X; repeat Pick x∗∈U that maximizes δ(x∗| D); if c(XD ∪{x∗}) ≤K then Observe state y∗of x∗; D ←D ∪{(x∗, y∗)}; end U ←U \ {x∗}; until U = ∅; Figure 1: Two greedy policies for adaptive optimization with budget constraint. The two greedy policies in Figure 1 are intuitive. The cost-average policy π1 greedily selects the items that maximize the worst-case utility gain per unit cost increment if they are still affordable by the remaining budget. On the other hand, the cost-insensitive policy π2 simply ignores the items’ costs and greedily selects the affordable items that maximize the worst-case utility gain. Analyses of π1 and π2: Given the two greedy policies, we are interested in their near-optimality: whether they provide a constant factor approximation to the optimal worst-case utility. Unfortunately, we can show that these policies are not near-optimal. This negative result is stated in Theorem 1 below. The proof of this theorem constructs counter-examples where the policies are not near-optimal. Theorem 1. For any πi ∈{π1, π2} and α > 0, there exists a worst-case adaptive optimization problem with a utility f, a modular cost c, and a budget K such that f satisfies the assumptions in Section 3.1 and fworst(πi)/fworst(π∗) < α, where π∗is the optimal policy for the problem. 3.2.2 A Near-optimal Policy Although the greedy policies π1 and π2 are not near-optimal, we now show that the best between them is in fact near-optimal. More specifically, let us define a policy π such that: π ≜ π1 if fworst(π1) > fworst(π2) π2 otherwise . (3) Theorem 2 below states that π is near-optimal for the worst-case adaptive optimization problem with budget constraint. Theorem 2. Let f be a utility that satisfies the assumptions in Section 3.1 and π∗be the optimal policy for the worst-case adaptive optimization problem with utility f, a modular cost c, and a budget K. The policy π defined by Equation (3) satisfies fworst(π) > 1 2 (1 −1/e) fworst(π∗). The constant factor 1 2(1 −1/e) in Theorem 2 is slightly worse than the constant factor (1 −1/√e) for the non-adaptive budgeted maximum coverage problem [10]. If we apply this theorem to a problem with a uniform cost, i.e., c({x}) = c({x′}) for all x and x′, then π1 = π2 and fworst(π) = fworst(π1) = fworst(π2). Thus, from Theorem 2, fworst(π1) = fworst(π2) > 1 2 (1 −1/e) fworst(π∗). Although this implies the greedy policy is near-optimal, the constant factor 1 2 (1 −1/e) in this case is not as good as the constant factor (1 −1/e) in [8] for the uniform modular cost setting. We also note that Theorem 2 still holds if we replace the cost-insensitive policy π2 with only the first item that it selects (see its proof for details). In other words, we can terminate π2 right after it selects the first item and the near-optimality in Theorem 2 is still guaranteed. 3.2.3 A Combined Policy With Theorem 2, a naive approach to the worst-case adaptive optimization problem with budget constraint is to estimate fworst(π1) and fworst(π2) (without actually running these policies) and use the best between them. However, exact estimation of these quantities is intractable because it would require a consideration of all realizations (an exponential number of them) to find the worst-case realization for these policies. This is very different from the non-adaptive setting [10, 12, 13] where we can easily find the best policy because there is only one realization. Furthermore, in the adaptive setting, we cannot roll back once we run a policy. For example, we cannot run π1 and π2 at the same time to determine which one is better without doubling the budget. 4 This is because we have to pay the cost every time we want to observe the state of an item, and the next item selected would depend on the previous states. Thus, the adaptive setting in our paper is more difficult than the non-adaptive setting considered in previous works [10, 12, 13]. If we consider a Bayesian setting with some prior on the set of realizations [2, 4, 14], we can sample a subset of realizations from the prior to estimate fworst. However, this method does not provide any guarantee for the estimation. 1. Run π1 with budget K/2 (half of the total budget), and let the set of selected items be S1. 2. Starting with the empty set, run π2 with budget K/2 and let the set of items selected in this step be S2. For simplicity, we allow S2 to overlap with S1. 3. Return S1 ∪S2. Figure 2: The combined policy π1/2. Given these difficulties, a more practical approach is to run both π1 and π2 using half of the budget for each policy and combine the selected sets. Details of this combined policy (π1/2) are in Figure 2. Using Theorem 2, we can show that π1/2 is near-optimal compared to the optimal worst-case policy that uses half of the budget. Theorem 3 below states this result. We note that the theorem still holds if the order of running π1 and π2 is exchanged in the policy π1/2. Theorem 3. Assume the same setting as in Theorem 2. Let π∗ 1/2 be the optimal policy for the worst-case adaptive optimization problem with budget K/2. The policy π1/2 satisfies fworst(π1/2) > 1 2 (1 −1/e) fworst(π∗ 1/2). Since Theorem 3 only compares π1/2 with the optimal policy π∗ 1/2 that uses half of the budget, a natural question is whether or not the policies π1 and π2 running with the full budget have a similar guarantee compared to π∗ 1/2. Using the same counter-example for π2 in the proof of Theorem 1, we can easily show in Theorem 4 that this guarantee does not hold for the cost-insensitive policy π2. Theorem 4. For any α > 0, there exists a worst-case adaptive optimization problem with a utility f, a modular cost c, and a budget K such that f satisfies the assumptions in Section 3.1 and fworst(π2)/fworst(π∗ 1/2) < α, where π∗ 1/2 is the optimal policy for the problem with budget K/2. As regards the cost-average policy π1, it remains open whether running it with full budget provides any constant factor approximation to the worst-case utility of π∗ 1/2. However, in the supplementary material, we show that it is not possible to construct a counter-example for this case using a modular utility function, so a counter-example (if there is any) should use a more sophisticated utility. 4 Non-Modular Cost Setting We first define cost-sensitive submodularity, a generalization of submodularity that takes into account a general, possibly non-modular, cost on sets of items. We then state the assumptions on the utility function and the near-optimality results of the greedy algorithms for this setting. Cost-sensitive Submodularity: Let c be a general cost function that is strictly monotone, i.e., c(A) < c(B) for all A ⊂B. Hence, ∆c(x | S) > 0 for all S and x /∈S. Assume c satisfies the triangle inequality: c(A ∪B) ≤c(A) + c(B) for all A, B ⊆X. We define cost-sensitive submodularity as follows. Definition 4 (Cost-sensitive Submodularity). A set function g : 2X →R is cost-sensitively submodular w.r.t. a cost function c if it satisfies: for all A ⊆B ⊆X and x ∈X \ B, g(A ∪{x}) −g(A) ∆c(x | A) ≥g(B ∪{x}) −g(B) ∆c(x | B) . (4) In essence, cost-sensitive submodularity is a generalization of submodularity and means that g is more submodular than the cost c. When c is modular, cost-sensitive submodularity is equivalent to submodularity. If g is cost-sensitively submodular w.r.t. a submodular cost, it will also be submodular. Since c satisfies the triangle inequality, it cannot be super-modular but it can be non-submodular (see the supplementary for an example). We state some useful properties of cost-sensitive submodularity in Theorem 5. In this theorem, αg1 + βg2 is the function g(S) = αg1(S) + βg2(S) for all S ⊆X, and αc1 + βc2 is the function c(S) = αc1(S) + βc2(S) for all S ⊆X. The proof of this theorem is in the supplementary material. 5 Theorem 5. (a) If g1 and g2 are cost-sensitively submodular w.r.t. a cost function c, then αg1 + βg2 is also cost-sensitively submodular w.r.t. c for all α, β ≥0. (b) If g is cost-sensitively submodular w.r.t. cost functions c1 and c2, then g is also cost-sensitively submodular w.r.t. αc1 + βc2 for all α, β ≥0 such that α + β > 0. (c) For any integer n ≥1, if g is monotone and c(S) = Pn i=1 ai(g(S))i with non-negative coefficients ai ≥0 such that Pn i=1 ai > 0, then g is cost-sensitively submodular w.r.t. c. (d) If g is monotone and c(S) = αeg(S) for α > 0, then g is cost-sensitively submodular w.r.t. c. This theorem specifies various cases where a function g is cost-sensitively submodular w.r.t. a cost c. Note that neither g nor c needs to be submodular for this theorem to hold. Parts (a,b) state that cost-sensitive submodularity is preserved for linear combinations of either g or c. Parts (c,d) state that if c is a polynomial (respectively, exponential) of g with non-negative (respectively, positive) coefficients, then g is cost-sensitively submodular w.r.t. c. Assumptions on the Utility: In this setting, we also assume the utility f(S, h) satisfies pointwise monotonicity and minimal dependency. Furthermore, we assume it satisfies the pointwise costsensitive submodularity property below. This property is an extension of cost-sensitive submodularity to the adaptive setting and is also a generalization of pointwise submodularity for a general cost. If the cost is modular, pointwise cost-sensitive submodularity is equivalent to pointwise submodularity. Definition 5 (Pointwise Cost-sensitive Submodularity). A utility f(S, h) is pointwise cost-sensitively submodular w.r.t. a cost c if, for all h, fh(S) ≜f(S, h) is cost-sensitively submodular w.r.t. c. Theoretical Results: Under the above assumptions, near-optimality guarantees in Theorems 2 and 3 for the greedy algorithms in Section 3.2 still hold. This result is stated and proven in the supplementary material. The proof requires a sophisticated combination of the techniques for worstcase adaptive optimization with uniform modular costs [8] and non-adaptive optimization with non-uniform modular costs [10]. Unlike [10], our proof deals with policy trees instead of sets and we generalize previous techniques, originally used for modular costs, to handle general cost functions. 5 Applications and Experiments 5.1 Applications We discuss two applications of our theoretical results in this section: the budgeted adaptive coverage problem and the budgeted pool-based active learning problem. These problems were considered in [2] for the average case, while we study them here in the worst case where the difficulty, as shown above, is that simple policies such as π1 and π2 are not near-optimal as compared to the former case. Budgeted Adaptive Coverage: In this problem, we are given a set of locations where we need to place some sensors to get the spatial information of the surrounding environment. If sensors are deployed at a set of sensing locations, we have to pay a cost depending on where the locations are. After a sensor is deployed at a location, it may be in one of a few possible states (e.g., this may be caused by a partial failure of the sensor), leading to various degrees of information covered by the sensor. The budgeted adaptive coverage problem can be stated as: given a cost budget K, where should we place the sensors to cover as much spatial information as possible? We can model this problem as a worst-case adaptive optimization problem with budget K. Let X be the set of all possible locations where sensors may be deployed, and let Y be the set of all possible states of the sensors. For each set of locations S ⊆X, c(S) is the cost of deploying sensors there. For a location x and a state y, let Rx,y be the geometric shape associated with the spatial information covered if we put a sensor at x and its state is y. We can define the utility function f(S, h) = | S x∈S Rx,h(x)|, which is the cardinality (or volume) of the covered region. If we fix a realization h, this utility is monotone submodular [11]. Thus, f(S, h) is pointwise monotone submodular. Since this function also satisfies minimal dependency, we can apply the policy π1/2 to this problem and get the guarantee in Theorem 3 if the cost function c is modular. Budgeted Pool-based Active Learning: For pool-based active learning, we are given a finite set of unlabeled examples and need to adaptively query the labels of some selected examples from that set to train a classifier. Every time we query an example, we have to pay a cost and then get to see its label. In the next iteration, we can use the labels observed so far to select the next example to 6 Table 1: AUCs (normalized to [0,100]) of four learning policies. Data set 1 Data set 2 Data set 3 Cost PL LC ALC BLC PL LC ALC BLC PL LC ALC BLC R1 79.8 85.6 93.9 92.0 69.0 69.3 83.1 77.5 76.7 79.7 94.0 90.1 R2 80.7 85.0 63.0 63.6 70.9 70.4 50.5 51.8 78.6 82.6 51.9 54.7 M1 92.5 93.0 96.5 95.9 84.6 86.7 91.7 92.6 90.7 91.0 96.9 96.3 M2 86.9 87.4 91.2 90.1 72.5 73.1 62.1 67.4 79.4 86.3 74.1 78.2 query. The budgeted pool-based active learning problem can be stated as: given a budget K, which examples should we query to train a good classifier? We can model this problem as a worst-case adaptive optimization problem with budget K. Let X be the set of unlabeled examples and Y be the set of all possible labels. For each set of examples S ⊆X, c(S) is the cost of querying their labels. A realization h is a labeling of all examples in X. For pool-based active learning, previous works [2, 8, 14] have shown that the version space reduction utility is pointwise monotone submodular and satisfies minimal dependency. This utility is defined as f(S, h) = P h′:h′(S)̸=h(S) p0[h′], where p0 is a prior on H and h(S) is the labels of S according to h. Thus, we can apply π1/2 to this problem with the guarantee in Theorem 3 if the cost c is modular. With the utility above, the greedy criterion that maximizes δ(x∗| D) in the cost-insensitive policy π2 is equivalent to the well-known least confidence criterion x∗= arg minx maxy pD[y; x] = arg maxx miny{1 −pD[y; x]}, where pD is the posterior after observing D and pD[y; x] is the probability that x has label y. On the other hand, the greedy criterion that maximizes δ(x∗| D)/∆c(x∗| XD) in the cost-average policy π1 is equivalent to: x∗= arg max x miny{1 −pD[y; x]} ∆c(x | XD)  . (5) We prove this equation in the supplementary material. Theorem 3 can also be applied if we consider the total generalized version space reduction utility [8] that incorporates an arbitrary loss. This utility was also shown to be pointwise monotone submodular and satisfy minimal dependency [8], and thus the theorem still holds in this case for modular costs. 5.2 Experiments We present experimental results for budgeted pool-based active learning with various modular cost settings. We use 3 binary classification data sets extracted from the 20 Newsgroups data [15]: alt.atheism/comp.graphics (data set 1), comp.sys.mac.hardware/comp.windows.x (data set 2), and rec.motorcycles/rec.sport.baseball (data set 3). Since the costs are modular, they are put on individual examples, and the total cost is the sum of the selected examples’ costs. We will consider settings where random costs and margin-dependent costs are put on training data. We compare 4 data selection strategies: passive learning (PL), cost-insensitive greedy policy or least confidence (LC), cost-average greedy policy (ALC), and budgeted least confidence (BLC). LC and ALC have been discussed in Section 5.1, and BLC is the corresponding policy π1/2. These three strategies are active learning algorithms. For comparison, we train a logistic regression model with budgets 50, 100, 150, and 200, and approximate its area under the learning curve (AUC) using the accuracies on a separate test set. In Table 1, bold numbers indicate the best scores, and underlines indicate that BLC is the second best among the active learning algorithms. Experiments with Random Costs: In this setting, costs are put randomly to the training examples in 2 scenarios. In scenario R1, some random examples have a cost drawn from Gamma(80, 0.1) and the other examples have cost 1. From the results for this scenario in Table 1, ALC is better than LC and BLC is the second best among the active learning algorithms. In scenario R2, all examples with label 1 have a cost drawn from Gamma(45, 0.1) and the others (examples with label 0) have cost 1. From Table 1, LC is better than ALC in this scenario, which is due to the biasness of ALC toward examples with label 0. In this scenario, BLC is also the second best among the active learning algorithms, although it is still significantly worse than LC. Experiments with Margin-Dependent Costs: In this setting, costs are put on training examples based on their margins to a classifier trained on the whole data set. Specifically, we first train a logistic regression model on all the data and compute its probabilistic prediction for each training example. 7 The margin of an example is then the scaled distance between 0.5 and its probabilistic prediction. We also consider 2 scenarios. In scenario M1, we put higher costs on examples with lower margins. From Table 1, ALC is better than LC in this scenario. BLC performs better than both ALC and LC on data set 2, and performs the second best among the active learning algorithms on data sets 1 and 3. In scenario M2, we put higher costs on examples with larger margins. From Table 1, ALC is better than LC on data set 1, while LC is better than ALC on data sets 2 and 3. On all data sets, BLC is the second best among the active learning algorithms. Note that our experiments do not intend to show BLC is better than LC and ALC. In fact, our theoretical results somewhat state that either LC or ALC will perform well although we may not know which one is better. So, our experiments are to demonstrate some cases where one of these methods would perform badly, and BLC can be a more robust choice that often performs in-between these two methods. 6 Related Work Our work is related to [7, 8, 10, 12] but is more general than these works. Cuong et al. [8] considered a similar worst-case setting as ours, but they assumed the utility is pointwise submodular and the cost is uniform modular. Our work is more general than theirs in two aspects: (1) pointwise cost-sensitive submodularity is a generalization of pointwise submodularity, and (2) our cost function is general and may be neither uniform nor modular. These generalizations make the problem more complicated as simple greedy policies, which are near-optimal in [8], will not be near-optimal anymore (see Section 3.2). Thus, we need to combine two simple greedy policies to obtain a new near-optimal policy. Guillory & Bilmes [7] were the first to consider worst-case adaptive submodular optimization, particularly in the interactive submodular set cover problem [7, 16]. In [7], the utility is also pointwise submodular, and they look for a policy that can achieve at least a certain value of utility w.r.t. an unknown target realization while at the same time minimizing the cost of this policy. Their final utility, which is derived from the individual utilities of various realizations, is submodular. Our work, in contrast, tries to maximize the worst-case utility directly given a cost budget. Khuller et al. [10] considered the budgeted maximum coverage problem, which is the non-adaptive version of our problem with a modular cost. For this problem, they showed that the best between two non-adaptive greedy policies can achieve near-optimality compared to the optimal non-adaptive policy. Similar results were also shown in [13] with a better constant and in [12] for the outbreak detection problem. Our work is a generalization of [10, 12] to the adaptive setting with general cost functions, and we can achieve the same constant factor as [12]. Furthermore, the class of utility functions in our work is even more general than the coverage utilities in these works. Our concept of cost-sensitive submodularity is a generalization of submodularity [9] for general costs. Submodularity has been successfully applied to many applications [1, 17, 18, 19, 20]. Besides pointwise submodularity, there are other ways to extend submodularity to the adaptive setting, e.g., adaptive submodularity [2, 21, 22] and approximately adaptive submodularity [23]. For adaptive submodular utilities, Golovin & Krause [2] proved that greedily maximizing the average utility gain in each step is near-optimal in both average and worst cases. However, neither pointwise submodularity implies adaptive submodularity nor vice versa. Thus, our assumptions in this paper can be applied to a different class of utilities than those in [2]. 7 Conclusion We studied worst-case adaptive optimization with budget constraint, where the cost can be either modular or non-modular and the utility satisfies pointwise submodularity or pointwise cost-sensitive submodularity respectively. We proved a negative result about two greedy policies for this problem but also showed a positive result for the best between them. We used this result to derive a combined policy which is near-optimal compared to the optimal policy that uses half of the budget. We discussed applications of our theoretical results and reported experiments for the greedy policies on the pool-based active learning problem. Acknowledgments This work was done when both authors were at the National University of Singapore. The authors were partially supported by the Agency for Science, Technology and Research (A*STAR) of Singapore through SERC PSF Grant R266000101305. 8 References [1] Andreas Krause and Carlos Guestrin. Nonmyopic active learning of Gaussian processes: An exploration-exploitation approach. In ICML, 2007. [2] Daniel Golovin and Andreas Krause. Adaptive submodularity: Theory and applications in active learning and stochastic optimization. JAIR, 2011. [3] Andrew McCallum and Kamal Nigam. Employing EM and pool-based active learning for text classification. In ICML, 1998. [4] Nguyen Viet Cuong, Nan Ye, and Wee Sun Lee. Robustness of Bayesian pool-based active learning against prior misspecification. In AAAI, 2016. [5] Brian C. Dean, Michel X. Goemans, and J. Vondrdk. Approximating the stochastic knapsack problem: The benefit of adaptivity. In FOCS, 2004. [6] Arash Asadpour, Hamid Nazerzadeh, and Amin Saberi. Stochastic submodular maximization. In Internet and Network Economics. 2008. [7] Andrew Guillory and Jeff Bilmes. Interactive submodular set cover. In ICML, 2010. [8] Nguyen Viet Cuong, Wee Sun Lee, and Nan Ye. Near-optimal adaptive pool-based active learning with general loss. In UAI, 2014. [9] G. L. Nemhauser and L. A. Wolsey. Best algorithms for approximating the maximum of a submodular set function. Mathematics of Operations Research, 3(3):177–188, 1978. [10] Samir Khuller, Anna Moss, and Joseph SeffiNaor. The budgeted maximum coverage problem. Information Processing Letters, 70(1):39–45, 1999. [11] Andreas Krause and Carlos Guestrin. Near-optimal observation selection using submodular functions. In AAAI, 2007. [12] Jure Leskovec, Andreas Krause, Carlos Guestrin, Christos Faloutsos, Jeanne VanBriesen, and Natalie Glance. Cost-effective outbreak detection in networks. In KDD, 2007. [13] Maxim Sviridenko. A note on maximizing a submodular set function subject to a knapsack constraint. Operations Research Letters, 32(1):41–43, 2004. [14] Nguyen Viet Cuong, Wee Sun Lee, Nan Ye, Kian Ming A. Chai, and Hai Leong Chieu. Active learning for probabilistic hypotheses using the maximum Gibbs error criterion. In NIPS, 2013. [15] Thorsten Joachims. A probabilistic analysis of the Rocchio algorithm with TFIDF for text categorization. DTIC Document, 1996. [16] Andrew Guillory and Jeff A. Bilmes. Simultaneous learning and covering with adversarial noise. In ICML, 2011. [17] Andreas Krause and Carlos Guestrin. Submodularity and its applications in optimized information gathering. ACM Transactions on Intelligent Systems and Technology, 2(4):32, 2011. [18] Andrew Guillory and Jeff A. Bilmes. Online submodular set cover, ranking, and repeated active learning. In NIPS, 2011. [19] Andrew Guillory. Active Learning and Submodular Functions. PhD thesis, University of Washington, 2012. [20] Kai Wei, Rishabh Iyer, and Jeff Bilmes. Submodularity in data subset selection and active learning. In ICML, 2015. [21] Shervin Javdani, Yuxin Chen, Amin Karbasi, Andreas Krause, Drew Bagnell, and Siddhartha S. Srinivasa. Near optimal Bayesian active learning for decision making. In AISTATS, 2014. [22] Alkis Gotovos, Amin Karbasi, and Andreas Krause. Non-monotone adaptive submodular maximization. In IJCAI, 2015. [23] Matt J. Kusner. Approximately adaptive submodular maximization. In NIPS Workshop on Discrete and Combinatorial Problems in Machine Learning, 2014. 9
2016
368
6,292
Guided Policy Search via Approximate Mirror Descent William Montgomery Dept. of Computer Science and Engineering University of Washington wmonty@cs.washington.edu Sergey Levine Dept. of Computer Science and Engineering University of Washington svlevine@cs.washington.edu Abstract Guided policy search algorithms can be used to optimize complex nonlinear policies, such as deep neural networks, without directly computing policy gradients in the high-dimensional parameter space. Instead, these methods use supervised learning to train the policy to mimic a “teacher” algorithm, such as a trajectory optimizer or a trajectory-centric reinforcement learning method. Guided policy search methods provide asymptotic local convergence guarantees by construction, but it is not clear how much the policy improves within a small, finite number of iterations. We show that guided policy search algorithms can be interpreted as an approximate variant of mirror descent, where the projection onto the constraint manifold is not exact. We derive a new guided policy search algorithm that is simpler and provides appealing improvement and convergence guarantees in simplified convex and linear settings, and show that in the more general nonlinear setting, the error in the projection step can be bounded. We provide empirical results on several simulated robotic navigation and manipulation tasks that show that our method is stable and achieves similar or better performance when compared to prior guided policy search methods, with a simpler formulation and fewer hyperparameters. 1 Introduction Policy search algorithms based on supervised learning from a computational or human “teacher” have gained prominence in recent years due to their ability to optimize complex policies for autonomous flight [16], video game playing [15, 4], and bipedal locomotion [11]. Among these methods, guided policy search algorithms [6] are particularly appealing due to their ability to adapt the teacher to produce data that is best suited for training the final policy with supervised learning. Such algorithms have been used to train complex deep neural network policies for vision-based robotic manipulation [6], as well as a variety of other tasks [19, 11]. However, convergence results for these methods typically follow by construction from their formulation as a constrained optimization, where the teacher is gradually constrained to match the learned policy, and guarantees on the performance of the final policy only hold at convergence if the constraint is enforced exactly. This is problematic in practical applications, where such algorithms are typically executed for a small number of iterations. In this paper, we show that guided policy search algorithms can be interpreted as approximate variants of mirror descent under constraints imposed by the policy parameterization, with supervised learning corresponding to a projection onto the constraint manifold. Based on this interpretation, we can derive a new, simplified variant of guided policy search, which corresponds exactly to mirror descent under linear dynamics and convex policy spaces. When these convexity and linearity assumptions do not hold, we can show that the projection step is approximate, up to a bound that depends on the step size of the algorithm, which suggests that for a small enough step size, we can achieve continuous improvement. The form of this bound provides us with intuition about how to adjust the step size in practice, so as to obtain a simple algorithm with a small number of hyperparameters. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. Algorithm 1 Generic guided policy search method 1: for iteration k ∈{1, . . . , K} do 2: C-step: improve each pi(ut|xt) based on surrogate cost ˜ℓi(xt, ut), return samples Di 3: S-step: train πθ(ut|xt) with supervised learning on the dataset D = ∪iDi 4: Modify ˜ℓi(xt, ut) to enforce agreement between πθ(ut|xt) and each p(ut|xt) 5: end for The main contribution of this paper is a simple new guided policy search algorithm that can train complex, high-dimensional policies by alternating between trajectory-centric reinforcement learning and supervised learning, as well as a connection between guided policy search methods and mirror descent. We also extend previous work on bounding policy cost in terms of KL divergence [15, 17] to derive a bound on the cost of the policy at each iteration, which provides guidance on how to adjust the step size of the method. We provide empirical results on several simulated robotic navigation and manipulation tasks that show that our method is stable and achieves similar or better performance when compared to prior guided policy search methods, with a simpler formulation and fewer hyperparameters. 2 Guided Policy Search Algorithms We first review guided policy search methods and background. Policy search algorithms aim to optimize a parameterized policy πθ(ut|xt) over actions ut conditioned on the state xt. Given stochastic dynamics p(xt+1|xt, ut) and cost ℓ(xt, ut), the goal is to minimize the expected cost under the policy’s trajectory distribution, given by J(θ) = PT t=1 Eπθ(xt,ut)[ℓ(xt, ut)], where we overload notation to use πθ(xt, ut) to denote the marginals of πθ(τ) = p(x1) QT t=1 p(xt+1|xt, ut)πθ(ut|xt), where τ = {x1, u1, . . . , xT , uT } denotes a trajectory. A standard reinforcement learning (RL) approach to policy search is to compute the gradient ∇θJ(θ) and use it to improve J(θ) [18, 14]. The gradient is typically estimated using samples obtained from the real physical system being controlled, and recent work has shown that such methods can be applied to very complex, high-dimensional policies such as deep neural networks [17, 10]. However, for complex, high-dimensional policies, such methods tend to be inefficient, and practical real-world applications of such model-free policy search techniques are typically limited to policies with about one hundred parameters [3]. Instead of directly optimizing J(θ), guided policy search algorithms split the optimization into a “control phase” (which we’ll call the C-step) that finds multiple simple local policies pi(ut|xt) that can solve the task from different initial states xi 1 ∼p(x1), and a “supervised phase” (S-step) that optimizes the global policy πθ(ut|xt) to match all of these local policies using standard supervised learning. In fact, a variational formulation of guided policy search [7] corresponds to the EM algorithm, where the C-step is actually the E-step, and the S-step is the M-step. The benefit of this approach is that the local policies pi(ut|xt) can be optimized separately using domain-specific local methods. Trajectory optimization might be used when the dynamics are known [19, 11], while local RL methods might be used with unknown dynamics [5, 6], which still requires samples from the real system, though substantially fewer than the direct approach, due to the simplicity of the local policies. This sample efficiency is the main advantage of guided policy search, which can train policies with nearly a hundred thousand parameters for vision-based control using under 200 episodes [6], in contrast to direct deep RL methods that might require orders of magnitude more experience [17, 10]. A generic guided policy search method is shown in Algorithm 1. The C-step invokes a local policy optimizer (trajectory optimization or local RL) for each pi(ut|xt) on line 2, and the S-step uses supervised learning to optimize the global policy πθ(ut|xt) on line 3 using samples from each pi(ut|xt), which are generated during the C-step. On line 4, the surrogate cost ˜ℓi(xt, ut) for each pi(ut|xt) is adjusted to ensure convergence. This step is crucial, because supervised learning does not in general guarantee that πθ(ut|xt) will achieve similar long-horizon performance to pi(ut|xt) [15]. The local policies might not even be reproducible by a single global policy in general. To address this issue, most guided policy search methods have some mechanism to force the local policies to agree with the global policy, typically by framing the entire algorithm as a constrained optimization that seeks at convergence to enforce equality between πθ(ut|xt) and each pi(ut|xt). The form of the 2 overall optimization problem resembles dual decomposition, and usually looks something like this: min θ,p1,...,pN N X i=1 T X t=1 Epi(xt,ut)[ℓ(xt, ut)] such that pi(ut|xt) = πθ(ut|xt) ∀xt, ut, t, i. (1) Since xi 1 ∼p(x1), we have J(θ) ≈PN i=1 PT t=1 Epi(xt,ut)[ℓ(xt, ut)] when the constraints are enforced exactly. The particular form of the constraint varies depending on the method: prior works have used dual gradient descent [8], penalty methods [11], ADMM [12], and Bregman ADMM [6]. We omit the derivation of these prior variants due to space constraints. 2.1 Efficiently Optimizing Local Policies A common and simple choice for the local policies pi(ut|xt) is to use time-varying linear-Gaussian controllers of the form pi(ut|xt) = N(Ktxt + kt, Ct), though other options are also possible [12, 11, 19]. Linear-Gaussian controllers represent individual trajectories with linear stabilization and Gaussian noise, and are convenient in domains where each local policy can be trained from a different (but consistent) initial state xi 1 ∼p(x1). This represents an additional assumption beyond standard RL, but allows for an extremely efficient and convenient local model-based RL algorithm based on iterative LQR [9]. The algorithm proceeds by generating N samples on the real physical system from each local policy pi(ut|xt) during the C-step, using these samples to fit local linear-Gaussian dynamics for each local policy of the form pi(xt+1|xt, ut) = N(fxtxt + futut + fct, Ft) using linear regression, and then using these fitted dynamics to improve the linear-Gaussian controller via a modified LQR algorithm [5]. This modified LQR method solves the following optimization problem: min Kt,kt,Ct T X t=1 Epi(xt,ut)[˜ℓi(xt, ut)] such that DKL(pi(τ)∥¯pi(τ)) ≤ϵ, (2) where we again use pi(τ) to denote the trajectory distribution induced by pi(ut|xt) and the fitted dynamics pi(xt+1|xt, ut). Here, ¯pi(ut|xt) denotes the previous local policy, and the constraint ensures that the change in the local policy is bounded, as proposed also in prior works [1, 14, 13]. This is particularly important when using linearized dynamics fitted to local samples, since these dynamics are not valid outside of a small region around the current controller. In the case of linearGaussian dynamics and policies, the KL-divergence constraint DKL(pi(τ)∥¯pi(τ)) ≤ϵ can be shown to simplify, as shown in prior work [5] and Appendix A: DKL(pi(τ)∥¯pi(τ))= T X t=1 DKL(pi(ut|xt)∥¯pi(ut|xt))= T X t=1 −Epi(xt,ut)[log ¯pi(ut|xt)]−H(pi(ut|xt)), and the resulting Lagrangian of the problem in Equation (2) can be optimized with respect to the primal variables using the standard LQR algorithm, which suggests a simple method for solving the problem in Equation (2) using dual gradient descent [5]. The surrogate objective ˜ℓi(xt, ut) = ℓ(xt, ut)+φi(θ) typically includes some term φi(θ) that encourages the local policy pi(ut|xt) to stay close to the global policy πθ(ut|xt), such as a KL-divergence of the form DKL(pi(ut|xt)∥πθ(ut|xt)). 2.2 Prior Convergence Results Prior work on guided policy search typically shows convergence by construction, by framing the C-step and S-step as block coordinate ascent on the (augmented) Lagrangian of the problem in Equation (1), with the surrogate cost ˜ℓi(xt, ut) for the local policies corresponding to the (augmented) Lagrangian, and the overall algorithm being an instance of dual gradient descent [8], ADMM [12], or Bregman ADMM [6]. Since these methods enforce the constraint pi(ut|xt) = πθ(ut|xt) at convergence (up to linearization or sampling error, depending on the method), we know that 1 N PN i=1 Epi(xt,ut)[ℓ(xt, ut)] ≈Eπθ(xt,ut)[ℓ(xt, ut)] at convergence.1 However, prior work does not say anything about πθ(ut|xt) at intermediate iterations, and the constraints of policy search in the real world might often preclude running the method to full convergence. We propose a simplified variant of guided policy search, and present an analysis that sheds light on the performance of both the new algorithm and prior guided policy search methods. 1As mentioned previously, the initial state xi 1 of each local policy pi(ut|xt) is assumed to be drawn from p(x1), hence the outer sum corresponds to Monte Carlo integration of the expectation under p(x1). 3 Algorithm 2 Mirror descent guided policy search (MDGPS): convex linear variant 1: for iteration k ∈{1, . . . , K} do 2: C-step: pi ←arg minpi Epi(τ) hPT t=1 ℓ(xt, ut) i such that DKL(pi(τ)∥πθ(τ)) ≤ϵ 3: S-step: πθ ←arg minθ P i DKL(pi(τ)∥πθ(τ)) (via supervised learning) 4: end for 3 Mirror Descent Guided Policy Search In this section, we propose our new simplified guided policy search, which we term mirror descent guided policy search (MDGPS). This algorithm uses the constrained LQR optimization in Equation (2) to optimize each of the local policies, but instead of constraining each local policy pi(ut|xt) against the previous local policy ¯pi(ut|xt), we instead constraint it directly against the global policy πθ(ut|xt), and simply set the surrogate cost to be the true cost, such that ˜ℓi(xt, ut) = ℓ(xt, ut). The method is summarized in Algorithm 2. In the case of linear dynamics and a quadratic cost (i.e. the LQR setting), and assuming that supervised learning can globally solve a convex optimization problem, we can show that this method corresponds to an instance of mirror descent [2] on the objective J(θ). In this formulation, the optimization is performed on the space of trajectory distributions, with a constraint that the policy must lie on the manifold of policies with the chosen parameterization. Let ΠΘ be the set of all possible policies πθ for a given parameterization, where we overload notation to also let ΠΘ denote the set of trajectory distributions that are possible under the chosen parameterization. The return J(θ) can be optimized according to πθ ←arg minπ∈ΠΘ Eπ(τ)[PT t=1 ℓ(xt, ut)]. Mirror descent solves this optimization by alternating between two steps at each iteration k: pk ←arg min p Ep(τ) " T X t=1 ℓ(xt, ut) # s. t. D p, πk ≤ϵ, πk+1 ←arg min π∈ΠΘ D pk, π  . The first step finds a new distribution pk that minimizes the cost and is close to the previous policy πk in terms of the divergence D p, πk , while the second step projects this distribution onto the constraint set ΠΘ, with respect to the divergence D(pk, π). In the linear-quadratic case with a convex supervised learning phase, this corresponds exactly to Algorithm 2: the C-step optimizes pk, while the S-step is the projection. Monotonic improvement of the global policy πθ follows from the monotonic improvement of mirror descent [2]. In the case of linear-Gaussian dynamics and policies, the S-step, which minimizes KL-divergence between trajectory distributions, in fact only requires minimizing the KL-divergence between policies. Using the identity in Appendix A, we know that DKL(pi(τ)∥πθ(τ)) = T X t=1 Epi(xt) [DKL(pi(ut|xt)∥πθ(ut|xt))] . (3) 3.1 Implementation for Nonlinear Global Policies and Unknown Dynamics In practice, we aim to optimize complex policies for nonlinear systems with unknown dynamics. This requires a few practical considerations. The C-step requires a local quadratic cost function, which can be obtained via Taylor expansion, as well as local linear-Gaussian dynamics p(xt+1|xt, ut) = N(fxtxt + futut + fct, Ft), which we can fit to samples as in prior work [5]. We also need a local time-varying linear-Gaussian approximation to the global policy πθ(ut|xt), denoted ¯πθi(ut|xt). This can be obtained either by analytically differentiating the policy, or by using the same linear regression method that we use to estimate p(xt+1|xt, ut), which is the approach in our implementation. In both cases, we get a different global policy linearization around each local policy. Following prior work [5], we use a Gaussian mixture model prior for both the dynamics and global policy fit. The S-step can be performed approximately in the nonlinear case by using the samples collected for dynamics fitting to also train the global policy. Following prior work [6], our S-step minimizes2 X i,t Epi(xt) [DKL(πθ(ut|xt)∥pi(ut|xt))] ≈ 1 |Di| X i,t,j DKL(πθ(ut|xt,i,j)∥pi(ut|xt,i,j)), 2Note that we flip the KL-divergence inside the expectation, following [6]. We found that this produced better results. The intuition behind this is that, because log pi(ut|xt) is proportional to the Q-function of pi(ut|xt) (see Appendix B.1), DKL(πθ(ut|xt,i,j)∥pi(ut|xt,i,j) minimizes the cost-to-go under pi(ut|xt) with respect to πθ(ut|xt), which provides for a more informative objective than the unweighted likelihood in Equation (3). 4 Algorithm 3 Mirror descent guided policy search (MDGPS): unknown nonlinear dynamics 1: for iteration k ∈{1, . . . , K} do 2: Generate samples Di = {τi,j} by running either pi or πθi 3: Fit linear-Gaussian dynamics pi(xt+1|xt, ut) using samples in Di 4: Fit linearized global policy ¯πθi(ut|xt) using samples in Di 5: C-step: pi ←arg minpi Epi(τ)[PT t=1 ℓ(xt, ut)] such that DKL(pi(τ)∥¯πθi(τ)) ≤ϵ 6: S-step: πθ ←arg minθ P t,i,j DKL(πθ(ut|xt,i,j)∥pi(ut|xt,i,j)) (via supervised learning) 7: Adjust ϵ (see Section 4.2) 8: end for where xt,i,j is the jth sample from pi(xt) obtained by running pi(ut|xt) on the real system. For linear-Gaussian pi(ut|xt) and (nonlinear) conditionally Gaussian πθ(ut|xt) = N(µπ(xt), Σπ(xt)), where µπ and Σπ can be any function (such as a deep neural network), the KL-divergence DKL(πθ(ut|xt,i,j)∥pi(ut|xt,i,j)) can easily be evaluated and differentiated in closed form [6]. However, in the nonlinear setting, minimizing this objective no longer minimizes the KL-divergence between trajectory distributions DKL(πθ(τ)∥pi(τ)) exactly, which means that MDGPS does not correspond exactly to mirror descent: although the C-step can still be evaluated exactly, the S-step now corresponds to an approximate projection onto the constraint manifold. In the next section, we discuss how we can bound the error in this projection. A summary of the nonlinear MDGPS method is provided in Algorithm 4, and additional details are in Appendix B. The samples for linearizing the dynamics and policy can be obtained by running either the last local policy pi(ut|xt), or the last global policy πθ(ut|xt). Both variants produce good results, and we compare them in Section 6. 3.2 Analysis of Prior Guided Policy Search Methods as Approximate Mirror Descent The main distinction between the proposed method and prior guided policy search methods is that the constraint DKL(pi(τ)∥¯πθi(τ)) ≤ϵ is enforced on the local policies at each iteration, while in prior methods, this constraint is iteratively enforced via a dual descent procedure over multiple iterations. This means that the prior methods perform approximate mirror descent with step sizes that are adapted (by adjusting the Lagrange multipliers) but not constrained exactly. In our empirical evaluation, we show that our approach is somewhat more stable, though sometimes slower than these prior methods. This empirical observation agrees with our intuition: prior methods can sometimes be faster, because they do not exactly constrain the step size, but our method is simpler, requires less tuning, and always takes bounded steps on the global policy in trajectory space. 4 Analysis in the Nonlinear Case Although the S-step under nonlinear dynamics is not an optimal projection onto the constraint manifold, we can bound the additional cost incurred by this projection in terms of the KL-divergence between pi(ut|xt) and πθ(ut|xt). This analysis also reveals why prior guided policy search algorithms, which only have asymptotic convergence guarantees, still attain good performance in practice even after a small number of iterations. We will drop the subscript i from pi(ut|xt) in this section for conciseness, though the same analysis can be repeated for multiple local policies pi(ut|xt). 4.1 Bounding the Global Policy Cost The analysis in this section is based on the following lemma, which we prove in Appendix C.1, building off of earlier results by Ross et al. [15] and Schulman et al. [17]: Lemma 4.1 Let ϵt = maxxt DKL(p(ut|xt)∥πθ(ut|xt). Then DTV(p(xt)∥πθ(xt)) ≤2 PT t=1 √2ϵt. This means that if we can bound the KL-divergence between the policies, then the total variation divergence between their state marginals (given by DTV(p(xt)∥πθ(xt)) = 1 2∥p(xt) −πθ(xt)∥1) will also be bounded. This bound allows us in turn to relate the total expected costs of the two policies to each other according to the following lemma, which we prove in Appendix C.2: 5 Lemma 4.2 If DTV(p(xt)∥πθ(xt)) ≤2 PT t=1 √2ϵt, then we can bound the total cost of πθ as T X t=1 Eπθ(xt,ut)[ℓ(xt, ut)] ≤ T X t=1  Ep(xt,ut)[ℓ(xt, ut)] + √ 2ϵt max xt,ut ℓ(xt, ut) + 2 √ 2ϵtQmax,t  where Qmax,t = PT t′=t maxxt′,ut′ ℓ(xt′, ut′), the maximum total cost from time t to T. This bound on the cost of πθ(ut|xt) tells us that if we update p(ut|xt) so as to decrease its total cost or decrease its KL-divergence against πθ(ut|xt), we will eventually reduce the cost of πθ(ut|xt). For the MDGPS algorithm, this bound suggests that we can ensure improvement of the global policy within a small number of iterations by appropriately choosing the constraint ϵ during the C-step. Recall that the C-step constrains PT t=1 ϵt ≤ϵ, so if we choose ϵ to be small enough, we can close the gap between the local and global policies. Optimizing the bound directly turns out to produce very slow learning in practice, because the bound is very loose. However, it tells us that we can either decrease ϵ toward the end of the optimization process or if we observe the global policy performing much worse than the local policies. We discuss how this idea can be put into action in the next section. 4.2 Step Size Selection Setting the local policy step size ϵ is important for proper convergence of guided policy search methods. Since we are approximating the true unknown dynamics with time-varying linear dynamics, setting ϵ too large can produce unstable local policies which cause the method to fail. However, setting ϵ too small will prevent the local policies from improving significantly between iterations, leading to slower learning rates. In prior work [8], the step size ϵ in the local policy optimization is dynamically adjusted by considering the difference between the predicted change in the cost of the local policy p(ut|xt) under the fitted dynamics, and the actual cost obtained when sampling from that policy. The intuition is that, because the linearized dynamics are local, we incur a larger cost the further we deviate from the previous policy. We can adjust the step size by estimating the rate at which the additional cost is incurred and choosing the optimal tradeoff. In Appendix B.3 we describe the step size adjustment rule used for BADMM in prior work, and use it to derive two step size adjustment rules for MDGPS: “classic” and “global.” The classic step size adjustment is a direct reintrepretation of the BADMM step rule for MDGPS, while the global step rule is a more conservative rule that takes the difference between the global and local policies into account. 5 Relation to Prior Work While we’ve discussed the connections between MDGPS and prior guided policy search methods, in this section we’ll also discuss the connections between our method and other policy search methods. One popular supervised policy learning methods is DAGGER [15], which also trains the policy using supervised learning, but does not attempt to adapt the teacher to provide better training data. MDGPS removes the assumption in DAGGER that the supervised learning stage has bounded error against an arbitrary teacher policy. MDGPS does not need to make this assumption, since the teacher can be adapted to the limitations of the global policy learning. This is particularly important when the global policy has computational or observational limitations, such as when learning to use camera images for partially observed control tasks or, as shown in our evaluation, blind peg insertion. When we sample from the global policy πθ(ut|xt), our method resembles policy gradient methods with KL-divergence constraints [14, 13, 17]. However, policy gradient methods update the policy πθ(ut|xt) at each iteration by linearizing with respect to the policy parameters, which often requires small steps for complex, nonlinear policies, such as neural networks. In contrast, we linearize in the space of time-varying linear dynamics, while the policy is optimized at each iteration with many steps of supervised learning (e.g. stochastic gradient descent). This makes MDGPS much better suited for quickly and efficiently training highly nonlinear, high-dimensional policies. 6 Figure 1: Results for MDGPS variants and BADMM on each task. MDGPS is tested with local policy (“off policy”) and global policy (“on policy”) sampling (see Section 3.1), and both the “classic” and “global” step sizes (see Section 4.2). The vertical axis for the obstacle task shows the average distance between the point mass and the target. The vertical axis for the peg tasks shows the average distance between the bottom of the peg and the hole. Distances above 0.1, which is the depth of the hole (shown as a dotted line) indicate failure. All experiments are repeated ten times, with the average performance and standard deviation shown in the plots. 6 Experimental Evaluation We compare several variants of MDGPS and a prior guided policy search method based on Bregman ADMM (BADMM) [6]. We evaluate all methods on one simulated robotic navigation task and two manipulation tasks. For MDGPS, during training we sample from either the local policies (“off-policy” sampling) or the global policy (“on-policy” sampling), and we use both forms of the step rule described in Section 4.2 (“classic” and “global”). 3 Obstacle Navigation. In this task, a 2D point mass (grey) must navigate around obstacles to reach a target (shown in green), using velocities and positions relative to the target. We use N = 5 initial states, with 5 samples per initial state per iteration. The target and obstacles are fixed, but the starting position varies. Peg Insertion. This task, which is more complex, requires controlling a 7 DoF 3D arm to insert a tight-fitting peg into a hole. The hole can be in different positions, and the state consists of joint angles, velocities, and end-effector positions relative to the target. This task is substantially more challenging physically. We use N = 9 different hole positions, with 5 samples per initial state per iteration. Blind Peg Insertion. The last task is a blind variant of the peg insertion task, where the target-relative end effector positions are provided to the local policies, but not to the global policy πθ(ut|xt). This requires the global policy to search for the hole, since no input to the global policy can distinguish between the different initial state xi 1. This makes it much more challenging to adapt the global and local policies to each other, and makes it impossible for the global learner to succeed without adaptation of the local policies. We use N = 4 different hole positions, with 5 samples per initial state per iteration. The global policy for each task consists of a fully connected neural network with two hidden layers with 40 rectified linear units. The same settings are used for MDGPS and the prior BADMM-based method, except for the difference in surrogate costs, constraints, and step size adjustment methods discussed in the paper. Results are presented in Figure 1 and Table 1. On the easier point mass navigation task all methods achieve similar performance, but the on-policy variants of MDGPS outperform the off-policy variants. This suggests that we can benefit from directly sampling from the global policy during training, which is not possible in the BADMM formulation. Although performance is similar among all methods, the MDGPS methods are all substantially easier to apply to these tasks, since they have very few free hyperparameters. An initial step size must be selected, but the adaptive step size adjustment rules make this choice less important. In contrast, 3Guided policy search code, including BADMM and MDGPS methods, is available at https://www.github.com/cbfinn/gps. 7 Itr. BADMM Off/Classic Off/Global On/Classic On/Global Peg 3 1.1% ± 3.3% 11.1 ± 9.9% 6.7% ± 7.4% 6.7% ± 7.4% 6.7% ± 7.4% 6 51.1% ± 10.2% 62.2 ± 17.4% 64.4% ± 19.1% 68.9% ± 18.5% 63.3% ± 20.0% 9 72.2% ± 14.3% 82.2 ± 11.3% 71.1% ± 24.0% 90.0% ± 10.5% 85.6% ± 8.7% 12 74.4% ± 19.3% 83.3 ± 11.4% 84.4% ± 15.1% 90.0% ± 11.6% 87.8% ± 13.6% Blind Peg 3 20.0% ± 31.2% 2.5 ± 7.5% 7.5% ± 16.0% 2.5% ± 7.5% 15.0% ± 30.0% 6 65.0% ± 22.9% 62.5 ± 32.1% 70.0% ± 21.8% 72.5% ± 28.4% 70.0% ± 35.0% 9 82.5% ± 25.1% 80.0 ± 24.5% 60.0% ± 32.0% 80.0% ± 35.0% 82.5% ± 19.5% 12 82.5% ± 16.1% 95.0 ± 10.0% 85.0% ± 22.9% 85.0% ± 20.0% 85.0% ± 12.2% Table 1: Success rates of each method on each peg insertion task. Success is defined as inserting the peg into the hole with a final distance of less than 0.06. Results are averaged over ten runs. the BADMM method requires choosing an initial weight on the augmented Lagrangian term, an adjustment schedule for this term, a step size on the dual variables, and a step size for local policies, all of which have a substantial impact on the final performance of the method (the reported results are for the best setting of these parameters, identified with a hyperparameter sweep). On the peg insertion tasks, all variants MDGPS consistently outperform BADMM as shown by the success rates in Table 1, which shows that the MDGPS policies succeed at actually inserting the peg into the hole more often and on more conditions. This suggests that our method is better able to improve global policies, particularly in situations where informational or representational constraints make naïve imitation of the local policies insufficient to solve the task. On both tasks, we see faster learning from the on-policy variants, although this is less noticeable on the harder blind peg insertion task, where the best final policy is the off-policy variant with classic step size adjustment. Sampling from the global policies may be desirable in practice, since the global policies can directly use observations at runtime instead of requiring access to the state [6]. The global step size also tends to be more conservative than the classic step size, but produces more consistent and monotonic improvement. 7 Discussion and Future Work We presented a new guided policy search method that corresponds to mirror descent under linearity and convexity assumptions, and showed how prior guided policy search methods can be seen as approximating mirror descent. We provide a bound on the return of the global policy in the nonlinear case, and argue that an appropriate step size can provide improvement of the global policy in this case also. Our analysis provides us with the intuition to design an automated step size adjustment rule, and we illustrate empirically that our method achieves good results on a complex simulated robotic manipulation task while requiring substantially less tuning and hyperparameter optimization than prior guided policy search methods. Manual tuning and hyperparameter searches are a major challenge across a range of deep reinforcement learning algorithms, and developing scalable policy search methods that are simple and reliable is vital to enable further progress. As discussed in Section 5, MDGPS has interesting connections to other policy search methods. Like DAGGER [15], MDGPS uses supervised learning to train the policy, but unlike DAGGER, MDGPS does not assume that the learner is able to reproduce an arbitrary teacher’s behavior with bounded error, which makes it very appealing for tasks with partial observability or other limits on information, such as learning to use camera images for robotic manipulation [6]. When sampling directly from the global policy, MDGPS also has close connections to policy gradient methods that take steps of fixed KL-divergence [14, 17], but with the steps taken in the space of trajectories rather than policy parameters, followed by a projection step. In future work, it would be interesting to explore this connection further, so as to develop new model-free policy gradient methods. Acknowledgments We thank the anonymous reviewers for their helpful and constructive feedback. This research was supported in part by an ONR Young Investigator Program award. 8 References [1] J. A. Bagnell and J. Schneider. Covariant policy search. In International Joint Conference on Artificial Intelligence (IJCAI), 2003. [2] A. Beck and M. Teboulle. Mirror descent and nonlinear projected subgradient methods for convex optimization. Operations Research Letters, 31(3):167–175, May 2003. [3] M. Deisenroth, G. Neumann, and J. Peters. A survey on policy search for robotics. Foundations and Trends in Robotics, 2(1-2):1–142, 2013. [4] X. Guo, S. Singh, H. Lee, R. L. Lewis, and X. Wang. Deep learning for real-time Atari game play using offline Monte-Carlo tree search planning. In Advances in Neural Information Processing Systems (NIPS), 2014. [5] S. Levine and P. Abbeel. Learning neural network policies with guided policy search under unknown dynamics. In Advances in Neural Information Processing Systems (NIPS), 2014. [6] S. Levine, C. Finn, T. Darrell, and P. Abbeel. End-to-end training of deep visuomotor policies. Journal of Machine Learning Research (JMLR), 17, 2016. [7] S. Levine and V. Koltun. Variational policy search via trajectory optimization. In Advances in Neural Information Processing Systems (NIPS), 2013. [8] S. Levine, N. Wagener, and P. Abbeel. Learning contact-rich manipulation skills with guided policy search. In International Conference on Robotics and Automation (ICRA), 2015. [9] W. Li and E. Todorov. Iterative linear quadratic regulator design for nonlinear biological movement systems. In ICINCO (1), pages 222–229, 2004. [10] T. P. Lillicrap, J. J. Hunt, A. Pritzel, N. Heess, T. Erez, Y. Tassa, D. Silver, and D. Wierstra. Continuous control with deep reinforcement learning. In International Conference on Learning Representations (ICLR), 2016. [11] I. Mordatch, K. Lowrey, G. Andrew, Z. Popovic, and E. Todorov. Interactive control of diverse complex characters with neural networks. In Advances in Neural Information Processing Systems (NIPS), 2015. [12] I. Mordatch and E. Todorov. Combining the benefits of function approximation and trajectory optimization. In Robotics: Science and Systems (RSS), 2014. [13] J. Peters, K. Mülling, and Y. Altün. Relative entropy policy search. In AAAI Conference on Artificial Intelligence, 2010. [14] J. Peters and S. Schaal. Reinforcement learning of motor skills with policy gradients. Neural Networks, 21(4):682–697, 2008. [15] S. Ross, G. Gordon, and A. Bagnell. A reduction of imitation learning and structured prediction to no-regret online learning. Journal of Machine Learning Research, 15:627–635, 2011. [16] S. Ross, N. Melik-Barkhudarov, K. Shaurya Shankar, A. Wendel, D. Dey, J. A. Bagnell, and M. Hebert. Learning monocular reactive UAV control in cluttered natural environments. In International Conference on Robotics and Automation (ICRA), 2013. [17] J. Schulman, S. Levine, P. Moritz, M. Jordan, and P. Abbeel. Trust region policy optimization. In International Conference on Machine Learning (ICML), 2015. [18] R. Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine Learning, 8(3-4):229–256, May 1992. [19] T. Zhang, G. Kahn, S. Levine, and P. Abbeel. Learning deep control policies for autonomous aerial vehicles with mpc-guided policy search. In International Conference on Robotics and Automation (ICRA), 2016. 9
2016
369
6,293
Measuring the reliability of MCMC inference with bidirectional Monte Carlo Roger B. Grosse Department of Computer Science University of Toronto Siddharth Ancha Department of Computer Science University of Toronto Daniel M. Roy Department of Statistics University of Toronto Abstract Markov chain Monte Carlo (MCMC) is one of the main workhorses of probabilistic inference, but it is notoriously hard to measure the quality of approximate posterior samples. This challenge is particularly salient in black box inference methods, which can hide details and obscure inference failures. In this work, we extend the recently introduced bidirectional Monte Carlo [GGA15] technique to evaluate MCMC-based posterior inference algorithms. By running annealed importance sampling (AIS) chains both from prior to posterior and vice versa on simulated data, we upper bound in expectation the symmetrized KL divergence between the true posterior distribution and the distribution of approximate samples. We integrate our method into two probabilistic programming languages, WebPPL [GS] and Stan [CGHL+ p], and validate it on several models and datasets. As an example of how our method be used to guide the design of inference algorithms, we apply it to study the effectiveness of different model representations in WebPPL and Stan. 1 Introduction Markov chain Monte Carlo (MCMC) is one of the most important classes of probabilistic inference methods and underlies a variety of approaches to automatic inference [e.g. LTBS00; GMRB+08; GS; CGHL+ p]. Despite its widespread use, it is still difficult to rigorously validate the effectiveness of an MCMC inference algorithm. There are various heuristics for diagnosing convergence, but reliable quantitative measures are hard to find. This creates difficulties both for end users of automatic inference systems and for experienced researchers who develop models and algorithms. In this paper, we extend the recently proposed bidirectional Monte Carlo (BDMC) [GGA15] method to evaluate certain kinds of MCMC-based inference algorithms by bounding the symmetrized KL divergence (Jeffreys divergence) between the distribution of approximate samples and the true posterior distribution. Specifically, our method is applicable to algorithms which can be viewed as importance sampling over an extended state space, such as annealed importance sampling (AIS; [Nea01]) or sequential Monte Carlo (SMC; [MDJ06]). BDMC was proposed as a method for accurately estimating the log marginal likelihood (log-ML) on simulated data by sandwiching the true value between stochastic upper and lower bounds which converge in the limit of infinite computation. These log-likelihood values were used to benchmark marginal likelihood estimators. We show that it can also be used to measure the accuracy of approximate posterior samples obtained from algorithms like AIS or SMC. More precisely, we refine the analysis of [GGA15] to derive an estimator which upper bounds in expectation the Jeffreys divergence between the distribution of approximate samples and the true posterior distribution. We show that this upper bound is quite accurate on some toy distributions for which both the true Jeffreys divergence and the upper bound can be computed exactly. We refer to our method of bounding the Jeffreys divergence by sandwiching the log-ML as Bounding Divergences with REverse Annealing (BREAD). 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. While our method is only directly applicable to certain algorithms such as AIS or SMC, these algorithms involve many of the same design choices as traditional MCMC methods, such as the choice of model representation (e.g. whether to collapse out certain variables), or the choice of MCMC transition operators. Therefore, the ability to evaluate AIS-based inference should also yield insights which inform the design of MCMC inference algorithms more broadly. One additional hurdle must be overcome to use BREAD to evaluate posterior inference: the method yields rigorous bounds only for simulated data because it requires an exact posterior sample. One would like to be sure that the results on simulated data accurately reflect the accuracy of posterior inference on the real-world data of interest. We present a protocol for using BREAD to diagnose inference quality on real-world data. Specifically, we infer hyperparameters on the real data, simulate data from those hyperparameters, measure inference quality on the simulated data, and validate the consistency of the inference algorithm’s behavior between the real and simulated data. (This protocol is somewhat similar in spirit to the parametric bootstrap [ET98].) We integrate BREAD into the tool chains of two probabilistic programming languages: WebPPL [GS] and Stan [CGHL+ p]. Both probabilistic programming systems can be used as automatic inference software packages, where the user provides a program specifying a joint probabilistic model over observed and unobserved quantities. In principle, probabilistic programming has the potential to put the power of sophisticated probabilistic modeling and efficient statistical inference into the hands of non-experts, but realizing this vision is challenging because it is difficult for a non-expert user to judge the reliability of results produced by black-box inference. We believe BREAD provides a rigorous, general, and automatic procedure for monitoring the quality of posterior inference, so that the user of a probabilistic programming language can have confidence in the accuracy of the results. Our approach to evaluating probabilistic programming inference is closely related to independent work [CTM16] that is also based on the ideas of BDMC. We discuss the relationships between both methods in Section 4. In summary, this work includes four main technical contributions. First, we show that BDMC yields an estimator which upper bounds in expectation the Jeffreys divergence of approximate samples from the true posterior. Second, we present a technique for exactly computing both the true Jeffreys divergence and the upper bound on small examples, and show that the upper bound is often a good match in practice. Third, we propose a protocol for using BDMC to evaluate the accuracy of approximate inference on real-world datasets. Finally, we extend both WebPPL and Stan to implement BREAD, and validate BREAD on a variety of probabilistic models in both frameworks. As an example of how BREAD can be used to guide modeling and algorithmic decisions, we use it to analyze the effectiveness of different representations of a matrix factorization model in both WebPPL and Stan. 2 Background 2.1 Annealed Importance Sampling Annealed importance sampling (AIS; [Nea01]) is a Monte Carlo algorithm commonly used to estimate (ratios of) normalizing constants. More carefully, fix a sequence of T distributions p1, . . . , pT , with pt(x) = ft(x)/Zt. The final distribution in the sequence, pT , is called the target distribution; the first distribution, p1, is called the initial distribution. It is required that one can obtain one or more exact samples from p1.1 Given a sequence of reversible MCMC transition operators T1, . . . , TT , where Tt leaves pt invariant, AIS produces a (nonnegative) unbiased estimate of ZT /Z1 as follows: first, we sample a random initial state x1 from p1 and set the initial weight w1 = 1. For every stage t ≥2 we update the weight w and sample the state xt according to wt wt−1 ft(xt−1) ft−1(xt−1) xt sample from Tt (x | xt−1) . (1) Neal [Nea01] justified AIS by showing that it is a simple importance sampler over an extended state space (see Appendix A for a derivation in our notation). From this analysis, it follows that the weight wT is an unbiased estimate of the ratio ZT /Z1. Two trivial facts are worth highlighting: when Z1 1Traditionally, this has meant having access to an exact sampler. However, in this work, we sometimes have access to a sample from p1, but not a sampler. 2 is known, Z1wT is an unbiased estimate of ZT , and when ZT is known, wT /ZT is an unbiased estimate of 1/Z1. In practice, it is common to repeat the AIS procedure to produce K independent estimates and combine these by simple averaging to reduce the variance of the overall estimate. In most applications of AIS, the normalization constant ZT for the target distribution pT is the focus of attention, and the initial distribution p1 is chosen to have a known normalization constant Z1. Any sequence of intermediate distributions satisfying a mild domination criterion suffices to produce a valid estimate, but in typical applications, the intermediate distributions are simply defined to be geometric averages ft(x) = f1(x)1−βtfT (x)βt, where the βt are monotonically increasing parameters with β1 = 0 and βT = 1. (An alternative approach is to average moments [GMS13].) In the setting of Bayesian posterior inference over parameters ✓and latent variables z given some fixed observation y, we take f1(✓, z) = p(✓, z) to be the prior distribution (hence Z1 = 1), and we take fT (✓, z) = p(✓, z, y) = p(✓, z) p(y|✓, z). This can be viewed as the unnormalized posterior distribution, whose normalizing constant ZT = p(y) is the marginal likelihood. Using geometric averaging, the intermediate distributions are then ft(✓, z) = p(✓, z) p(y|✓, z)βt. (2) In addition to moment averaging, reasonable intermediate distributions can be produced in the Bayesian inference setting by conditioning on a sequence of increasing subsets of data; this insight relates AIS to the seemingly different class of sequential Monte Carlo (SMC) methods [MDJ06]. 2.2 Stochastic lower bounds on the log partition function ratio AIS produces a nonnegative unbiased estimate ˆR of the ratio R = ZT /Z1 of partition functions. Unfortunately, because such ratios often vary across many orders of magnitude, it frequently happens that ˆR underestimates R with overwhelming probability, while occasionally taking extremely large values. Correspondingly, the variance may be extremely large, or even infinite. For these reasons, it is more meaningful to estimate log R. Unfortunately, the logarithm of a nonnegative unbiased estimate (such as the AIS estimate) is, in general, a biased estimator of the log estimand. More carefully, let ˆA be a nonnegative unbiased estimator for A = E[ ˆA]. Then, by Jensen’s inequality, E[log ˆA] log E[ ˆA] = log A, and so log ˆA is a lower bound on log A in expectation. The estimator log ˆA satisfies another important property: by Markov’s inequality for nonnegative random variables, Pr(log ˆA > log A + b) < e−b, and so log ˆA is extremely unlikely to overestimate log A by any appreciable number of nats. These observations motivate the following definition [BGS15]: a stochastic lower bound on X is an estimator ˆX satisfying E[ ˆX] X and Pr( ˆX > X + b) < e−b. Stochastic upper bounds are defined analogously. The above analysis shows that log ˆA is a stochastic lower bound on log A when ˆA is a nonnegative unbiased estimate of A, and, in particular, log ˆR is a stochastic lower bound on log R. (It is possible to strengthen the tail bound by combining multiple samples [GBD07].) 2.3 Reverse AIS and Bidirectional Monte Carlo Upper and lower bounds are most useful in combination, as one can then sandwich the true value. As described above, AIS produces a stochastic lower bound on the ratio R; many other algorithms do as well. Upper bounds are more challenging to obtain. The key insight behind bidirectional Monte Carlo (BDMC; [GGA15]) is that, provided one has an exact sample from the target distribution pT , one can run AIS in reverse to produce a stochastic lower bound on log Rrev = log Z1/ZT , and therefore a stochastic upper bound on log R = −log Rrev. (In fact, BDMC is a more general framework which allows a variety of partition function estimators, but we focus on AIS for pedagogical purposes.) More carefully, for t = 1, . . . , T, define ˜pt = pT −t+1 and ˜Tt = TT −t+1. Then ˜p1 corresponds to our original target distribution pT and ˜pT corresponds to our original initial distribution p1. As before, ˜Tt leaves ˜pt invariant. Consider the estimate produced by AIS on the sequence of distributions ˜p1, . . . , ˜pT and corresponding MCMC transition operators ˜T1, . . . , ˜TT . (In this case, the forward chain of AIS corresponds to the reverse chain described in Section 2.1.) The resulting estimate ˆRrev is a nonnegative unbiased estimator of Rrev. It follows that log ˆRrev is a stochastic lower bound on log Rrev, and therefore log ˆR−1 rev is a stochastic upper bound on log R = log R−1 rev. BDMC is 3 simply the combination of this stochastic upper bound with the stochastic lower bound of Section 2.2. Because AIS is a consistent estimator of the partition function ratio under the assumption of ergodicity [Nea01], the two bounds converge as T ! 1; therefore, given enough computation, BDMC can sandwich log R to arbitrary precision. Returning to the setting of Bayesian inference, given some fixed observation y, we can apply BDMC provided we have exact samples from both the prior distribution p(✓, z) and the posterior distribution p(✓, z|y). In practice, the prior is typically easy to sample from, but it is typically infeasible to generate exact posterior samples. However, in models where we can tractably sample from the joint distribution p(✓, z, y), we can generate exact posterior samples for simulated observations using the elementary fact that p(y) p(✓, z|y) = p(✓, z, y) = p(✓, z) p(y|✓, z). (3) In other words, if one ancestrally samples ✓, z, and y, this is equivalent to first generating a dataset y and then sampling (✓, z) exactly from the posterior. Therefore, for simulated data, one has access to a single exact posterior sample; this is enough to obtain stochastic upper bounds on log R = log p(y). 2.4 WebPPL and Stan We focus on two particular probabilistic programming packages. First, we consider WebPPL [GS], a lightweight probabilistic programming language built on Javascript, and intended largely to illustrate some of the important ideas in probabilistic programming. Inference is based on Metropolis–Hastings (M–H) updates to a program’s execution trace, i.e. a record of all stochastic decisions made by the program. WebPPL has a small and clean implementation, and the entire implementation is described in an online tutorial on probabilistic programming [GS]. Second, we consider Stan [CGHL+ p], a highly engineered automatic inference system which is widely used by statisticians and is intended to scale to large problems. Stan is based on the No U-Turn Sampler (NUTS; [HG14]), a variant of Hamiltonian Monte Carlo (HMC; [Nea+11]) which chooses trajectory lengths adaptively. HMC can be significantly more efficient than M–H over execution traces because it uses gradient information to simultaneously update multiple parameters of a model, but is less general because it requires a differentiable likelihood. (In particular, this disallows discrete latent variables unless they are marginalized out analytically.) 3 Methods There are at least two criteria we would desire from a sampling-based approximate inference algorithm in order that its samples be representative of the true posterior distribution: we would like the approximate distribution q(✓, z; y) to cover all the high-probability regions of the posterior p(✓, z|y), and we would like it to avoid placing probability mass in low-probability regions of the posterior. The former criterion motivates measuring the KL divergence DKL(p(✓, z|y) k q(✓, z; y)), and the latter criterion motivates measuring DKL(q(✓, z; y) k p(✓, z|y)). If we desire both simultaneously, this motivates paying attention to the Jeffreys divergence, defined as DJ(qkp) = DKL(qkp) + DKL(pkq). In this section, we present Bounding Divergences with Reverse Annealing (BREAD), a technique for using BDMC to bound the Jeffreys divergence from the true posterior on simulated data, combined with a protocol for using this technique to analyze sampler accuracy on real-world data. 3.1 Upper bounding the Jeffreys divergence in expectation We now present our technique for bounding the Jeffreys divergence between the target distribution and the distribution of approximate samples produced by AIS. In describing the algorithm, we revert to the abstract state space formalism of Section 2.1, since the algorithm itself does not depend on any structure specific to posterior inference (except for the ability to obtain an exact sample). We first repeat the derivation from [GGA15] of the bias of the stochastic lower bound log ˆR. Let v = (x1, . . . , xT −1) denote all of the variables sampled in AIS before the final stage; the final state xT corresponds to the approximate sample produced by AIS. We can write the distributions over the forward and reverse AIS chains as: qfwd(v, xT ) = qfwd(v) qfwd(xT |v) (4) qrev(v, xT ) = pT (xT ) qrev(v|xT ). (5) 4 The distribution of approximate samples qfwd(xT ) is obtained by marginalizing out v. Note that sampling from qrev requires sampling exactly from pT , so strictly speaking, BREAD is limited to those cases where one has at least one exact sample from pT — such as simulated data from a probabilistic model (see Section 2.3). The expectation of the estimate log ˆR of the log partition function ratio is given by: E[log ˆR] = Eqfwd(v,xT )  log fT (xT ) qrev(v|xT ) Z1 qfwd(v, xT ) " (6) = log ZT −log Z1 −DKL(qfwd(xT ) qfwd(v|xT ) k pT (xT ) qrev(v|xT )) (7) log ZT −log Z1 −DKL(qfwd(xT ) k pT (xT )). (8) (Note that qfwd(v|xT ) is the conditional distribution of the forward chain, given that the final state is xT .) The inequality follows because marginalizing out variables cannot increase the KL divergence. We now go beyond the analysis in [GGA15], to bound the bias in the other direction. The expectation of the reverse estimate ˆRrev is E[log ˆRrev] = Eqrev(xT ,v)  log Z1 qfwd(v, xT ) fT (xT ) qrev(v|xT ) " (9) = log Z1 −log ZT −DKL(pT (xT ) qrev(v|xT ) k qfwd(xT ) qfwd(v|xT )) (10) log Z1 −log ZT −DKL(pT (xT ) k qfwd(xT )). (11) As discussed above, log ˆR and log ˆR−1 rev can both be seen as estimators of log ZT Z1 , the former of which is a stochastic lower bound, and the latter of which is a stochastic upper bound. Consider the gap between these two bounds, ˆB , log ˆR−1 rev −log ˆR. It follows from Eqs. (8) and (11) that, in expectation, ˆB upper bounds the Jeffreys divergence J , DJ(pT (xT ), qfwd(xT )) , DKL(pT (xT ) k qfwd(xT )) + DKL(qfwd(xT ) k pT (xT )) (12) between the target distribution pT and the distribution qfwd(pT ) of approximate samples. Alternatively, if one happens to have some other lower bound L or upper bound U on log R, then one can bound either of the one-sided KL divergences by running only one direction of AIS. Specifically, from Eq. (8), E[U −log ˆR] ≥DKL(qfwd(xT ) k pT (xT )), and from Eq. (11), E[log ˆR−1 rev −L] ≥ DKL(pT (xT ) k qfwd(xT )). How tight is the expectation B , E[ ˆB] as an upper bound on J ? We evaluated both B and J exactly on some toy distributions and found them to be a fairly good match. Details are given in Appendix B. 3.2 Application to real-world data So far, we have focused on the setting of simulated data, where it is possible to obtain an exact posterior sample, and then to rigorously bound the Jeffreys divergence using BDMC. However, we are more likely to be interested in evaluating the performance of inference on real-world data, so we would like to simulate data which resembles a real-world dataset of interest. One particular difficulty is that, in Bayesian analysis, hyperparameters are often assigned non-informative or weakly informative priors, in order to avoid biasing the inference. This poses a challenge for BREAD, as datasets generated from hyperparameters sampled from such priors (which are often very broad) can be very dissimilar to real datasets, and hence conclusions from the simulated data may not generalize. In order to generate simulated datasets which better match a real-world dataset of interest, we adopt the following heuristic scheme: we first perform approximate posterior inference on the real-world dataset. Let ˆ⌘real denote the estimated hyperparameters. We then simulate parameters and data from the forward model p(✓| ˆ⌘real)p(D| ˆ⌘real, ✓). The forward AIS chain is run on D in the usual way. However, to initialize the reverse chain, we first start with (ˆ⌘real, ✓), and then run some number of MCMC transitions which preserve p(⌘, ✓|D), yielding an approximate posterior sample (⌘?, ✓?). In general, (⌘?, ✓?) will not be an exact posterior sample, since ˆ⌘real was not sampled from p(⌘|D). However, the true hyperparameters ˆ⌘real which generated D ought to be in a region of high posterior mass unless the prior p(⌘) concentrates most of its mass away from ˆ⌘real. Therefore, we expect even a small number of MCMC steps to produce a plausible posterior sample. This motivates our use of (⌘?, ✓?) in place of an exact posterior sample. We validate this procedure in Section 5.1.2. 5 4 Related work Much work has been devoted to the diagnosis of Markov chain convergence (e.g. [CC96; GR92; BG98]). Diagnostics have been developed both for estimating the autocorrelation function of statistics of interest (which determines the number of effective samples from an MCMC chain) and for diagnosing whether Markov chains have reached equilibrium. In general, convergence diagnostics cannot confirm convergence; they can only identify particular forms of non-convergence. By contrast, BREAD can rigorously demonstrate convergence in the simulated data setting. There has also been much interest in automatically configuring parameters of MCMC algorithms. Since it is hard to reliably summarize the performance of an MCMC algorithm, such automatic configuration methods typically rely on method-specific analyses. For instance, Roberts and Rosenthal [RR01] showed that the optimal acceptance rate of Metropolis–Hastings with an isotropic proposal distribution is 0.234 under fairly general conditions. M–H algorithms are sometimes tuned to achieve this acceptance rate, even in situations where the theoretical analysis doesn’t hold. Rigorous convergence measures might enable more direct optimization of algorithmic hyperparameters. Gorham and Mackey [GM15] presented a method for directly estimating the quality of a set of approximate samples, independently of how those samples were obtained. This method has strong guarantees under a strong convexity assumption. By contrast, BREAD makes no assumptions about the distribution itself, so its mathematical guarantees (for simulated data) are applicable even to multimodal or badly conditioned posteriors. It has been observed that heating and cooling processes yield bounds on log-ratios of partition functions by way of finite difference approximations to thermodynamic integration. Neal [Nea96] used such an analysis to motivate tempered transitions, an MCMC algorithm based on heating and cooling a distribution. His analysis cannot be directly applied to measuring convergence, as it assumed equilibrium at each temperature. Jarzynski [Jar97] later gave a non-equilibrium analysis which is equivalent to that underlying AIS [Nea01]. We have recently learned of independent work [CTM16] which also builds on BDMC to evaluate the accuracy of posterior inference in a probabilistic programming language. In particular, CusumanoTowner and Mansinghka [CTM16] define an unbiased estimator for a quantity called the subjective divergence. The estimator is equivalent to BDMC except that the reverse chain is initialized from an arbitrary reference distribution, rather than the true posterior. In [CTM16], the subjective divergence is shown to upper bound the Jeffreys divergence when the true posterior is used; this is equivalent to our analysis in Section 3.1. Much less is known about subjective divergence when the reference distribution is not taken to be the true posterior. (Our approximate sampling scheme for hyperparameters can be viewed as a kind of reference distribution.) 5 Experiments In order to experiment with BREAD, we extended both WebPPL and Stan to run forward and reverse AIS using the sequence of distributions defined in Eq. (2). The MCMC transition kernels were the standard ones provided by both platforms. Our first set of experiments was intended to validate that BREAD can be used to evaluate the accuracy of posterior inference in realistic settings. Next, we used BREAD to explore the tradeoffs between two different representations of a matrix factorization model in both WebPPL and Stan. 5.1 Validation As described above, BREAD returns rigorous bounds on the Jeffreys divergence only when the data are sampled from the model distribution. Here, we address three ways in which it could potentially give misleading results. First, the upper bound B may overestimate the true Jeffreys divergence J . Second, results on simulated data may not correspond to results on real-world data if the simulated data are not representative of the real-world data. Finally, the fitted hyperparameter procedure of Section 3.2 may not yield a sample sufficiently representative of the true posterior p(✓, ⌘|D). The first issue, about the accuracy of the bound, is addressed in Appendix B.1.1; the bound appears to be fairly close to the true Jeffreys divergence on some toy distributions. We address the other two issues in this section. In particular, we attempted to validate that the behavior of the method on simulated 6 (a) (b) (c) Figure 1: (a) Validation of the consistency of the behavior of forward AIS on real and simulated data for the logistic regression model. Since the log-ML values need not match between the real and simulated data, the y-axes for each curve are shifted based on the maximum log-ML lower bound obtained by forward AIS. (b) Same as (a), but for matrix factorization. The complete set of results on all datasets is given in Appendix D. (c) Validation of the fitted hyperparameter scheme on the logistic regression model (see Section 5.1.2 for details). Reverse AIS curves are shown as the number of Gibbs steps used to initialize the hyperparameters is varied. data is consistent with that on real data, and that the fitted-hyperparameter samples can be used as a proxy for samples from the posterior. All experiments in this section were performed using Stan. 5.1.1 Validating consistency of inference behavior between real and simulated data To validate BREAD in a realistic setting, we considered five models based on examples from the Stan manual [Sta], and chose a publicly available real-world dataset for each model. These models include: linear regression, logistic regression, matrix factorization, autoregressive time series modeling, and mixture-of-Gaussians clustering. See Appendix C for model details and Stan source code. In order to validate the use of simulated data as a proxy for real data in the context of BREAD, we fit hyperparameters to the real-world datasets and simulated data from those hyperparameters, as described in Section 3.2. In Fig. 1 and Appendix D, we show the distributions of forward and reverse AIS estimates on simulated data and forward AIS estimates on real-world data, based on 100 AIS chains for each condition.2 Because the distributions of AIS estimates included many outliers, we visualize quartiles of the estimates rather than means.3 The real and simulated data need not have the same marginal likelihood, so the AIS estimates for real and simulated data are shifted vertically based on the largest forward AIS estimate obtained for each model. For all five models under consideration, the forward AIS curves were nearly identical (up to a vertical shift), and the distributions of AIS estimates were very similar at each number of AIS steps. (An example where the forward AIS curves failed to match up due to model misspecification is given in Appendix D.) Since the inference behavior appears to match closely between the real and simulated data, we conclude that data simulated using fitted hyperparameters can be a useful proxy for real data when evaluating inference algorithms. 5.1.2 Validating the approximate posterior over hyperparameters As described in Section 3.2, when we simulate data from fitted hyperparameters, we use an approximate (rather than exact) posterior sample (⌘?, ✓?) to initialize the reverse chain. Because of this, BREAD is not mathematically guaranteed to upper bound the Jeffreys divergence even on the simulated data. In order to determine the effect of this approximation in practice, we repeated the procedure of Section 5.1.1 for all five models, but varying S, the number of MCMC steps used to obtain (⌘?, ✓?), with S 2 {10, 100, 1000, 10000}. The reverse AIS estimates are shown in Fig. 1 and Appendix D. (We do not show the forward AIS estimates because these are unaffected by S.) In all five cases, the reverse AIS curves were statistically indistinguishable. This validates our use of fitted hyperparameters, as it suggests that the use of approximate samples of hyperparameters has little impact on the reverse AIS upper bounds. 2The forward AIS chains are independent, while the reverse chains share an initial state. 3Normally, such outliers are not a problem for AIS, because one averages the weights wT , and this average is insensitive to extremely small values. Unfortunately, the analysis of Section 3.1 does not justify such averaging, so we report estimates corresponding to individual AIS chains. 7 (a) (b) Figure 2: Comparison of Jeffreys divergence bounds for matrix factorization in Stan and WebPPL, using the collapsed and uncollapsed formulations. Given as a function of (a) number of MCMC steps, (b) running time. 5.2 Scientific findings produced by BREAD Having validated various aspects of BREAD, we applied it to investigate the choice of model representation in Stan and WebPPL. During our investigation, we also uncovered a bug in WebPPL, indicating the potential usefulness of BREAD as a means of testing the correctness of an implementation. 5.2.1 Comparing model representations Many models can be written in more than one way, for example by introducing or collapsing latent variables. Performance of probabilistic programming languages can be sensitive to such choices of representation, and the representation which gives the best performance may vary from one language to another. We consider the matrix factorization model described above, which we now specify in more detail. We approximate an N ⇥D matrix Y as a low rank matrix, the product of matrices U and V with dimensions N ⇥K and K ⇥D respectively (where K < min(N, D)). We use a spherical Gaussian observation model, and spherical Gaussian priors on U and V: uik ⇠N(0, σ2 u) vkj ⇠N(0, σ2 v) yij | ui, vj ⇠N(u> i vj, σ2) We can also collapse U to obtain the model vkj ⇠N(0, σ2 v) and yi | V ⇠N(0, σuV>V + σI). In general, collapsing variables can help MCMC samplers mix faster at the expense of greater computational cost per update. The precise tradeoff can depend on the size of the model and dataset, the choice of MCMC algorithm, and the underlying implementation, so it would be useful to have a quantitative criterion to choose between them. We fixed the values of all hyperparameters to 1, and set N = 50, K = 5 and D = 25. We ran BREAD on both platforms (Stan and WebPPL) and for both formulations (collapsed and uncollapsed) (see Fig. 2). The simulated data and exact posterior sample were shared between all conditions in order to make the results directly comparable. As predicted, the collapsed sampler resulted in slower updates but faster convergence (in terms of the number of steps). However, the per-iteration convergence benefit of collapsing was much larger in WebPPL than in Stan (perhaps because of the different underlying inference algorithm). Overall, the tradeoff between efficiency and convergence speed appears to favour the uncollapsed version in Stan, and the collapsed version in WebPPL (see Fig. 2(b)). (Note that this result holds only for our particular choice of problem size; the tradeoff may change given different model or dataset sizes.) Hence BREAD can provide valuable insights into the tricky question of which representations of models to choose to achieve faster convergence. 5.2.2 Debugging Mathematically, the forward and reverse AIS chains yield lower and upper bounds on log p(y) with high probability; if this behavior is not observed, that indicates a bug. In our experimentation with WebPPL, we observed a case where the reverse AIS chain yielded estimates significantly lower than those produced by the forward chain, inconsistent with the theoretical guarantee. This led us to find a subtle bug in how WebPPL sampled from a multivariate Gaussian distribution (which had the effect that the exact posterior samples used to initialize the reverse chain were incorrect).4 These days, while many new probabilistic programming languages are emerging and many are in active development, such debugging capabilities provided by BREAD can potentially be very useful. 4Issue: https://github.com/probmods/webppl/issues/473 8 References [BG98] S. P. Brooks and A. Gelman. “General methods for monitoring convergence of iterative simulations”. Journal of Computational and Graphical Statistics 7.4 (1998), pp. 434–455. [BGS15] Y. Burda, R. B. Grosse, and R. Salakhutdinov. “Accurate and conservative estimates of MRF log-likelihood using reverse annealing”. In: Artificial Intelligence and Statistics. 2015. [CC96] M. K. Cowles and B. P. Carlin. “Markov chain Monte Carlo convergence diagnostics: a comparative review”. Journal of the American Statistical Association 91.434 (1996), pp. 883–904. [CGHL+ p] B. Carpenter, A. Gelman, M. Hoffman, D. Lee, B. Goodrich, M. Betancourt, M. A. Brubaker, J. Guo, P. Li, and A. Riddell. “Stan: a probabilistic programming language”. Journal of Statistical Software (in press). [CTM16] M. F. Cusumano-Towner and V. K. Mansinghka. Quantifying the probable approximation error of probabilistic inference programs. arXiv:1606.00068. 2016. [ET98] B. Efron and R. J. Tibshirani. An Introduction to the Bootstrap. Chapman & Hall/CRC, 1998. [GBD07] V. Gogate, B. Bidyuk, and R. Dechter. “Studies in lower bounding probability of evidence using the Markov inequality”. In: Conference on Uncertainty in AI. 2007. [GGA15] R. B. Grosse, Z. Ghahramani, and R. P. Adams. Sandwiching the marginal likelihood with bidirectional Monte Carlo. arXiv:1511.02543. 2015. [GM15] J. Gorham and L. Mackey. “Measuring sample quality with Stein’s method”. In: Neural Information Processing Systems. 2015. [GMRB+08] N. D. Goodman, V. K. Mansinghka, D. M. Roy, K. Bonawitz, and J. B. Tenenbaum. “Church: a language for generative models”. In: Conference on Uncertainty in AI. 2008. [GMS13] R. Grosse, C. J. Maddison, and R. Salakhutdinov. “Annealing between distributions by averaging moments”. In: Neural Information Processing Systems. 2013. [GR92] A. Gelman and D. B. Rubin. “Inference from iterative simulation using multiple sequences”. Statistical Science 7.4 (1992), pp. 457–472. [GS] N. D. Goodman and A. Stuhlmüller. The Design and Implementation of Probabilistic Programming Languages. http://dippl.org. [HG14] M. D. Homan and A. Gelman. “The No-U-turn Sampler: Adaptively Setting Path Lengths in Hamiltonian Monte Carlo”. J. Mach. Learn. Res. 15.1 (Jan. 2014), pp. 1593–1623. ISSN: 1532-4435. [Jar97] C. Jarzynski. “Equilibrium free-energy differences from non-equilibrium measurements: a master-equation approach”. Physical Review E 56 (1997), pp. 5018–5035. [LTBS00] D. J. Lunn, A. Thomas, N. Best, and D. Spiegelhalter. “WinBUGS – a Bayesian modelling framework: concepts, structure, and extensibility”. Statistics and Computing 10.4 (2000), pp. 325–337. [MDJ06] P. del Moral, A. Doucet, and A. Jasra. “Sequential Monte Carlo samplers”. Journal of the Royal Statistical Society: Series B (Statistical Methodology) 68.3 (2006), pp. 411– 436. [Nea+11] R. M. Neal et al. “MCMC using Hamiltonian dynamics”. Handbook of Markov Chain Monte Carlo 2 (2011), pp. 113–162. [Nea01] R. M. Neal. “Annealed importance sampling”. Statistics and Computing 11 (2001), pp. 125–139. [Nea96] R. M. Neal. “Sampling from multimodal distributions using tempered transitions”. Statistics and Computing 6.4 (1996), pp. 353–366. [RR01] G. O. Roberts and J. S. Rosenthal. “Optimal scaling for various Metropolis–Hastings algorithms”. Statistical Science 16.4 (2001), pp. 351–367. [Sta] Stan Modeling Language Users Guide and Reference Manual. Stan Development Team. 9
2016
37
6,294
On Graph Reconstruction via Empirical Risk Minimization: Fast Learning Rates and Scalability Guillaume Papa, Stéphan Clémençon LTCI, CNRS, Télécom ParisTech, Université Paris-Saclay 75013, Paris, France first.last@telecom-paristech.fr Aurélien Bellet INRIA 59650 Villeneuve d’Ascq, France aurelien.bellet@inria.fr Abstract The problem of predicting connections between a set of data points finds many applications, in systems biology and social network analysis among others. This paper focuses on the graph reconstruction problem, where the prediction rule is obtained by minimizing the average error over all n(n −1)/2 possible pairs of the n nodes of a training graph. Our first contribution is to derive learning rates of order OP(log n/n) for this problem, significantly improving upon the slow rates of order OP(1/√n) established in the seminal work of Biau and Bleakley (2006). Strikingly, these fast rates are universal, in contrast to similar results known for other statistical learning problems (e.g., classification, density level set estimation, ranking, clustering) which require strong assumptions on the distribution of the data. Motivated by applications to large graphs, our second contribution deals with the computational complexity of graph reconstruction. Specifically, we investigate to which extent the learning rates can be preserved when replacing the empirical reconstruction risk by a computationally cheaper Monte-Carlo version, obtained by sampling with replacement B ≪n2 pairs of nodes. Finally, we illustrate our theoretical results by numerical experiments on synthetic and real graphs. 1 Introduction Although statistical learning theory mainly focuses on establishing universal rate bounds (i.e., which hold for any distribution of the data) for the accuracy of a decision rule based on training observations, refined concentration inequalities have recently helped understanding conditions on the data distribution under which learning paradigms such as Empirical Risk Minimization (ERM) lead to faster rates. In binary classification, i.e., the problem of learning to predict a random binary label Y ∈{−1, +1} from on an input random variable X based on independent copies (X1, Y1), . . . , (Xn, Yn) of the pair (X, Y ), rates faster than 1/√n are achieved when little mass in the vicinity of 1/2 is assigned by the distribution of the random variable η(X) = P{Y = +1 | X}. This condition and its generalizations are referred to as the Mammen-Tsybakov noise conditions (see Mammen and Tsybakov, 1999; Tsybakov, 2004; Massart and Nédélec, 2006). It has been shown that a similar phenomenon occurs for various other statistical learning problems. Indeed, specific conditions under which fast rate results hold have been exhibited for density level set estimation (Rigollet and Vert, 2009), (bipartite) ranking (Clémençon et al., 2008; Clémençon and Robbiano, 2011; Agarwal, 2014), clustering (Antos et al., 2005; Clémençon, 2014) and composite hypothesis testing (Clémençon and Vayatis, 2010). In this paper, we consider the supervised learning problem on graphs referred to as graph reconstruction, rigorously formulated by Biau and Bleakley (2006). The objective of graph reconstruction is to predict the possible occurrence of connections between a set of objects/individuals known to form the nodes of an undirected graph. Precisely, each node is described by a random vector X which defines 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. a form of conditional preferential attachment: one predicts whether two nodes are connected based on their features X and X′. This statistical learning problem is motivated by a variety of applications such as systems biology (e.g., inferring protein-protein interactions or metabolic networks, see Jansen et al., 2003; Kanehisa, 2001) and social network analysis (e.g., predicting future connections between users, see Liben-Nowell and Kleinberg, 2003). It has recently been the subject of a good deal of attention in the machine learning literature (see Vert and Yamanishi, 2004; Biau and Bleakley, 2006; Shaw et al., 2011), and is also known as supervised link prediction (Lichtenwalter et al., 2010; Cukierski et al., 2011). The learning task is formulated as the minimization of a reconstruction risk, whose natural empirical version is the average prediction error over the n(n −1)/2 pairs of nodes in a training graph of size n. Under standard complexity assumptions on the set of candidate prediction rules, excess risk bounds of the order OP(1/√n) for the empirical risk minimizers have been established by Biau and Bleakley (2006) based on a representation of the objective functional very similar to the first Hoeffding decomposition for second-order U-statistics (see Hoeffding, 1948). However, Biau & Bleakley ignored the computational complexity of finding an empirical risk minimizer, which scales at least as O(n2) since the empirical graph reconstruction risk involves summing up over n(n −1)/2 terms. This makes the approach impractical when dealing with large graphs commonly found in many applications. Building up on the above work, our contributions to statistical graph reconstruction are two-fold: Universal fast rates. We prove that a fast rate of order OP(log n/n) is always achieved by empirical reconstruction risk minimizers, in absence of any restrictive condition imposed on the data distribution. This is much faster than the OP(1/√n) rate established by Biau and Bleakley (2006). Our analysis is based on a different decomposition of the excess of reconstruction risk of any decision rule candidate, involving the second Hoeffding representation of a U-statistic approximating it, as well as appropriate maximal/concentration inequalities. Scaling-up ERM. We investigate the performance of minimizers of computationally cheaper MonteCarlo estimates of the empirical reconstruction risk, built by averaging over B ≪n2 pairs of vertices drawn with replacement. The rate bounds we obtain highlight that B plays the role of a tuning parameter to achieve an effective trade-off between statistical accuracy and computational cost. Numerical results based on simulated graphs and real-world networks are presented in order to support these theoretical findings. The paper is organized as follows. In Section 2, we present the probabilistic setting for graph reconstruction and recall state-of-the-art results. Section 3 provides our fast rate bound analysis, while Section 4 deals with the problem of scaling-up reconstruction risk minimization to large graphs. Numerical experiments are displayed in Section 5, and a few concluding remarks are collected in Section 6. The technical proofs can be found in the Supplementary Material, along with some additional remarks and results. 2 Background and Preliminaries We start by describing at length the probabilistic framework we consider for statistical inference on graphs, as introduced by Biau and Bleakley (2006). We then briefly recall the related theoretical results documented in the literature. 2.1 A Probabilistic Setup for Preferential Attachment In this paper, G = (V, E) is an undirected random graph with a set V = {1, . . . , n} of n ≥2 vertices and a set E = {ei,j : 1 ≤i ̸= j ≤n} ∈{0, 1}n(n−1) describing its edges: for all i ̸= j, we have ei,j = ej,i = +1 if the vertices i and j are connected by an edge and ei,j = ej,i = 0 otherwise. We assume that G is a Bernoulli graph, i.e. the random variables ei,j, 1 ≤i < j ≤n, are independent labels drawn from a Bernoulli distribution Ber(p) with parameter p = P{ei,j = +1}, the probability that two vertices of G are connected by an edge. The degree of each vertex is thus distributed as a binomial with parameters n and p, which can be classically approximated by a Poisson distribution of parameter λ > 0 in the limit of large n, when np →λ. Whereas the marginal distribution of the graph G is that of a Bernoulli graph (also sometimes abusively referred to as a random graph), a form of conditional preferential attachment is also specified in the framework considered here. Precisely, we assume that, for all i ∈V , a continuous r.v. 2 Xi, taking its values in a separable Banach space X, describes some features related to vertex i. The Xi’s are i.i.d. with common distribution µ(dx) and, for any i ̸= j, the random pair (Xi, Xj) models some information useful for predicting the occurrence of an edge connecting the vertices i and j. Conditioned upon the features (X1, . . . , Xn), any binary variables ei,j and ek,l are independent only if {i, j} ∩{k, l} = ∅. The conditional distribution of ei,j, i ̸= j, is supposed to depend on (Xi, Xj) solely, described by the posterior preferential attachment probability: η (Xi, Xj) = P {ei,j = +1 | (Xi, Xj)} . (1) For instance, ∀(x1, x2) ∈X 2, η (x1, x2) can be a certain function of a specific distance or similarity measure between x1 and x2, as in the synthetic graphs described in Section 5. The conditional average degree of the vertex i ∈V given Xi (respectively, given (X1, . . . , Xn)) is thus (n −1) R x∈X η(Xi, x)µ(dx) (respectively, P j̸=i η(Xi, Xj)). Observe incidentally that, equipped with these notations, p = R (x,x′)∈X 2 η(x, x′)µ(dx)µ(dx′). Hence, the 3-tuples (Xi, Xj, ei,j), 1 ≤i < j ≤n, are non-i.i.d. copies of a generic random vector (X1, X2, e1,2) whose distribution L is given by the tensorial product µ(dx1) ⊗µ(dx2) ⊗Ber(η(x1, x2)), which is fully described by the pair (µ, η). Observe also that the function η is symmetric by construction: ∀(x1, x2) ∈X 2, η(x1, x2) = η(x2, x1). In this framework, the learning problem introduced by Biau and Bleakley (2006), referred to as graph reconstruction, consists in building a symmetric reconstruction rule g : X 2 →{0, 1}, from a training graph G, with nearly minimum reconstruction risk R(g) = P {g(X1, X2) ̸= e1,2} , (2) thus achieving a comparable performance to that of the Bayes rule g∗(x1, x2) = I{η(x1, x2) > 1/2}, whose risk is given by R∗= E[min{η(X1, X2), 1 −η(X1, X2)}] = infg R(g). Remark 1 (EXTENDED FRAMEWORK) The results established in this paper can be straightforwardly extended to a more general framework, where L = L(n) may depend on the number n of vertices. This allows to consider a general class of models, accounting for possible accelerating properties exhibited by various non scale-free real networks (Mattick and Gagen, 2005). An asymptotic study can be then carried out with the additional assumption that, as n →+∞, L(n) converges in distribution to a probability measure L(∞) on X × X × {0, 1}, see (Biau and Bleakley, 2006). For simplicity, we restrict our study to the stationary case, i.e. L(n) = L for all n ≥2. 2.2 Related Results on Empirical Risk Minimization A paradigmatic approach in statistical learning, referred to as Empirical Risk Minimization (ERM), consists in replacing (2) by its empirical version based on the labeled sample Dn = {(Xi, Xj, ei,j) : 1 ≤i < j ≤n} related to G:1 bRn(g) = 2 n(n −1) X 1≤i<j≤n I {g(Xi, Xj) ̸= ei,j} . (3) An empirical risk minimizer bgn is a solution of the optimization problem ming∈G bRn(g), where G is a class of reconstruction rules of controlled complexity, hopefully rich enough to yield a small bias infg∈G R(g) −R∗. The performance of bgn is measured by its excess risk R(bgn) −infg∈G R(g), which can be bounded if we can derive probability inequalities for the maximal deviation sup g∈G | bRn(g) −R(g)|. (4) In the framework of classification, the flagship problem of statistical learning theory, the empirical risk is of the form of an average of i.i.d. r.v.’s, so that results pertaining to empirical process theory can be readily used to obtain bounds for the performance of empirical error minimization. Unfortunately, the empirical risk (3) is a sum of dependent variables. Following in the footsteps of Clémençon et al. 1A classical Lehmann-Scheffé argument shows that (3) is the estimator of (2) with smallest variance among all unbiased estimators. 3 (2008), the work of Biau and Bleakley (2006) circumvents this difficulty by means of a representation of bRn(g) as an average of sums of i.i.d. r.v.’s, namely 1 n! X σ∈Sn 1 ⌊n/2⌋ ⌊n 2 ⌋ X i=1 I{g(Xσ(i), Xσ(i+⌊n 2 ⌋)) ̸= eσ(i),σ(i+⌊n 2 ⌋)}, where the sum is taken over all permutations of Sn, the symmetric group of order n, and ⌊u⌋denotes the integer part of any u ∈R. Very similar to the first Hoeffding decomposition for U-statistics (see Lee, 1990), this representation reduces the first order analysis of the concentration properties of (4) to the study of a basic empirical process (see Biau and Bleakley, 2006, Lemma 3.1). Biau and Bleakley (2006) thereby establish rate bounds of the order OP(1/√n) for the excess of reconstruction risk of bgn under appropriate complexity assumptions (namely, G is of finite VC-dimension). Note incidentally that (3) is a U-statistic only when the variable η(X1, X2) is almost-surely constant (see Janson and Nowicki, 1991, for an asymptotic study of graph reconstruction in this restrictive context). Remark 2 (ALTERNATIVE LOSS FUNCTIONS) For simplicity, all our results are stated for the case of the 0-1 loss I{g(Xi, Xj) ̸= ei,j}, but they straightforwardly extend to more practical alternatives such as the convex surrogate and cost-sensitive variants used in our numerical experiments. See the Supplementary Material for more details. 3 Empirical Reconstruction is Always Fast! In this section, we show that the rate bounds established by Biau and Bleakley (2006) can be largely improved without any additional assumptions. Precisely, we prove that fast learning rates of order OP(log n/n) are always attained by the minimizers of the empirical reconstruction risk (3), as revealed by the following theorem. Theorem 1 (FAST RATES) Let bgn be any minimizer of the empirical reconstruction risk (3) over a class G of finite VC-dimension V < +∞. For all δ ∈(0, 1), we have w.p. at least 1 −δ: ∀n ≥2, R(bgn) −R∗≤2  inf g∈G R(g) −R∗  + C × V log(n/δ) n , where C < +∞is a universal constant.2 Remark 3 (ON THE BIAS TERM) Apart from its remarkable universality, Theorem 1 takes the same form as in the case of empirical minimization of U-statistics (Clémençon et al., 2008, Corollary 6), with the same constant 2 in front of the bias term infg∈G R(g) −R∗. As can be seen from the proof, this constant has no special meaning and can be replaced by any constant strictly larger than 1 at the cost of increasing the constant C. Note that the OP(1/√n) rate obtained by Biau and Bleakley (2006) has a factor 1 in front of the bias term. Therefore, Theorem 1 provides a significant improvement unless the bias overly dominates the second term of the bound (i.e., the complexity of G is too small). Remark 4 (ON COMPLEXITY ASSUMPTIONS) We point out that a similar result can be established under weaker complexity assumptions involving Rademacher averages (refer to the Supplementary Material for more details). As may be seen by carefully examining the proof of Theorem 1, this would require to use the moment inequality for degenerate U-processes stated in (Clémençon et al., 2008, Theorem 11) instead of that proved by Arcones and Giné (1994). In the rest of this section, we outline the main ideas used to obtain this result (the detailed proofs can be found in the Supplementary Material). We rely on some arguments used in the fast rate analysis for empirical minimization of U-statistics (Clémençon et al., 2008), although these results only hold true under restrictive distributional assumptions. Whereas the quantity (3) is not a U-statistic, one may decompose the difference between the excess of reconstruction risk of any candidate rule g ∈G and its empirical counterpart as the sum of its conditional expectation given the Xi’s, which is a U-statistic, plus a residual term. In order to explain the main argument underlying the present analysis, additional notation is required. Set Hg(x1, x2, e1,2) = I{g(x1, x2) ̸= e1,2} and qg(x1, x2, e1,2) = Hg(x1, x2, e1,2)−Hg∗(x1, x2, e1,2) 2Note that, throughout the paper, the constant C is not necessarily the same at each appearance. 4 for any (x1, x2, e1,2) ∈X × X × {0, 1}. Denoting by Λ(g) = R(g) −R∗= E[qg(X1, X2, e1,2)] the excess reconstruction risk with respect to the Bayes rule, its empirical estimate is given by Λn(g) = bRn(g) −bRn(g∗) = 2 n(n −1) X 1≤i<j≤n qg(Xi, Xj, ei,j). For all g ∈G, one may write: Λn(g) −Λ(g) = Un(g) + c Wn(g), (5) where Un(g) = E [Λn(g) −Λ(g) | X1, . . . , Xn] = 2 n(n −1) X 1≤i<j≤n eqg(Xi, Xj) −Λ(g) is a U-statistic of degree 2 with symmetric kernel eqg(X1, X2)−Λ(g), where we denote eqg(X1, X2) = E[qg(X1, X2, e1,2) | X1, X2], and c Wn(g) = 2 n(n−1) P i<j{qg(Xi, Xj, ei,j) −eqg(Xi, Xj)}. Equipped with this notation, we can now sketch the main steps of the proof of the fast rate bound stated in Theorem 1. As shown in the Supplementary Material, it is based on Eq. (5) combined with two intermediary results, each providing a control of one of the terms involved in it. The second order analysis carried out by Clémençon et al. (2008) shows that the small variance property of U-statistics may yield fast learning rates for empirical risk minimizers when U-statistics are used to estimate the risk, under a certain “low-noise” condition (see Assumption 4 therein). One of our main findings is that this condition is always fulfilled for the specific U-statistic Un(g) involved in the decomposition (5) of the excess of reconstruction risk of any rule candidate g, as shown by the following lemma. Lemma 2 (VARIANCE CONTROL) For any distribution L and any reconstruction rule g, we have Var (E [qg(X1, X2, e1,2) | X1]) ≤Λ(g). The fundamental reason for the universal character of this result lies in the fact that the empirical reconstruction risk is not an average over all pairs (i.e., a U-statistic of order 2) but an average over randomly selected pairs (random selection being ruled by the function η). The resulting smoothness is the key ingredient allowing us to establish the desired property. Empirical reconstruction risk minimization over a class G being equivalent to minimization of Λn(g) −Λ(g), the result below, combined with (5), proves that it also boils down to minimizing Un(g) under appropriate conditions on G, so that the fast rate analysis of Clémençon et al. (2008) can be extended to graph reconstruction. Lemma 3 (UNIFORM APPROXIMATION) Under the same assumptions as in Theorem 1, for any δ ∈(0, 1), we have with probability larger than 1 −δ: ∀n ≥2, sup g∈G c Wn(g) ≤C × V log(n/δ) n , where C < +∞is a universal constant. The proof relies on classical symmetrization and randomization tricks combined with the decoupling method, in order to cope with the dependence structure of the variables and apply maximal/concentration inequalities for sums of independent random variables (see De la Pena and Giné, 1999). Based on the above results, Theorem 1 can then be derived by relying on the second Hoeffding decomposition (see Hoeffding, 1948). This allows us to write Un(g) as a leading term taking the form of a sum of i.i.d r.v.’s with variance 4V ar(E[qg(X1, X2, e1,2) | X1]), plus a degenerate U-statistic (i.e., a U-statistic of symmetric kernel h(x1, x2) such that E[h(x1, X2)] = 0 for all x1 ∈X). The latter can be shown to be of order OP(1/n) uniformly over the class G by means of concentration results for degenerate U-processes. We conclude this section by observing that, instead of estimating the reconstruction risk by (3), one could split the training dataset into two halves and consider the unbiased estimate of (2) given by 1 ⌊n/2⌋ ⌊n/2⌋ X i=1 I{g(Xi, Xi+⌊n/2⌋) ̸= ei,i+⌊n/2⌋}. (6) 5 The analysis of the generalization ability of minimizers of this empirical risk functional is simpler, insofar as only independent r.v.’s are involved in the sum (6). However, this estimate does not share the reduced variance property of (3) and although one could show that rate bounds of the same order as those stated in Theorem 1 may be attained by means of results pertaining to ERM theory for binary classification (see e.g. Section 5 in Boucheron et al., 2005), this would require a very restrictive assumption on distribution L, namely to suppose that the posterior preferential attachment probability η stays bounded away from 1/2 with probability one (cf Massart and Nédélec, 2006). This is illustrated in the Supplementary Material. 4 Scaling-up Empirical Risk Minimization The results of the previous section, as well as those of Biau and Bleakley (2006), characterize the excess risk achieved by minimizers of the empirical reconstruction risk bRn(g) but do not consider the computational complexity of finding such minimizers. For large training graphs, the complexity of merely computing bRn(g) is prohibitive as the number of terms involved in the summation is O(n2). In this section, we introduce a sampling-based approach to build approximations of the reconstruction risk with much fewer terms than O(n2), so as to scale-up risk minimization to large graphs. The strategy we propose, inspired from the notion of incomplete U-statistic (see Lee, 1990), is of disarming simplicity: instead of the empirical reconstruction risk (3), we will consider an incomplete approximation obtained by sampling pairs of vertices (and not vertices) with replacement. Formally, we define the incomplete graph reconstruction risk based on B ≥1 pairs of vertices as eRB(g) = 1 B X (i,j)∈PB I {g(Xi, Xj) ̸= ei,j} , (7) where PB is a set of cardinality B built by sampling with replacement in the set Θn = {(i, j) : 1 ≤i < j ≤n} of all pairs of vertices of the training graph G. For any b ∈{1, . . . , B} and all (i, j) ∈Θn, denote by ϵb(i, j) the variable indicating whether the pair (i, j) has been picked at the b-th draw (ϵb(i, j) = +1) or not (ϵb(i, j) = +0). The (multinomial) random vectors ϵb = (ϵb(i, j))(i,j)∈Θn are i.i.d. (notice that P (i,j)∈Θn ϵb(i, j) = +1 for 1 ≤b ≤B) and the incomplete risk can be then rewritten as eRB(g) = 1 B B X b=1 X (i,j)∈Θn ϵb(i, j) · I {g(Xi, Xj) ̸= ei,j} . (8) Observe that the statistic (7) is an unbiased estimate of the true risk (2) and that, given the Xi’s, its conditional expectation is equal to (3). Considering (7) with B = o(n2) as our empirical risk estimate significantly reduces the computational cost, at the price of a slightly increased variance: Var  eRB(g)  = Var  bRn(g)  + 1 B  Var  bR1(g)  −Var  bRn(g)  , for any reconstruction rule g. Note in particular that the above variance is in general much smaller than that of the complete reconstruction risk based on a subsample of ⌊ √ B⌋vertices drawn at random (thus involving O(B) pairs as well). We refer to the Supplementary Material for more details. We are thus interested in characterizing the performance of solutions egB to the computationally simpler problem ming∈G eRB(g). The following theorem shows that, when the class G is of finite VCdimension, the concentration properties of the incomplete reconstruction risk process { eRB(g)}g∈G can be deduced from those of the complete version { bRn(g)}g∈G. Theorem 4 (UNIFORM DEVIATIONS) Suppose that the class G is of finite VC-dimension V < +∞. For all δ > 0, n ≥1 and B ≥1, we have with probability at least 1 −δ:, sup g∈G | eRB(g) −bRn(g)| ≤ r log 2 + V log ((1 + n(n −1)/2)/δ) 2B . The finite VC-dimension hypothesis can be relaxed and a bound of the same order can be proved to hold true under weaker complexity assumptions involving Rademacher averages (see Remark 4). 6 (a) True graph (b) Graph with scrambled features (c) Reconstructed graph Figure 1: Illustrative experiment with n = 50, q = 2, τ = 0.27 and p = 0. Figure 1(a) shows the training graph, where the position of each node is given by its 2D feature vector. Figure 1(b) depicts the same graph after applying a random transformation R to the features. On this graph, the Euclidean distance with optimal threshold achieves a reconstruction error of 0.1311. In contrast, the reconstruction rule learned from B = 100 pairs of nodes (out of 1225 possible pairs) successfully inverts R and accurately recovers the original graph (Figure 1(c)). Its reconstruction error is 0.008 on the training graph and 0.009 on a held-out graph generated with the same parameters. Remarkably, with only B = O(n) pairs, the rate in Theorem 4 is of the same order (up to a log factor) as that obtained by Biau and Bleakley (2006) for the maximal deviation supg∈G | bRn(g) −R(g)| related to the complete reconstruction risk bRn(g) with O(n2) pairs. From Theorem 4, one can get a learning rate of order OP(1/√n) for the minimizer of the incomplete risk involving only O(n) pairs. Unfortunately, such an analysis does not exploit the relationship between conditional variance and expectation formulated in Lemma 2, and is thus not sufficient to show that reconstruction rules minimizing the incomplete risk (7) can achieve learning rates comparable to those stated in Theorem 1. In contrast, the next theorem provides sharper statistical guarantees. We refer to the Supplementary Material for the proof. Theorem 5 Let egB be any minimizer of the incomplete reconstruction risk (7) over a class G of finite VC-dimension V < +∞. Then, for all δ ∈(0, 1), we have with probability at least 1 −δ: ∀n ≥2, R(egB) −R∗≤2  inf g∈G R(g) −R∗  + CV log(n/δ) ×  1 n + 1 √ B  , where C < +∞is a universal constant. This bound reveals that the number B ≥1 of pairs of vertices plays the role of a tuning parameter, ruling a trade-off between statistical accuracy (taking B(n) = O(n2) fully preserves the convergence rate) and computational complexity. This will be confirmed numerically in Section 5. The above results can be extended to other sampling techniques, such as Bernoulli sampling and sampling without replacement. We refer to the Supplementary Material for details. 5 Numerical Experiments In this section, we present some numerical experiments on large-scale graph reconstruction to illustrate the practical relevance of the idea of incomplete risk introduced in Section 4. Following a well-established line of work (Vert and Yamanishi, 2004; Vert et al., 2007; Shaw et al., 2011), we formulate graph reconstruction as a distance metric learning problem (Bellet et al., 2015): we learn a distance function such that we predict an edge between two nodes if the distance between their features is smaller than some threshold. Assuming X ⊆Rq, let Sq + be the cone of symmetric PSD q × q real-valued matrices. The reconstruction rules we consider are parameterized by M ∈Sq + and have the form gM(x1, x2) = I {DM(x1, x2) ≤1} , where DM(x1, x2) = (x1 −x2)T M(x1 −x2) is a (pseudo) distance equivalent to the Euclidean distance after a linear transformation L ∈Rq×q, with M = LT L. Note that gM(x1, x2) can be seen as a linear separator operating on the pairwise representation vec((x1 −x2)(x1 −x′ 2)T ) ∈Rq2, 7 Table 1: Results (averaged over 10 runs) on synthetic graph with n = 1, 000, 000, q = 100, p = 0.05. B = 0.01n B = 0.1n B = n B = 5n B = 10n Reconstruction error 0.2272 0.1543 0.1276 0.1185 0.1159 Relative improvement – 32% 17% 7% 2% Training time (seconds) 21 398 5,705 20,815 42,574 hence the class of learning rules we consider has VC-dimension bounded by q2 + 1. We define the reconstruction risk as: bSn(gM) = 2 n(n −1) X i<j [(2ei,j −1)(DM(Xi, Xj) −1)]+ , where [·]+ = max(0, ·) is a convex surrogate for the 0-1 loss. In earlier work, ERM has only been applied to graphs with at most a few hundred or thousand nodes due to scalability issues. Thanks to our results, we are able to scale it up to much larger networks by sampling pairs of nodes and solve the resulting simpler optimization problem. We create a synthetic graph with n nodes as follows. Each node i has features Xtrue i ∈Rq sampled uniformly over [0, 1]. We then add an edge between nodes that are at Euclidean distance smaller than some threshold τ, and introduce some noise by flipping the value of ei,j for each pair of nodes (i, j) independently with probability p. We then apply a random linear transformation R ∈Rq×q to each node to generate a “scrambled” version Xi = RXtrue i of the nodes’ features. The learning algorithm is only allowed to observe the scrambled features and must find a rule which accurately recovers the graph by solving the ERM problem above. Note that, denoting Dij = ∥R−1Xi −R−1Xj∥2, the posterior preferential attachment probability is given by η (Xi, Xj) = (1 −p) · I{Dij ≤τ} + p · I{Dij > τ}. The process is illustrated in Figure 1. Using this procedure, we generate a training graph with n = 1, 000, 000 and q = 100. We set the threshold τ such that there is an edge between about 20% of the node pairs, and set p = 0.05. We also generate a test graph using the same parameters. We then sample uniformly with replacement B pairs of nodes from the training graph to construct our incomplete reconstruction risk. The reconstruction error of the resulting empirical risk minimizer is estimated on 1,000,000 pairs of nodes drawn from the test graph. Table 1 shows the test error (averaged over 10 runs) as well as the training time for several values of B. Consistently with our theoretical findings, B implements a trade-off between statistical accuracy and computational cost. For this dataset, sampling B = 5, 000, 000 pairs (out of 1012 possible pairs!) is sufficient to find an accurate reconstruction rule. A larger B would result in increased training time for negligible gains in reconstruction error. Additional results. In the Supplementary Material, we present comparisons to a node sampling scheme and to the “dataset splitting” strategy given by (6), as well as experiments on a real network. 6 Conclusion In this paper, we proved that the learning rates for ERM in the graph reconstruction problem are always of order OP(log n/n). We also showed how sampling schemes applied to the population of edges (not nodes) can be used to scale-up such ERM-based predictive methods to very large graphs by means of a detailed rate bound analysis, further supported by empirical results. A first possible extension of this work would naturally consist in considering more general sampling designs, such as Poisson sampling (which generalizes Bernoulli sampling) used in graph sparsification (cf Spielman, 2005), and investigating the properties of minimizers of Horvitz-Thompson versions of the reconstruction risk (see Horvitz and Thompson, 1951). Another challenging line of future research is to extend the results of this paper to more complex unconditional graph structures in order to account for properties shared by some real-world graphs (e.g., graphs with a power law degree distribution). Acknowledgments This work was partially supported by the chair “Machine Learning for Big Data” of Télécom ParisTech and by a grant from CPER Nord-Pas de Calais/FEDER DATA Advanced data science and technologies 2015-2020. 8 References Agarwal, S. (2014). Surrogate regret bounds for bipartite ranking via strongly proper losses. JMLR, 15:1653– 1674. Antos, A., Györfi, L., and György, A. (2005). Individual convergence rates in empirical vector quantizer design. IEEE Transactions on Information Theory, 51(11):4013–4023. Arcones, M. and Giné, E. (1994). U-processes indexed by Vapnik-Chervonenkis classes of functions with applications to asymptotics and bootstrap of U-statistics with estimated parameters. Stochastic Processes and their Applications, 52:17–38. Bellet, A., Habrard, A., and Sebban, M. (2015). Metric Learning. Morgan & Claypool Publishers. Biau, G. and Bleakley, K. (2006). Statistical Inference on Graphs. Statistics & Decisions, 24:209–232. Boucheron, S., Bousquet, O., Lugosi, G., and Massart, P. (2005). Moment inequalities for functions of independent random variables. Ann. Stat., 33(2):514–560. Clémençon, S. (2014). A statistical view of clustering performance through the theory of U-processes. Journal of Multivariate Analysis, 124:42 – 56. Clémençon, S. and Robbiano, S. (2011). Minimax learning rates for bipartite ranking and plug-in rules. In ICML. Clémençon, S. and Vayatis, N. (2010). Overlaying classifiers: a practical approach to optimal scoring. Constructive Approximation, 32(3):619–648. Clémençon, S., Lugosi, G., and Vayatis, N. (2008). Ranking and Empirical Minimization of U-statistics. Ann. Stat., 36(2):844–874. Cukierski, W., Hamner, B., and Yang, B. (2011). Graph-based features for supervised link prediction. In IJCNN. De la Pena, V. and Giné, E. (1999). Decoupling : from dependence to independence. Springer. Hoeffding, W. (1948). A class of statistics with asymptotically normal distribution. The Annals of Mathematical Statistics, 19:293–325. Horvitz, D. and Thompson, D. (1951). A generalization of sampling without replacement from a finite universe. Journal of the American Statistical Association, 47:663–685. Jansen, R., Yu, H., Greenbaum, D., Kluger, Y., Krogan, N., Chung, S., Emili, A., Snyder, M., Greenblatt, J., and Gerstein, M. (2003). A Bayesian networks approach for predicting protein-protein interactions from genomic data. Science, 302(5644):449–453. Janson, S. and Nowicki, K. (1991). The asymptotic distributions of generalized U-statistics with applications to random graphs. Probability Theory and Related Fields, 90:341–375. Kanehisa, M. (2001). Prediction of higher order functional networks from genomic data. Pharmacogenomics, 2(4):373–385. Lee, A. J. (1990). U-statistics: Theory and practice. Marcel Dekker, Inc., New York. Liben-Nowell, D. and Kleinberg, J. (2003). The link prediction problem for social networks. In CIKM. Lichtenwalter, R., Lussier, J., and Chawla, N. (2010). New perspectives and methods in link prediction. In KDD. Mammen, E. and Tsybakov, A. (1999). Smooth discrimination analysis. Ann. Stat., 27(6):1808–1829. Massart, P. and Nédélec, E. (2006). Risk bounds for statistical learning. Ann. Stat., 34(5). Mattick, J. and Gagen, M. (2005). Accelerating networks. Science, 307(5711):856–858. Rigollet, P. and Vert, R. (2009). Fast rates for plug-in estimators of density level sets. Bernoulli, 14(4):1154–1178. Shaw, B., Huang, B., and Jebara, T. (2011). Learning a Distance Metric from a Network. In NIPS. Spielman, D. (2005). Fast Randomized Algorithms for Partitioning, Sparsification, and Solving Linear Systems. Lecture notes from IPCO Summer School 2005. Tsybakov, A. (2004). Optimal aggregation of classifiers in statistical learning. Ann. Stat., 32(1):135–166. Vert, J.-P., Qiu, J., and Noble, W. S. (2007). A new pairwise kernel for biological network inference with support vector machines. BMC Bioinformatics, 8(10). Vert, J.-P. and Yamanishi, Y. (2004). Supervised graph inference. In NIPS, pages 1433–1440. 9
2016
370
6,295
Geometric Dirichlet Means algorithm for topic inference Mikhail Yurochkin Department of Statistics University of Michigan moonfolk@umich.edu XuanLong Nguyen Department of Statistics University of Michigan xuanlong@umich.edu Abstract We propose a geometric algorithm for topic learning and inference that is built on the convex geometry of topics arising from the Latent Dirichlet Allocation (LDA) model and its nonparametric extensions. To this end we study the optimization of a geometric loss function, which is a surrogate to the LDA’s likelihood. Our method involves a fast optimization based weighted clustering procedure augmented with geometric corrections, which overcomes the computational and statistical inefficiencies encountered by other techniques based on Gibbs sampling and variational inference, while achieving the accuracy comparable to that of a Gibbs sampler. The topic estimates produced by our method are shown to be statistically consistent under some conditions. The algorithm is evaluated with extensive experiments on simulated and real data. 1 Introduction Most learning and inference algorithms in the probabilistic topic modeling literature can be delineated along two major lines: the variational approximation popularized in the seminal paper of Blei et al. (2003), and the sampling based approach studied by Pritchard et al. (2000) and other authors. Both classes of inference algorithms, their virtues notwithstanding, are known to exhibit certain deficiencies, which can be traced back to the need for approximating or sampling from the posterior distributions of the latent variables representing the topic labels. Since these latent variables are not geometrically intrinsic — any permutation of the labels yields the same likelihood — the manipulation of these redundant quantities tend to slow down the computation, and compromise with the learning accuracy. In this paper we take a convex geometric perspective of the Latent Dirichlet Allocation, which may be obtained by integrating out the latent topic label variables. As a result, topic learning and inference may be formulated as a convex geometric problem: the observed documents correspond to points randomly drawn from a topic polytope, a convex set whose vertices represent the topics to be inferred. The original paper of Blei et al. (2003) (see also Hofmann (1999)) contains early hints about a convex geometric viewpoint, which is left unexplored. This viewpoint had laid dormant for quite some time, until studied in depth in the work of Nguyen and co-workers, who investigated posterior contraction behaviors for the LDA both theoretically and practically (Nguyen, 2015; Tang et al., 2014). Another fruitful perspective on topic modeling can be obtained by partially stripping away the distributional properties of the probabilistic model and turning the estimation problem into a form of matrix factorization (Deerwester et al., 1990; Xu et al., 2003; Anandkumar et al., 2012; Arora et al., 2012). We call this the linear subspace viewpoint. For instance, the Latent Semantic Analysis approach (Deerwester et al., 1990), which can be viewed as a precursor of the LDA model, looks to find a latent subspace via singular-value decomposition, but has no topic structure. Notably, the RecoverKL by Arora et al. (2012) is one of the recent fast algorithms with provable guarantees coming from the linear subspace perspective. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. The geometric perspective continues to be the main force driving this work. We develop and analyze a new class of algorithms for topic inference, which exploits both the convex geometry of topic models and the distributional properties they carry. The main contributions in this work are the following: (i) we investigate a geometric loss function to be optimized, which can be viewed as a surrogate to the LDA’s likelihood; this leads to a novel estimation and inference algorithm — the Geometric Dirichlet Means algorithm, which builds upon a weighted k-means clustering procedure and is augmented with a geometric correction for obtaining polytope estimates; (ii) we prove that the GDM algorithm is consistent, under conditions on the Dirichlet distribution and the geometry of the topic polytope; (iii) we propose a nonparametric extension of GDM and discuss geometric treatments for some of the LDA extensions; (v) finally we provide a thorough evaluation of our method against a Gibbs sampler, a variational algorithm, and the RecoverKL algorithm. Our method is shown to be comparable to a Gibbs sampler in terms of estimation accuracy, but much more efficient in runtime. It outperforms RecoverKL algorithm in terms of accuracy, in some realistic settings of simulations and in real data. The paper proceeds as follows. Section 2 provides a brief background of the LDA and its convex geometric formulation. Section 3 carries out the contributions outlined above. Section 4 presents experiments results. We conclude with a discussion in Section 5. 2 Background on topic models In this section we give an overview of the well-known Latent Dirichlet Allocation model for topic modeling (Blei et al., 2003), and the geometry it entails. Let α ∈RK + and η ∈RV + be hyperparameters, where V denotes the number of words in a vocabulary, and K the number of topics. The K topics are represented as distributions on words: βk|η ∼DirV (η), for k = 1, . . . , K. Each of the M documents can be generated as follows. First, draw the document topic proportions: θm|α ∼DirK(α), for m = 1, . . . , M. Next, for each of the Nm words in document m, pick a topic label z and then sample a word d from the chosen topic: znm|θm ∼ Categorical(θm); dnm|znm, β1...K ∼Categorical(βznm ). (1) Each of the resulting documents is a vector of length Nm with entries dnm ∈{1, . . . , V }, where nm = 1, . . . , Nm. Because these words are exchangeable by the modeling, they are equivalently represented as a vector of word counts wm ∈NV . In practice, the Dirichlet distributions are often simplified to be symmetric Dirichlet, in which case hyperparameters α, η ∈R+ and we will proceed with this setting. Two most common approaches for inference with the LDA are Gibbs sampling (Griffiths & Steyvers, 2004), based on the Multinomial-Dirichlet conjugacy, and mean-field inference (Blei et al., 2003). The former approach produces more accurate estimates but is less computationally efficient than the latter. The inefficiency of both techniques can be traced to the need for sampling or estimating the (redundant) topic labels. These labels are not intrinsic — any permutation of the topic labels yield the same likelihood function. Convex geometry of topics. By integrating out the latent variables that represent the topic labels, we obtain a geometric formulation of the LDA. Indeed, integrating z’s out yields that, for m = 1, . . . , M, wm|θm, β1...K, Nm ∼Multinomial(pm1, . . . , pmV , Nm), where pmi denotes probability of observing the i-th word from the vocabulary in the m-th document, and is given by pmi = K X k=1 θmkβki for i = 1, . . . , V ; m = 1, . . . , M. (2) The model’s geometry becomes clear. Each topic is represented by a point βk lying in the V −1 dimensional probability simplex ∆V −1. Let B := Conv(β1, . . . , βK) be the convex hull of the K topics βk, then each document corresponds to a point pm := (pm1, . . . , pmV ) lying inside the polytope B. This point of view has been proposed before (Hofmann, 1999), although topic proportions θ were not given any geometric meaning. The following treatment of θ lets us relate to the LDA’s Dirichlet prior assumption and complete the geometric perspective of the problem. The Dirichlet distribution generates probability vectors θm, which can be viewed as the (random) barycentric coordinates of the document m with respect to the polytope B. Each pm = P k θmkβk is a vector of cartesian coordinates of the m-th document’s multinomial probabilities. Given pm, document m is 2 generated by taking wm ∼Multinomial(pm, Nm). In Section 4 we will show how this interpretation of topic proportions can be utilized by other topic modeling approaches, including for example the RecoverKL algorithm of Arora et al. (2012). In the following the model geometry is exploited to derive fast and effective geometric algorithm for inference and parameter estimation. 3 Geometric inference of topics We shall introduce a geometric loss function that can be viewed as a surrogate to the LDA’s likelihood. To begin, let β denote the K × V topic matrix with rows βk, θ be a M × K document topic proportions matrix with rows θm, and W be M × V normalized word counts matrix with rows ¯wm = wm/Nm. 3.1 Geometric surrogate loss to the likelihood Unlike the original LDA formulation, here the Dirichlet distribution on θ can be viewed as a prior on parameters θ. The log-likelihood of the observed corpora of M documents is L(θ, β) = M X m=1 V X i=1 wmi log K X k=1 θmkβki ! , where the parameters β and θ are subject to constraints P i βki = 1 for each k = 1, . . . , K, and P k θmk = 1 for each m = 1, . . . , M. Partially relaxing these constraints and keeping only the one that the sum of all entries for each row of the matrix product θβ is 1, yields the upper bound that L(θ, β) ≤L(W), where function L(W) is given by L(W) = X m X i wmi log ¯wmi. We can establish a tighter bound, which will prove useful (the proof of this and other technical results are in the Supplement): Proposition 1. Given a fixed topic polytope B and θ. Let Um be the set of words present in document m, and assume that pmi > 0 ∀i ∈Um, then L(W) −1 2 M X m=1 Nm X i∈Um ( ¯wmi −pmi)2 ≥L(θ, β) ≥L(W) − M X m=1 Nm X i∈Um 1 pmi ( ¯wmi −pmi)2. Since L(W) is constant, the proposition above shows that maximizing the likelihood has the effect of minimizing the following quantity with respect to both θ and β: X m Nm X i ( ¯wmi −pmi)2. For each fixed β (and thus B), minimizing first with respect to θ leads to the following G(B) := min θ X m Nm X i ( ¯wmi −pmi)2 = M X m=1 Nm min x:x∈B ∥x −¯wm∥2 2, (3) where the second equality in the above display is due pm = P k θmkβk ∈B. The proposition suggests a strategy for parameter estimation: β (and B) can be estimated by minimizing the geometric loss function G: min B G(B) = min B M X m=1 Nm min x:x∈B ∥x −¯wm∥2 2. (4) In words, we aim to find a convex polytope B ∈∆V −1, which is closest to the normalized word counts ¯wm of the observed documents. It is interesting to note the presence of document length Nm, which provides the weight for the squared ℓ2 error for each document. Thus, our loss function adapts to the varying length of documents in the collection. Without the weights, our objective is similar to the sum of squared errors of the Nonnegative Matrix Factorization(NMF). Ding et al. (2006) studied 3 the relation between the likelihood function of interest and NMF, but with a different objective of the NMF problem and without geometric considerations. Once ˆB is solved, ˆθ can be obtained as the barycentric coordinates of the projection of ¯wm onto ˆB for each document m = 1, . . . , M (cf. Eq (3)). We note that if K ≤V , then B is a simplex and β1, . . . , βk in general positions are the extreme points of B, and the barycentric coordinates are unique. (If K > V , the uniqueness no longer holds). Finally, ˆpm = ˆθT mˆβ gives the cartesian coordinates of a point in B that minimizes Euclidean distance to the maximum likelihood estimate: ˆpm = argmin x∈B ∥x −¯wm∥2. This projection is not available in the closed form, but a fast algorithm is available (Golubitsky et al., 2012), which can easily be extended to find the corresponding distance and to evaluate our geometric objective. 3.2 Geometric Dirichlet Means algorithm We proceed to devise a procedure for approximately solving the topic polytope B via Eq. (4): first, obtain an estimate of the underlying subspace based on weighted k-means clustering and then, estimate the vertices of the polytope that lie on the subspace just obtained via a geometric correction technique. Please refer to the Supplement for a clarification of the concrete connection between our geometric loss function and other objectives which arise in subspace learning and weighted k-means clustering literature, the connection that motivates the first step of our algorithm. Geometric Dirichlet Means (GDM) algorithm estimates a topic polytope B based on the training documents (see Algorithm 1). The algorithm is conceptually simple, and consists of two main steps: First, we perform a (weighted) k-means clustering on the M points ¯w1, . . . , ¯wM to obtain the K centroids µ1, . . . , µK, and second, construct a ray emanating from a (weighted) center of the polytope and extending through each of the centroids µk until it intersects with a sphere of radius Rk or with the simplex ∆V −1 (whichever comes first). The intersection point will be our estimate for vertices βk, k = 1, . . . , K of the polytope B. The center C of the sphere is given in step 1 of the algorithm, while Rk = max 1≤m≤M ∥C −¯wm∥2, where the maximum is taken over those documents m that are clustered with label k. To see the intuition behind the algorithm, let us consider a simple Algorithm 1 Geometric Dirichlet Means (GDM) Input: documents w1, . . . , wM, K, extension scalar parameters m1, . . . , mK Output: topics β1, . . . , βK 1: C = 1 M P m ¯wm {find center of the data} 2: µ1, . . . , µK = weighted k-means( ¯w1, . . . , ¯wM, K) {find centers of K clusters}. 3: for all k = 1, . . . , K do 4: βk = C + mk (µk −C). 5: if any βki < 0 then {threshold topic if it is outside vocabulary simplex ∆V −1} 6: for all i = 1, . . . , V do 7: βki = βik1βki>0 P i βki1βki>0 . 8: end for 9: end if 10: end for 11: β1, . . . , βK. simulation experiment. We use the LDA data generative model with α = 0.1, η = 0.1, V = 5, K = 4, M = 5000, Nm = 100. Multidimensional scaling is used for visualization (Fig. 1). We observe that the k-means centroids (pink) do not represent the topics very well, but our geometric modification finds extreme points of the tetrahedron: red and yellow spheres overlap, meaning we found the true topics. In this example, we have used a very small vocabulary size, but in practice V is much higher and the cluster centroids are often on the boundary of the vocabulary simplex, therefore we have to threshold the betas at 0. Extending length until Rk is our default choice for the extension parameters: mk = Rk ∥C −µk∥2 for k = 1, . . . , K, (5) 4 Figure 1: Visualization of GDM: Black, green, red and blue are cluster assignments; purple is the center, pink are cluster centroids, dark red are estimated topics and yellow are the true topics. but we will see in our experiments that a careful tuning of the extension parameters based on optimizing the geometric objective (4) over a small range of mk helps to improve the performance considerably. We call this tGDM algorithm (tuning details are presented in the Supplement). The connection between extension parameters and the thresholding is the following: if the cluster centroid assigns probability to a word smaller than the whole data does on average, this word will be excluded from topic k with large enough mk. Therefore, the extension parameters can as well be used to control for the sparsity of the inferred topics. 3.3 Consistency of Geometric Dirichlet Means We shall present a theorem which provides a theoretical justification for the Geometric Dirichlet Means algorithm. In particular, we will show that the algorithm can achieve consistent estimates of the topic polytope, under conditions on the parameters of the Dirichlet distribution of the topic proportion vector θm, along with conditions on the geometry of the convex polytope B. The problem of estimating vertices of a convex polytope given data drawn from the interior of the polytope has long been a subject of convex geometry — the usual setting in this literature is to assume the uniform distribution for the data sample. Our setting is somewhat more general — the distribution of the points inside the polytope will be driven by a symmetric Dirichlet distribution setting, i.e., θm iid ∼DirK(α). (If α = 1 this results in the uniform distribution on B.) Let n = K −1. Assume that the document multinomial parameters p1, . . . , pM (given in Eq. (2)) are the actual data. Now we formulate a geometric problem linking the population version of k-means and polytope estimation: Problem 1. Given a convex polytope A ∈Rn, a continuous probability density function f(x) supported by A, find a K-partition A = KF k=1 Ak that minimizes: K X k Z Ak ∥µk −x∥2 2f(x) dx, where µk is the center of mass of Ak: µk := 1 R Ak f(x) dx R Ak xf(x) dx. This problem is closely related to the Centroidal Voronoi Tessellations (Du et al., 1999). This connection can be exploited to show that Lemma 1. Problem 1 has a unique global minimizer. In the following lemma, a median of a simplex is a line segment joining a vertex of a simplex with the centroid of the opposite face. Lemma 2. If A ∈Rn is an equilateral simplex with symmetric Dirichlet density f parameterized by α, then the optimal centers of mass of the Problem 1 lie on the corresponding medians of A. 5 Based upon these two lemmas, consistency is established under two distinct asymptotic regimes. Theorem 1. Let B = Conv(β1, . . . , βK) be the true convex polytope from which the M-sample p1, . . . , pM ∈∆V −1 are drawn via Eq. (2), where θm iid ∼DirK(α) for m = 1, . . . , M. (a) If B is also an equilateral simplex, then topic estimates obtained by the GDM algorithm using the extension parameters given in Eq. (5) converge to the vertices of B in probability, as α is fixed and M →∞. (b) If M is fixed, while α →0 then the topic estimates obtained by the GDM also converge to the vertices of B in probability. 3.4 nGDM: nonparametric geometric inference of topics In practice, the number of topics K may be unknown, necessitating a nonparametric probabilistic approach such as the well-known Hierarchical Dirichlet Process (HDP) (Teh et al., 2006). Our geometric approach can be easily extended to this situation. The objective (4) is now given by min B G(B) = min B M X m=1 Nm min x∈B ∥x −¯wm∥2 2 + λ|B|, (6) where |B| denotes the number of extreme points of convex polytope B = Conv(β1, . . . , βK). Accordingly, our nGDM algorithm now consists of two steps: (i) solve a penalized and weighted k-means clustering to obtain the cluster centroids (e.g. using DP-means (Kulis & Jordan, 2012)); (ii) apply geometric correction for recovering the extreme points, which proceeds as before. Our theoretical analysis can be also extended to this nonparametric framework. We note that the penalty term is reminiscent of the DP-means algorithm of Kulis & Jordan (2012), which was derived under a small-variance asymptotics regime. For the HDP this corresponds to α →0 — the regime in part (b) of Theorem 1. This is an unrealistic assumption in practice. Our geometric correction arguably enables the accounting of the non-vanishing variance in data. We perform a simulation experiment for varying values of α and show that nGDM outperforms the KL version of DP-means (Jiang et al., 2012) in terms of perplexity. This result is reported in the Supplement. 4 Performance evaluation Simulation experiments We use the LDA model to simulate data and focus our attention on the perplexity of held-out data and minimum-matching Euclidean distance between the true and estimated topics (Tang et al., 2014). We explore settings with varying document lengths (Nm increasing from 10 to 1400 - Fig. 2(a) and Fig. 3(a)), different number of documents (M increasing from 100 to 7000 - Fig. 2(b) and Fig. 3(b)) and when lengths of documents are small, while number of documents is large (Nm = 50, M ranging from 1000 to 15000 - Fig. 2(c) and Fig. 3(c)). This last setting is of particular interest, since it is the most challenging for our algorithm, which in theory works well given long documents, but this is not always the case in practice. We compare two versions of the Geometric Dirichlet Means algorithm: with tuned extension parameters (tGDM) and the default one (GDM) (cf. Eq. 5) against the variational EM (VEM) algorithm (Blei et al., 2003) (with tuned hyperparameters), collapsed Gibbs sampling (Griffiths & Steyvers, 2004) (with true data generating hyperparameters), and RecoverKL (Arora et al., 2012) and verify the theoretical upper bounds for topic polytope estimation (i.e. either (log M/M)0.5 or (log Nm/Nm)0.5) - cf. Tang et al. (2014) and Nguyen (2015). We are also interested in estimating each document’s topic proportion via the projection technique. RecoverKL produced only a topic matrix, which is combined with our projection based estimates to compute the perplexity (Fig. 3). Unless otherwise specified, we set η = 0.1, α = 0.1, V = 1200, M = 1000, K = 5; Nm = 1000 for each m; the number of held-out documents is 100; results are averaged over 5 repetitions. Since finding exact solution to the k-means objective is NP hard, we use the algorithm of Hartigan & Wong (1979) with 10 restarts and the k-means++ initialization. Our results show that (i) Gibbs sampling and tGDM have the best and almost identical performance in terms of statistical estimation; (ii) RecoverKL and GDM are the fastest while sharing comparable statistical accuracy; (iii) VEM is the worst in most scenarios due to its instability (i.e. often producing poor topic estimates); (iv) short document lengths (Fig. 2(c) and Fig. 3(c)) do not degrade performance of GDM, (this appears to be an effect of the law of large 6 numbers, as the algorithm relies on the cluster means, which are obtained by averaging over a large number of documents); (v) our procedure for estimating document topic proportions results in a good quality perplexity of the RecoverKL algorithm in all scenarios (Fig. 3) and could be potentially utilized by other algorithms. Additional simulation experiments are presented in the Supplement, which considers settings with varying Nm, α and the nonparametric extension. G G GG G G G G G G G G G G G G 0.000 0.025 0.050 0.075 0 500 1000 Document length Nm MM distance G G GDM tGDM Gibbs sampling VEM 0.1(log(Nm) Nm)0.5 RecoverKL G G G G G G G G G G G G G G G G 0.000 0.005 0.010 0.015 0.020 0 2000 4000 6000 Number of documents M with Nm = 1000 G G GDM tGDM Gibbs sampling VEM 0.1(log(M) M)0.5 RecoverKL G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G 0.000 0.025 0.050 0.075 4000 8000 12000 Number of documents M with Nm = 50 G G GDM tGDM Gibbs sampling VEM 0.1(log(M) M)0.5 RecoverKL 0.01 0.02 0.03 0.0 0.3 0.6 0.9 η GDM tGDM RecoverKL Figure 2: Minimum-matching Euclidean distance: increasing Nm, M = 1000 (a); increasing M, Nm = 1000 (b); increasing M, Nm = 50 (c); increasing η, Nm = 50, M = 5000 (d). G G G G G G G G 250 275 300 325 350 375 0 500 1000 Document length Nm Perplexity G GDM tGDM Gibbs sampling VEM RecoverKL G G G G G G G G 260 270 280 290 300 0 2000 4000 6000 Number of documents M with Nm = 1000 G GDM tGDM Gibbs sampling VEM RecoverKL G G G G G G G G G G G G G G G 300 400 500 600 4000 8000 12000 Number of documents M with Nm = 50 G GDM tGDM Gibbs sampling VEM RecoverKL 0 250 500 750 0.0 0.3 0.6 0.9 η GDM tGDM RecoverKL Figure 3: Perplexity of the held-out data: increasing Nm, M = 1000 (a); increasing M, Nm = 1000 (b); increasing M, Nm = 50 (c); increasing η, Nm = 50, M = 5000 (d). Comparison to RecoverKL Both tGDM and RecoverKL exploit the geometry of the model, but they rely on very different assumptions: RecoverKL requires the presence of anchor words in the topics and exploits this in a crucial way (Arora et al., 2012); our method relies on long documents in theory, even though the violation of this does not appear to degrade its performance in practice, as we have shown earlier. The comparisons are performed by varying the document length Nm, and varying the Dirichlet parameter η (recall that βk|η ∼DirV (η)). In terms of perplexity, RecoverKL, GDM and tGDM perform similarly (see Fig.4(c,d)), with a slight edge to tGDM. Pronounced differences come in the quality of topic’s word distribution estimates. To give RecoverKL the advantage, we considered manually inserting anchor words for each topic generated, while keeping the document length short, Nm = 50 (Fig. 4(a,c)). We found that tGDM outperforms RecoverKL when η ≤0.3, an arguably more common setting, while RecoverKL is more accurate when η ≥0.5. However, if the presence of anchor words is not explicitly enforced, tGDM always outperforms RecoverKL in terms of topic distribution estimation accuracy for all η (Fig. 2(d)). The superiority of tGDM persists even as Nm varies from 50 to 10000 (Fig. 4(b)), while GDM is comparable to RecoverKL in this setting. NIPS corpora analysis We proceed with the analysis of the NIPS corpus.1 After preprocessing, there are 1738 documents and 4188 unique words. Length of documents ranges from 39 to 1403 with mean of 272. We consider K = 5, 10, 15, 20, α = 5 K , η = 0.1. For each value of K we set aside 300 documents chosen at random to compute the perplexity and average results over 3 repetitions. Our results are compared against Gibbs sampling, Variational EM and RecoverKL (Table 1). For K = 10, GDM with 1500 k-means iterations and 5 restarts in R took 50sec; Gibbs sampling with 5000 iterations took 10.5min; VEM with 750 variational, 1500 EM iterations and 3 restarts took 25.2min; RecoverKL coded in Python took 1.1min. We note that with recent developments (e.g., 1https://archive.ics.uci.edu/ml/datasets/Bag+of+Words 7 0.01 0.02 0.03 0.0 0.3 0.6 0.9 η MM distance GDM tGDM RecoverKL 0.005 0.010 0 2500 5000 7500 10000 Document length Nm GDM tGDM RecoverKL 0 250 500 750 0.0 0.3 0.6 0.9 η Perplexity GDM tGDM RecoverKL 260 265 270 275 280 0 2500 5000 7500 10000 Document length Nm GDM tGDM RecoverKL Figure 4: MM distance and Perplexity for varying η, Nm = 50 with anchors (a,c); varying Nm (b,d). (Hoffman et al., 2013)) VEM could be made faster, but its statistical accuracy remains poor. Although RecoverKL is as fast as GDM, its perplexity performance is poor and is getting worse with more topics, which we believe could be due to lack of anchor words in the data. We present topics found by Gibbs sampling, GDM and RecoverKL for K = 10 in the Supplement. Table 1: Perplexities of the 4 topic modeling algorithms trained on the NIPS dataset. GDM RecoverKL VEM Gibbs sampling K = 5 1269 1378 1980 1168 K = 10 1061 1235 1953 924 K = 15 957 1409 1545 802 K = 20 763 1586 1352 704 5 Discussion We wish to highlight a conceptual aspect of GDM distinguishing it from moment-based methods such as RecoverKL. GDM operates on the document-to-document distance/similarity matrix, as opposed to the second-order word-to-word matrix. So, from an optimization viewpoint, our method can be viewed as the dual to RecoverKL method, which must require anchor-word assumption to be computationally feasible and theoretically justifiable. While the computational complexity of RecoverKL grows with the vocabulary size and not the corpora size, our convex geometric approach continues to be computationally feasible when number of documents is large: since only documents near the polytope boundary are relevant in the inference of the extreme points, we can discard most documents residing near the polytope’s center. We discuss some potential improvements and extensions next. The tGDM algorithm showed a superior performance when the extension parameters are optimized. This procedure, while computationally effective relative to methods such as Gibbs sampler, may still be not scalable to massive datasets. It seems possible to reformulate the geometric objective as a function of extension parameters, whose optimization can be performed more efficiently. In terms of theory, we would like to establish the error bounds by exploiting the connection of topic inference to the geometric problem of Centroidal Voronoi Tessellation of a convex polytope. The geometric approach to topic modeling and inference may lend itself naturally to other LDA extensions, as we have demonstrated with nGDM algorithm for the HDP (Teh et al., 2006). Correlated topic models of Blei & Lafferty (2006a) also fit naturally into the geometric framework — we would need to adjust geometric modification to capture logistic normal distribution of topic proportions inside the topic polytope. Another interesting direction is to consider dynamic (Blei & Lafferty, 2006b) (extreme points of topic polytope evolving over time) and supervised (McAuliffe & Blei, 2008) settings. Such settings appear relatively more challenging, but they are worth pursuing further. Acknowledgments This research is supported in part by grants NSF CAREER DMS-1351362 and NSF CNS-1409303. 8 References Anandkumar, A., Foster, D. P., Hsu, D., Kakade, S. M., and Liu, Y. A spectral algorithm for Latent Dirichlet Allocation. Advances in Neural Information Processing Systems, 2012. Arora, S., Ge, R., Halpern, Y., Mimno, D., Moitra, A., Sontag, D., Wu, Y., and Zhu, M. A practical algorithm for topic modeling with provable guarantees. arXiv preprint arXiv:1212.4777, 2012. Blei, D. M. and Lafferty, J. D. Correlated topic models. Advances in Neural Information Processing Systems, 2006a. Blei, D. M. and Lafferty, J. D. Dynamic topic models. In Proceedings of the 23rd international conference on Machine learning, pp. 113–120. ACM, 2006b. Blei, D. M., Ng, A. Y., and Jordan, M. I. Latent Dirichlet Allocation. J. Mach. Learn. Res., 3:993–1022, March 2003. Deerwester, S., Dumais, S. T., Furnas, G. W., Landauer, T. K., and Harshman, R. Indexing by latent semantic analysis. Journal of the American Society for Information Science, 41(6):391, Sep 01 1990. Ding, C., Li, T., and Peng, W. Nonnegative matrix factorization and probabilistic latent semantic indexing: Equivalence chi-square statistic, and a hybrid method. In Proceedings of the National Conference on Artificial Intelligence, volume 21, pp. 342. AAAI Press; MIT Press, 2006. Du, Q., Faber, V., and Gunzburger, M. Centroidal Voronoi Tessellations: applications and algorithms. SIAM Review, 41(4):637–676, 1999. Golubitsky, O., Mazalov, V., and Watt, S. M. An algorithm to compute the distance from a point to a simplex. ACM Commun. Comput. Algebra, 46:57–57, 2012. Griffiths, T. L. and Steyvers, M. Finding scientific topics. PNAS, 101(suppl. 1):5228–5235, 2004. Hartigan, J. A. and Wong, M. A. Algorithm as 136: A K-means clustering algorithm. Journal of the Royal Statistical Society. Series C (Applied Statistics), 28(1):100–108, 1979. Hoffman, M. D., Blei, D. M., Wang, C., and Paisley, J. Stochastic variational inference. J. Mach. Learn. Res., 14 (1):1303–1347, May 2013. Hofmann, T. Probabilistic latent semantic indexing. In Proceedings of the 22nd Annual International ACM SIGIR Conference on Research and Development in Information Retrieval, SIGIR ’99, pp. 50–57. ACM, 1999. Jiang, K., Kulis, B., and Jordan, M. I. Small-variance asymptotics for exponential family Dirichlet process mixture models. In Advances in Neural Information Processing Systems, pp. 3158–3166, 2012. Kulis, B. and Jordan, M. I. Revisiting k-means: new algorithms via Bayesian nonparametrics. In Proceedings of the 29th International Conference on Machine Learning. ACM, 2012. McAuliffe, J. D. and Blei, D. M. Supervised topic models. In Advances in Neural Information Processing Systems, pp. 121–128, 2008. Nguyen, X. Posterior contraction of the population polytope in finite admixture models. Bernoulli, 21(1): 618–646, 02 2015. Pritchard, J. K., Stephens, M., and Donnelly, P. Inference of population structure using multilocus genotype data. Genetics, 155(2):945–959, 2000. Tang, J., Meng, Z., Nguyen, X., Mei, Q., and Zhang, M. Understanding the limiting factors of topic modeling via posterior contraction analysis. In Proceedings of the 31st International Conference on Machine Learning, pp. 190–198. ACM, 2014. Teh, Y. W., Jordan, M. I., Beal, M. J., and Blei, D. M. Hierarchical Dirichlet processes. Journal of the American Statistical Association, 101(476), 2006. Xu, W., Liu, X., and Gong, Y. Document clustering based on non-negative matrix factorization. In Proceedings of the 26th Annual International ACM SIGIR Conference on Research and Development in Informaion Retrieval, SIGIR ’03, pp. 267–273. ACM, 2003. 9
2016
371
6,296
Learned Region Sparsity and Diversity Also Predict Visual Attention Zijun Wei1∗, Hossein Adeli2∗, Gregory Zelinsky1,2, Minh Hoai1, Dimitris Samaras1 1. Department of Computer Science 2. Department of Psychology – Stony Brook University 1.{zijwei, minhhoai, samaras}@cs.stonybrook.edu 2.{hossein.adelijelodar, gregory.zelinsky}@stonybrook.edu *. Both authors contributed equally to this work Abstract Learned region sparsity has achieved state-of-the-art performance in classification tasks by exploiting and integrating a sparse set of local information into global decisions. The underlying mechanism resembles how people sample information from an image with their eye movements when making similar decisions. In this paper we incorporate the biologically plausible mechanism of Inhibition of Return into the learned region sparsity model, thereby imposing diversity on the selected regions. We investigate how these mechanisms of sparsity and diversity relate to visual attention by testing our model on three different types of visual search tasks. We report state-of-the-art results in predicting the locations of human gaze fixations, even though our model is trained only on image-level labels without object location annotations. Notably, the classification performance of the extended model remains the same as the original. This work suggests a new computational perspective on visual attention mechanisms, and shows how the inclusion of attention-based mechanisms can improve computer vision techniques. 1 Introduction Visual spatial attention refers to the narrowing of processing in the brain to particular objects in particular locations so as to mediate everyday tasks. A widely used paradigm for studying visual spatial attention is visual search, where a desired object must be located and recognized in a typically cluttered environment. Visual search is accompanied by observable estimates—in the form of gaze fixations—of how attention samples information from a scene while searching for a target. Efficient visual search requires prioritizing the locations of features of the target object class over features at locations offering less evidence for the target [31]. Computational models of visual search typically estimate and plot goal directed prioritization of visual space as priority maps for directing attention [32]. This form of target directed prioritization is different from the saliency modeling literature, where bottom-up feature contrast in an image is used to predict fixation behavior during the free-viewing of scenes [16]. The field of fixation prediction is highly active and growing [2], although it was not until fairly recently that attention researchers have begun using the sophisticated object detection techniques developed in the computer vision literature [8, 18, 31]. The dominant method used in the visual search literature to generate priority maps for detection has been the exhaustive detection mechanism [8, 18]. Using this method, an object detector is applied to an image to provide bounding boxes that are then combined, weighted by their detection scores, to generate a priority map [8]. While these models have had success in predicting behavior, training these detectors requires human labeled bounding boxes, which are expensive and laborious to collect, and also prone to individual annotator differences. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. An alternative approach to modeling visual attention is to determine how model and behavioral task performance depends on shared core computational principles [24]. To this end, a new class of attention-inspired models have been developed and applied to tasks ranging from image captioning [30] to hand writing generation [13], where selective spatial attention mechanisms have been shown to emerge [1, 25]. By requiring visual inputs to be gated in a manner similar to the human gating of visual inputs via fixations, these models are able to localize or “attend” selectively to the most informative regions of an input image while ignoring irrelevant visual inputs [25, 1]. This built in attention mechanism enables the model of [30], trained only on generating captions, to bias the visual input so as to gate only relevant information when generating each word to describe an image. Priority maps were then generated to show the mapping of attended image areas to generated words. While these new models show attention-like behavior, to our knowledge none have been used to predict actual human allocations of attention. The current work bridges the behavioral and computer vision literatures by using a classification model that has biologically plausible constraints to create a priority map for the purpose of predicting the allocation of spatial attention as measured by changes in fixation. The specific image-category classification model that we use is called Region Ranking SVM (RRSVM) [29]. This model was developed in our recent work [29], and it achieved state-of-the-art performance on a number of classification tasks by learning categorization with locally-pooled information from input images. This model works by imposing sparsity on selected image areas that contribute to the classification decision, much like how humans prioritize visual space and sample with fixations only a sparse set of image locations while attempting to detect and recognize object categories [4]. We believe that this analogy between sparse sampling and attention makes this model a natural candidate for predicting attention behavior in visual search tasks. It is worth noting that this model was originally created for object classification and not localization, hence no object localization data is used to train it, unlike standard fixation prediction algorithms [16, 17]. There are two contributions of our work. First, we show that the RSSVM model approaches stateof-the-art in predicting the fixations made by humans searching for the same targets in the same images. This means that a model trained solely for the purpose of image classification, without any localization data, is also able to predict the locations of fixations that people make while searching for the to-be-classified objects. Second, we incorporate the biologically plausible constraint of Inhibition of Return [10], which we model by requiring a set of diverse (minimally overlapping) sparse regions in RRSVM. Incorporating this constraint, we are able to reduce the error in fixation prediction (up to 21%). Importantly, adding the Inhibition of Return constraint does not affect the classification performance. By building this bridge, we hope to show how automated object detection might be improved by the inclusion of an attention mechanism, and how a recent attention-inspired approach from computer vision might illuminate how the brain prioritizes visual information for the efficient direction of spatial attention. 2 Region Ranking SVM Here we review Region Ranking SVM (RRSVM) [29]. The main problem addressed by RRSVM is image classification, which aims to recognize the semantic category of an image, such as whether the image contains a certain object (e.g., car, cat) or portrays a certain action (e.g., jumping, typing). RRSVM evaluates multiple local regions of an image, and subsequently outputs the classification decision based on a sparse set of regions. This mechanism is noteworthy and different from other approaches that aggregate information from multiple regions indistinguishably (e.g., [23, 28, 22, 14]). RRSVM assumes training data consisting of images {Bi}n i=1 and associated binary labels {yi}n i=1 indicating the presence or absence of the visual element (object or action) of interest. To account for the uncertainty of each semantic region in an image, RRSVM considers multiple local regions. The number of regions can differ between images, but for brevity, assume each image has the same number of regions. Let m be the number of regions for each image, and d the dimension of each region descriptor. RRSVM represents each image as a matrix Bi ∈ℜd×m, but the order of the columns can be arbitrary. RRSVM jointly learns a region evaluation function and a region selection function by minimizing: λ||w||2+Pn i=1(wT Γ(Bi; w)s+b−yi)2 subject to the constraints: s1 ≥s2 ≥· · · ≥sm ≥0 and h(Γ(Bi; w)s) ≤1. Here h(·) is the function that measures the spread of the column vectors of a matrix: h([x1, · · · , xn]) = Pn i=1 xi −1 n Pn i=1 xi 2 . w and b are the weight vector and the bias term of an SVM classifier, which are the parameters of the region 2 evaluation function. Γ(B; w) denotes a matrix that can be obtained by rearranging the columns of the matrix B so that wT Γ(B; w) is a sequence of non-increasing values. The vector s is the weight vector for combining the SVM region scores for each image [15]; this vector is common to all images of a class. The objective of the above formulation consists of the regularization term λ||w||2 and the sum of squared losses. This objective is based purely on classification performance. However, note that the classification decision is based on both the region evaluation function (i.e., w, b) and the region selection function (i.e., s), which are simultaneously learned using the above formulation. What is interesting is that the obtained s vector is always sparse. An experiment [29] on the ImageNet dataset [27] with 1000 classes showed that RRSVM generally uses 20 regions or less (from hundreds of local regions considered). This intriguing fact prompted us to consider the connection between sparse region selection and visual attention. Would machine-based discriminative localization reflect the allocation of human attention in visual search? It turns out that there is compelling evidence for a relationship, as will be shown in the experiment section. This relationship can be strengthened if RRSVM is extended to incorporate Inhibition of Return in the region selection process, which will be explained next. 3 Incorporating Inhibition of Return into Region Ranking SVM A mechanism critical to the modeling of human visual search behavior is Inhibition of Return: the lower probability of re-fixating on or near already attended areas, possibly mediated by lateral inhibition [16, 20]. This mechanism, however, is not currently enforced in the formulation of RRSVM, and indeed the spatial relationship between selected regions is not considered. RRSVM usually selects a sparse set of regions, but the selected regions are free to overlap and concentrate on a single image area. Inspired by Inhibition of Return, we consider an extension of RRSVM where non-maxima suppression is incorporated into the process of selecting regions. This mechanism will select the local maximum for nearby activation areas (a potential fixation location) and discard the rest (non-maxima nearby locations). The biological plausibility of non-maxima suppression has been discussed in previous work, where it was shown to be a plausible method for allowing the stronger activations to stand out (see [21, 7] for details). To incorporate non-maxima suppression in the framework of RRSVM, we replaced the region ranking procedure Γ(B; w) of RRSVM by Ψ(Bi; w, α), a procedure that ranks and subsequently returns the list of regions that do not significantly overlap with one another. In particular, we use intersection over union to measure overlap, where α is a threshold for tolerable overlap (we set α = 0.5 in our experiments). This leads to the following optimization problem: minimize w,s,b λ||w||2 + n X i=1 (wT Ψ(Bi; w, α)s + b −yi)2 (1) s.t. s1 ≥s2 ≥· · · ≥sm ≥0, (2) h(Ψ(Bi; w, α)s) ≤1. (3) The above formulation can be optimized in the same way as RRSVM in [29]. It will yield a classifier that makes a decision based on a sparse and diverse set of regions. Sparsity is inherited from RRSVM, and location diversity is attained using non-maxima suppression. Hereafter, we refer to this method as Sparse Diverse Regions (SDR) classifier. 4 Experiments and Analysis We present here empirical evidence showing that learned region sparsity and diversity can also predict visual attention. We first describe the implementation details of RRSVM and SDR. We then consider attention prediction under three conditions: (1) single-target present, that is to find the one instance of a target category appearing in a stimulus image; (2) target absent, i.e., searching for a target category that does not appear in the image; and (3) multiple-targets present, i.e., searching for multiple object categories where at least one is present in the image. Experiments are performed on three datasets POET [26], PET [11] and MIT900 [8], which are the only available datasets for object search tasks. 3 4.1 Implementation details of RRSVM and SDR Our implementation of RRSVM and SDR is similar to [29], but we consider more local regions. This yields a finer localization map without changing the classification performance. As in [29], the feature extraction pipeline is based on VGG16 [28]. The last fully connected layer of VGG16 is removed and the remaining fully connected layer is converted to a fully convolutional layer. To compute feature vectors for multiple regions of an image, the image is resized and then fed into VGG16 to yield a feature map with 4096 channels. The size of the feature map depends on the size of the resized image, and each feature map corresponds to a subwindow of the original image. By resizing the original image to multiple sizes, one can compute feature vectors for multiple regions of the original image. In this work, we consider 7 different image sizes instead of the three sizes used by [28, 29]. The first three resized images are obtained by scaling the image isotropically so that the smallest dimension is 256, 384, or 512. For brevity, assuming the width is smaller than the height, this yields three images with dimensions 256 × a, 384 × b, and 512 × c. We consider four other resized images with dimensions 256 × b, 384 × c, 384 × a, 512 × b. These image sizes correspond to local regions having an aspect ratio of either 2:3 or 3:2, while the isotropically resized images yield square local regions. Additionally, we also consider horizontal flips of the resized images. Overall, this process yields 700 to 1000 feature vectors, each corresponding to a local image region. The RRSVM and SDR classifiers used in the following experiments are trained on the trainval set of PASCAL VOC 2007 dataset [9] unless otherwise stated. This dataset is distinct from the datasets used for evaluation. For SDR, the non-maxima suppression threshold is 0.5, and we only keep the top ranked regions that have non-zero region scores (si ≥0.01). To generate a priority map, we first associate each pixel with an integer indicating the total number of selected regions covering that pixel, then apply a Gaussian blur kernel to the integer valued map, with the kernel width tuned on the validation set. To test whether learned region sparsity and diversity predicts human attention, we compare the generated priority maps with the behaviorally-derived fixation density maps. To make this comparison we use the Area Under the ROC Curve (AUC), a commonly used metric for visual search task evaluation [6]. We use the publicly available implementation of the AUC evaluation from the MIT saliency benchmark [5], specifically the AUC-Judd implementation for its better approximation. 4.2 Single-target present condition We consider visual attention in the single-target present condition using the POET dataset [26]. This dataset is a subset of PASCAL VOC 2012 dataset [9], and it has 6270 images from 10 object categories (aeroplane, boat, bike, motorbike, cat, dog, horse, cow, sofa and dining table). The task was two-alternative forced choice for object categories, approximating visual search, and eye movement data were collected from 5 subjects as they freely viewed these images. On average, 5.7 fixations were made per image. The SDR classifier is trained on the trainval set of PASCAL VOC 2007 dataset, which does not overlap with the POET dataset. We randomly selected one third of the images for each category to compile a validation set for tuning the width of the Gaussian blur kernel for all categories. The rest were used as test images. For each test image, we compare the priority map generated for the selected regions by RRSVM with the human fixation density map. The overall correlation is high, yielding a mean AUC score of 0.81 (on all images of 10 object classes). This is intriguing because RRSVM is optimized for classification performance only; joint classification is apparently related to discriminative localization by human attention in the context of a visual search task. By incorporating Inhibition of Return into RRSVM, we observe even stronger correlation with human behavior, with the mean AUC score obtained by SDR now being 0.85. The left part of Table 1 shows AUC scores for individual categories of the POET dataset. We compare the performance of other attention prediction baselines. All recent fixation prediction models [8, 19, 31] apply object category detectors on the input image and combine the detection results to create priority maps. Unfortunately, direct comparison to these models is not currently possible due to the unavailability of needed code and datasets. However, our RCNN [12] baseline, which is the state-of-the-art object detector on this dataset, should improve the pipelines of these models. To account for possible localization errors and multiple object instances, we keep all the detections with a detection score greater than a threshold. This threshold is chosen to maximize the 4 Table 1: AUC scores on POET and PET test sets POET PET Model aero bike boat cat cow table dog horse mbike sofa mean multi-target SDR 0.87 0.85 0.83 0.89 0.88 0.79 0.88 0.86 0.86 0.77 0.85 0.83 RCNN 0.84 0.83 0.79 0.84 0.81 0.76 0.83 0.80 0.87 0.76 0.82 0.77 CAM [34] 0.86 0.78 0.78 0.88 0.84 0.74 0.87 0.84 0.83 0.67 0.82 0.65 AnnoBoxes 0.85 0.86 0.81 0.84 0.84 0.79 0.80 0.80 0.88 0.80 0.83 0.82 Figure 1: Priority maps generated for SDR on the POET dataset. Warm colors represent high values. Dots represents human fixations. Best viewed on a digital device. detector’s F1 score, which is the harmonic mean between precision and recall. We also consider a variant method where only the top detection is kept, but the result is not as good. We also consider the recently proposed weakly-supervised object localization approach of [34], which is denoted as CAM in Table 1. We use the released model to extract features and train a linear SVM on top of the features. For each test image, we weigh a linear sum of local activations to create an activation map. We normalize the activation map to get the priority map. We even compare SDR with a method that directly uses the annotated object bounding boxes to predict human attention, which is denoted as AnnoBoxes in the table. For this method, the priority map is created by applying a Gaussian filter to a binary map where the center of the bounding box over the target(s) is set to 1 and everywhere else 0. Notably, the methods selected for comparison are strong models for predicting human attention. RCNN has an unfair advantage over SDR because it has access to localized annotations in its training data, and AnnoBoxes even assumes the availability of object bounding boxes for test data. As can be seen from Table 1, SDR significantly outperforms the other methods. This provides strong empirical evidence suggesting that learned region sparsity and diversity is highly predictive human attention. Fig. 1 shows some randomly selected results from SDR on test images. Note that the incorporation of Inhibition of Return into RRSVM and the consideration of more local regions does not affect the classification performance. When evaluated on the PASCAL VOC 2007 test set, the RRSVM method that uses local regions corresponding to 3 image scales (as in [29]), the RRSVM method that uses more regions with different aspect ratios (as explained in Sec. 4.1), and the RRSVM method that incorporates the NMS mechanism (i.e., SDR), all achieve a mean AP of 92.9%. SDR, however, is significantly better than RRSVM in predicting fixations during search tasks, increasing the mean AUC score from 0.81 to 0.85. Also note that the predictive power of SDR is not sensitive to the value of α: for aeroplane on the POET dataset, the AUC scores remain the same (0.87) when α is varied from 0.5 to 0.7. Figure 2 shows some examples highlighting the difference between the regions selected by RRSVM and SDR. As can be seen, incorporating non-maxima suppression encourages greater dispersion of 5 (a) (b) KLDiv 0.11 0.29 0.61 0.89 Figure 2: Comparison between RRSVM and SDR on the POET dataset. (a): priority maps created by RRSVM, (b): priority maps generated by SDR. SDR better captures fixations when there are multiple instances of the target categories. The KL Divergence scores between RRSVM and SDR are reported in the bottom row. (a) motorbike (b) aeroplane (c) diningtable (d) cow Figure 3: Failure cases. Representative images where the priority maps produced by SDR are significantly different from human fixations. The caption under each image indicates the target category. The modes of failure are: (a) failure in classification; (b) and (c) existence of a more attractive object (text or face); (d) co-occurrence of multiple objects. Best viewed on digital devices. the sparse areas as opposed to a more clustered distribution in RRSVM. This in turn better predicts attention when there are multiple instances of the target object in the display. Figure 3 shows representative cases where the priority maps produced by SDR are significantly different from human fixations. The common failure modes are: (1) failure to locate the correct region for correct classification (see Fig 3a); (2) particularly distracting elements in the scene, such as text (3b) or faces (3c); (3) failure to attend to multiple instances of the target categories. Tuning SDR using human fixation behavioral data [17] and combining SDR with multiple sources of guidance information [8], including saliency and scene context, could mitigate some of the model limitations. 4.3 Target absent condition To test whether SDR is able to predict people’s fixations when the search target is absent, we performed experiments on 456 target-absent images from the MIT900 dataset [8]. Human observers were asked to search for people in real world scenes. Eye movement data were collected from 14 searchers who made roughly 6 fixations per image, on average. We picked a random subset of 150 images to tune the Gaussian blur parameter and reported the results for the remaining 306 images. We noticed that the sizes and poses of the people in these images were very different from those of the training samples in VOC2007, which could have led to poor SDR classification performance. In order to address this issue, we augmented the training set of SDR with 456 images from MIT900 that contain people. The added training examples were a disjoint set from the target-absent images for evaluation. On these target absent cases, SDR achieves an AUC score of 0.78. As a reference, the method of Ehinger et al. [8] also achieves AUC of 0.78. But the two methods are not directly comparable because Ehinger et al. [8] used a HOG-based person detector that was trained on a much larger dataset with location annotation. 6 Figure 4: Priority map predictions using SDR on some MIT target-absent stimuli. Warm colors represent high probabilities. Dots indicate human fixations. Best viewed on a digital device. (a) dog and sheep (b) cows and sheep (c) dog and cat (d) cows Figure 5: Visualization of SDR prediction on the PET dataset. Note that the high classification accuracy ensures that more reliable regions are detected. Figure 4 shows some randomly selected results from the test set demonstrating SDR’s success in predicting where people attend. Interestingly, SDR looks at regions that either contain person-like objects or are likely to contain persons (e.g., sidewalks), with the latter observation likely the result of sidewalks co-occurring with persons in the positive training samples (a form of scene context effect). 4.4 Multiple-target attention We considered human visual search behavior when there were multiple targets. The experiments were performed on the PET dataset [11]. This dataset is a subset of PASCAL VOC2012 dataset [9], and it contains 4135 images from 6 animal categories (cat, dog, bird, horse cow and sheep). Four subjects were instructed to find all of the animals in each image. Eye movements were recorded, where each subject made roughly 6 fixations per image. We excluded the images that contained people to avoid ambiguity with the animal category. We also removed the images that were shared with the PASCAL VOC 2007 dataset to ensure no overlap between training and testing data. This yielded a total of 3309 images from which a random set of 1300 images were selected for tuning the Gaussian kernel width parameter. The remaining 2309 images were used for testing. To model the search for multiple categories in an image, for all methods except AnnoBoxes we applied six animal classifiers/detectors simultaneously to the test image. For each classifier/detector of each category, a threshold was selected to achieve the highest F1 score on the validation data. The prediction results are shown in the right part of Tab. 1. SDR significantly outperforms other methods. Notably, CAM performs poorly on this dataset, due perhaps to the low classification accuracy of that model (83% mAP on VOC 2007 test set as opposed to 93% of SDR). Some randomly selected results are shown in Fig. 5. 4.5 Center Bias For the POET dataset, some of the target objects are quite iconic and in the center of the image. For these cases, a simple center bias map might be a good predictor of the fixations. To test this, we generated priority maps by setting the center of the image to 1 and everywhere else 0, and then applying a Gaussian filter with sigma tuned on the validation set. This simple Center Bias (CB) map achieved an AUC score of 0.84, which is even higher than some of the methods presented in Tab. 1. This prompted us to analyze whether the good performance of SDR is simply due to center bias. An intuitive way to address the CB problem would be to use Shuffled AUC (sAUC) [33]. However, sAUC favors true positives over false negatives and gives more credit to off-center information [3], which may lead to biased results. This is especially true when the datasets are center-biased. The sAUC scores for RCNN, AnnoBox, CAM, SDR, and Inter-Observer [3] are 0.61, 0.61, 0.65, 0.64, and 0.70, respectively. SDR outperforms AnnoBox and RCNN by 3% and is on par with CAM. Also 7 (a) (b) Figure 6: (a): Red bars: the distribution of AUC scores of SDR for which the AUC scores of Center Bias are under 0.6. Blue bars: the distribution of AUC scores Center Bias where AUC scores of SDR are under 0.6. (b): The box plot for the distributions of KL divergence between Center Bias and SDR scores on each class in POET dataset. The KL divergence distribution revealed that the priority maps created by Center Bias are significantly different from the ones created by SDR. note that sAUC for Inter-Observer is 0.70, which suggests the existence of center bias in POET (the sAUC score of Inter-Observer on MIT300 [17] is 0.81) and raises a concern that sAUC might be misleading for model comparison using this dataset. To further address the concern of center bias, we show in Fig. 6 that the priority maps produced by SDR and Center Bias are quite different. Fig. 6a plots the distribution of the AUC scores for one method when the AUC scores of the other method was low (< 0.6). The spread of these distributions indicate a low correlation between the errors of the two methods. Fig. 6b shows a box plot of the distribution of KL divergence [6] between the priority maps generated by SDR and Center Bias. For each category, the mean KL divergence value is high, indicating a large difference between SDR and Center Bias. For a more qualitative intuition of KL divergence in these distributions, see Figure 2. The center bias effect in PET and MIT900 is not as pronounced as in POET because there are multiple target objects in the PET images and the target objects in the MIT900 dataset are relatively small. For these datasets, Center Bias achieves AUC scores of 0.78 and 0.72, respectively. These numbers are significantly lower than the results obtained by SDR, which are 0.82 and 0.78, respectively. 5 Conclusions and Future Work We introduced a classification model based on sparse and diverse region ranking and selection, which is trained only on image level annotations. We then provided experimental evidence from visual search tasks under three different conditions to support our hypothesis that these computational mechanisms might be analogous to computations underlying visual attention processes in the brain. While this work is not the first to use computer vision models to predict where humans look in visual search tasks, it is the first to show that core mechanisms driving high model performance in a search task also predict how humans allocate their attention in the same tasks. By improving upon these core computational principles, and perhaps by incorporating new ones suggested by attention mechanisms, our hope is to shed more light on human visual processing. There are several directions for future work. The first is to create a visual search dataset that mitigates the center bias effect and avoids cases of trivially easy search. The second is to incorporate into the current model known factors affecting search, such as a center bias, bottom-up saliency, scene context, etc., to better predict shifts in human spatial attention. Acknowledgment. This project was partially supported by the National Science Foundation Awards IIS-1161876 and IIS-1566248 and the Subsample project from the Digiteo Institute, France. References [1] J. Ba, V. Mnih, and K. Kavukcuoglu. Multiple object recognition with visual attention. In ICLR, 2015. [2] A. Borji and L. Itti. State-of-the-art in visual attention modeling. PAMI, 35(1):185–207, 2013. 8 [3] A. Borji, H. R. Tavakoli, D. N. Sihite, and L. Itti. Analysis of scores, datasets, and models in visual saliency prediction. In ICCV, 2013. [4] N. D. Bruce and J. K. Tsotsos. Saliency, attention, and visual search: An information theoretic approach. Journal of Vision, 9(3):5–5, 2009. [5] Z. Bylinskii, T. Judd, A. Borji, L. Itti, F. Durand, A. Oliva, and A. Torralba. Mit saliency benchmark. http://saliency.mit.edu/. [6] Z. Bylinskii, T. Judd, A. Oliva, A. Torralba, and F. Durand. What do different evaluation metrics tell us about saliency models? arXiv preprint arXiv:1604.03605, 2016. [7] P. Dario, G. Sandini, and P. Aebischer. Robots and biological systems: Towards a new bionics? In NATO Advanced Workshop, 2012. [8] K. A. Ehinger, B. Hidalgo-Sotelo, A. Torralba, and A. Oliva. Modelling search for people in 900 scenes: A combined source model of eye guidance. Visual Cognition, 17(6-7):945–978, 2009. [9] M. Everingham, S. M. A. Eslami, L. V. Gool, C. K. I. Williams, J. Winn, and A. Zisserman. The pascal visual object classes challenge: A retrospective. IJCV, 111(1):98–136, 2015. [10] J. H. Fecteau and D. P. Munoz. Salience, relevance, and firing: a priority map for target selection. Trends in cognitive sciences, 10(8):382–390, 2006. [11] S. O. Gilani, R. Subramanian, Y. Yan, D. Melcher, N. Sebe, and S. Winkler. Pet: An eye-tracking dataset for animal-centric pascal object classes. In ICME, 2015. [12] R. Girshick, J. Donahue, T. Darrell, and J. Malik. Rich feature hierarchies for accurate object detection and semantic segmentation. In CVPR, 2014. [13] A. Graves. Generating sequences with recurrent neural networks. arXiv preprint arXiv:1308.0850, 2013. [14] M. Hoai. Regularized max pooling for image categorization. In Proc. BMVC., 2014. [15] M. Hoai and A. Zisserman. Improving human action recognition using score distribution and ranking. In Proc. ACCV, 2014. [16] L. Itti and C. Koch. A saliency-based search mechanism for overt and covert shifts of visual attention. Vision Research, 40(10):1489–1506, 2000. [17] T. Judd, K. Ehinger, F. Durand, and A. Torralba. Learning to predict where humans look. In Proc. ICCV. IEEE, 2009. [18] C. Kanan, M. H. Tong, L. Zhang, and G. W. Cottrell. Sun: Top-down saliency using natural statistics. Visual Cognition, 17(6-7):979–1003, 2009. [19] A. Kannan, J. Winn, and C. Rother. Clustering appearance and shape by learning jigsaws. In NIPS. 2007. [20] C. Koch and S. Ullman. Shifts in selective visual attention: towards the underlying neural circuitry. In Matters of intelligence, pages 115–141. Springer, 1987. [21] I. Kokkinos, R. Deriche, T. Papadopoulo, O. Faugeras, and P. Maragos. Towards bridging the Gap between Biological and Computational Image Segmentation. Research Report RR-6317, INRIA, 2007. [22] A. Krizhevsky, I. Sutskever, and G. E. Hinton. Imagenet classification with deep convolutional neural networks. In NIPS, 2012. [23] S. Lazebnik, C. Schmid, and J. Ponce. Beyond bags of features: Spatial pyramid matching for recognizing natural scene categories. In CVPR, 2006. [24] T. S. Lee and X. Y. Stella. An information-theoretic framework for understanding saccadic eye movements. In NIPS, 1999. [25] V. Mnih, N. Heess, A. Graves, et al. Recurrent models of visual attention. In NIPS, 2014. [26] D. P. Papadopoulos, A. D. Clarke, F. Keller, and V. Ferrari. Training object class detectors from eye tracking data. In ECCV. 2014. [27] O. Russakovsky, J. Deng, H. Su, J. Krause, S. Satheesh, S. Ma, Z. Huang, A. Karpathy, A. Khosla, M. Bernstein, A. C. Berg, and L. Fei-Fei. Imagenet large scale visual recognition challenge. IJCV, 2015. [28] K. Simonyan and A. Zisserman. Very deep convolutional networks for large-scale image recognition. In ICLR, 2015. [29] Z. Wei and M. Hoai. Region ranking svms for image classification. In CVPR, 2016. [30] K. Xu, J. Ba, R. Kiros, K. Cho, A. Courville, R. Salakhudinov, R. Zemel, and Y. Bengio. Show, attend and tell: Neural image caption generation with visual attention. In ICML, 2015. [31] G. J. Zelinsky, H. Adeli, Y. Peng, and D. Samaras. Modelling eye movements in a categorical search task. Philosophical Transactions of the Royal Society of London B: Biological Sciences, 368(1628):20130058, 2013. [32] G. J. Zelinsky and J. W. Bisley. The what, where, and why of priority maps and their interactions with visual working memory. Annals of the New York Academy of Sciences, 1339(1):154–164, 2015. [33] L. Zhang, M. H. Tong, T. K. Marks, H. Shan, and G. W. Cottrell. Sun: A bayesian framework for saliency using natural statistics. Journal of vision, 8(7):32–32, 2008. [34] B. Zhou, A. Khosla, L. A., A. Oliva, and A. Torralba. Learning Deep Features for Discriminative Localization. CVPR, 2016. 9
2016
372
6,297
Deep Learning Models of the Retinal Response to Natural Scenes Lane T. McIntosh∗1, Niru Maheswaranathan∗1, Aran Nayebi1, Surya Ganguli2,3, Stephen A. Baccus3 1Neurosciences PhD Program, 2Department of Applied Physics, 3Neurobiology Department Stanford University {lmcintosh, nirum, anayebi, sganguli, baccus}@stanford.edu Abstract A central challenge in sensory neuroscience is to understand neural computations and circuit mechanisms that underlie the encoding of ethologically relevant, natural stimuli. In multilayered neural circuits, nonlinear processes such as synaptic transmission and spiking dynamics present a significant obstacle to the creation of accurate computational models of responses to natural stimuli. Here we demonstrate that deep convolutional neural networks (CNNs) capture retinal responses to natural scenes nearly to within the variability of a cell’s response, and are markedly more accurate than linear-nonlinear (LN) models and Generalized Linear Models (GLMs). Moreover, we find two additional surprising properties of CNNs: they are less susceptible to overfitting than their LN counterparts when trained on small amounts of data, and generalize better when tested on stimuli drawn from a different distribution (e.g. between natural scenes and white noise). An examination of the learned CNNs reveals several properties. First, a richer set of feature maps is necessary for predicting the responses to natural scenes compared to white noise. Second, temporally precise responses to slowly varying inputs originate from feedforward inhibition, similar to known retinal mechanisms. Third, the injection of latent noise sources in intermediate layers enables our model to capture the sub-Poisson spiking variability observed in retinal ganglion cells. Fourth, augmenting our CNNs with recurrent lateral connections enables them to capture contrast adaptation as an emergent property of accurately describing retinal responses to natural scenes. These methods can be readily generalized to other sensory modalities and stimulus ensembles. Overall, this work demonstrates that CNNs not only accurately capture sensory circuit responses to natural scenes, but also can yield information about the circuit’s internal structure and function. 1 Introduction A fundamental goal of sensory neuroscience involves building accurate neural encoding models that predict the response of a sensory area to a stimulus of interest. These models have been used to shed light on circuit computations [1, 2, 3, 4], uncover novel mechanisms [5, 6], highlight gaps in our understanding [7], and quantify theoretical predictions [8, 9]. A commonly used model for retinal responses is a linear-nonlinear (LN) model that combines a linear spatiotemporal filter with a single static nonlinearity. Although LN models have been used to describe responses to artificial stimuli such as spatiotemporal white noise [10, 2], they fail to generalize to natural stimuli [7]. Furthermore, the white noise stimuli used in previous studies are often low resolution or spatially uniform and therefore fail to differentially activate nonlinear subunits in the ∗These authors contributed equally to this work. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. … … time 8 subunits 16 subunits convolution convolution dense responses Figure 1: A schematic of the model architecture. The stimulus was convolved with 8 learned spatiotemporal filters whose activations were rectified. The second convolutional layer then projected the activity of these subunits through spatial filters onto 16 subunit types, whose activity was linearly combined and passed through a final soft rectifying nonlinearity to yield the predicted response. retina, potentially simplifying the retinal response to such stimuli [11, 12, 2, 10, 13]. In contrast to the perceived linearity of the retinal response to coarse stimuli, the retina performs a wide variety of nonlinear computations including object motion detection [6], adaptation to complex spatiotemporal patterns [14], encoding spatial structure as spike latency [15], and anticipation of periodic stimuli [16], to name a few. However it is unclear what role these nonlinear computational mechanisms have in generating responses to more general natural stimuli. To better understand the visual code for natural stimuli, we modeled retinal responses to natural image sequences with convolutional neural networks (CNNs). CNNs have been successful at many pattern recognition and function approximation tasks [17]. In addition, these models cascade multiple layers of spatiotemporal filtering and rectification–exactly the elementary computational building blocks thought to underlie complex functional responses of sensory circuits. Previous work utilized CNNs to gain insight into the neural computations of inferotemporal cortex [18], but these models have not been applied to early sensory areas where knowledge of neural circuitry can provide important validation for such models. We find that deep neural network models markedly outperform previous models in predicting retinal responses both for white noise and natural scenes. Moreover, these models generalize better to unseen stimulus classes, and learn internal features consistent with known retinal properties, including sub-Poisson variability, feedforward inhibition, and contrast adaptation. Our findings indicate that CNNs can reveal both neural computations and mechanisms within a multilayered neural circuit under natural stimulation. 2 Methods The spiking activity of a population of tiger salamander retinal ganglion cells was recorded in response to both sequences of natural images jittered with the statistics of eye movements and high resolution spatiotemporal white noise. Convolutional neural networks were trained to predict ganglion cell responses to each stimulus class, simultaneously for all cells in the recorded population of a given retina. For a comparison baseline, we also trained linear-nonlinear models [19] and generalized linear models (GLMs) with spike history feedback [2]. More details on the stimuli, retinal recordings, experimental structure, and division of data for training, validation, and testing are given in the Supplemental Material. 2.1 Architecture and optimization The convolutional neural network architecture is shown in Figure 2.1. Model parameters were optimized to minimize a loss function corresponding to the negative log-likelihood under Poisson spike generation. Optimization was performed using ADAM [20] via the Keras and Theano software libraries [21]. The networks were regularized with an ℓ2 weight penalty at each layer and an ℓ1 activity penalty at the final layer, which helped maintain a baseline firing rate near 0 Hz. 2 We explored a variety of architectures for the CNN, varying the number of layers, number of filters per layer, the type of layer (convolutional or dense), and the size of the convolutional filters. Increasing the number of layers increased prediction accuracy on held-out data up to three layers, after which performance saturated. One implication of this architecture search is that LN-LN cascade models – which are equivalent to a 2-layer CNN – would also underperform 3 layer CNN models. Contrary to the increasingly small filter sizes used by many state-of-the-art object recognition networks, our networks had better performance using filter sizes in excess of 15x15 checkers. Models were trained over the course of 100 epochs, with early-stopping guided by a validation set. See Supplementary Materials for details on the baseline models we used for comparison. 3 Results We found that convolutional neural networks were substantially better at predicting retinal responses than either linear-nonlinear (LN) models or generalized linear models (GLMs) on both white noise and natural scene stimuli (Figure 2). 3.1 Performance E A B White noise Natural scenes CNN LN D Retinal reliability C Data 6 trials GLM CNN LN GLM CNN LN GLM Firing Rate (Hz) Time (seconds) ROC Curve for Natural Scenes Figure 2: Model performance. (A,B) Correlation coefficients between the data and CNN, GLM or LN models for white noise and natural scenes. Dotted line indicates a measure of retinal reliability (See Methods). (C) Receiver Operating Characteristic (ROC) curve for spike events for CNN, GLM and LN models. (D) Spike rasters of one example retinal ganglion cell responding to 6 repeated trials of the same randomly selected segment of the natural scenes stimulus (black) compared to the predictions of the LN (red), GLM (green), or CNN (blue) model with Poisson spike generation used to generate model rasters. (E) Peristimulus time histogram (PSTH) of the spike rasters in (D). 3 LN models and GLMs failed to capture retinal responses to natural scenes (Figure 2B) consistent with previous results [7]. In addition, we also found that LN models only captured a small fraction of the response to high resolution spatiotemporal white noise, presumably because of the finer resolution that were used (Figure 2A). In contrast, CNNs approach the reliability of the retina for both white noise and natural scenes. Using other metrics, including fraction of explained variance, log-likelihood, and mean squared error, CNNs showed a robust gain in performance over previously described sensory encoding models. We investigated how model performance varied as a function of training data, and found that LN models were more susceptible to overfitting than CNNs, despite having fewer parameters (Figure 4A). In particular, a CNN model trained using just 25 minutes of data had better held out performance than an LN model fit using the full 60 minute recording. We expect that both depth and convolutional filters act as implicit regularizers for CNN models, thereby increasing generalization performance. 3.2 CNN model parameters Figure 3 shows a visualization of the model parameters learned when a convolutional network is trained to predict responses to either white noise or natural scenes. We visualized the average feature represented by a model unit by computing a response-weighted average for that unit. Models trained on white noise learned first layer features with small (∼200 µm) receptive field widths (top left box in Figure 3), whereas the natural scene model learns spatiotemporal filters with overall lower spatial and temporal frequencies. This is likely in part due to the abundance of low spatial frequencies present in natural images [22]. We see a greater diversity of spatiotemporal features in the second layer receptive fields compared to the first (bottom panels in Figure 3). Additionally, we see more diversity in models trained on natural scenes, compared to white noise. Figure 3: Model parameters visualized by computing a response-weighted average for different model units, computed for models trained on spatiotemporal white noise stimuli (left) or natural image sequences (right). Top panel (purple box): visualization of units in the first layer. Each 3D spatiotemporal receptive field is displayed via a rank-one decomposition consisting of a spatial filter (top) and temporal kernel (black traces, bottom). Bottom panel (green box): receptive fields for the second layer units, again visualized using a rank-one decomposition. Natural scenes models required more active second layer units, displaying a greater diversity of spatiotemporal features. Receptive fields are cropped to the region of space where the subunits have non-zero sensitivity. 3.3 Generalization across stimulus distributions Historically, much of our understanding of the retina comes from fitting models to responses to artificial stimuli and then generalizing this understanding to cases where the stimulus distribution is more natural. Due to the large difference between artificial and natural stimulus distributions, it is unknown what retinal encoding properties generalize to a new stimulus. 4 Figure 4: CNNs overfit less and generalize better across stimulus class as compared to simpler models. (A) Held-out performance curves for CNN (∼150,000 parameters) and GLM/LN models cropped around the cell’s receptive field (∼4,000 parameters) as a function of the amount of training data. (B) Correlation coefficients between responses to natural scenes and models trained on white noise but tested on natural scenes. See text for discussion. We explored what portion of CNN, GLM, and LN model performance is specific to a particular stimulus distribution (white noise or natural scenes), versus what portion describes characteristics of the retinal response that generalize to another stimulus class. We found that CNNs trained on responses to one stimulus class generalized better to a stimulus distribution that the model was not trained on (Figure 4B). Despite LN models having fewer parameters, they nonetheless underperform larger convolutional neural network models when predicting responses to stimuli not drawn from the training distribution. GLMs faired particularly poorly when generalizing to natural scene responses, likely because changes in mean luminance result in pathological firing rates after the GLM’s exponential nonlinearity. Compared to standard models, CNNs provide a more accurate description of sensory responses to natural stimuli even when trained on artificial stimuli (Figure 4B). 3.4 Capturing uncertainty of the neural response In addition to describing the average response to a particular stimulus, an accurate model should also capture the variability about the mean response. Typical noise models assume i.i.d. Poisson noise drawn from a deterministic mean firing rate. However, the variability in retinal spiking is actually sub-Poisson, that is, the variability scales with the mean but then increases sublinearly at higher mean rates [23, 24]. By training models with injected noise [25], we provided a latent noise source in the network that models the unobserved internal variability in the retinal population. Surprisingly, the model learned to shape injected Gaussian noise to qualitatively match the shape of the true retinal noise distribution, increasing with the mean response but growing sublinearly at higher mean rates (Figure 5). Notably, this relationship only arises when noise is injected during optimization–injecting Gaussian noise in a pre-trained network simply produced a linear scaling of the noise variance as a function of the mean. 3.5 Feedforward inhibition shapes temporal responses in the model To understand how a particular model response arises, we visualized the flow of signals through the network. One prominent aspect of the difference between CNN and LN model responses is that CNNs but not LN models captured the precise timing and short duration of firing events. By examining the responses to the internal units of CNNs in time and averaged over space (Figure 6 A-C), we found that in both convolutional layers, different units had either positive or negative responses to the same stimuli, equivalent to excitation and inhibition as found in the retina. Precise timing in CNNs arises by a timed combination of positive and negative responses, analogous to feedforward inhibition that is thought to generate precise timing in the retina [26, 27]. To examine network responses in 5 Variance in Spike Count Mean Spike Count A Mean Spike Count Normalized Variance in Spike Count Mean Spike Count B Variance in Spike Count C Data Poisson 0.1 0.1 1.0 2.0 4.0 10.0 Data Poisson 1.0 2.0 4.0 10.0 Figure 5: Training with added noise recovers retinal sub-Poisson noise scaling property. (A) Variance versus mean spike count for CNNs with various strengths of injected noise (from 0.1 to 10 standard deviations), as compared to retinal data (black) and a Poisson distribution (dotted red). (B) The same plot as A but with each curve normalized by the maximum variance. (C) Variance versus mean spike count for CNN models with noise injection at test time but not during training. space, we selected a particular time in the experiment and visualized the activation maps in the first (purple) and second (green) convolutional layers (Figure 6D). A given image is shown decomposed through multiple parallel channels in this manner. Finally, Figure 6E highlights how the temporal autocorrelation in the signals at different layers varies. There is a progressive sharpening of the response, such that by the time it reaches the model output the predicted responses are able to mimic the statistics of the real firing events (Figure 6C). 3.6 Feedback over long timescales Retinal dynamics are known to exceed the duration of the filters that we used (400 ms). In particular, changes in stimulus statistics such as luminance, contrast and spatio-temporal correlations can generate adaptation lasting seconds to tens of seconds [5, 28, 14]. Therefore, we additionally explored adding feedback over longer timescales to the convolutional network. To do this, we added a recurrent neural network (RNN) layer with a history of 10s after the fully connected layer prior to the output layer. We experimented with different recurrent architectures (LSTMs [29], GRUs [30], and MUTs [31]) and found that they all had similar performance to the CNN at predicting natural scene responses. Despite the similar performance, we found that the recurrent network learned to adapt its response over the timescale of a few seconds in response to step changes in stimulus contrast (Figure 7). This suggests that RNNs are a promising way forward to capture dynamical processes such as adaptation over longer timescales in an unbiased, data-driven manner. 4 Discussion In the retina, simple models of retinal responses to spatiotemporal white noise have greatly influenced our understanding of early sensory function. However, surprisingly few studies have addressed whether or not these simple models can capture responses to natural stimuli. Our work applies models with rich computational capacity to bear on the problem of understanding natural scene responses. We find that convolutional neural network (CNN) models, sometimes augmented with lateral recurrent connections, well exceed the performance of other standard retinal models including LN and GLMs. In addition, CNNs are better at generalizing both to held-out stimuli and to entirely different stimulus classes, indicating that they are learning general features of the retinal response. Moreover, CNNs capture several key features about retinal responses to natural stimuli where LN models fail. In particular, they capture: (1) the temporal precision of firing events despite employing filters with slower temporal frequencies, (2) adaptive responses during changing stimulus statistics, and (3) biologically realistic sub-Poisson variability in retinal responses. In this fashion, this work provides the first application of deep learning to understanding early sensory systems under natural conditions. 6 Figure 6: Visualizing the internal activity of a CNN in response to a natural scene stimulus. (A-C) Time series of the CNN activity (averaged over space) for the first convolutional layer (8 units, A), the second convolutional layer (16 units, B), and the final predicted response for an example cell (C, cyan trace). The recorded (true) response is shown below the model prediction (C, gray trace) for comparison. (D) Spatial activation of example CNN filters at a particular time point. The selected stimulus frame (top, grayscale) is represented by parallel pathways encoding spatial information in the first (purple) and second (green) convolutional layers (a subset of the activation maps is shown for brevity). (E) Autocorrelation of the temporal activity in (A-C). The correlation in the recorded firing rates is shown in gray. 0 Firing Rate (spikes/s) 0 4 2 4 2 Time (s) Stimulus Intensity RNN 6 LSTM A B Full Field Flicker Figure 7: Recurrent neural network (RNN) layers capture response features occurring over multiple seconds. (A) A schematic of how the architecture from Figure 2.1 was modified to incorporate the RNN at the last layer of the CNN. (B) Response of an RNN trained on natural scenes, showing a slowly adapting firing rate in response to a step change in contrast. To date, modeling efforts in sensory neuroscience have been most useful in the context of carefully designed parametric stimuli, chosen to illuminate a computation or mechanism of interest [32]. In part, this is due to the complexities of using generic natural stimuli. It is both difficult to describe the distribution of natural stimuli mathematically (unlike white or pink noise), and difficult to fit models to stimuli with non-stationary statistics when those statistics influence response properties. 7 We believe the approach taken in this paper provides a way forward for understanding general natural scene responses. We leverage the computational power and flexibility of CNNs to provide us with a tractable, accurate model that we can then dissect, probe, and analyze to understand what that model captures about the retinal response. This strategy of casting a wide computational net to capture neural circuit function and then constraining it to better understand that function will likely be useful in a variety of neural systems in response to many complex stimuli. Acknowledgments The authors would like to thank Ben Poole and EJ Chichilnisky for helpful discussions related to this work. Thanks also goes to the following institutions for providing funding and hardware grants, LM: NSF, NVIDIA Titan X Award, NM: NSF, AN and SB: NEI grants, SG: Burroughs Wellcome, Sloan, McKnight, Simons, James S. McDonnell Foundations and the ONR. References [1] Tim Gollisch and Markus Meister. Eye smarter than scientists believed: neural computations in circuits of the retina. Neuron, 65(2):150–164, 2010. [2] Jonathan W Pillow, Jonathon Shlens, Liam Paninski, Alexander Sher, Alan M Litke, EJ Chichilnisky, and Eero P Simoncelli. Spatio-temporal correlations and visual signalling in a complete neuronal population. Nature, 454(7207):995–999, 2008. [3] Nicole C Rust, Odelia Schwartz, J Anthony Movshon, and Eero P Simoncelli. Spatiotemporal elements of macaque v1 receptive fields. Neuron, 46(6):945–956, 2005. [4] David B Kastner and Stephen A Baccus. Coordinated dynamic encoding in the retina using opposing forms of plasticity. Nature neuroscience, 14(10):1317–1322, 2011. [5] Stephen A Baccus and Markus Meister. Fast and slow contrast adaptation in retinal circuitry. Neuron, 36(5):909–919, 2002. [6] Bence P Ölveczky, Stephen A Baccus, and Markus Meister. Segregation of object and background motion in the retina. Nature, 423(6938):401–408, 2003. [7] Alexander Heitman, Nora Brackbill, Martin Greschner, Alexander Sher, Alan M Litke, and EJ Chichilnisky. Testing pseudo-linear models of responses to natural scenes in primate retina. bioRxiv, page 045336, 2016. [8] Joseph J Atick and A Norman Redlich. Towards a theory of early visual processing. Neural Computation, 2(3):308–320, 1990. [9] Xaq Pitkow and Markus Meister. Decorrelation and efficient coding by retinal ganglion cells. Nature neuroscience, 15(4):628–635, 2012. [10] Jonathan W Pillow, Liam Paninski, Valerie J Uzzell, Eero P Simoncelli, and EJ Chichilnisky. Prediction and decoding of retinal ganglion cell responses with a probabilistic spiking model. The Journal of Neuroscience, 25(47):11003–11013, 2005. [11] S Hochstein and RM Shapley. Linear and nonlinear spatial subunits in y cat retinal ganglion cells. The Journal of Physiology, 262(2):265, 1976. [12] Tim Gollisch. Features and functions of nonlinear spatial integration by retinal ganglion cells. Journal of Physiology-Paris, 107(5):338–348, 2013. [13] Adrienne L Fairhall, C Andrew Burlingame, Ramesh Narasimhan, Robert A Harris, Jason L Puchalla, and Michael J Berry. Selectivity for multiple stimulus features in retinal ganglion cells. Journal of neurophysiology, 96(5):2724–2738, 2006. [14] Toshihiko Hosoya, Stephen A Baccus, and Markus Meister. Dynamic predictive coding by the retina. Nature, 436(7047):71–77, 2005. [15] Tim Gollisch and Markus Meister. Rapid neural coding in the retina with relative spike latencies. science, 319(5866):1108–1111, 2008. 8 [16] Greg Schwartz, Rob Harris, David Shrom, and Michael J Berry. Detection and prediction of periodic patterns by the retina. Nature neuroscience, 10(5):552–554, 2007. [17] Yann LeCun, Yoshua Bengio, and Geoffrey Hinton. Deep learning. Nature, 521(7553):436–444, 2015. [18] Daniel L Yamins, Ha Hong, Charles Cadieu, and James J DiCarlo. Hierarchical modular optimization of convolutional networks achieves representations similar to macaque it and human ventral stream. In Advances in neural information processing systems, pages 3093–3101, 2013. [19] EJ Chichilnisky. A simple white noise analysis of neuronal light responses. Network: Computation in Neural Systems, 12(2):199–213, 2001. [20] Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. [21] Frédéric Bastien, Pascal Lamblin, Razvan Pascanu, James Bergstra, Ian Goodfellow, Arnaud Bergeron, Nicolas Bouchard, David Warde-Farley, and Yoshua Bengio. Theano: new features and speed improvements. arXiv preprint arXiv:1211.5590, 2012. [22] Aapo Hyvärinen, Jarmo Hurri, and Patrick O Hoyer. Natural Image Statistics: A Probabilistic Approach to Early Computational Vision., volume 39. Springer Science &amp; Business Media, 2009. [23] Michael J Berry, David K Warland, and Markus Meister. The structure and precision of retinal spike trains. Proceedings of the National Academy of Sciences, 94(10):5411–5416, 1997. [24] Rob R de Ruyter van Steveninck, Geoffrey D Lewen, Steven P Strong, Roland Koberle, and William Bialek. Reproducibility and variability in neural spike trains. Science, 275(5307):1805– 1808, 1997. [25] Ben Poole, Jascha Sohl-Dickstein, and Surya Ganguli. Analyzing noise in autoencoders and deep networks. arXiv preprint arXiv:1406.1831, 2014. [26] Botond Roska and Frank Werblin. Vertical interactions across ten parallel, stacked representations in the mammalian retina. Nature, 410(6828):583–587, 2001. [27] Botond Roska and Frank Werblin. Rapid global shifts in natural scenes block spiking in specific ganglion cell types. Nature neuroscience, 6(6):600–608, 2003. [28] Peter D Calvert, Victor I Govardovskii, Vadim Y Arshavsky, and Clint L Makino. Two temporal phases of light adaptation in retinal rods. The Journal of general physiology, 119(2):129–146, 2002. [29] Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural Computation, 9(8):1735–1780, 1997. [30] Kyunghyun Cho, Bart van Merrienboer, Dzmitry Bahdanau, and Yoshua Bengio. On the properties of neural machine translation: Encoder–decoder approaches. Eighth Workshop on Syntax, Semantics and Structure in Statistical Translation (SSST-8), pages 103–111, 2014. [31] Rafal Jozefowicz, Wojciech Zaremba, and Ilya Sutskever. An empirical exploration of recurrent network architectures. Proceedings of the 32nd International Conference on Machine Learning, 37:2342–2350, 2015. [32] Nicole C Rust and J Anthony Movshon. In praise of artifice. Nature neuroscience, 8(12):1647– 1650, 2005. 9
2016
373
6,298
Batched Gaussian Process Bandit Optimization via Determinantal Point Processes Tarun Kathuria, Amit Deshpande, Pushmeet Kohli Microsoft Research t-takat@microsoft.com, amitdesh@microsoft.com, pkohli@microsoft.com Abstract Gaussian Process bandit optimization has emerged as a powerful tool for optimizing noisy black box functions. One example in machine learning is hyper-parameter optimization where each evaluation of the target function may require training a model which may involve days or even weeks of computation. Most methods for this so-called “Bayesian optimization” only allow sequential exploration of the parameter space. However, it is often desirable to propose batches or sets of parameter values to explore simultaneously, especially when there are large parallel processing facilities at our disposal. Batch methods require modeling the interaction between the different evaluations in the batch, which can be expensive in complex scenarios. In this paper, we propose a new approach for parallelizing Bayesian optimization by modeling the diversity of a batch via Determinantal point processes (DPPs) whose kernels are learned automatically. This allows us to generalize a previous result as well as prove better regret bounds based on DPP sampling. Our experiments on a variety of synthetic and real-world robotics and hyper-parameter optimization tasks indicate that our DPP-based methods, especially those based on DPP sampling, outperform state-of-the-art methods. 1 Introduction The optimization of an unknown function based on noisy observations is a fundamental problem in various real world domains, e.g., engineering design [33], finance [36] and hyper-parameter optimization [29]. In recent years, an increasingly popular direction has been to model smoothness assumptions about the function via a Gaussian Process (GP), which provides an easy way to compute the posterior distribution of the unknown function, and thereby uncertainty estimates that help to decide where to evaluate the function next, in search of an optima. This Bayesian optimization (BO) framework has received considerable attention in tuning of hyper-parameters for complex models and algorithms in Machine Learning, Robotics and Computer Vision [16, 31, 29, 12]. Apart from a few notable exceptions [9, 8, 11], most methods for Bayesian optimization work by exploring one parameter value at a time. However, in many applications, it may be possible and, moreover, desirable to run multiple function evaluations in parallel. A case in point is when the underlying function corresponds to a laboratory experiment where multiple experimental setups are available or when the underlying function is the result of a costly computer simulation and multiple simulations can be run across different processors in parallel. By parallelizing the experiments, substantially more information can be gathered in the same time-frame; however, future actions must be chosen without the benefit of intermediate results. One might conceptualize these problems as choosing “batches” of experiments to run simultaneously. The key challenge is to assemble batches (out of a combinatorially large set of batches) of experiments that both explore the function and exploit by focusing on regions with high estimated value. Our Contributions Given that functions sampled from GPs usually have some degree of smoothness, in the so-called batch Bayesian optimization (BBO) methods, it is desirable to choose batches which are diverse. Indeed, this is the motivation behind many popular BBO methods like the BUCB [9], UCB-PE [8] and Local Penalization [11]. Motivated by this long line of work in BBO, we propose 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. a new approach that employs Determinantal Point Processes (DPPs) to select diverse batches of evaluations. DPPs are probability measures over subsets of a ground set that promote diversity, have applications in statistical physics and random matrix theory [28, 21], and have efficient sampling algorithms [17, 18]. The two main ways for fixed cardinality subset selection via DPPs are that of choosing the subset which maximizes the determinant [DPP-MAX, Theorem 3.3] and sampling a subset according to the determinantal probability measure [DPP-SAMPLE, Theorem 3.4]. Following UCB-PE [8], our methods also choose the first point via an acquisition function, and then the rest of the points are selected from a relevance region using a DPP. Since DPPs crucially depend on the choice of the DPP kernel, it is important to choose the right kernel. Our method allows the kernel to change across iterations and automatically compute it based on the observed data. This kernel is intimately linked to the GP kernel used to model the function; it is in fact exactly the posterior kernel function of the GP. The acquisition functions we consider are EST [34], a recently proposed sequential MAP-estimate based Bayesian optimization algorithm with regret bounds independent of the size of the domain, and UCB [30]. In fact, we show that UCB-PE can be cast into our framework as just being DPP-MAX where the maximization is done via a greedy selection rule. Given that DPP-MAX is too greedy, it may be desirable to allow for uncertainty in the observations. Thus, we define DPP-SAMPLE which selects the batches via sampling subsets from DPPs, and show that the expected regret is smaller than that of DPP-MAX. To provide a fair comparison with an existing method, BUCB, we also derive regret bounds for B-EST [Theorem 3.2]. Finally, for all methods with known regret bounds, the key quantity is the information gain. In the appendix, we also provide a simpler proof of the information gain for the widely-used RBF kernel which also improves the bound from O((log T)d+1) [26, 30] to O((log T)d). We conclude with experiments on synthetic and real-world robotics and hyper-parameter optimization for extreme multi-label classification tasks which demonstrate that our DPP-based methods, especially the sampling based ones are superior or competitive with the existing baselines. Related Work One of the key tasks involved in black box optimization is of choosing actions that both explore the function and exploit our knowledge about likely high reward regions in the function’s domain. This exploration-exploitation trade-off becomes especially important when the function is expensive to evaluate. This exploration-exploitation trade off naturally leads to modeling this problem in the multi-armed bandit paradigm [25], where the goal is to maximize cumulative reward by optimally balancing this trade-off. Srinivas et al. [30] analyzed the Gaussian Process Upper Confidence Bound (GP-UCB) algorithm, a simple and intuitive Bayesian method [3] to achieve the first sub-linear regret bounds for Gaussian process bandit optimization. These bounds however grow logarithmically in the size of the (finite) search space. Recent work by Wang et al. [34] considered an intuitive MAP-estimate based strategy (EST) which involves estimating the maximum value of a function and choosing a point which has maximum probability of achieving this maximum value. They derive regret bounds for this strategy and show that the bounds are actually independent of the size of the search space. The problem setting for both UCB and EST is of optimizing a particular acquisition function. Other popular acquisition functions include expected improvement (EI), probability of improvement over a certain threshold (PI). Along with these, there is also work on Entropy search (ES) [13] and its variant, predictive entropy search (PES) [14] which instead aims at minimizing the uncertainty about the location of the optimum of the function. All the fore-mentioned methods, though, are inherently sequential in nature. The BUCB and UCB-PE both depend on the crucial observation that the variance of the posterior distribution does not depend on the actual values of the function at the selected points. They exploit this fact by “hallucinating” the function values to be as predicted by the posterior mean. The BUCB algorithm chooses the batch by sequentially selecting the points with the maximum UCB score keeping the mean function the same and only updating the variance. The problem with this naive approach is that it is too “overconfident” of the observations which causes the confidence bounds on the function values to shrink very quickly as we go deeper into the batch. This is fixed by a careful initialization and expanding the confidence bounds which leads to regret bounds which are worse than that of UCB by some multiplicative factor (independent of T and B). The UCB-PE algorithm chooses the first point of the batch via the UCB score and then defines a “relevance region” and selects the remaining points from this region greedily to maximize the information gain, in order to focus on pure exploration (PE). This algorithm does not require any initialization like the BUCB and, in fact, achieves better regret bounds than the BUCB. 2 Both BUCB and UCB-PE, however, are too greedy in their selection of batches which may be really far from the optimal due to our “immediate overconfidence” of the values. Indeed this is the criticism of these two methods by a recently proposed BBO strategy PPES [27], which parallelizes predictive entropy search based methods and shows considerable improvements over the BUCB and UCB-PE methods. Another recently proposed method is the Local Penalization (LP) [11], which assumes that the function is Lipschitz continuous and tries to estimate the Lipschitz constant. Since assumptions of Lipschitz continuity naturally allow one to place bounds on how far the optimum of f is from a certain location, they work to smoothly reduce the value of the acquisition function in a neighborhood of any point reflecting the belief about the distance of this point to the maxima. However, assumptions of Lipschitzness are too coarse-grained and it is unclear how their method to estimate the Lipschitz constant and modelling of local penalization affects the performance from a theoretical standpoint. Our algorithms, in constrast, are general and do not assume anything about the function other than it being drawn from a Gaussian Process. 2 Preliminaries Gaussian Process Bandit Optimization We address the problem of finding, in the lowest possible number of iterations, the maximum (m) of an unknown function f : X →R where X ⊂Rd, i.e., m = f(x∗) = max x∈X f(x). We consider the domain to be discrete as it is well-known how to obtain regret bounds for continous, compact domains via suitable discretizations [30]. At each iteration t, we choose a batch {xt,b}1≤b≤B of B points and then simultaneously observe the noisy values taken by f at these points, yt,b = f(xt,b) + ϵt,b, where ϵt,k is i.i.d. Gaussian noise N(0, σ2). The function is assumed to be drawn from a Gaussian process (GP), i.e., f ∼GP(0, k), where k : X 2 →R+ is the kernel function. Given the observations Dt = {(xτ, yτ)t τ=1} up to time t, we obtain the posterior mean and covariance functions [24] via the kernel matrix Kt = [k(xi, xj)]xi,xj∈Dt and kt(x) = [k(xi, x)]xi∈Dt : µt(x) = kt(x)T (Kt + σ2I)−1yt and kt(x, x′) = k(x, x′) −kt(x)T (Kt + σ2I)−1kt(x′). The posterior variance is given by σ2 t (x) = kt(x, x). Define the Upper Confidence Bound (UCB) f + and Lower Confidence Bound (LCB) f −as f + t (x) = µt−1(x) + β1/2 t σt−1(x) f − t (x) = µt−1(x) −β1/2 t σt−1(x) A crucial observation made in BUCB [9] and UCB-PE [8] is that the posterior covariance and variance functions do not depend on the actual function values at the set of points. The EST algorithm in [34] chooses at each timestep t,the point which has the maximum posterior probability of attaining the maximum value m, i.e., the arg maxx∈X Pr(Mx|m, Dt) where Mx is the event that point x achieves the maximum value. This turns out to be equal to arg minx∈X  (m −µt(x))/σt(x)  . Note that this actually depends on the value of m which, in most cases, is unknown. [34] get around this by using an approximation ˆm which, under certain conditions specified in their paper, is an upper bound on m. They provide two ways to get the estimate ˆm, namely ESTa and ESTn. We refer the reader to [34] for details of the two estimates and refer to ESTa as EST. Assuming that the horizon T is unknown, a strategy has to be good at any iteration. Let rt,b denote the simple regret, the difference between the value of the maxima and the point queried xt,k, i.e., rt,b = maxx∈X f(x) −f(xt,b). While, UCB-PE aims at minimizing a batched cumulative regret, in this paper we will focus on the standard full cumulative regret defined as RT B = PT t=1 PB b=1 rt,b. This models the case where all the queries in a batch should have low regret. The key quantity controlling the regret bounds of all known BO algorithms is the maximum mutual information that can be gained about f from T measurements : γT = maxA⊆X,|A|≤T I(yA, fA) = maxA⊆X,|A|≤T 1 2 log det(I + σ−2KA), where KA is the (square) submatrix of K formed by picking the row and column indices corresponding to the set A. The regret for both the UCB and the EST algorithms are presented in the following theorem which is a combination of Theorem 1 in [30] and Theorem 3.1 in [34]. Theorem 2.1. Let C = 2/ log(1 + σ−2) and fix δ > 0. For UCB, choose βt = 2 log(|X|t2π2/6δ) and for EST, choose βt = (minx∈X ˆm−µt−1(x) σt−1(x) )2 and ζt = 2 log(π2t2/δ). With probability 1 −δ, the cumulative regret up to any time step T can be bounded as RT = T X t=1 rt ≤ (√CTβT γT for UCB √CTγT (β1/2 t∗ + ζ1/2 T ) for EST where t∗= arg max t βt. Determinantal Point Processes Given a DPP kernel K ∈Rm×m of m elements {1, . . . , m}, the kDPP distribution defined on 2Y is defined as picking B, a k-subset of [m] with probability proportional 3 Algorithm 1 GP-BUCB/B-EST Algorithm Input: Decision set X, GP prior µ0, σ0, kernel function k(·, ·), feedback mapping fb[·] for t = 1 to TB do Choose β1/2 t = C′ 2 log(|X|π2t2/6)δ  for BUCB C′ minx∈X ( ˆm −µfb[t])/σt−1(x)  for B-EST Choose xt = arg maxx∈X [µfb[t](x) + β1/2 t σt−1(x)] and compute σt(·) if fb[t] < fb[t + 1] then Obtain yt′ = f(xt′) + ϵt′ for t′ ∈{fb[t] + 1, . . . , fb[t + 1]} and compute µfb[t+1](·) end if end for return arg max t=1...T B yt to det(KB). Formally, Pr(B) = det(KB) P |S|=k det(KS) The problem of picking a set of size k which maximizes the determinant and sampling a set according to the k-DPP distribution has received considerable attention [22, 7, 6, 10, 1, 17]. The maximization problem in general is NP-hard and furthermore, has a hardness of approximation result of 1/ck for some c > 1. The best known approximation algorithm is by [22] with a factor of 1/ek, which almost matches the lower bound. Their algorithm however is a complicated and expensive convex program. A simple greedy algorithm on the other hand gives a 1/2k log(k)-approximation. For sampling from k-DPPs, an exact sampling algorithm exists due to [10]. This, however, does not scale to large datasets. A recently proposed alternative is an MCMC based method by [1] which is much faster. 3 Main Results In this section, we present our DPP-based algorithms. For a fair comparison of the various methods, we first prove the regret bounds of the EST version of BUCB, i.e., B-EST. We then show the equivalence between UCB-PE and UCB-DPP maximization along with showing regret bounds for the EST version of PE/DPP-MAX. We then present the DPP sampling (DPP-SAMPLE) based methods for UCB and EST and provide regret bounds. In Appendix 4, while borrowing ideas from [26], we provide a simpler proof with improved bounds on the maximum information gain for the RBF kernel. 3.1 The Batched-EST algorithm The BUCB has a feedback mapping fb which indicates that at any given time t (just in this case we will mean a total of TB timesteps), the iteration upto which the actual function values are available. In the batched setting, this is just ⌊(t −1)/B⌋B. The BUCB and B-EST, its EST variant algorithms are presented in Algorithm 1. The algorithm mainly comes from the observation made in [34] that the point chosen by EST is the same as a variant of UCB. This is presented in the following lemma. Lemma 3.1. (Lemma 2.1 in [34]) At any timestep t, the point selected by EST is the same as the point selected by a variant of UCB with β1/2 t = minx∈X ( ˆm −µt−1(x))/σt−1(x). This will be sufficient to get to B-EST as well by just running BUCB with the βt as defined in Lemma 3.1 and is also provided in Algorithm 1. In the algorithm, C′ is chosen to be exp(2C), where C is an upper bound on the maximum conditional mutual information I(f(x); yfb[t]+1:t−1|y1:fb[t]) (refer to [9] for details). The problem with naively using this algorithm is that the value of C′, and correspondingly the regret bounds, usually has at least linear growth in B. This is corrected in [9] by two-stage BUCB which first chooses an initial batch of size T init by greedily choosing points based on the (updated) posterior variances. The values are then obtained and the posterior GP is calculated which is used as the prior GP in Algorithm 1. The C′ value can then be chosen independent of B. We refer the reader to the Table 1 in [9] for values of C′ and T init for common kernels. Finally, the regret bounds of B-EST are presented in the next theorem. Theorem 3.2. Choose αt = minx∈X ˆm−µfb[t](x) σt−1(x) 2 and βt = (C′)2αt, B ≥2, δ > 0 and the C′ and T init values are chosen according to Table 1 in [9]. At any timestep T, let RT be the cumulative regret of the two-stage initialized B-EST algorithm. Then Pr{RT ≤C′Rseq T + 2∥f∥∞T init, ∀T ≥1} ≥1 −δ Proof. The proof is presented in Appendix 1. 4 Algorithm 2 GP-(UCB/EST)-DPP-(MAX/SAMPLE) Algorithm Input: Decision set X, GP prior µ0, σ0, kernel function k(·, ·) for t = 1 to T do Compute µt−1 and σt−1 according to Bayesian inference. Choose β1/2 t =  2 log(|X|π2t2/6)δ  for UCB  minx∈X ( ˆm −µfb[t])/σt−1(x)  for EST xt,1 ←arg maxx∈X µt−1(x) + √βtσt−1(x) Compute R+ t and construct the DPP kernel Kt,1 {xt,b}B b=2 ← kDPPMaxGreedy(Kt,1, B −1) for DPP-MAX kDPPSample(Kt,1, B −1) for DPP-SAMPLE Obtain yt,b = f(xt,b) + ϵt,b for b = 1, . . . , B end for 3.2 Equivalence of Pure Exploration (PE) and DPP Maximization We now present the equivalence between the Pure Exploration and a procedure which involves DPP maximization based on the Greedy algorithm. For the next two sections, by an iteration, we mean all B points selected in that iteration and thus, µt−1 and kt−1 are computed using (t −1)B observations that are available to us. We first describe a generic framework for BBO inspired by UCB-PE : At any iteration, the first point is chosen by selecting the one which maximizes UCB or EST which can be seen as a variant of UCB as per Lemma 3.1. A relevance region R+ t is defined which contains arg maxx∈X f + t+1(x) with high probability. Let y• t = f − t (x• t ), where x• t = arg maxx∈X f − t (x). The relevance region is formally defined as R+ t = {x ∈X|µt−1 + 2 p βt+1σt−1(x) ≥y• t }. The intuition for considering this region is that using R+ t guarantees that the queries at iteration t will leave an impact on the future choices at iteration t + 1. The next B −1 points for the batch are then chosen from R+ t , according to some rule. In the special case of UCB-PE, the B −1 points are selected greedily from R+ t by maximizing the (updated) posterior variance, while keeping the mean function the same. Now, at the tth iteration, consider the posterior kernel function after xt,1 has been chosen (say kt,1) and consider the kernel matrix Kt,1 = I + σ−2[kt,1(pi, pj)]i,j over the points pi ∈R+ t . We will consider this as our DPP kernel at iteration t. Two possible ways of choosing B −1 points via this DPP kernel is to either choose the subset of size B −1 of maximum determinant (DPP-MAX) or sample a set from a (B −1)-DPP using this kernel (DPP-SAMPLE). In this subsection, we focus on the maximization problem. The proof of the regret bounds of UCB-PE go through a few steps but in one of the intermediate steps (Lemma 5 of [8]), it is shown that the sum of regrets over a batch at an iteration t is upper bounded as B X b=1 rt,b ≤ B X b=1 (σt,b(xt,b))2 ≤ B X b=1 C2σ2 log(1 + σ−2σt,b(xt,b)) = C2σ2 log  B Y b=1 (1 + σ−2σt,b(xt,b)  where C2 = σ−2/ log(1 + σ−2). From the final log-product term, it can be seen (from Schur’s determinant identity [5] and the definition of σt,b(xt,b)) that the product of the last B −1 terms is exactly the B −1 principal minor of Kt,1 formed by the indices corresponding to S = {xt,b}B b=2. Thus, it is straightforward to see that the UCB-PE algorithm is really just (B −1)-DPP maximization via the greedy algorithm. This connection will also be useful in the next subsection for DPPSAMPLE. Thus, PB b=1 rt,b ≤C2σ2  log(1 + σ−2σt,1(xt,1)) + log det((Kt,1)S)  . Finally, for EST-PE, the proof proceeds like in the B-EST case by realising that EST is just UCB with an adaptive βt. The final algorithm (along with its sampling counterpart; details in the next subsection) is presented in Algorithm 2. The procedure kDPPMaxGreedy(K, k) picks a principal submatrix of K of size k by the greedy algorithm. Finally, we have the theorem for the regret bounds for (UCB/EST)-DPP-MAX. Theorem 3.3. At iteration t, let βt = 2 log(|X|π2t2/6δ) for UCB, βt = (min ˆm−µt−1(x) σt−1(x) )2 and ζt = 2 log(π2t2/3δ) for EST, C1 = 36/ log(1 + σ−2) and fix δ > 0, then, with probability ≥1 −δ the full cumulative regret RT B incurred by UCB-DPP-MAX is RT B ≤√C1TBβT γT B} and that for EST-DPP-MAX is RT B ≤√C1TBγT B(β1/2 t∗ + ζ1/2 T ). Proof. The proof is provided in Appendix 2. It should be noted that the term inside the logarithm in ζt has been multiplied by 2 as compared to the sequential EST, which has a union bound over just one point, xt. This happens because we will need a union bound over not just xt,b but also x• t . 5 Figure 1: Immediate regret of the algorithms on two synthetic functions with B = 5 and 10 3.3 Batch Bayesian Optimization via DPP Sampling In the previous subsection, we looked at the regret bounds achieved by DPP maximization. One natural question to ask is whether the other subset selection method via DPPs, namely DPP sampling, gives us equivalent or better regret bounds. Note that in this case, the regret would have to be defined as expected regret. The reason to believe this is well-founded as indeed sampling from k-DPPs results in better results, in both theory and practice, for low-rank matrix approximation [10] and exemplar-selection for Nystrom methods [19]. Keeping in line with the framework described in the previous subsection, the subset to be selected has to be of size B −1 and the kernel should be Kt,1 at any iteration t. Instead of maximizing, we can choose to sample from a (B −1)-DPP. The algorithm is described in Algorithm 2. The kDPPSample(K, k) procedure denotes sampling a set from the k-DPP distribution with kernel K. The question then to ask is what is the expected regret of this procedure. In this subsection, we show that the expected regret bounds of DPP-SAMPLE are less than the regret bounds of DPP-MAX and give a quantitative bound on this regret based on entropy of DPPs. By entropy of a k-DPP with kernel K, H(k −DPP(K)), we simply mean the standard definition of entropy for a discrete distribution. Note that the entropy is always non-negative in this case. Please see Appendix 3 for details. For brevity, since we always choose B −1 elements from the DPP, we denote H(DPP(K)) to be the entropy of (B −1)-DPP for kernel K. Theorem 3.4. The regret bounds of DPP-SAMPLE are less than that of DPP-MAX. Furthermore, at iteration t, let βt = 2 log(|X|π2t2/6δ) for UCB, βt = (min ˆm−µt−1(x) σt−1(x) )2 and ζt = 2 log(π2t2/3δ) for EST, C1 = 36/ log(1 + σ−2) and fix δ > 0, then the expected full cumulative regret of UCB-DPPSAMPLE satisfies R2 T B ≤2TBC1βT  γT B − T X t=1 H(DPP(Kt,1)) + B log(|X|)  and that for EST-DPP-SAMPLE satisfies R2 T B ≤2TBC1(β1/2 t + ζ1/2 t )2  γT B − T X t=1 H(DPP(Kt,1)) + B log(|X|)  Proof. The proof is provided in Appendix 3. Note that the regret bounds for both DPP-MAX and DPP-SAMPLE are better than BUCB/B-EST due to the latter having both an additional factor of B in the log term and a regret multiplier constant C′. In fact, for the RBF kernel, C′ grows like edd which is quite large for even moderate values of d. 4 Experiments In this section, we study the performance of the DPP-based algorithms, especially DPP-SAMPLE against some existing baselines. In particular, the methods we consider are BUCB [9], B-EST, 6 UCB-PE/UCB-DPP-MAX [8], EST-PE/EST-DPP-MAX, UCB-DPP-SAMPLE, EST-DPP-SAMPLE and UCB with local penalization (LP-UCB) [11]. We used the publicly available code for BUCB and PE1. The code was modified to include the code for the EST counterparts using code for EST 2. For LP-UCB, we use the publicly available GPyOpt codebase 3 and implemented the MCMC algorithm by [1] for k-DPP sampling with ϵ = 0.01 as the variation distance error. We were unable to compare against PPES as the code was not publicly available. Furthermore, as shown in the experiments in [27], PPES is very slow and does not scale beyond batch sizes of 4-5. Since UCB-PE almost always performs better than the simulation matching algorithm of [4] in all experiments that we could find in previous papers [27, 8], we forego a comparison against simulation matching as well to avoid clutter in the graphs. The performance is measured after t batch evaluations using immediate regret, rt = |f(ext) −f(x∗)|, where x∗is a known optimizer of f and ext is the recommendation of an algorithm after t batch evaluations. We perform 50 experiments for each objective function and report the median of the immediate regret obtained for each algorithm. To maintain consistency, the first point of all methods is chosen to be the same (random). The mean function of the prior GP was the zero function while the kernel function was the squared-exponential kernel of the form k(x, y) = γ2 exp[−0.5 P d(xd −y2 d)/l2 d]. The hyper-parameter λ was picked from a broad Gaussian hyperprior and the the other hyper-parameters were chosen from uninformative Gamma priors. Our first set of experiments is on a set of synthetic benchmark objective functions including BraninHoo [20], a mixture of cosines [2] and the Hartmann-6 function [20]. We choose batches of size 5 and 10. Due to lack of space, the results for mixture of cosines are provided in Appendix 5 while the results of the other two are shown in Figure 1. The results suggest that the DPP-SAMPLE based methods perform superior to the other methods. They do much better than their DPP-MAX and Batched counterparts. The trends displayed with regards to LP are more interesting. For the Branin-Hoo, LP-UCB starts out worse than the DPP based algorithms but takes over DPP-MAX relatively quickly and approaches the performance of DPP-SAMPLE when the batch size is 5. When the batch size is 10, the performance of LP-UCB does not improve much but both DPP-MAX and DPP-SAMPLE perform better. For Hartmann, LP-UCB outperforms both DPP-MAX algorithms by a considerable margin. The DPP-SAMPLE based methods perform better than LP-UCB. The gap, however, is more for the batch size of 10. Again, the performance of LP-UCB changes much lesser compared to the performance gain of the DPP-based algorithms. This is likely because the batches chosen by the DPP-based methods are more “globally diverse” for larger batch sizes. The superior performance of the sampling based methods can be attributed to allowing for uncertainty in the observations by sampling as opposed to greedily emphasizing on maximizing information gain. We now consider maximization of real-world objective functions. The first function we consider, robot, returns the walking speed of a bipedal robot [35]. The function’s input parameters, which live in [0, 1]8, are the robot’s controller. We add Gaussian noise with σ = 0.1 to the noiseless function. The second function, Abalone4 is a test function used in [8]. The challenge of the dataset is to predict the age of a species of sea snails from physical measurements. Similar to [8], we will use it as a maximization problem. Our final experiment is on hyper-parameter tuning for extreme multi-label learning. In extreme classification, one needs to deal with multi-class and multi-label problems involving a very large number of categories. Due to the prohibitively large number of categories, running traditional machine learning algorithms is not feasible. A recent popular approach for extreme classification is the FastXML algorithm [23]. The main advantage of FastXML is that it maintains high accuracy while training in a fraction of the time compared to the previous state-of-the-art. The FastXML algorithm has 5 parameters and the performance depends on these hyper-parameters, to a reasonable amount. Our task is to perform hyper-parameter optimization on these 5 hyper-parameters with the aim to maximize the Precision@k for k = 1, which is the metric used in [23] to evaluate the performance of FastXML compared to other algorithms as well. While the authors of [23] run extensive tests on a variety of datasets, we focus on two small datasets : Bibtex [15] and Delicious[32]. As before, we use batch sizes of 5 and 10. The results for Abalone and the FastXML experiment on Delicious are provided in the appendix. The results for Prec@1 for FastXML on the Bibtex dataset 1http://econtal.perso.math.cnrs.fr/software/ 2https://github.com/zi-w/EST 3http://sheffieldml.github.io/GPyOpt/ 4The Abalone dataset is provided by the UCI Machine Learning Repository at http://archive.ics.uci.edu/ml/datasets/Abalone 7 Figure 2: Immediate regret of the algorithms for Prec@1 for FastXML on Bibtex and Robot with B = 5 and 10 and for the robot experiment are provided in Figure 2. The blue horizontal line for the FastXML results indicates the maximum Prec@k value found using grid search. The results for robot indicate that while DPP-MAX does better than their Batched counterparts, the difference in the performance between DPP-MAX and DPP-SAMPLE is much less pronounced for a small batch size of 5 but is considerable for batch sizes of 10. This is in line with our intuition about sampling being more beneficial for larger batch sizes. The performance of LP-UCB is quite close and slightly better than UCB-DPP-SAMPLE. This might be because the underlying function is well-behaved (Lipschitz continuous) and thus, the estimate for the Lipschitz constant might be better which helps them get better results. This improvement is more pronounced for batch size of 10 as well. For Abalone (see Appendix 5), LP does better than DPP-MAX but there is a reasonable gap between DPP-SAMPLE and LP which is more pronounced for B = 10. The results for Prec@1 for the Bibtex dataset for FastXML are more interesting. Both DPP based methods are much better than their Batched counterparts. For B = 5, DPP-SAMPLE is only slightly better than DPP-MAX. LP-UCB starts out worse than DPP-MAX but starts doing comparable to DPP-MAX after a few iterations. For B = 10, there is not a large improvement in the gap between DPP-MAX and DPP-SAMPLE. LP-UCB however, quickly takes over UCB-DPP-MAX and comes quite close to the performance of DPP-SAMPLE after a few iterations. For the Delicious dataset (see Appendix 5), we see a similar trend of the improvement of sampling to be larger for larger batch sizes. LP-UCB displays an interesting trend in this experiment by doing much better than UCB-DPP-MAX for B = 5 and is in fact quite close to the performance of DPP-SAMPLE. However, for B = 10, its performance is much closer to UCB-DPP-MAX. DPP-SAMPLE loses out to LP-UCB only on the robot dataset and does better for all the other datasets. Furthermore, this improvement seems more pronounced for larger batch sizes. We leave experiments with other kernels and a more thorough experimental evaluation with respect to batch sizes for future work. 5 Conclusion We have proposed a new method for batched Gaussian Process bandit (batch Bayesian) optimization based on DPPs which are desirable in this case as they promote diversity in batches. The DPP kernel is automatically figured out on the fly which allows us to show regret bounds for DPP maximization and sampling based methods for this problem. We show that this framework exactly recovers a popular algorithm for BBO, namely the UCB-PE when we consider DPP maximization using the greedy algorithm. We showed that the regret for the sampling based method is always less than the maximization based method. We also derived their EST counterparts and also provided a simpler proof of the information gain for RBF kernels which leads to a slight improvement in the best bound known. Our experiments on a variety of synthetic and real-world tasks validate our theoretical claims that sampling performs better than maximization and other methods. 8 References [1] N. Anari, S.O. Gharan, and A. Rezaei. Monte carlo markov chains algorithms for sampling strongly rayleigh distributions and determinantal point processes. COLT, 2016. [2] B.S. Anderson, A.W. Moore, and D. Cohn. A nonparametric approach to noisy and costly optimization. ICML, 2000. [3] P. Auer. Using confidence bounds for exploration-exploitation trade-offs. JMLR, 3:397–422, 2002. [4] J. Azimi, A. Fern, and X. Fern. Batch bayesian optimization via simulation matching. 2010. [5] R. Brualdi and H. Schneider. Determinantal identities: Gauss, schur, cauchy, sylvester, kronecker, jacobi, binet, laplace, muir, and cayley. Linear Algebra and its Applications, 1983. [6] A. Çivril and M. Magdon-Ismail. On selecting a maximum volume sub-matrix of a matrix and related problems. Theor. Comput. Sci., 410(47-49):4801–4811, 2009. [7] A. Çivril and M. Magdon-Ismail. Exponential inapproximability of selecting a maximum volume submatrix. Algorithmica, 65(1):159–176, 2013. [8] E. Contal, D. Buffoni, D. Robicquet, and N. Vayatis. Parallel gaussian process optimization with upper confidence bound and pure exploration. ECML, 2013. [9] T. Desautels, A. Krause, and J.W. Burdick. Parallelizing exploration-exploitation tradeoffs in gaussian process bandit optimization. JMLR, 15:4053–4103, 2014. [10] A. Deshpande and L. Rademacher. Efficient volume sampling for row/column subset selection. FOCS, 2010. [11] J. Gonzalez, Z. Dai, P. Hennig, and N. Lawrence. Batch bayesian optimization via local penalization. AISTATS, 2016. [12] J. González, M. A. Osborne, and N. D. Lawrence. GLASSES: relieving the myopia of bayesian optimisation. AISTATS, 2016. [13] P. Hennig and C. Schuler. Entropy search for information-efficient global optimization. JMLR, 13, 2012. [14] J.M. Hernandex-Lobato, M.W. Hoffman, and Z. Ghahramani. Predicitive entropy search for efficient global optimization of black-box functions. NIPS, 2014. [15] I. Katakis, G. Tsoumakas, and I. Vlahavas. Multilabel text classification for automated tag suggestion. ECML/PKDD Discovery Challenge, 2008. [16] A. Krause and C. S. Ong. Contextual gaussian process bandit optimization. NIPS, 2011. [17] Alex Kulesza and Ben Taskar. k-dpps: Fixed-size determinantal point processes. In ICML, 2011. [18] Alex Kulesza and Ben Taskar. Determinantal Point Processes for Machine Learning. Found. Trends R⃝ Mach. Learn., (2-3):123–286, 2012. [19] C. Li, S. Jegelka, and S. Sra. Fast dpp sampling for nyström with application to kernel methods. ICML, 2016. [20] D. Lizotte. Pratical bayesian optimization. PhD thesis, University of Alberta, 2008. [21] R. Lyons. Determinantal probability measures. Publications Mathématiques de l’Institut des Hautes Études Scientifiques, 98(1):167–212, 2003. [22] A. Nikolov. Randomized rounding for the largest simplex problem. In STOC, pages 861–870, 2015. [23] Y. Prabhu and M. Varma. Fastxml: A fast, accurate and stable tree-classifier for extreme multi-label learning. KDD, 2014. [24] C. Rasmussen and C. Williams. Gaussian processes for machine learning. MIT Press, 2008. [25] H. Robbins. Some aspects of the sequential design of experiments. Bul. Am. Math. Soc., 1952. [26] M. W. Seeger, S. M. Kakade, and D. P. Foster. Information consistency of nonparametric gaussian process methods. IEEE Tr. Inf. Theo., 54(5):2376–2382, 2008. [27] A. Shah and Z. Ghahramani. Parallel predictive entropy search for batch global optimization of expensive objective functions. NIPS, 2015. [28] T. Shirai and Y. Takahashi. Random point fields associated with certain fredholm determinants i: fermion, poisson and boson point processes. Journal of Functional Analysis, 205(2):414 – 463, 2003. [29] J. Snoek, H. Larochelle, and R.P. Adams. Practical bayesian optimization of machine learning. NIPS, 2012. [30] N. Srinivas, A. Krause, S. Kakade, and M. Seeger. Information-theoretic regret bounds for gaussian process optimization in the bandit setting. IEEE Transactions on Information Theory, 58(5):3250–3265, 2012. [31] C. Thornton, F. Hutter, H. H. Hoos, and K. Leyton-Brown. Auto-weka : combined selection and hyperparameter optimization of classification algorithms. KDD, 2003. [32] G. Tsoumakas, I. Katakis, and I. Vlahavas. Effective and efficient multilabel classification in domains with large number of labels. ECML/PKDD 2008 Workshop on Mining Multidimensional Data, 2008. [33] G. Wang and S. Shan. Review of metamodeling techniques in support of engineering design optimization. Journal of Mechanical Design, 129:370–380, 2007. [34] Z. Wang, B. Zhou, and S. Jegelka. Optimization as estimation with gaussian processes in bandit settings. AISTATS, 2016. [35] E. Westervelt and J. Grizzle. Feedback control of dynamic bipedal robot locomotion. Control and Automation Series, 2007. [36] W. Ziemba and R. Vickson. Stochastic optimization models in finance. World Scientific Singapore, 2006. 9
2016
374
6,299
Inference by Reparameterization in Neural Population Codes Rajkumar V. Raju Department of ECE Rice University Houston, TX 77005 rv12@rice.edu Xaq Pitkow Dept. of Neuroscience, Dept. of ECE Baylor College of Medicine, Rice University Houston, TX 77005 xaq@rice.edu Abstract Behavioral experiments on humans and animals suggest that the brain performs probabilistic inference to interpret its environment. Here we present a new generalpurpose, biologically-plausible neural implementation of approximate inference. The neural network represents uncertainty using Probabilistic Population Codes (PPCs), which are distributed neural representations that naturally encode probability distributions, and support marginalization and evidence integration in a biologically-plausible manner. By connecting multiple PPCs together as a probabilistic graphical model, we represent multivariate probability distributions. Approximate inference in graphical models can be accomplished by message-passing algorithms that disseminate local information throughout the graph. An attractive and often accurate example of such an algorithm is Loopy Belief Propagation (LBP), which uses local marginalization and evidence integration operations to perform approximate inference efficiently even for complex models. Unfortunately, a subtle feature of LBP renders it neurally implausible. However, LBP can be elegantly reformulated as a sequence of Tree-based Reparameterizations (TRP) of the graphical model. We re-express the TRP updates as a nonlinear dynamical system with both fast and slow timescales, and show that this produces a neurally plausible solution. By combining all of these ideas, we show that a network of PPCs can represent multivariate probability distributions and implement the TRP updates to perform probabilistic inference. Simulations with Gaussian graphical models demonstrate that the neural network inference quality is comparable to the direct evaluation of LBP and robust to noise, and thus provides a promising mechanism for general probabilistic inference in the population codes of the brain. 1 Introduction In everyday life we constantly face tasks we must perform in the presence of sensory uncertainty. A natural and efficient strategy is then to use probabilistic computation. Behavioral experiments have established that humans and animals do in fact use probabilistic rules in sensory, motor and cognitive domains [1, 2, 3]. However, the implementation of such computations at the level of neural circuits is not well understood. In this work, we ask how distributed neural computations can consolidate incoming sensory information and reformat it so it is accessible for many tasks. More precisely, how can the brain simultaneously infer marginal probabilities in a probabilistic model of the world? Previous efforts to model marginalization in neural networks using distributed codes invoked limiting assumptions, either treating only a small number of variables [4], allowing only binary variables [5, 6, 7], or 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. restricting interactions [8, 9]. Real-life tasks are more complicated and involve a large number of variables that need to be marginalized out, requiring a more general inference architecture. Here we present a distributed, nonlinear, recurrent network of neurons that performs inference about many interacting variables. There are two crucial parts to this model: the representation and the inference algorithm. We assume that brains represent probabilities over individual variables using Probabilistic Population Codes (PPCs) [10], which were derived by using Bayes’ Rule on experimentally measured neural responses to sensory stimuli. Here for the first time we link multiple PPCs together to construct a large-scale graphical model. For the inference algorithm, many researchers have considered Loopy Belief Propagation (LBP) to be a simple and efficient candidate algorithm for the brain [11, 12, 13, 14, 8, 5, 7, 6]. However, we will discuss one particular feature of LBP that makes it neurally implausible. Instead, we propose that an alternative formulation of LBP known as Tree-based Reparameterization (TRP) [15], with some modifications for continuous-time operation at two timescales, is well-suited for neural implementation in population codes. We describe this network mathematically below, but the main conceptual ideas are fairly straightforward: multiplexed patterns of activity encode statistical information about subsets of variables, and neural interactions disseminate these statistics to all other relevant encoded variables. In Section 2 we review key properties of our model of how neurons can represent probabilistic information through PPCs. Section 3 reviews graphical models, Loopy Belief Propagation and Tree-based Reparameterization. In Section 4, we merge these ingredients to model how populations of neurons can represent and perform inference on large multivariate distributions. Section 5 describes experiments to test the performance of network. We summarize and discuss our results in Section 6. 2 Probabilistic Population Codes Neural responses r vary from trial to trial, even to repeated presentations of the same stimulus x. This variability can be expressed as the likelihood function p(r|x). Experimental data from several brain areas responding to simple stimuli suggests that this variability often belongs to the exponential family of distributions with linear sufficient statistics [10, 16, 17, 4, 18]: p(r|x) = φ(r) exp(h(x) · r), (1) where h(x) depends on the stimulus-dependent mean and fluctuations of the neuronal response and φ(r) is independent of the stimulus. For a conjugate prior p(x), the posterior distribution will also have this general form, p(x|r) / exp(h(x) · r). This neural code is known as a linear PPC: it is a Probabilistic Population Code because the population activity collectively encodes the stimulus probability, and it is linear because the log-likelihood is linear in r. In this paper, we assume responses are drawn from this family, although incorporation of more general PPCs with nonlinear sufficient statistics T(r) is possible: p(r|x) / exp(h(x) · T(r)). An important property of linear PPCs, central to this work, is that different projections of the population activity encode the natural parameters of the underlying posterior distribution. For example, if the posterior distribution is Gaussian (Figure 1), then p(x|r) / exp ! −1 2x2a · r + xb · r " , with a · r and b · r encoding the linear and quadratic natural parameters of the posterior. These projections are related to the expectation parameters, the mean and variance, by µ = b·r a·r and σ2 = 1 a·r. A second important property of linear PPCs is that the variance of the encoded distribution is inversely proportional to the overall amplitude of the neural activity. Intuitively, this means that more spikes means more certainty (Figure 1). The most fundamental probabilistic operations are the product rule and the sum rule. Linear PPCs can perform both of these operations while maintaining a consistent representation [4], a useful feature for constructing a model of canonical computation. For a log-linear probability code like linear PPCs, the product rule corresponds to weighted summation of neural activities: p(x|r1, r2) / p(x|r1)p(x|r2) () r3 = A1r1 + A2r2. In contrast, to use the sum rule to marginalize out variables, linear PPCs require nonlinear transformations of population activity. Specifically, a quadratic nonlinearity with divisive normalization performs near-optimal marginalization in linear PPCs [4]. Quadratic interactions arise naturally through coincidence detection, and divisive normalization is a nonlinear inhibitory effect widely observed in neural circuits [19, 20, 21]. Alternatively, near-optimal marginalizations on PPCs can also be performed by more general nonlinear transformations [22]. In sum, PPCs provide a biologically compatible representation of probabilistic information. 2 ri a.r b.r b.r µ = a.r B A Neuron index i p(x|r) x Neural response Posterior 1 σ = a.r Figure 1: Key properties of linear PPCs. (A) Two single trial population responses for a particular stimulus, with low and high amplitudes (blue and red). The two projections a · r and b · r encode the natural parameters of the posterior. (B) Corresponding posteriors over stimulus variables determined by the responses in panel A. The gain or overall amplitude of the population code is inversely proportional to the variance of the posterior distribution. 3 Inference by Tree-based Reparameterization 3.1 Graphical Models To generalize PPCs, we need to represent the joint probability distribution of many variables. A natural way to represent multivariate distributions is with probabilistic graphical models. In this work, we use the formalism of factor graphs, a type of bipartite graph in which nodes representing variables are connected to other nodes called factors representing interactions between ‘cliques’ or sets of variables (Figure 2A). The joint probability over all variables can then be represented as a product over cliques, p(x) = 1 Z Q c2C c(xc), where c(xc) are nonnegative compatibility functions on the set of variables xc = {xc|c 2 C} in the clique, and Z is a normalization constant. The distribution of interest will be a posterior distribution p(x|r) that depends on neural responses r. Since the inference algorithm we present is unchanged with this conditioning, for notational convenience we suppress this dependence on r. In this paper, we focus on pairwise interactions, although our main framework generalizes naturally to richer, higher-order interactions. In a pairwise model, we allow singleton factors s for variable nodes s in a set of vertices V , and pairwise interaction factors st for pairs (s, t) in the set of edges E that connect those vertices. The joint distribution is then p(x) = 1 Z Q V s(xs) Q E st(xs, xt). 3.2 Belief Propagation and its neural plausibility The inference problem of interest in this work is to compute the marginal distribution for each variable, ps(xs) = R x\xs p(x) d(x\xs). This task is generally intractable. However, the factorization structure of the distribution can be used to perform inference efficiently, either exactly in the case of tree graphs, or approximately for graphs with cycles. One such inference algorithm is called Belief Propagation (BP) [11]. BP iteratively passes information along the graph in the form of messages mst(xt) from node s to t, using only local computations that summarize the relevant aspects of other messages upstream in the graph: mn+1 st (xt) = Z xs dxs s(xs) st(xs, xt) Y u2N(s)\t mn us(xs) bs(xs) / s Y u2N(s) mus(xs) (2) where n is the time or iteration number, and N(s) is the set of neighbors of node s on the graph. The estimated marginal, called the ‘belief’ bs(xs) at a node s, is proportional to the local evidence at that node s(xs) and all the messages coming into node s. Similarly, the messages themselves are determined self-consistently by combining incoming messages — except for the previous message from the target node t. This message exclusion is critical because it prevents evidence previously passed by the target node from being counted as if it were new evidence. This exclusion only prevents overcounting on a tree graph, and is unable to prevent overcounting of evidence passed around loops. For this reason, BP is exact for trees, but only approximate for general, loopy graphs. If we use this algorithm anyway, it is called ‘Loopy’ Belief Propagation (LBP), and it often has quite good performance [12]. 3 Multiple researchers have been intrigued by the possibility that the brain may perform LBP [13, 14, 5, 8, 7, 6], since it gives “a principled framework for propagating, in parallel, information and uncertainty between nodes in a network” [12]. Despite the conceptual appeal of LBP, it is important to get certain details correct: in an inference algorithm described by nonlinear dynamics, deviations from ideal behavior could in principle lead to very different outcomes. One critically important detail is that each node must send different messages to different targets to prevent overcounting. This exclusion can render LBP neurally implausible, because neurons cannot readily send different output signals to many different target neurons. Some past work simply ignores the problem [5, 7]; the resultant overcounting destroys much of the inferential power of LBP, often performing worse than more naïve algorithms like mean-field inference. One better option is to use different readouts of population activity for different targets [6], but this approach is inefficient because it requires many readout populations for messages that differ only slightly, and requires separate optimization for each possible target. Other efforts have avoided the problem entirely by performing only unidirectional inference of low-dimensional variables that evolve over time [14]. Appealingly, one can circumvent all of these difficulties by using an alternative formulation of LBP known as Tree-based Reparameterization (TRP). 3.3 Tree-based Reparameterization Insightful work by Wainwright, Jakkola, and Willsky [15] revealed that belief propagation can be understood as a convenient way of refactorizing a joint probability distribution, according to approximations of local marginal probabilities. For pairwise interactions, this can be written as p(x) = 1 Z Y s2V s(xs) Y (s,t)2E st(xs, xt) = Y s2V Ts(xs) Y (s,t)2E Tst(xs, xt) Ts(xs)Tt(xt) (3) where Ts(xs) is a so-called ‘pseudomarginal’ distribution of xs and Tst(xs, xt) is a joint pseudomarginal over xs and xt (Figure 2A–B), where Ts and Tst are the outcome of Loopy Belief Propagation. The name pseudomarginal comes from the fact that these quantities are always locally consistent with being marginal distributions, but they are only globally consistent with the true marginals when the graphical model is tree-structured. These pseudomarginals can be constructed iteratively as the true marginals of a different joint distribution p⌧(x) on an isolated tree-structured subgraph ⌧. Compatibility functions from factors remaining outside of the subgraph are collected in a residual term r⌧(x). This regrouping leaves the joint distribution unchanged: p(x) = p⌧(x)r⌧(x). The factors of p⌧are then rearranged by computing the true marginals on its subgraph ⌧, again preserving the joint distribution. In subsequent updates, we iteratively refactorize using the marginals of p⌧along different tree subgraphs ⌧(Figure 2C). p(x)=pi(x)ri(x) p(x)=pj(x)r j(x) x1 x2 x3 x1 x2 x3 A Original Iteration i Iteration j Tree reparameterized B C Figure 2: Visualization of tree reparameterization. (A) A probability distribution is specified by factors { s, st} on a tree graph. (B) An alternative parameterization of the same distribution in terms of the marginals {Ts, Tst}. (C) Two TRP updates for a 3⇥3 nearest-neighbor grid of variables. Typical LBP can be interpreted as a sequence of local reparameterizations over just two neighboring nodes and their corresponding edge [15]. Pseudomarginals are initialized at time n = 0 using the original factors: T 0 s (xs) / s(xs) and T 0 st(xs, xt) / s(xs) t(xt) st(xs, xt). At iteration n + 1, the node and edge pseudomarginals are computed by exactly marginalizing the distribution built from previous pseudomarginals at iteration n: T n+1 s / T n s Y u2N(s) 1 T n s Z T n su dxu T n+1 st / T n st !R T n st dxt " !R T n st dxs "T n+1 s T n+1 t (4) Notice that, unlike the original form of LBP, operations on graph neighborhoods Q u2N(s) do not differentiate between targets. 4 4 Neural implementation of TRP updates 4.1 Updating natural parameters TRP’s operation only requires updating pseudomarginals, in place, using local information. These are appealing properties for a candidate brain algorithm. This representation is also nicely compatible with the structure of PPCs: different projections of the neural activity encode the natural parameters of an exponential family distribution. It is thus useful to express the pseudomarginals and the TRP inference algorithm using vectors of sufficient statistics φc(xc) and natural parameters ✓n c for each clique: T n c (xc) = exp (✓n c · φc(xc)). For a model with at most pairwise interactions, the TRP updates (4) can be expressed in terms of these natural parameters as ✓n+1 s = (1 −ds)✓n s + X u2N(s) gV (✓n su) ✓n+1 st = ✓n st + Qs✓n+1 s + Qt✓n+1 t + gE(✓n st) (5) where ds is the number of neighbors of node s, the matrices Qs, Qt embed the node parameters into the space of the pairwise parameters, and gV and gE are nonlinear functions (for vertices V and edges E) that are determined by the particular graphical model. Since the natural parameters reflect log-probabilities, the product rule for probabilities becomes a linear sum in ✓, while the sum rule for probabilities must be implemented by nonlinear operations g on ✓. In the concrete case of a Gaussian graphical model, the joint distribution is given by p(x) / exp (−1 2x>Ax + b>x), where A and b are the natural parameters, and the linear and quadratic functions x and xx> are the sufficient statistics. When we reparameterize this distribution by pseudomarginals, we again have linear and quadratic sufficient statistics: two for each node, φs = (−1 2x2 s, xs)>, and five for each edge, φst = (−1 2x2 s, xsxt, −1 2x2 t, xs, xt)>. Each of these vectors of sufficient statistics has its own vector of natural parameters, ✓s and ✓st. To approximate the marginal probabilities, the TRP algorithm initializes the pseudomarginals to ✓0 s = (Ass, bs)> and ✓0 st = (Ass, Ast, Att, bs, bt)>. To update ✓, we must specify the nonlinear functions g that recover the univariate marginal distribution of a bivariate gaussian Tst. For Tst(xs, xt) / exp ! −1 2✓1;stx2 s −✓2;stxsxt −1 2✓3;stx2 t + ✓4;stxs + ✓5;stxt " , this marginal is Ts(xs) = Z dxt Tst(xs, xt) / exp −✓1;st✓3;st −✓2 2;st ✓3;st x2 s 2 + ✓4;st✓3;st −✓2;st✓5;st ✓3;st xs ! (6) Using this, we can now specify the embedding matrices and the nonlinear functions in the TRP updates (5): Qs = ✓ 1 0 0 0 0 0 0 0 1 0 ◆> and Qt = ✓ 0 0 1 0 0 0 0 0 0 1 ◆> gV (✓n su) = ✓n 1;su − ! ✓n 2;su "2 ✓n 3;su , ✓n 4;su −✓n 2;su✓n 5;su ✓n 3;su !> (7) gE(✓n st) = − ✓n 1;st − ! ✓n 2;st "2 ✓n 3;st , 0, ✓n 3;st − ! ✓n 2;st "2 ✓n 1;st , ✓n 4;st −✓n 2;st✓n 5;st ✓n 3;st , ✓n 5;st −✓n 2;st✓n 4;st ✓n 1;st !> where ✓i;st is the ith elements of ✓st. Notice that these nonlinearities are all quadratic functions with a linear divisive normalization. 4.2 Separation of Time Scales for TRP Updates An important feature of the TRP updates is that they circumvent the ‘message exclusion’ problem of LBP. The TRP update for the singleton terms, (4) and (5), includes contributions from all the neighbors of a given node. There is no free lunch, however, and the price is that the updates at time n + 1 depend on previous pseudomarginals at two different times, n and n + 1. The latter update is therefore instantaneous information transmission, which is not biologically feasible. To overcome this limitation, we observe that the brain can use fast and slow timescales ⌧fast ⌧⌧slow instead of instant and delayed signals. The fast timescale would most naturally correspond to the 5 membrane time constant of the neurons, whereas the slow timescale would emerge from network interactions. We convert the update equations to continuous time, and introduce auxiliary variables ˜✓which are lowpass-filtered versions of ✓on a slow timescale: ⌧slow ˙˜✓= −˜✓+ ✓. The nonlinear dynamics of (5) are then updated on a faster timescale ⌧fast according to ⌧fast ˙✓s = −ds˜✓s + X u2N(s) gV (˜✓su) ⌧fast ˙✓st = Qs✓s + Qt✓t + gE(˜✓st) (8) where the nonlinear terms g depend only on the slower, delayed activity ˜✓. By concatenating these two sets of parameters, ⇥= (✓, ˜✓), we obtain a coupled multidimensional dynamical system which represents the approximation to the TRP iterations: ˙⇥= W⇥+ G(⇥) (9) Here the weight matrix W and the nonlinear function G inherit their structure from the discrete-time updates and the lowpass filtering at the fast and slow timescales. 4.3 Network Architecture To complete our neural inference network, we now embed the nonlinear dynamics (9) into the population activity r. Since different projections of the neural activity in a linear PPC encode natural parameters of the underlying distribution, we map neural activity onto ⇥by r = U⇥, where U is a rectangular Nr ⇥N⇥embedding matrix that projects the natural parameters and their low-pass versions into the neural response space. These parameters can be decoded from the neural activity as ⇥= U +r, where U + is the pseudoinverse of U. Applying this basis transformation to (9), we have ˙r = U ˙⇥= U(W⇥+ G(⇥)) = UWU +r + UG(U+r). We then obtain the general form of the updates for the neural activity ˙r = WLr + GNL(r) (10) where WLr = UWU +r and GNL(r) = UG(U +r) correspond to the linear and nonlinear computational components that integrate and marginalize evidence, respectively. The nonlinear function on r inherits the structure needed for the natural parameters, such as a quadratic polynomial with a divisive normalization used in low-dimensional Gaussian marginalization problems [4], but now expanded to high-dimensional graphical models. Figure 3 depicts the network architecture for the simple graphical model from Figure 2A, both when there are distinct neural subpopulations for each factor (Figure 3A), and when the variables are fully multiplexed across the entire neural population (Figure 3B). These simple, biologically-plausible neural dynamics (10) represent a powerful, nonlinear, fully-recurrent network of PPCs which implements the TRP update equations on an underlying graphical model. linear connections singleton projections pairwise projections nonlinear connections linear connections singleton populations pairwise populations nonlinear connections r12 r23 r1 r2 r3 A B Figure 3: Distributed, nonlinear, recurrent network of neurons that performs probabilistic inference on a graphical model. (A) This simple case uses distinct subpopulations of neurons to represent different factors in the example model in Figure 2A. (B) A cartoon shows how the same distribution can be represented as distinct projections of the distributed neural activity, instead of as distinct populations. In both cases, since the neural activities encode log-probabilities, linear connections are responsible for integrating evidence while nonlinear connections perform marginalization. 5 Experiments We evaluate the performance of our neural network on a set of small Gaussian graphical models with up to 400 interacting variables. The networks time constants were set to have a ratio of 6 ⌧slow/⌧fast = 20. Figure 4A shows the neural population dynamics as the network performs inference, along with the temporal evolution of the corresponding node and pairwise means and covariances. The neural activity exhibits a complicated timecourse, and reflects a combination of many natural parameters changing simultaneously during inference. This type of behavior is seen in neural activity recorded from behaving animals [23, 24, 25]. Figure 4B shows how the performance of the network improves with the ratio of time-scales, γ , ⌧slow/⌧fast. The performance is quantified by the mean squared error in the inferred parameters for a given γ divided by the error for a reference γ0 = 10. min max Time Neural activity r Time Time Inferred expectation parameters Means Covariances Figure 4: Dynamics of neural population activity (A) and the expectation parameters of the posterior distribution that the population encodes (B) for one trial of the tree model in Figure 2A. (C) Multiple simulations show that relative error decreases as a function of the ratio of fast and slow timescales γ. Figure 5 shows that our recurrent neural network accurately infers the marginal probabilities, and reaches almost the same conclusions as loopy belief propagation. The data points are obtained from multiple simulations with different graph topologies, including graphs with many loops. Figure 6 verifies that the network is robust to noise even when there are few neurons per inferred parameter; adding more neurons improves performance since the noise can be averaged away. Figure 5: Inference performance of our neural network (blue) and standard loopy belief propagation (red) for a variety of graph topologies: chains, single loops, square grids up to 20 ⇥20 and densely connected graphs with up to 25 variables. The expectation parameters (means, covariances) of the pseudomarginals closely match the corresponding parameters for the true marginals. min max True parameters Nneurons B A no noise Neural activity r Inferred parameters Mean Variance Time Nparams = 1 Nneurons Nparams = 5 Figure 6: Network performance is robust to noise, and improves with more neurons. (A) Neural activity performing inference on a 5 ⇥5 square grid, in the presence of independent spatiotemporal Gaussian noise of standard deviation 0.1 times the standard deviation of each signal. (B) Expectation parameters (means, variances) of the node pseudomarginals closely match the corresponding parameters for the true marginals, despite the noise. Results are shown for one or five neurons per parameter in the graphical model, and for no noise (i.e. infinitely many neurons). 7 6 Conclusion We have shown how a biologically-plausible nonlinear recurrent network of neurons can represent a multivariate probability distribution using population codes, and can perform inference by reparameterizing the joint distribution to obtain approximate marginal probabilities. Our network model has desirable properties beyond those lauded features of belief propagation. First, it allows for a thoroughly distributed population code, with many neurons encoding each variable and many variables encoded by each neuron. This is consistent with neural recordings in which many task-relevant features are multiplexed across a neural population [23, 24, 25], as well as with models where information is embedded in a higher-dimensional state space [26, 27]. Second, the network performs inference in place, without using a distinct neural representation for messages, and avoids the biological implausibility associated with sending different messages about every variable to different targets. This virtue comes from exchanging multiple messages for multiple timescales. It is noteworthy that allowing two timescales prevents overcounting of evidence on loops of length two (target to source to target). This suggests a novel role of memory in static inference problems: a longer memory could be used to discount past information sent at more distant times, thus avoiding the overcounting of evidence that arises from loops of length three and greater. It may therefore be possible to develop reparameterization algorithms with all the convenient properties of LBP but with improved performance on loopy graphs. Previous results show that the quadratic nonlinearity with divisive normalization is convenient and biologically plausible, but this precise form is not necessary: other pointwise neuronal nonlinearities can also produce high-quality marginalizations in PPCs [22]. In a distributed code, the precise nonlinear form at the neuronal scale is not important as long as the effect on the parameters is the same. More generally, however, different nonlinear computations on the parameters implement different approximate inference algorithms. The distinct behaviors of such algorithms as variational inference [28], generalized belief propagation, and others arise from differences in their nonlinear transformations. Even Gibbs sampling can be described as a noisy nonlinear message-passing algorithm. Although LBP and its generalizations have strong appeal, we doubt the brain will use this algorithm exactly. The real nonlinear functions in the brain may implement even smarter algorithms. To identify the brain’s algorithm, it may be more revealing to measure how information is represented and transformed in a low-dimensional latent space embedded in the high-dimensional neural responses than to examine each neuronal nonlinearity in isolation. The present work is directed toward this challenge of understanding computation in this latent space. It provides a concrete example showing how distributed nonlinear computation can be distinct from localized neural computations. Learning this computation from data will be a key challenge for neuroscience. In future work we aim to recover the latent computations of our network from artificial neural recordings generated by the model. Successful model recovery would encourage us to apply these methods to large-scale neural recordings to uncover key properties of the brain’s distributed nonlinear computations. Author contributions XP conceived the study. RR and XP derived the equations. RR implemented the computer simulations. RR and XP analyzed the results and wrote the paper. Acknowledgments XP and RR were supported in part by a grant from the McNair Foundation, NSF CAREER Award IOS-1552868, and by the Intelligence Advanced Research Projects Activity (IARPA) via Department of Interior/Interior Business Center (DoI/IBC) contract number D16PC00003.1 1The U.S. Government is authorized to reproduce and distribute reprints for Governmental purposes notwithstanding any copyright annotation thereon. Disclaimer: The views and conclusions contained herein are those of the authors and should not be interpreted as necessarily representing the official policies or endorsements, either expressed or implied, of IARPA, DoI/IBC, or the U.S. Government. 8 References [1] Knill DC, Richards W (1996) Perception as Bayesian inference. Cambridge University Press. [2] Doya K (2007) Bayesian brain: Probabilistic approaches to neural coding. MIT press. [3] Pouget A, Beck JM, Ma WJ, Latham PE (2013) Probabilistic brains: knowns and unknowns. Nature neuroscience 16: 1170–1178. [4] Beck JM, Latham PE, Pouget A (2011) Marginalization in neural circuits with divisive normalization. The Journal of neuroscience 31: 15310–15319. [5] Ott T, Stoop R (2006) The neurodynamics of belief propagation on binary markov random fields. In: Advances in neural information processing systems. pp. 1057–1064. [6] Steimer A, Maass W, Douglas R (2009) Belief propagation in networks of spiking neurons. Neural Computation 21: 2502–2523. [7] Litvak S, Ullman S (2009) Cortical circuitry implementing graphical models. Neural computation 21: 3010–3056. [8] George D, Hawkins J (2009) Towards a mathematical theory of cortical micro-circuits. PLoS Comput Biol 5: e1000532. [9] Grabska-Barwinska A, Beck J, Pouget A, Latham P (2013) Demixing odors-fast inference in olfaction. In: Advances in Neural Information Processing Systems. pp. 1968–1976. [10] Ma WJ, Beck JM, Latham PE, Pouget A (2006) Bayesian inference with probabilistic population codes. Nature neuroscience 9: 1432–1438. [11] Pearl J (1988) Probabilistic reasoning in intelligent systems: networks of plausible inference. Morgan Kaufmann. [12] Yedidia JS, Freeman WT, Weiss Y (2003) Understanding belief propagation and its generalizations. Exploring artificial intelligence in the new millennium 8: 236–239. [13] Lee TS, Mumford D (2003) Hierarchical bayesian inference in the visual cortex. JOSA A 20: 1434–1448. [14] Rao RP (2004) Hierarchical bayesian inference in networks of spiking neurons. In: Advances in neural information processing systems. pp. 1113–1120. [15] Wainwright MJ, Jaakkola TS, Willsky AS (2003) Tree-based reparameterization framework for analysis of sum-product and related algorithms. Information Theory, IEEE Transactions on 49: 1120–1146. [16] Jazayeri M, Movshon JA (2006) Optimal representation of sensory information by neural populations. Nature neuroscience 9: 690–696. [17] Beck JM, Ma WJ, Kiani R, Hanks T, Churchland AK, Roitman J, Shadlen MN, et al. (2008) Probabilistic population codes for bayesian decision making. Neuron 60: 1142–1152. [18] Graf AB, Kohn A, Jazayeri M, Movshon JA (2011) Decoding the activity of neuronal populations in macaque primary visual cortex. Nature neuroscience 14: 239–245. [19] Heeger DJ (1992) Normalization of cell responses in cat striate cortex. Visual neuroscience 9: 181–197. [20] Carandini M, Heeger DJ (2012) Normalization as a canonical neural computation. Nature Reviews Neuroscience 13: 51–62. [21] Rubin DB, Van Hooser SD, Miller KD (2015) The stabilized supralinear network: A unifying circuit motif underlying multi-input integration in sensory cortex. Neuron 85: 402–417. [22] Vasudeva Raju R, Pitkow X (2015) Marginalization in random nonlinear neural networks. In: COSYNE. [23] Hayden BY, Platt ML (2010) Neurons in anterior cingulate cortex multiplex information about reward and action. The Journal of Neuroscience 30: 3339–3346. [24] Rigotti M, Barak O, Warden MR, Wang XJ, Daw ND, Miller EK, Fusi S (2013) The importance of mixed selectivity in complex cognitive tasks. Nature 497: 585–590. [25] Raposo D, Kaufman MT, Churchland AK (2014) A category-free neural population supports evolving demands during decision-making. Nature neuroscience 17: 1784–1792. [26] Savin C, Deneve S (2014) Spatio-temporal representations of uncertainty in spiking neural networks. In: Advances in Neural Information Processing Systems. pp. 2024–2032. [27] Archer E, Park I, Buesing L, Cunningham J, Paninski L (2015) Black box variational inference for state space models. arXiv stat.ML: 1511.07367. [28] Beck J, Pouget A, Heller KA (2012) Complex inference in neural circuits with probabilistic population codes and topic models. In: Advances in neural information processing systems. pp. 3059–3067. 9
2016
375